summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTails developers <amnesia@boum.org>2014-06-28 18:32:48 +0000
committerTails developers <amnesia@boum.org>2014-06-28 18:32:48 +0000
commit657ab41d0b7e2fc9d162bc35326f2c6e0ed3e33d (patch)
treee4f55b011668937b3e15b87281a043361f5fc90b
parentd3c4208a92fcdaa71cfb58f9941abdb137facfc7 (diff)
Have syslinux' SYSAPPEND feature add FSUUID= to the kernel command-line.feature/6397-stop-relying-on-the-removable-bit
This will help addressing #6397, without having to hard-code in the bootloader configuration the UUID of the FS the SquashFS should be loaded from.
-rwxr-xr-xconfig/binary_local-hooks/15-syslinux_sysappend46
1 files changed, 46 insertions, 0 deletions
diff --git a/config/binary_local-hooks/15-syslinux_sysappend b/config/binary_local-hooks/15-syslinux_sysappend
new file mode 100755
index 0000000..bbba340
--- /dev/null
+++ b/config/binary_local-hooks/15-syslinux_sysappend
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+set -e
+
+# Including common functions
+. "${LB_BASE:-/usr/share/live/build}"/scripts/build.sh
+
+# Setting static variables
+DESCRIPTION="$(Echo 'adding SYSAPPEND parameter to the syslinux menu')"
+HELP=""
+USAGE="${PROGRAM}"
+
+# Reading configuration files
+Read_conffiles config/all config/bootstrap config/common config/binary
+Set_defaults
+
+# Safeguards
+if [ "${LB_BOOTLOADER}" != "syslinux" ]
+then
+ exit 0
+fi
+if [ "${LB_ARCHITECTURE}" != "i386" ]
+then
+ exit 0
+fi
+
+# Seems like we'll have work to do
+Echo_message "adding SYSAPPEND parameter to the syslinux menu"
+
+# Setting boot method specific variables
+case "${LB_BINARY_IMAGES}" in
+ iso|iso-hybrid)
+ SYSLINUX_PATH="binary/isolinux"
+ SYSLINUX_CFG="${SYSLINUX_PATH}/isolinux.cfg"
+ ;;
+ usb-hdd)
+ SYSLINUX_PATH="binary/syslinux"
+ SYSLINUX_CFG="${SYSLINUX_PATH}/syslinux.cfg"
+ ;;
+esac
+
+# Setting variables
+SYSLINUX_LIVE_CFG="${SYSLINUX_PATH}/live.cfg"
+
+# Patch live.cfg to add the SYSAPPEND parameter
+perl -pi -E 'if (/^(\s+)append\s+/) { say "$1sysappend 0x40000"}' "${SYSLINUX_LIVE_CFG}"