I have just done a quick test, replacing "if test ...;" style if lines
in /etc/grub.d/10_kfreebsd with "if [...];" style if lines, the
update-grub will successfully run without having to comment out set -e.
I have attached a patch that does this.
~Tiernan Messmer
--- /home/nvx/10_kfreebsd 2011-03-15 02:22:17.472637164 +1000
+++ 10_kfreebsd 2011-03-15 02:21:10.269802446 +1000
@@ -62,13 +62,13 @@
kfreebsd ${rel_dirname}/${basename}
EOF
- if test -n "${devices}" ; then
+ if [ -n "${devices}" ]; then
cat << EOF
kfreebsd_loadenv ${devices_rel_dirname}/${devices_basename}
EOF
fi
- if test -e "${module_dir}/acpi.ko" ; then
+ if [ -e "${module_dir}/acpi.ko" ]; then
printf '%s\n' "${prepare_module_dir_cache}"
cat << EOF
kfreebsd_module_elf ${module_dir_rel}/acpi.ko
@@ -145,12 +145,12 @@
module_dir=
for i in "/lib/modules/${version}" "/lib/modules/${alt_version}" \
"/boot/kernel"; do
- if test -e "$i" ; then
+ if [ -e "$i" ]; then
module_dir="$i"
break
fi
done
- if test -n "${module_dir}" ; then
+ if [ -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