From: Michael Prokop Date: Thu, 20 Sep 2007 11:26:46 +0000 (+0200) Subject: Support grub as bootloader X-Git-Tag: 0.0.1~2 X-Git-Url: http://git.grml.org/?p=grml-live.git;a=commitdiff_plain;h=64160df70c57e1404ca3cfd27cfaf0a3928baf78 Support grub as bootloader --- diff --git a/debian/copyright b/debian/copyright index aca79c2..7199f16 100644 --- a/debian/copyright +++ b/debian/copyright @@ -9,6 +9,11 @@ Copyright: Copyright 2007++ Michael Prokop + Copyright of /usr/share/grml-live/i386_files/boot/grub/splash.xpm.gz by + Robin Bakels , which is licensed under "GPL v2 or higher" + and hase been taken from Debian package grub-splashimages + (file /boot/grub/splashimages/fiesta.xpm.gz). + License: This package is free software; you can redistribute it and/or modify diff --git a/etc/grml/grml-live.conf b/etc/grml/grml-live.conf index 372c56f..8c1fe24 100644 --- a/etc/grml/grml-live.conf +++ b/etc/grml/grml-live.conf @@ -69,6 +69,10 @@ HOSTNAME=grml # Specify user with UID 1000 on live-system: USERNAME=grml +# Which bootloader do you want to use? Default: isolinux +# Supported values: isolinux, grub +# BOOT_METHOD='isolinux' + # Directory of configuration files for grml-live's FAI: GRML_FAI_CONFIG=/etc/grml/fai diff --git a/grml-live b/grml-live index ae0e99e..9fc2d26 100755 --- a/grml-live +++ b/grml-live @@ -4,7 +4,7 @@ # Authors: grml-team (grml.org), (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2 or any later version. -# Latest change: Wed Sep 19 23:59:48 CEST 2007 [mika] +# Latest change: Thu Sep 20 13:25:31 CEST 2007 [mika] ################################################################################ # read configuration files, set some misc variables {{{ @@ -279,9 +279,9 @@ mkdir -p "$BUILD_TARGET" || bailout 6 "Problem with creating $BUILD_TARGET for s # i386: [ -n "$ARCH" ] || ARCH="$(dpkg --print-architecture)" if [ "$ARCH" = i386 ] ; then - if [ -d "$BUILD_TARGET"/boot/isolinux ] ; then - ewarn "$BUILD_TARGET/boot exists already, skipping stage 'boot/isolinux'" ; eend 0 - log "$BUILD_TARGET/boot exists already, skipping stage 'boot/isolinux'" + if [ -d "$BUILD_TARGET"/boot ] ; then + ewarn "$BUILD_TARGET/boot exists already, skipping stage 'boot'" ; eend 0 + log "$BUILD_TARGET/boot exists already, skipping stage 'boot'" else # booting stuff: mkdir -p "$BUILD_TARGET"/boot/isolinux @@ -293,14 +293,9 @@ if [ "$ARCH" = i386 ] ; then cp /usr/lib/syslinux/isolinux.bin "$BUILD_TARGET"/boot/isolinux/ cp /usr/lib/syslinux/memdisk "$BUILD_TARGET"/boot/isolinux/ cp /usr/lib/syslinux/menu.c32 "$BUILD_TARGET"/boot/isolinux/ - cp /usr/share/grml-live/i386_files/boot/isolinux/allinone.img "$BUILD_TARGET"/boot/isolinux/ - cp /usr/share/grml-live/i386_files/boot/isolinux/balder10.imz "$BUILD_TARGET"/boot/isolinux/ - cp /usr/share/grml-live/i386_files/boot/isolinux/boot-beep.msg "$BUILD_TARGET"/boot/isolinux/ - cp /usr/share/grml-live/i386_files/boot/isolinux/boot.msg "$BUILD_TARGET"/boot/isolinux/ - cp /usr/share/grml-live/i386_files/boot/isolinux/f* "$BUILD_TARGET"/boot/isolinux/ - cp /usr/share/grml-live/i386_files/boot/isolinux/isolinux.cfg "$BUILD_TARGET"/boot/isolinux/ - cp /usr/share/grml-live/i386_files/boot/isolinux/logo.16 "$BUILD_TARGET"/boot/isolinux/ - cp /usr/share/grml-live/i386_files/boot/isolinux/syslinux.cfg "$BUILD_TARGET"/boot/isolinux/ + cp /usr/share/grml-live/i386_files/boot/isolinux/* "$BUILD_TARGET"/boot/isolinux/ + cp /usr/share/grml-live/i386_files/boot/isolinux/* "$BUILD_TARGET"/boot/isolinux/ + cp -a /usr/share/grml-live/i386_files/boot/grub "$BUILD_TARGET"/boot/ # adjust boot splash information: ISO_DATE="$(date +%Y-%m-%d)" @@ -315,6 +310,8 @@ if [ "$ARCH" = i386 ] ; then sed -i "s/%RELEASENAME%/$RELEASENAME/" "$BUILD_TARGET"/boot/isolinux/boot-beep.msg sed -i "s/%DATE%/$ISO_DATE/" "$BUILD_TARGET"/boot/isolinux/boot-beep.msg + sed -i "s/%VERSION%/$VERSION/" "$BUILD_TARGET"/boot/grub/menu.lst + # autostart for Windows: cp /usr/share/grml-live/windows/autostart/autorun.bat "$BUILD_TARGET"/ cp /usr/share/grml-live/windows/autostart/autorun.inf "$BUILD_TARGET"/ @@ -335,7 +332,7 @@ if [ "$ARCH" = i386 ] ; then einfo "Finished execution of stage 'WINDOWS_BINARIES'" ; eend 0 log "Finished execution of stage 'WINDOWS_BINARIES' [$(date)]" fi - einfo "Finished execution of stage 'boot/isolinux'" ; eend 0 + einfo "Finished execution of stage 'boot'" ; eend 0 fi # amd64: elif [ "$ARCH" = amd64 ] ; then @@ -363,6 +360,13 @@ fi [ -n "$ISO_TARGET" ] || ISO_TARGET="$TARGET/grml_isos" [ -n "$ISO_NAME" ] || ISO_NAME="grml_${VERSION}.iso" +[ -n "$BOOT_METHOD" ] || BOOT_METHOD='isolinux' +if [ "$BOOT_METHOD" = "isolinux" ] ; then + BOOT_FILE="boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat" +elif [ "$BOOT_METHOD" = "grub" ] ; then + BOOT_FILE="boot/grub/stage2_eltorito" +fi + if [ -f "${ISO_TARGET}/${ISO_NAME}" ] ; then ewarn "$ISO_TARGET exists already, skipping stage 'iso build'" ; eend 0 log "$ISO_TARGET exists already, skipping stage 'iso build'" @@ -371,7 +375,7 @@ else ( cd "$BUILD_TARGET" && mkisofs -V "grml $VERSION" -publisher 'grml-live | grml.org' \ -l -r -J -no-emul-boot -boot-load-size 4 -boot-info-table \ - -c boot/isolinux/boot.cat -b boot/isolinux/isolinux.bin \ + -b $BOOT_FILE \ -o "${ISO_TARGET}/${ISO_NAME}" . ) einfo "Finished execution of stage 'iso build'" ; eend 0 diff --git a/i386_files/boot/grub/menu.lst b/i386_files/boot/grub/menu.lst new file mode 100644 index 0000000..3a46406 --- /dev/null +++ b/i386_files/boot/grub/menu.lst @@ -0,0 +1,56 @@ +# menu.lst - See: grub(8), info grub, update-grub(8) +# grub-install(8), grub-floppy(8), +# grub-md5-crypt, /usr/share/doc/grub +# and /usr/share/doc/grub-doc/. + +# misc options: +timeout 30 +root (cd) +# color red/blue green/black +splashimage=/boot/grub/splash.xpm.gz +foreground = 000000 +background = FFCC33 + +# define entries: +title grml %VERSION% - Default boot (using 1024x768 framebuffer) +kernel /boot/isolinux/linux26 lang=us apm=power-off vga=791 quiet boot=live nomce +initrd /boot/isolinux/initrd.gz + +title grml %VERSION% - without framebuffer +kernel /boot/isolinux/linux26 lang=us apm=power-off vga=normal video=ofonly quiet initrd=initrd.gz boot=live nomce +initrd /boot/isolinux/initrd.gz + +title grml %VERSION% - with 1280x1024 framebuffer +kernel /boot/isolinux/linux26 lang=us apm=power-off vga=794 quiet initrd=initrd.gz boot=live nomce +initrd /boot/isolinux/initrd.gz + +title grml %VERSION% - with 800x600 framebuffer +kernel /boot/isolinux/linux26 lang=us apm=power-off vga=788 quiet initrd=initrd.gz boot=live nomce +initrd /boot/isolinux/initrd.gz + +title grml %VERSION% - failsafe boot +kernel /boot/isolinux/linux26 vga=normal lang=us boot=live noautoconfig atapicd noacpi acpi=off nomodules nofirewire noudev nousb nohotplug noapm nopcmcia maxcpus=1 noscsi noagp nodma ide=nodma noswap nofstab nosound nogpm nosyslog nodhcp nocpu nodisc nomodem xmodule=vesa noraid nolvm +initrd /boot/isolinux/initrd.gz + +title grml %VERSION% - debug mode +kernel /boot/isolinux/linux26 lang=us apm=power-off vga=791 verbose debug=vc debug initrd=initrd.gz boot=live initcall_debug nomce +initrd /boot/isolinux/initrd.gz + +title grml %VERSION% - forensic mode +kernel /boot/isolinux/linux26 vga=791 lang=us nofstab noraid nolvm noautoconfig noswap raid=noautodetect quiet initrd=initrd.gz boot=live +initrd /boot/isolinux/initrd.gz + +title grml %VERSION% - serial mode +kernel /boot/isolinux/linux26 lang=us apm=power-off vga=normal video=vesafb:off quiet initrd=initrd.gz boot=live nomce +initrd /boot/isolinux/initrd.gz + +title Run memtest86+ +kernel /boot/isolinux/memtest + +title Boot FreeDOS +kernel /boot/isolinux/memdisk +initrd /boot/isolinux/balder10.imz + +title grml %VERSION% - old boot method +kernel /boot/isolinux/linux26 ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=791 nomce quiet grml_dir="live" grml_name="grml.squashfs" +initrd /boot/isolinux/minirt26.gz diff --git a/i386_files/boot/grub/splash.xpm.gz b/i386_files/boot/grub/splash.xpm.gz new file mode 100644 index 0000000..9c34906 Binary files /dev/null and b/i386_files/boot/grub/splash.xpm.gz differ diff --git a/i386_files/boot/grub/stage2_eltorito b/i386_files/boot/grub/stage2_eltorito new file mode 100644 index 0000000..a726b51 Binary files /dev/null and b/i386_files/boot/grub/stage2_eltorito differ diff --git a/i386_files/boot/isolinux/isolinux.cfg b/i386_files/boot/isolinux/isolinux.cfg index d4aa1c8..5dab5f1 100644 --- a/i386_files/boot/isolinux/isolinux.cfg +++ b/i386_files/boot/isolinux/isolinux.cfg @@ -22,7 +22,7 @@ F10 f10 # MENU HIDE # KERNEL menu.c32 -MENU TITLE grml 1.0 - Boot Menu +MENU TITLE grml - Boot Menu LABEL grml MENU LABEL grml - Standard Bootup @@ -31,16 +31,10 @@ KERNEL linux26 APPEND lang=us apm=power-off vga=791 quiet initrd=initrd.gz boot=live nomce # APPEND lang=us apm=power-off vga=791 live-media-path=/GRML quiet initrd=initrd.gz boot=live nomce -LABEL live -MENU LABEL live -MENU DEFAULT -KERNEL linux26 -APPEND lang=us apm=power-off vga=791 initrd=initrd.gz boot=live nomce - LABEL old MENU LABEL old KERNEL linux26 -APPEND ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=791 initrd=minirt26.gz nomce quiet BOOT_IMAGE=grml +APPEND ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=791 nomce quiet grml_dir="live" grml_name="grml.squashfs" LABEL splash MENU LABEL grml - Bootsplash @@ -77,21 +71,11 @@ MENU LABEL grmlx KERNEL linux26 APPEND lang=us apm=power-off startx=wm-ng vga=791 quiet initrd=initrd.gz boot=live nomce -LABEL initng -MENU LABEL initng -KERNEL linux26 -APPEND init=/sbin/initng lang=us apm=power-off vga=791 quiet initrd=initrd.gz boot=live nomce - LABEL nofb MENU LABEL grml without framebuffer KERNEL linux26 APPEND lang=us apm=power-off vga=normal video=ofonly quiet initrd=initrd.gz boot=live nomce -LABEL expert -MENU LABEL expert -KERNEL linux26 -APPEND lang=us apm=power-off vga=791 verbose initrd=initrd.gz boot=live nomce - LABEL linux26 MENU LABEL linux26 KERNEL linux26 @@ -117,35 +101,15 @@ MENU LABEL fb800x600 KERNEL linux26 APPEND lang=us apm=power-off vga=788 quiet initrd=initrd.gz boot=live nomce -LABEL mika -MENU LABEL mika -KERNEL linux26 -APPEND lang=us vga=791 quiet initrd=initrd.gz boot=live nomce gmt tz=Europe/Vienna - -LABEL jimmy -MENU LABEL jimmy -KERNEL linux26 -APPEND lang=us vga=791 quiet initrd=initrd.gz boot=live scandelay=3 nomce gmt tz=Europe/Vienna - LABEL failsafe MENU LABEL failsafe KERNEL linux26 -APPEND vga=normal video=ofonly noautoconfig lang=us atapicd noacpi nomodules acpi=off noagent nousb nohotplug noacpi noapm nopcmcia nosmp noscsi noagp nodma ide=nodma noswap nofstab nosound nogpm nosyslog nodhcp nocpu nodisc nomodem xmodule=vesa noautoconfig quiet initrd=initrd.gz boot=live - -LABEL failsafe2 -MENU LABEL failsafe2 -KERNEL linux26 -APPEND lang=us atapicd nosound noacpi noautoconfig acpi=off noscsi nodma ide=nodma noapm nousb nopcmcia nofirewire noagp nomce nodhcp xmodule=vesa quiet initrd=initrd.gz boot=live +APPEND initrd=initrd.gz vga=normal lang=us boot=live noautoconfig atapicd noacpi acpi=off nomodules nofirewire noudev nousb nohotplug noapm nopcmcia maxcpus=1 noscsi noagp nodma ide=nodma noswap nofstab nosound nogpm nosyslog nodhcp nocpu nodisc nomodem xmodule=vesa noraid nolvm LABEL forensic MENU LABEL forensic KERNEL linux26 -APPEND vga=791 lang=us nofstab noraid noautoconfig noswap raid=noautodetect quiet initrd=initrd.gz boot=live - -LABEL m23 -MENU LABEL m23 -KERNEL m23 -APPEND devfs=nomount load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=25000 initrd=m23rt.gz root=/dev/ram0 rw +APPEND vga=791 lang=us nofstab noraid nolvm noautoconfig noswap raid=noautodetect quiet initrd=initrd.gz boot=live LABEL grub MENU LABEL grub diff --git a/i386_files/boot/isolinux/syslinux.cfg b/i386_files/boot/isolinux/syslinux.cfg index bbfc86e..21ef563 100644 --- a/i386_files/boot/isolinux/syslinux.cfg +++ b/i386_files/boot/isolinux/syslinux.cfg @@ -22,7 +22,7 @@ F10 f10 # MENU HIDE # KERNEL menu.c32 -MENU TITLE grml 1.0 - Boot Menu +MENU TITLE grml - Boot Menu LABEL grml MENU LABEL grml - Standard Bootup @@ -31,16 +31,10 @@ KERNEL linux26 APPEND lang=us apm=power-off vga=791 quiet initrd=initrd.gz boot=live nomce # APPEND lang=us apm=power-off vga=791 live-media-path=/GRML quiet initrd=initrd.gz boot=live nomce -LABEL live -MENU LABEL live -MENU DEFAULT -KERNEL linux26 -APPEND lang=us apm=power-off vga=791 initrd=initrd.gz boot=live nomce - LABEL old MENU LABEL old KERNEL linux26 -APPEND ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=791 initrd=minirt26.gz nomce quiet BOOT_IMAGE=grml +APPEND ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=791 nomce quiet grml_dir="live" grml_name="grml.squashfs" LABEL splash MENU LABEL grml - Bootsplash @@ -77,21 +71,11 @@ MENU LABEL grmlx KERNEL linux26 APPEND lang=us apm=power-off startx=wm-ng vga=791 quiet initrd=initrd.gz boot=live nomce -LABEL initng -MENU LABEL initng -KERNEL linux26 -APPEND init=/sbin/initng lang=us apm=power-off vga=791 quiet initrd=initrd.gz boot=live nomce - LABEL nofb MENU LABEL grml without framebuffer KERNEL linux26 APPEND lang=us apm=power-off vga=normal video=ofonly quiet initrd=initrd.gz boot=live nomce -LABEL expert -MENU LABEL expert -KERNEL linux26 -APPEND lang=us apm=power-off vga=791 verbose initrd=initrd.gz boot=live nomce - LABEL linux26 MENU LABEL linux26 KERNEL linux26 @@ -117,35 +101,15 @@ MENU LABEL fb800x600 KERNEL linux26 APPEND lang=us apm=power-off vga=788 quiet initrd=initrd.gz boot=live nomce -LABEL mika -MENU LABEL mika -KERNEL linux26 -APPEND lang=us vga=791 quiet initrd=initrd.gz boot=live nomce gmt tz=Europe/Vienna - -LABEL jimmy -MENU LABEL jimmy -KERNEL linux26 -APPEND lang=us vga=791 quiet initrd=initrd.gz boot=live scandelay=3 nomce gmt tz=Europe/Vienna - LABEL failsafe MENU LABEL failsafe KERNEL linux26 -APPEND vga=normal video=ofonly noautoconfig lang=us atapicd noacpi nomodules acpi=off noagent nousb nohotplug noacpi noapm nopcmcia nosmp noscsi noagp nodma ide=nodma noswap nofstab nosound nogpm nosyslog nodhcp nocpu nodisc nomodem xmodule=vesa noautoconfig quiet initrd=initrd.gz boot=live - -LABEL failsafe2 -MENU LABEL failsafe2 -KERNEL linux26 -APPEND lang=us atapicd nosound noacpi noautoconfig acpi=off noscsi nodma ide=nodma noapm nousb nopcmcia nofirewire noagp nomce nodhcp xmodule=vesa quiet initrd=initrd.gz boot=live +APPEND initrd=initrd.gz vga=normal lang=us boot=live noautoconfig atapicd noacpi acpi=off nomodules nofirewire noudev nousb nohotplug noapm nopcmcia maxcpus=1 noscsi noagp nodma ide=nodma noswap nofstab nosound nogpm nosyslog nodhcp nocpu nodisc nomodem xmodule=vesa noraid nolvm LABEL forensic MENU LABEL forensic KERNEL linux26 -APPEND vga=791 lang=us nofstab noraid noautoconfig noswap raid=noautodetect quiet initrd=initrd.gz boot=live - -LABEL m23 -MENU LABEL m23 -KERNEL m23 -APPEND devfs=nomount load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=25000 initrd=m23rt.gz root=/dev/ram0 rw +APPEND vga=791 lang=us nofstab noraid nolvm noautoconfig noswap raid=noautodetect quiet initrd=initrd.gz boot=live LABEL grub MENU LABEL grub