2010-07-31 Robert Millan <rmh@gnu.org>

* util/grub.d/10_kfreebsd.in: Make module handling more generic.
This commit is contained in:
Robert Millan 2010-08-01 02:14:07 +02:00
parent 8072efebf2
commit 3710bb6b96
2 changed files with 18 additions and 11 deletions

View file

@ -1,3 +1,7 @@
2010-07-31 Robert Millan <rmh@gnu.org>
* util/grub.d/10_kfreebsd.in: Make module handling more generic.
2010-07-31 Robert Millan <rmh@gnu.org> 2010-07-31 Robert Millan <rmh@gnu.org>
* kern/emu/misc.c: Add missing license header. * kern/emu/misc.c: Add missing license header.

View file

@ -51,6 +51,10 @@ kfreebsd_entry ()
if [ -z "${prepare_boot_cache}" ]; then if [ -z "${prepare_boot_cache}" ]; then
prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")" prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")"
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_boot_cache}" printf '%s\n' "${prepare_boot_cache}"
cat << EOF cat << EOF
echo '$(printf "$(gettext_quoted "Loading kernel of FreeBSD %s ...")" ${version})' echo '$(printf "$(gettext_quoted "Loading kernel of FreeBSD %s ...")" ${version})'
@ -63,9 +67,10 @@ EOF
EOF EOF
fi fi
if test -n "${acpi_ko}" ; then if test -e "${module_dir}/acpi.ko" ; then
printf '%s\n' "${prepare_module_dir_cache}"
cat << EOF cat << EOF
kfreebsd_module_elf ${acpi_ko_rel_dirname}/${acpi_ko_basename} kfreebsd_module_elf ${module_dir_rel}/acpi.ko
EOF EOF
fi fi
@ -103,19 +108,17 @@ while [ "x$list" != "x" ] ; do
version=`echo $basename | sed -e "s,^[^0-9]*-,,g;s/\.gz$//g"` version=`echo $basename | sed -e "s,^[^0-9]*-,,g;s/\.gz$//g"`
alt_version=`echo $version | sed -e "s,\.old$,,g"` alt_version=`echo $version | sed -e "s,\.old$,,g"`
acpi_ko= module_dir=
for i in "/lib/modules/${version}/acpi.ko" "/lib/modules/${alt_version}/acpi.ko" \ for i in "/lib/modules/${version}" "/lib/modules/${alt_version}" \
"/boot/kernel/acpi.ko"; do "/boot/kernel"; do
if test -e "$i" ; then if test -e "$i" ; then
acpi_ko="$i" module_dir="$i"
break break
fi fi
done done
if test -n "${acpi_ko}" ; then if test -n "${module_dir}" ; then
echo "Found ACPI module: ${acpi_ko}" >&2 echo "Found kernel module directory: ${module_dir}" >&2
acpi_ko_basename=`basename ${acpi_ko}` module_dir_rel=$(make_system_path_relative_to_its_root $module_dir)
acpi_ko_dirname=`dirname ${acpi_ko}`
acpi_ko_rel_dirname=`make_system_path_relative_to_its_root $acpi_ko_dirname`
fi fi
kfreebsd_entry "${OS}" "${version}" kfreebsd_entry "${OS}" "${version}"