diff --git a/plist b/plist index 354c7f0de..601d3348b 100644 --- a/plist +++ b/plist @@ -121,6 +121,7 @@ /usr/local/etc/rc.loader.d/20-misc /usr/local/etc/rc.loader.d/20-modules /usr/local/etc/rc.loader.d/20-netgraph +/usr/local/etc/rc.loader.d/20-zfs /usr/local/etc/rc.monitor /usr/local/etc/rc.newwanip /usr/local/etc/rc.newwanipv6 diff --git a/src/etc/rc b/src/etc/rc index 1c433ce78..93bc710fd 100755 --- a/src/etc/rc +++ b/src/etc/rc @@ -90,6 +90,10 @@ while read FS_PART FS_MNT FS_TYPE FS_MORE; do fi done < /etc/fstab +if kldstat -qm zfs; then + zfs set readonly=off zroot +fi + attempts=0 while [ ${attempts} -lt 3 ]; do fsck -C -y / diff --git a/src/etc/rc.loader b/src/etc/rc.loader index 77e6d5c9b..819eb4ac3 100755 --- a/src/etc/rc.loader +++ b/src/etc/rc.loader @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (c) 2016 Franco Fichtner +# Copyright (c) 2016-2018 Franco Fichtner # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -51,8 +51,15 @@ LOADERCHUNKS=$(find -s ${LOADERDIR} -type f) for LOADERCHUNK in ${LOADERCHUNKS}; do # extract loader chunk origin LOADERCHUNK=${LOADERCHUNK##"${LOADERDIR}/"} + LOADERNAME=${LOADERCHUNK#??-} - echo "rc.loader: assembling ${LOADERCHUNK#??-}" + if [ "${LOADERNAME}" = "zfs" ]; then + if ! kldstat -qm zfs; then + continue + fi + fi + + echo "rc.loader: assembling ${LOADERNAME}" cat ${LOADERDIR}/${LOADERCHUNK} >> ${LOADERCONF} echo >> ${LOADERCONF} diff --git a/src/etc/rc.loader.d/20-zfs b/src/etc/rc.loader.d/20-zfs new file mode 100644 index 000000000..ac08466ec --- /dev/null +++ b/src/etc/rc.loader.d/20-zfs @@ -0,0 +1,4 @@ +kern.geom.label.disk_ident.enable="0" +kern.geom.label.gptid.enable="0" +vfs.zfs.min_auto_ashift=12 +zfs_load="YES"