2010-08-01 Robert Millan <rmh@gnu.org>

* util/grub.d/10_kfreebsd.in: Initialize ${kfreebsd_device} as the
	kFreeBSD device name, except on ZFS where the filesystem label is
	used.
	(kfreebsd_entry): On ZFS root, load `opensolaris.ko', `zfs.ko' and
	`/boot/zfs/zpool.cache'.
	Set mountfrom kernel variable using ${kfreebsd_device}.
This commit is contained in:
Robert Millan 2010-08-01 23:21:09 +02:00
parent f7abdefbdd
commit c7db243b92
2 changed files with 34 additions and 1 deletions

View file

@ -1,3 +1,12 @@
2010-08-01 Robert Millan <rmh@gnu.org>
* util/grub.d/10_kfreebsd.in: Initialize ${kfreebsd_device} as the
kFreeBSD device name, except on ZFS where the filesystem label is
used.
(kfreebsd_entry): On ZFS root, load `opensolaris.ko', `zfs.ko' and
`/boot/zfs/zpool.cache'.
Set mountfrom kernel variable using ${kfreebsd_device}.
2010-08-01 Robert Millan <rmh@gnu.org>
Make it even harder to use uninitialized `libzfs_handle' (and

View file

@ -74,8 +74,27 @@ EOF
EOF
fi
case "${kfreebsd_fs}" in
zfs)
test -e "${module_dir}/opensolaris.ko"
test -e "${module_dir}/zfs.ko"
test -e "${dirname}/zfs/zpool.cache"
printf '%s\n' "${prepare_module_dir_cache}"
cat << EOF
kfreebsd_module_elf ${module_dir_rel}/opensolaris.ko
kfreebsd_module_elf ${module_dir_rel}/zfs.ko
EOF
printf '%s\n' "${prepare_boot_cache}"
cat << EOF
set kFreeBSD.vfs.root.mountfrom=${kfreebsd_fs}:${GRUB_DEVICE}
kfreebsd_module ${rel_dirname}/zfs/zpool.cache type=/boot/zfs/zpool.cache
EOF
;;
esac
cat << EOF
set kFreeBSD.vfs.root.mountfrom=${kfreebsd_fs}:${kfreebsd_device}
set kFreeBSD.vfs.root.mountfrom.options=rw
}
EOF
@ -105,6 +124,11 @@ while [ "x$list" != "x" ] ; do
*) kfreebsd_fs=${GRUB_FS} ;;
esac
case ${GRUB_FS} in
zfs) kfreebsd_device=$(grub-probe -t label --device ${GRUB_DEVICE}) ;;
*) kfreebsd_device=${GRUB_DEVICE} ;;
esac
version=`echo $basename | sed -e "s,^[^0-9]*-,,g;s/\.gz$//g"`
alt_version=`echo $version | sed -e "s,\.old$,,g"`