From: Michael Prokop Date: Mon, 5 Mar 2012 14:16:56 +0000 (+0100) Subject: Generate static loopback.cfg configuration without depending on GRUB's regexp module X-Git-Tag: v0.19.0~16 X-Git-Url: http://git.grml.org/?p=grml-live.git;a=commitdiff_plain;h=94a9b17b795c04ea5b4ca8de8c329fb641ce0d1b 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. --- diff --git a/grml-live b/grml-live index 3a2301f..95f0b3e 100755 --- a/grml-live +++ b/grml-live @@ -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/ diff --git a/templates/boot/grub/grub.cfg b/templates/boot/grub/grub.cfg index aba78da..40faccc 100644 --- a/templates/boot/grub/grub.cfg +++ b/templates/boot/grub/grub.cfg @@ -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 diff --git a/templates/boot/grub/header.cfg b/templates/boot/grub/header.cfg new file mode 100644 index 0000000..2b78bbc --- /dev/null +++ b/templates/boot/grub/header.cfg @@ -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