merge with mainline
This commit is contained in:
commit
d84666e6bb
37 changed files with 2533 additions and 641 deletions
|
@ -39,6 +39,31 @@ case "${GRUB_DISTRIBUTOR}" in
|
|||
;;
|
||||
esac
|
||||
|
||||
load_kfreebsd_module ()
|
||||
{
|
||||
mod="$1"
|
||||
allow_fail="$2"
|
||||
|
||||
if ! test -e "${module_dir}/${mod}.ko" ; then
|
||||
if [ "${allow_fail}" = "true" ] ; then
|
||||
# Return silently
|
||||
return
|
||||
else
|
||||
# Print an error and fail.
|
||||
ls "${module_dir}/${mod}.ko" > /dev/null
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "${prepare_module_dir_cache}" ]; then
|
||||
prepare_module_dir_cache="$(prepare_grub_to_access_device $(grub-probe -t device "${module_dir}") | sed -e "s/^/\t/")"
|
||||
fi
|
||||
|
||||
printf '%s\n' "${prepare_module_dir_cache}"
|
||||
cat << EOF
|
||||
kfreebsd_module_elf ${module_dir_rel}/${mod}.ko
|
||||
EOF
|
||||
}
|
||||
|
||||
kfreebsd_entry ()
|
||||
{
|
||||
os="$1"
|
||||
|
@ -51,9 +76,6 @@ kfreebsd_entry ()
|
|||
if [ -z "${prepare_boot_cache}" ]; then
|
||||
prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")"
|
||||
fi
|
||||
if [ -z "${prepare_module_dir_cache}" ]; then
|
||||
prepare_module_dir_cache="$(prepare_grub_to_access_device $(grub-probe -t device "${module_dir}") | sed -e "s/^/\t/")"
|
||||
fi
|
||||
|
||||
printf '%s\n' "${prepare_boot_cache}"
|
||||
cat << EOF
|
||||
|
@ -67,26 +89,13 @@ EOF
|
|||
EOF
|
||||
fi
|
||||
|
||||
if test -e "${module_dir}/acpi.ko" ; then
|
||||
printf '%s\n' "${prepare_module_dir_cache}"
|
||||
cat << EOF
|
||||
kfreebsd_module_elf ${module_dir_rel}/acpi.ko
|
||||
EOF
|
||||
fi
|
||||
load_kfreebsd_module acpi true
|
||||
|
||||
case "${kfreebsd_fs}" in
|
||||
zfs)
|
||||
for i in "${module_dir}/opensolaris.ko" "${module_dir}/zfs.ko" \
|
||||
"${dirname}/zfs/zpool.cache" ; do
|
||||
ls "$i" > /dev/null
|
||||
done
|
||||
|
||||
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
|
||||
load_kfreebsd_module opensolaris false
|
||||
|
||||
ls "${dirname}/zfs/zpool.cache" > /dev/null
|
||||
printf '%s\n' "${prepare_boot_cache}"
|
||||
cat << EOF
|
||||
kfreebsd_module ${rel_dirname}/zfs/zpool.cache type=/boot/zfs/zpool.cache
|
||||
|
@ -94,6 +103,8 @@ EOF
|
|||
;;
|
||||
esac
|
||||
|
||||
load_kfreebsd_module ${kfreebsd_fs} false
|
||||
|
||||
cat << EOF
|
||||
set kFreeBSD.vfs.root.mountfrom=${kfreebsd_fs}:${kfreebsd_device}
|
||||
set kFreeBSD.vfs.root.mountfrom.options=rw
|
||||
|
@ -121,8 +132,9 @@ while [ "x$list" != "x" ] ; do
|
|||
fi
|
||||
|
||||
case ${GRUB_FS} in
|
||||
ufs1 | ufs2) kfreebsd_fs=ufs ;;
|
||||
*) kfreebsd_fs=${GRUB_FS} ;;
|
||||
ufs1 | ufs2) kfreebsd_fs=ufs ;;
|
||||
ext2) kfreebsd_fs=ext2fs ;;
|
||||
*) kfreebsd_fs=${GRUB_FS} ;;
|
||||
esac
|
||||
|
||||
case ${GRUB_FS} in
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue