Permalink
Browse files

Generate static loopback.cfg configuration without depending on GRUB'…

…s regexp module

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.
  • Loading branch information...
1 parent 6eb1b1e commit 94a9b17b795c04ea5b4ca8de8c329fb641ce0d1b @mika mika committed Mar 5, 2012
Showing with 37 additions and 25 deletions.
  1. +11 −0 grml-live
  2. +1 −25 templates/boot/grub/grub.cfg
  3. +25 −0 templates/boot/grub/header.cfg
View
@@ -899,6 +899,17 @@ if [ "$ARCH" = i386 ] || [ "$ARCH" = amd64 ] ; then
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/
@@ -1,29 +1,5 @@
## grub2 configuration
-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
insmod regexp
@@ -0,0 +1,25 @@
+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

0 comments on commit 94a9b17

Please sign in to comment.