The GRUB version provided by Debian/squeeze sadly doesn't support
the regexp module yet. Therefore we can't use the file globbing
pattern to include configuration files. So instead build a somewhat
more static loopback.cfg configuration file when generating the ISO.
fi
cp -a ${TEMPLATE_DIRECTORY}/boot/grub/* "$BUILD_OUTPUT"/boot/grub/
fi
cp -a ${TEMPLATE_DIRECTORY}/boot/grub/* "$BUILD_OUTPUT"/boot/grub/
+ # generate loopback.cfg config file without depending on grub's regexp module
+ # which isn't available in Debian/squeeze
+ echo "## grub2 loopback configuration" > "${BUILD_OUTPUT}"/boot/grub/loopback.cfg
+ echo "source /boot/grub/header.cfg" >> "${BUILD_OUTPUT}"/boot/grub/loopback.cfg
+ for config in "${BUILD_OUTPUT}"/boot/grub/*_default.cfg "${BUILD_OUTPUT}"/boot/grub/*_options.cfg ; do
+ [ -r "$config" ] || continue
+ echo "source ${config##$BUILD_OUTPUT}" >> "${BUILD_OUTPUT}"/boot/grub/loopback.cfg
+ done
+ echo "source /boot/grub/addons.cfg" >> "${BUILD_OUTPUT}"/boot/grub/loopback.cfg
+ echo "source /boot/grub/footer.cfg" >> "${BUILD_OUTPUT}"/boot/grub/loopback.cfg
+
# copy grub files from target
cp -a "${CHROOT_OUTPUT}"/usr/lib/grub/*-pc/*.mod "${BUILD_OUTPUT}"/boot/grub/
cp -a "${CHROOT_OUTPUT}"/usr/lib/grub/*-pc/*.o "${BUILD_OUTPUT}"/boot/grub/
# copy grub files from target
cp -a "${CHROOT_OUTPUT}"/usr/lib/grub/*-pc/*.mod "${BUILD_OUTPUT}"/boot/grub/
cp -a "${CHROOT_OUTPUT}"/usr/lib/grub/*-pc/*.o "${BUILD_OUTPUT}"/boot/grub/
-set default=0
-set timeout=20
-
-if loadfont /boot/grub/ascii.pf2 ; then
- insmod png
- set gfxmode=auto
- insmod gfxterm
- insmod vbe
- terminal_output gfxterm
-fi
-
-if [ -f /boot/grub/grml-theme/theme.txt ] ; then
- set theme=/boot/grub/grml-theme/theme.txt
- export theme
-else
- set menu_color_normal=white/black
- set menu_color_highlight=black/yellow
- export menu_color_normal
- export menu_color_highlight
-fi
-
-if [ ${iso_path} ] ; then
- set loopback="findiso=${iso_path}"
- export loopback
-fi
+source /boot/grub/header.cfg
--- /dev/null
+set default=0
+set timeout=20
+
+if loadfont /boot/grub/ascii.pf2 ; then
+ insmod png
+ set gfxmode=auto
+ insmod gfxterm
+ insmod vbe
+ terminal_output gfxterm
+fi
+
+if [ -f /boot/grub/grml-theme/theme.txt ] ; then
+ set theme=/boot/grub/grml-theme/theme.txt
+ export theme
+else
+ set menu_color_normal=white/black
+ set menu_color_highlight=black/yellow
+ export menu_color_normal
+ export menu_color_highlight
+fi
+
+if [ ${iso_path} ] ; then
+ set loopback="findiso=${iso_path}"
+ export loopback
+fi