Also consider /boot/loader.conf.local when updating vfs.root.mountfrom

This commit is contained in:
Bryan Drewery 2012-04-29 10:54:43 -05:00
parent 347990888c
commit c1626f0e9d
1 changed files with 3 additions and 1 deletions

4
beadm
View File

@ -152,7 +152,9 @@ case ${1} in
} }
zfs set mountpoint=${MNT} ${POOL}/ROOT/${2} zfs set mountpoint=${MNT} ${POOL}/ROOT/${2}
cp /boot/zfs/zpool.cache ${MNT}/boot/zfs/zpool.cache cp /boot/zfs/zpool.cache ${MNT}/boot/zfs/zpool.cache
sed -i '' -E s/"^vfs.root.mountfrom=.*$"/"vfs.root.mountfrom=\"zfs:${POOL}\/ROOT\/${2##*/}\""/g ${MNT}/boot/loader.conf LOADER_CONFIGS=${MNT}/boot/loader.conf
[ -f ${MNT}/boot/loader.conf.local ] && LOADER_CONFIGS="${LOADER_CONFIGS} ${MNT}/boot/loader.conf.local"
sed -i '' -E s/"^vfs.root.mountfrom=.*$"/"vfs.root.mountfrom=\"zfs:${POOL}\/ROOT\/${2##*/}\""/g ${LOADER_CONFIGS}
zfs set mountpoint=legacy ${POOL}/ROOT/${2} zfs set mountpoint=legacy ${POOL}/ROOT/${2}
} }
zpool set bootfs=${POOL}/ROOT/${2} ${POOL} && { zpool set bootfs=${POOL}/ROOT/${2} ${POOL} && {