[SCM] live-helper branch, master, updated. 1.0.5-2-45-g566d279
Daniel Baumann
daniel at debian.org
Wed Oct 28 12:28:40 UTC 2009
The following commit has been merged in the master branch:
commit 566d27904afb37153043d3e1cdb3f5a2edce8162
Author: Daniel Baumann <daniel at debian.org>
Date: Wed Oct 28 13:15:30 2009 +0100
Merging initial and experimental grub2 support from Luigi Capriotti <l.capriotti at xbmc.org>.
Outstanding issues: doesn't work chrooted yet, lh_binary_iso binary.sh modifications probably should be done at lh_binary_grub2.
diff --git a/helpers/lh_binary b/helpers/lh_binary
index 91e04a4..271bfd7 100755
--- a/helpers/lh_binary
+++ b/helpers/lh_binary
@@ -54,6 +54,7 @@ lh binary_linux-image ${*}
lh binary_debian-installer ${*}
lh binary_memtest ${*}
lh binary_grub ${*}
+lh binary_grub2 ${*}
lh binary_syslinux ${*}
lh binary_yaboot ${*}
lh binary_silo ${*}
diff --git a/helpers/lh_binary_grub b/helpers/lh_binary_grub2
similarity index 69%
copy from helpers/lh_binary_grub
copy to helpers/lh_binary_grub2
index d0e3221..7be3bf5 100755
--- a/helpers/lh_binary_grub
+++ b/helpers/lh_binary_grub2
@@ -1,6 +1,6 @@
#!/bin/sh
-# lh_binary_grub(1) - installs grub into binary
+# lh_binary_grub2(1) - installs grub2 into binary
# Copyright (C) 2006-2009 Daniel Baumann <daniel at debian.org>
#
# live-helper comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
@@ -13,7 +13,7 @@ set -e
. "${LH_BASE:-/usr/share/live-helper}"/functions.sh
# Setting static variables
-DESCRIPTION="$(Echo 'installs grub into binary')"
+DESCRIPTION="$(Echo 'installs grub2 into binary')"
HELP=""
USAGE="${PROGRAM} [--force]"
@@ -23,12 +23,12 @@ Arguments "${@}"
Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
Set_defaults
-if [ "${LH_BOOTLOADER}" != "grub" ]
+if [ "${LH_BOOTLOADER}" != "grub2" ]
then
exit 0
fi
-Echo_message "Begin installing grub..."
+Echo_message "Begin installing grub2..."
# Requiring stage file
Require_stagefile .stage/config .stage/bootstrap
@@ -36,8 +36,8 @@ Require_stagefile .stage/config .stage/bootstrap
# Checking stage file
Check_stagefile .stage/binary_grub
-# Checking grub templates
-Check_templates grub
+# Checking grub2 templates
+Check_templates grub2
# Checking lock file
Check_lockfile .lock
@@ -50,7 +50,7 @@ Check_architecture amd64 i386 lpia
Check_crossarchitecture
# Checking depends
-Check_package chroot/usr/sbin/grub grub
+Check_package chroot/usr/bin/grub-mkimage grub-pc
# Restoring cache
Restore_cache cache/packages_binary
@@ -66,9 +66,10 @@ Grub_live_entry ()
INITRD="${3}"
APPEND="${4}"
- LINUX_LIVE="${LINUX_LIVE}\ntitle\t\tDebian GNU/Linux - ${LABEL}"
- LINUX_LIVE="${LINUX_LIVE}\nkernel\t\t/${KERNEL} boot=${INITFS} LH_BOOTAPPEND_LIVE ${APPEND}"
+ LINUX_LIVE="${LINUX_LIVE}\nmenuentry \"Debian GNU/Linux - ${LABEL}\" {"
+ LINUX_LIVE="${LINUX_LIVE}\nlinux\t\t/${KERNEL} boot=${INITFS} LH_BOOTAPPEND_LIVE ${APPEND}"
LINUX_LIVE="${LINUX_LIVE}\ninitrd\t\t/${INITRD}"
+ LINUX_LIVE="${LINUX_LIVE}\n}"
}
Grub_install_entry ()
@@ -78,46 +79,15 @@ Grub_install_entry ()
INITRD="${3}"
APPEND="${4}"
- # Boot in quiet mode where appropriate
- if [ "${LH_DISTRIBUTION}" != "etch" ]
+ if [ "${LH_DISTRIBUTION}" != "etch" ] && [ "${LABEL}" != "rescue" ] && [ "${LABEL}" != "rescuegui" ]
then
- QAPPEND="quiet"
+ APPEND="${APPEND} quiet"
fi
- for TYPE in Install Expert Rescue Auto
- do
- case "${TYPE}" in
- Install)
- TAPPEND="${APPEND} ${QAPPEND}"
- ;;
-
- Expert)
- TAPPEND="priority=low ${APPEND}"
- ;;
-
- Rescue)
- TAPPEND="rescue/enable=true ${APPEND} ${QAPPEND}"
- ;;
-
- Auto)
- TAPPEND="auto=true priority=critical ${APPEND} ${QAPPEND}"
- ;;
- esac
-
- case "${LABEL}" in
- Text)
- TYPE_SUFFIX=""
- ;;
- GUI)
- TYPE_SUFFIX="gui"
- ;;
- esac
-
-
- LINUX_INSTALL="${LINUX_INSTALL}\ntitle\t\t${LABEL} ${TYPE}"
- LINUX_INSTALL="${LINUX_INSTALL}\nkernel\t\t/${KERNEL} ${TAPPEND} ${LH_BOOTAPPEND_INSTALL}"
- LINUX_INSTALL="${LINUX_INSTALL}\ninitrd\t\t/${INITRD}"
- done
+ LINUX_INSTALL="${LINUX_INSTALL}\nmenuentry \"Debian GNU/Linux - ${LABEL}\" {"
+ LINUX_INSTALL="${LINUX_INSTALL}\nlinux\t\t/${KERNEL} ${APPEND} LH_BOOTAPPEND_INSTALL"
+ LINUX_INSTALL="${LINUX_INSTALL}\ninitrd\t\t/${INITRD}"
+ LINUX_INSTALL="${LINUX_INSTALL}\n}"
}
case "${LH_INITRAMFS}" in
@@ -243,8 +213,8 @@ LINUX_LIVE="$(/bin/echo ${LINUX_LIVE} | sed -e 's|binary||g' -e 's|//|/|g')"
# Assembling debian-installer configuration
if [ "${LH_DEBIAN_INSTALLER}" != "disabled" ]
then
- LINUX_LIVE="title\t\tLive:\nroot\n\n${LINUX_LIVE}"
- LINUX_INSTALL="title\t\tInstaller:\nroot"
+ LINUX_LIVE="#\t \"Live\"\n${LINUX_LIVE}"
+ LINUX_INSTALL="#\t \"Installer\"\n"
VMLINUZ_DI="install/vmlinuz"
INITRD_DI="install/initrd.gz"
@@ -254,15 +224,14 @@ then
INITRD_GI="install/gtk/initrd.gz"
APPEND_GI="video=vesa:ywrap,mtrr vga=788"
- if [ -f "binary/boot/${VMLINUZ_DI}" ] && [ -f "binary/boot/${INITRD_DI}" ]
- then
- Grub_install_entry "Text" "${VMLINUZ_DI}" "${INITRD_DI}" "${APPEND_DI}"
- fi
-
- if [ -f "binary/boot/${VMLINUZ_GI}" ] && [ -f "binary/boot/${INITRD_GI}" ]
- then
- Grub_install_entry "GUI" "${VMLINUZ_GI}" "${INITRD_GI}" "${APPEND_GI}"
- fi
+ Grub_install_entry "install" "${VMLINUZ_DI}" "${INITRD_DI}" "${APPEND_DI}"
+ Grub_install_entry "installgui" "${VMLINUZ_GI}" "${INITRD_GI}" "${APPEND_GI}"
+ Grub_install_entry "expert" "${VMLINUZ_DI}" "${INITRD_DI}" "priority=low ${APPEND_DI}"
+ Grub_install_entry "expertgui" "${VMLINUZ_GI}" "${INITRD_GI}" "priority=low ${APPEND_GI}"
+ Grub_install_entry "rescue" "${VMLINUZ_DI}" "${INITRD_DI}" "rescue/enable=true ${APPEND_DI}"
+ Grub_install_entry "rescuegui" "${VMLINUZ_GI}" "${INITRD_GI}" "rescue/enable=true ${APPEND_GI}"
+ Grub_install_entry "auto" "${VMLINUZ_DI}" "${INITRD_DI}" "auto=true priority=critical ${APPEND_DI}"
+ Grub_install_entry "autogui" "${VMLINUZ_GI}" "${INITRD_GI}" "auto=true priority=critical ${APPEND_GI}"
fi
LINUX_INSTALL="$(/bin/echo ${LINUX_INSTALL} | sed -e 's|binary||g' -e 's|//|/|g')"
@@ -270,8 +239,8 @@ LINUX_INSTALL="$(/bin/echo ${LINUX_INSTALL} | sed -e 's|binary||g' -e 's|//|/|g'
# Assembling memtest configuration
if [ -f "${DESTDIR_LIVE}"/memtest ]
then
- MEMTEST="title\t\tOther:\nroot"
- MEMTEST="${MEMTEST}\n\ntitle\t\t${LH_MEMTEST}\nkernel\t\t/$(basename ${DESTDIR_LIVE})/memtest"
+ MEMTEST="#\t \"Other\"\n"
+ MEMTEST="${MEMTEST}\nmenuentry\t\"${LH_MEMTEST}\" {\nlinux16\t$(basename ${DESTDIR_LIVE})/memtest\n}"
MEMTEST="$(/bin/echo ${MEMTEST} | sed -e 's|//|/|g')"
fi
@@ -281,11 +250,11 @@ cp -r "${TEMPLATES}"/* binary/boot/grub
case ${LH_BINARY_IMAGES} in
iso)
- FILES="chroot/usr/lib/grub/*/stage2_eltorito"
+ FILES="chroot/usr/lib/grub/i386-pc/*.mod chroot/usr/lib/grub/i386-pc/*.lst chroot/usr/lib/grub/i386-pc/efiemu??.o chroot/usr/share/grub/*.pf2"
;;
tar|usb-hdd)
- FILES="chroot/usr/lib/grub/*/stage1 chroot/usr/lib/grub/*/e2fs_stage1_5 chroot/usr/lib/grub/*/stage2"
+ FILES="chroot/usr/lib/grub/i386-pc/*"
;;
esac
@@ -298,18 +267,15 @@ fi
cp ${FILES} binary/boot/grub
# Copying local configuration file
-if [ -f config/binary_grub/menu.lst ]
+if [ -f config/binary_grub/grub.cfg ]
then
- cp config/binary_grub/menu.lst binary/boot/grub/menu.lst
+ cp config/binary_grub/grub.cfg binary/boot/grub/grub.cfg
fi
# Copying splash screen
-if [ -f config/binary_grub/splash.xpm.gz ]
-then
- LH_GRUB_SPLASH="config/binary_grub/splash.xpm.gz"
-elif [ -f config/binary_grub/splash.xpm ]
+if [ -f config/binary_grub/splash.tga ]
then
- LH_GRUB_SPLASH="config/binary_grub/splash.xpm"
+ LH_GRUB_SPLASH="config/binary_grub/splash.tga"
fi
if [ -n "${LH_GRUB_SPLASH}" ]
@@ -317,21 +283,21 @@ then
if [ "${LH_GRUB_SPLASH}" = "none" ]
then
# Removing splash file
- rm -f binary/boot/grub/splash.xpm.gz
+ rm -f binary/boot/grub/splash.tga
# Removing splash entry
- sed -i -e "s|splashimage.*||" binary/boot/grub/menu.lst
+ sed -i -e "s|background_image.*||" binary/boot/grub/grub.cfg
else
# Overwriting splash file
cp -f "${LH_GRUB_SPLASH}" binary/boot/grub
- sed -i -e "s|splashimage.*|splashimage /boot/grub/$(basename ${LH_GRUB_SPLASH})|" binary/boot/grub/menu.lst
+ sed -i -e "s|background_image .*.tga|background_image \$\(root\)/boot/grub/$(basename ${LH_GRUB_SPLASH})|" binary/boot/grub/grub.cfg
fi
fi
-sed -i -e "s|LINUX_LIVE|${LINUX_LIVE}|" -e "s|LINUX_INSTALL|${LINUX_INSTALL}|" -e "s|MEMTEST|${MEMTEST}|" binary/boot/grub/menu.lst
-sed -i -e "s|LH_BOOTAPPEND_INSTALL|${LH_BOOTAPPEND_INSTALL}|" -e "s|LH_BOOTAPPEND_LIVE|${LH_BOOTAPPEND_LIVE}|" binary/boot/grub/menu.lst
+sed -i -e "s|LINUX_LIVE|${LINUX_LIVE}|" -e "s|LINUX_INSTALL|${LINUX_INSTALL}|" -e "s|MEMTEST|${MEMTEST}|" binary/boot/grub/grub.cfg
+sed -i -e "s|LH_BOOTAPPEND_INSTALL|${LH_BOOTAPPEND_INSTALL}|" -e "s|LH_BOOTAPPEND_LIVE|${LH_BOOTAPPEND_LIVE}|" binary/boot/grub/grub.cfg
-sed -i -e 's|\ $||g' binary/boot/grub/menu.lst
+sed -i -e 's|\ $||g' binary/boot/grub/grub.cfg
# Saving cache
Save_cache cache/packages_binary
diff --git a/helpers/lh_binary_iso b/helpers/lh_binary_iso
index 0b8bb55..d9f3902 100755
--- a/helpers/lh_binary_iso
+++ b/helpers/lh_binary_iso
@@ -99,6 +99,12 @@ case "${LH_BOOTLOADER}" in
GENISOIMAGE_EXCLUDE="boot/grub/stage2_eltorito"
;;
+ grub2)
+ GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -no-emul-boot -boot-load-size 4 -boot-info-table"
+ GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -r -b boot/grub/grub_eltorito -J"
+ GENISOIMAGE_EXCLUDE="boot/grub/grub_eltorito"
+ ;;
+
silo)
GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -r -G boot/isofs.b -B ..."
GENISOIMAGE_EXCLUDE="boot/isofs.b"
@@ -132,7 +138,40 @@ then
fi
fi
+if [ "${LH_BOOTLOADER}" = "grub2" ]
+then
+
cat > binary.sh << EOF
+#!/bin/sh
+
+input_dir=/usr/lib/grub/i386-pc
+
+# build core.img
+core_img=\$(mktemp)
+grub-mkimage -d ${input_dir} -o ${core_img} biosdisk iso9660
+
+# build grub_eltorito image
+cat ${input_dir}/cdboot.img ${core_img} > binary/boot/grub/grub_eltorito
+
+rm -f ${core_img}
+
+for file in ${input_dir}/*.mod ${input_dir}/efiemu??.o \
+ ${input_dir}/command.lst ${input_dir}/moddep.lst ${input_dir}/fs.lst \
+ ${input_dir}/handler.lst ${input_dir}/parttool.lst
+do
+ if test -f "$file"
+ then
+ cp -f "$file" binary/boot/grub
+ fi
+done
+EOF
+
+else
+ echo "#!/bin/sh" > binary.sh
+fi
+
+cat >> binary.sh << EOF
+
genisoimage ${GENISOIMAGE_OPTIONS} -o binary.iso binary
EOF
diff --git a/helpers/lh_chroot_hacks b/helpers/lh_chroot_hacks
index 721a6d7..cc12630 100755
--- a/helpers/lh_chroot_hacks
+++ b/helpers/lh_chroot_hacks
@@ -124,7 +124,15 @@ then
# late to fix it in d-i because lenny rc2 has been already released.
case "${LH_ARCHITECTURE}" in
amd64|i386|lpia)
- Apt install grub
+ case "${LH_BOOTLOADER}" in
+ grub)
+ Apt install grub
+ ;;
+
+ grub2)
+ Apt install grub2
+ ;;
+ esac
;;
powerpc)
diff --git a/manpages/lh_chroot_cache.en.1 b/manpages/lh_binary_grub2.en.1
similarity index 68%
copy from manpages/lh_chroot_cache.en.1
copy to manpages/lh_binary_grub2.en.1
index 2086a5e..26149dd 100644
--- a/manpages/lh_chroot_cache.en.1
+++ b/manpages/lh_binary_grub2.en.1
@@ -1,19 +1,19 @@
-.TH LH_CHROOT_COPY 1 "2009\-06\-14" "1.0.5" "live\-helper"
+.TH LH_BINARY_GRUB2 1 "2009\-10\-09" "1.0.5" "live\-helper"
.SH NAME
-lh_chroot_cache \- cache chroot stage
+lh_binary_grub2 \- install grub2 into binary
.SH SYNOPSIS
-\fBlh_chroot_cache\fR [\fIlive\-helper options\fR]
+\fBlh_binary_grub2\fR [\fIlive\-helper options\fR]
.SH DESCRIPTION
-lh_chroot_cache is a low\-level command (plumbing) of live\-helper, the Debian Live tool suite. It caches the chroot stage.
+lh_binary_grub2 is a low\-level command (plumbing) of live\-helper, the Debian Live tool suite. It installs grub2 into binary.
.SH OPTIONS
-lh_chroot_cache has no specific options but understands all generic live\-helper options. See \fIlive\-helper\fR(7) for a complete list of all generic live\-helper options.
+lh_binary_grub2 has no specific options but understands all generic live\-helper options. See \fIlive\-helper\fR(7) for a complete list of all generic live\-helper options.
.SH SEE ALSO
-\fIlh_chroot\fR(1)
+\fIlh_binary\fR(1)
.br
\fIlive\-helper\fR(7)
.PP
diff --git a/manpages/live-helper.en.7 b/manpages/live-helper.en.7
index 67fbebb..1ef64c9 100644
--- a/manpages/live-helper.en.7
+++ b/manpages/live-helper.en.7
@@ -159,6 +159,8 @@ install disk information into binary
encrypts rootfs
.IP "\fBlh_binary_grub\fR(1)" 4
installs grub into binary
+.IP "\fBlh_binary_grub2\fR(1)" 4
+installs grub2 into binary
.IP "\fBlh_binary_includes\fR(1)" 4
copy files into binary
.IP "\fBlh_binary_iso\fR(1)" 4
diff --git a/templates/grub2/grub.cfg b/templates/grub2/grub.cfg
new file mode 100644
index 0000000..4ad86bd
--- /dev/null
+++ b/templates/grub2/grub.cfg
@@ -0,0 +1,12 @@
+set default=0
+
+insmod tga
+background_image ($root)/boot/grub/xbmc.tga
+set color_normal=cyan/blue
+set color_highlight=white/blue
+
+LINUX_LIVE
+
+LINUX_INSTALL
+
+MEMTEST
diff --git a/templates/grub2/splash.tga b/templates/grub2/splash.tga
new file mode 100644
index 0000000..854d0b2
Binary files /dev/null and b/templates/grub2/splash.tga differ
--
live-helper
More information about the debian-live-changes
mailing list