Skip to content

Commit

Permalink
Drop support for all boot methods other than isolinux
Browse files Browse the repository at this point in the history
The "grub2" and "manifold" options for HYBRID_METHOD as well as the
"grub" and "grub2" options for BOOT_METHOD are not used by any official
Grml ISO, though they add considerable overhead and complexity in our
code base.

I'd like to keep our code base simple and avoid feature creep, so let's
deprecate BOOT_METHOD, and drop support for HYBRID_METHOD other than
isolinux.
  • Loading branch information
mika committed Aug 20, 2024
1 parent 27019e1 commit 4381f50
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 671 deletions.
1 change: 0 additions & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ Depends:
fai-client (>= 3.4.0),
isolinux (>= 3:6.03+dfsg-5+deb8u1~),
jo,
mksh,
moreutils,
mtools,
pciutils,
Expand Down
4 changes: 0 additions & 4 deletions debian/copyright
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ Files: fonts/graphicoreBitmapFont0-Light.otf
Copyright: 2010, Lasse Fister [email protected]
License: SIL

Files: scripts/bootgrub.mksh scripts/bootilnx.mksh
Copyright: 2007, 2008, 2009, 2010 Thorsten Glaser <[email protected]>
License: MirOS

Files: templates/EFI/debian/BOOT/grubx64.efi.signed
Copyright: 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc
2009-2012 Intel Corporation
Expand Down
2 changes: 0 additions & 2 deletions debian/grml-live.lintian-overrides
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
grml-live: bugs-field-does-not-refer-to-debian-infrastructure mailto:[email protected]
grml-live: executable-not-elf-or-script usr/share/grml-live/templates/windows/autostart/autorun.inf
grml-live: privacy-breach-generic usr/share/grml-live/templates/GRML/index.html [<link rel="home" href="http://grml.org/" title="grml.org" />] (http://grml.org/)
grml-live: script-not-executable usr/share/grml-live/scripts/bootgrub.mksh
grml-live: script-not-executable usr/share/grml-live/scripts/bootilnx.mksh
grml-live: unknown-section grml
grml-live: uses-dpkg-database-directly etc/grml/fai/config/hooks/instsoft.GRMLBASE
grml-live: uses-dpkg-database-directly etc/grml/fai/config/scripts/GRMLBASE/98-clean-chroot
Expand Down
17 changes: 0 additions & 17 deletions docs/grml-live.txt
Original file line number Diff line number Diff line change
Expand Up @@ -695,23 +695,6 @@ FAI_DEBOOTSTRAP:
Make sure apt-cacher-ng is running ('/etc/init.d/apt-cacher-ng restart').
That's it. All downloaded files will be cached in /var/cache/apt-cacher-ng then.

[[revert_manifold]]
How do I revert the manifold feature from an ISO?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

By default, Grml ISOs use isohybrid to allow them to be booted from CDs as
well as USB sticks. Manifold is an alternative to isohybrid.

If you notice any problems
when booting manifold-crafted media, just revert the manifold feature running:

% dd if=/dev/zero of=grml.iso bs=512 count=1 conv=notrunc

To switch from manifold to isohybrid mode (an alternative approach provided by
syslinux, used by default for official Grml images) then just execute:

% isohybrid grml.iso

[[create-a-base-tgz]]
How do I create a base tar.gz (I386.tar.gz or AMD64.tar.gz or ARM64.tar.gz)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
11 changes: 1 addition & 10 deletions etc/grml/grml-live.conf
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,6 @@
# Specify user with UID 1000 on live-system:
# USERNAME=grml

# Which bootloader do you want to use? Default: isolinux
# Supported values: isolinux, grub, grub2
# BOOT_METHOD='isolinux'

# Directory of configuration files for grml-live's FAI:
# GRML_FAI_CONFIG=/etc/grml/fai

Expand Down Expand Up @@ -133,8 +129,7 @@
# likes the default directory [/usr/share/grml-live/templates]
# TEMPLATE_DIRECTORY='/usr/share/grml-live/templates'

# Use custom scripts, for example for bootgrub.mksh?
# Useful when running grml-live from git checkout.
# Use custom scripts, useful when running grml-live from git checkout.
# If unset defaults to /usr/share/grml-live/scripts
# SCRIPTS_DIRECTORY='/usr/share/grml-live/scripts'

Expand All @@ -152,12 +147,8 @@
# boot the CD using normal el torito mode or copy it to USB device
# *without* having to run grml2usb (like: 'dd if=grml.iso of=/dev/sdX')
# - working both with the same ISO
# Note that the manifold method is currently not be compatible with UEFI
# setups.
# HYBRID_METHOD='disable' # do not create a hybrid ISO
# HYBRID_METHOD='isohybrid' # use isohybrid from SYSLINUX (default)
# HYBRID_METHOD='grub2' # use manifold with GRUB 2
# HYBRID_METHOD='manifold' # use manifold with ISOLINUX

# Secure Boot method that should be used (amd64 only).
# If unset defaults to "disabled" (which means no Secure Boot will be present)
Expand Down
86 changes: 13 additions & 73 deletions grml-live
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#!/bin/bash
# Filename: grml-live
# Purpose: build process script for generating a (grml based) Linux Live-ISO
# Authors: grml-team (grml.org),
# (c) Michael Prokop <[email protected]>,
# (c) Thorsten Glaser <[email protected]>
# Authors: Grml Team (see https://grml.org/)
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2 or any later version.
################################################################################
Expand Down Expand Up @@ -448,7 +446,6 @@ fi

# assume sane defaults (if not set already) {{{
[ -n "$ARCH" ] || ARCH="$(dpkg --print-architecture)"
[ -n "$BOOT_METHOD" ] || BOOT_METHOD='isolinux'
[ -n "$CLASSES" ] || CLASSES="GRMLBASE,GRML_FULL,$(echo ${ARCH} | tr 'a-z' 'A-Z')"
[ -n "$DATE" ] || DATE="$(date +%Y-%m-%d)"
[ -n "$DISTRI_INFO" ] || DISTRI_INFO='Grml - Live Linux for system administrators'
Expand Down Expand Up @@ -530,7 +527,6 @@ if [ -z "$FORCE" ] ; then
[ -n "$VERSION" ] && echo " Grml version: $VERSION"
[ -n "$SUITE" ] && echo " Debian suite: $SUITE"
[ -n "$ARCH" ] && echo " Architecture: $ARCH"
[ -n "$BOOT_METHOD" ] && echo " Boot method: $BOOT_METHOD"
[ -n "$HYBRID_METHOD" ] && echo " Hybrid method: $HYBRID_METHOD"
[ -n "$SECURE_BOOT" ] && echo " Secure Boot: $SECURE_BOOT"
[ -n "$TEMPLATE_DIRECTORY" ] && echo " Template files: $TEMPLATE_DIRECTORY"
Expand Down Expand Up @@ -717,6 +713,14 @@ elif echo $CLASSES | grep -qi arm64 ; then
fi
fi

if [[ -n "${BOOT_METHOD:-}" ]] && [[ "${BOOT_METHOD}" != "isolinux" ]] ; then
log "Error: You specified unsupported BOOT_METHOD '${BOOT_METHOD:-}', though only isolinux is supported."
eerror "Error: You specified unsupported BOOT_METHOD '${BOOT_METHOD:-}', though only isolinux is supported."
eerror "NOTE: The BOOT_METHOD configuration is deprecated, please consider unsetting it. Exiting."
eend 1
bailout
fi

# generate nfsroot configuration for FAI on the fly
if [ -z "$FAI_DEBOOTSTRAP" ] ; then
if [ -n "$WAYBACK_DATE" ] ; then
Expand Down Expand Up @@ -1532,7 +1536,6 @@ fi
# shellcheck disable=SC2034
generate_build_info() {
jo -p \
boot_method="${BOOT_METHOD}" \
bootstrap_only="${BOOTSTRAP_ONLY}" \
build_date="${DATE}" \
build_dirty="${BUILD_DIRTY}" \
Expand Down Expand Up @@ -1591,21 +1594,9 @@ generate_build_info() {
[ -n "$ISO_OUTPUT" ] || ISO_OUTPUT="$OUTPUT/grml_isos"
[ -n "$ISO_NAME" ] || ISO_NAME="${GRML_NAME}_${VERSION}.iso"

if [ "$BOOT_METHOD" = "isolinux" ] ; then
BOOT_ARGS="-no-emul-boot -boot-load-size 4 -boot-info-table -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat"
if [ "$HYBRID_METHOD" = "isohybrid" ] ; then
EFI_ARGS="-isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin -eltorito-alt-boot -e boot/efi.img -no-emul-boot -isohybrid-gpt-basdat"
fi
elif [ "$BOOT_METHOD" = "grub2" ] ; then
BOOT_ARGS="-no-emul-boot -boot-load-size 4 -b boot/grub/toriboot.bin"
fi

# Work around http://bts.grml.org/grml/issue945
if [[ $BOOT_METHOD != isolinux && ($HYBRID_METHOD = isohybrid || $HYBRID_METHOD = manifold) ]]; then
log "Setting HYBRID_METHOD to grub2 as hybrid mode does not work with isohybrid yet."
ewarn "Setting HYBRID_METHOD to grub2 as hybrid mode does not work with isohybrid yet."
HYBRID_METHOD='grub2'
eend 0
BOOT_ARGS="-no-emul-boot -boot-load-size 4 -boot-info-table -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat"
if [ "$HYBRID_METHOD" = "isohybrid" ] ; then
EFI_ARGS="-isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin -eltorito-alt-boot -e boot/efi.img -no-emul-boot -isohybrid-gpt-basdat"
fi

if [ -f "${ISO_OUTPUT}/${ISO_NAME}" -a -z "$UPDATE" -a -z "$BUILD_ONLY" -a -z "$BUILD_DIRTY" -a "$FORCE_ISO_REBUILD" = "false" ] ; then
Expand Down Expand Up @@ -1662,14 +1653,6 @@ else

CURRENT_DIR=$(pwd)
if cd "$BUILD_OUTPUT" ; then
if [ "$BOOT_METHOD" = "grub2" ]; then
# make a 2048-byte bootsector for El Torito
dd if=/dev/zero of=boot/grub/toriboot.bin bs=512 count=4 2>/dev/null
# those are in 2048-byte sectors, so 1 16 matches 4 63 below
echo 1 16 | mksh "${SCRIPTS_DIRECTORY}/bootgrub.mksh" -B 11 | \
dd of=boot/grub/toriboot.bin conv=notrunc 2>/dev/null
fi

log "Generating build information in conf/buildinfo.json"
einfo "Generating build information in conf/buildinfo.json"
mkdir -p conf/
Expand All @@ -1690,57 +1673,14 @@ else
bailout $RC
fi

# both of these need core.img there, so it’s easier to write it here
if [ "$BOOT_METHOD" = "grub2" ] || [ "$HYBRID_METHOD" = "grub2" ]; then
# must be <= 30720 bytes
dd if=boot/grub/core.img of="${ISO_OUTPUT}/${ISO_NAME}" \
conv=notrunc bs=512 seek=4 2>/dev/null
fi

# TODO - review whether actually still needed?
# pad the output ISO to multiples of 256 KiB for partition table support
siz=$($getfilesize "${ISO_OUTPUT}/${ISO_NAME}")
cyls=$((siz / 512 / 32 / 16 + 1)) # C=$cyls H=16 S=32
siz=$((cyls * 16 * 32 * 512)) # size after padding
dd if=/dev/zero bs=1 count=1 seek=$((siz - 1)) \
of="${ISO_OUTPUT}/${ISO_NAME}" 2>/dev/null

# support disabling hybrid ISO image
if [ "$HYBRID_METHOD" = "disable" ] ; then
log "Skipping creation of hybrid ISO file as requested via HYBRID_METHOD=disable"
einfo "Skipping creation of hybrid ISO file as requested via HYBRID_METHOD=disable"
eend 0
elif [ "$HYBRID_METHOD" = "manifold" ] || [ "$HYBRID_METHOD" = "grub2" ] ; then
# isoinfo is part of both mkisofs and genisoimage so we're good
bootoff=$(isoinfo -l -i "${ISO_OUTPUT}/${ISO_NAME}" | \
sed -n '/^.*\[ *\([0-9]*\)[] ].* ISOLINUX.BIN[;1]* *$/s//\1/p')

if ! [ -r boot/grub/core.img ] ; then
log "boot/grub/core.img not found, not creating manifold boot ISO file"
ewarn "boot/grub/core.img not found, not creating manifold boot ISO file"
elif [ "${bootoff:-0}" -lt 1 ] ; then
log "isolinux.bin not found on the ISO file, disabling manifold boot"
ewarn "isolinux.bin not found on the ISO file, disabling manifold boot"
else
if [ "$HYBRID_METHOD" = "grub2" ] ; then
log "Creating hybrid ISO file with manifold/grub2 method"
einfo "Creating hybrid ISO file with manifold/grub2 method"
# 512 bytes: MBR, partition table, load GRUB 2
echo 4 63 | mksh "${SCRIPTS_DIRECTORY}/bootgrub.mksh" -A -M 4:0x96 -g $cyls:16:32
else
log "Creating hybrid ISO file with manifold method"
einfo "Creating hybrid ISO file with manifold method"
# read only one but 2048-byte sized (scale: << 2) sector
echo $bootoff $bootoff | \
mksh ${SCRIPTS_DIRECTORY}/bootilnx.mksh -A -M 4:0x96 -g $cyls:16:32 -S 2
fi | dd of="${ISO_OUTPUT}/${ISO_NAME}" conv=notrunc 2>/dev/null
eend $?
fi
elif [ "$HYBRID_METHOD" = "isohybrid" ] ; then
: # nothing to do, handled via $MKISOFS $EFI_ARGS already
else
bailout 12 "Unknown HYBRID_METHOD [${HYBRID_METHOD}]. Supported values: disable, isohybrid, grub2, manifold"
fi

# generate ISO checksums if we are using class 'RELEASE':
case $CLASSES in *RELEASE*)
[ "$RC" = 0 ] && \
Expand Down
2 changes: 0 additions & 2 deletions remaster/grml-live-remaster
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,6 @@ siz=$((cyls * 16 * 32 * 512)) # size after padding
dd if=/dev/zero bs=1 count=1 seek=$((siz - 1)) of="$1" 2>/dev/null
rm -R /remaster/iso

# here is the place where we could apply bootgrub.mksh

echo ""
echo "ISO generation complete:"
ls --color -l "$1"
Expand Down
Loading

0 comments on commit 4381f50

Please sign in to comment.