rc: initial zfs boot awareness for #2386

This should have no impact on existing non-zfs installations.
This commit is contained in:
Franco Fichtner 2018-05-03 21:40:46 +00:00
parent ba35d5ec8d
commit 345e92fedc
4 changed files with 18 additions and 2 deletions

1
plist
View File

@ -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

View File

@ -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 /

View File

@ -1,6 +1,6 @@
#!/bin/sh
# Copyright (c) 2016 Franco Fichtner <franco@opnsense.org>
# Copyright (c) 2016-2018 Franco Fichtner <franco@opnsense.org>
#
# 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}

View File

@ -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"