2010-07-31 Robert Millan <rmh@gnu.org>
* util/grub.d/10_kfreebsd.in: Make module handling more generic.
This commit is contained in:
parent
8072efebf2
commit
3710bb6b96
2 changed files with 18 additions and 11 deletions
|
@ -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>
|
||||
|
||||
* kern/emu/misc.c: Add missing license header.
|
||||
|
|
|
@ -51,6 +51,10 @@ 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
|
||||
echo '$(printf "$(gettext_quoted "Loading kernel of FreeBSD %s ...")" ${version})'
|
||||
|
@ -63,9 +67,10 @@ EOF
|
|||
EOF
|
||||
fi
|
||||
|
||||
if test -n "${acpi_ko}" ; then
|
||||
if test -e "${module_dir}/acpi.ko" ; then
|
||||
printf '%s\n' "${prepare_module_dir_cache}"
|
||||
cat << EOF
|
||||
kfreebsd_module_elf ${acpi_ko_rel_dirname}/${acpi_ko_basename}
|
||||
kfreebsd_module_elf ${module_dir_rel}/acpi.ko
|
||||
EOF
|
||||
fi
|
||||
|
||||
|
@ -103,19 +108,17 @@ while [ "x$list" != "x" ] ; do
|
|||
version=`echo $basename | sed -e "s,^[^0-9]*-,,g;s/\.gz$//g"`
|
||||
alt_version=`echo $version | sed -e "s,\.old$,,g"`
|
||||
|
||||
acpi_ko=
|
||||
for i in "/lib/modules/${version}/acpi.ko" "/lib/modules/${alt_version}/acpi.ko" \
|
||||
"/boot/kernel/acpi.ko"; do
|
||||
module_dir=
|
||||
for i in "/lib/modules/${version}" "/lib/modules/${alt_version}" \
|
||||
"/boot/kernel"; do
|
||||
if test -e "$i" ; then
|
||||
acpi_ko="$i"
|
||||
module_dir="$i"
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -n "${acpi_ko}" ; then
|
||||
echo "Found ACPI module: ${acpi_ko}" >&2
|
||||
acpi_ko_basename=`basename ${acpi_ko}`
|
||||
acpi_ko_dirname=`dirname ${acpi_ko}`
|
||||
acpi_ko_rel_dirname=`make_system_path_relative_to_its_root $acpi_ko_dirname`
|
||||
if test -n "${module_dir}" ; then
|
||||
echo "Found kernel module directory: ${module_dir}" >&2
|
||||
module_dir_rel=$(make_system_path_relative_to_its_root $module_dir)
|
||||
fi
|
||||
|
||||
kfreebsd_entry "${OS}" "${version}"
|
||||
|
|
Loading…
Reference in a new issue