From a542d52141acef0e2d2bb78253d6b5df4305dcd1 Mon Sep 17 00:00:00 2001 From: Lyndon Brown Date: Mon, 4 May 2020 18:20:02 +0100 Subject: rename binary_loopback_cfg to binary_grub_cfg when loopback support was introduced, it initially duplicated the code for generating a grub2 config, before the duplicated code was removed from the grub-pc script, effectively thus moving grub config generation to the loopback feature script. grub-efi support was added after this. this results in a misleading filename, since the `binary_loopback_cfg` script is essential for use of grub-pc|grub-efi, and actually only has a single line of code on top that's needed for adding actual loopback support on top. (when grub-pc and grub-efi are not used, the entire script is still needed for loopback support to work). so here we rename it to make better sense, and correct/clarify bits of documentation. Gbp-Dch: Short --- scripts/build/binary_grub_cfg | 289 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 289 insertions(+) create mode 100755 scripts/build/binary_grub_cfg (limited to 'scripts/build/binary_grub_cfg') diff --git a/scripts/build/binary_grub_cfg b/scripts/build/binary_grub_cfg new file mode 100755 index 000000000..54649e187 --- /dev/null +++ b/scripts/build/binary_grub_cfg @@ -0,0 +1,289 @@ +#!/bin/sh + +## live-build(7) - System Build Scripts +## Copyright (C) 2016-2020 The Debian Live team +## Copyright (C) 2006-2015 Daniel Baumann +## +## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING. +## This is free software, and you are welcome to redistribute it +## under certain conditions; see COPYING for details. + + +set -e + +# Including common functions +[ -e "${LIVE_BUILD}/scripts/build.sh" ] && . "${LIVE_BUILD}/scripts/build.sh" || . /usr/lib/live/build.sh + +# Setting static variables +DESCRIPTION="Generates config for grub-pc and grub-efi, and installs loopback support" +USAGE="${PROGRAM} [--force]" + +# Processing arguments and configuration files +Init_config_data "${@}" + +# NOTE: This creates the config used for both grub-pc and grub-efi. +# It also installs loopback.cfg for looback support, which depends upon that +# config. Since loopback support is added unconditionally, this script is +# thus run unconditionally! +# TODO: Add an option to allow disabling loopback.cfg creation? (and thus conditionally run the script) + +Echo_message "Begin installing config for grub-pc and/or grub-pc, and loopback support..." + +# Requiring stage file +Require_stagefiles config bootstrap + +# Checking stage file +Check_stagefile + +# Acquire lock file +Acquire_lockfile + +# Check architecture +Check_architectures amd64 i386 +Check_crossarchitectures + +_TARGET="binary/boot/grub" + +# Local functions +Grub_live_menu_entry() { + local LABEL="$1" + local KERNEL="$2" + local INITRD="$3" + local APPEND="$4" + local HOTKEY="${5:+ --hotkey=$5}" + + cat >> "${LIVE_ENTRIES_TMP}" <> "${LIVE_ENTRIES_TMP}" < "${_TARGET}"/loopback.cfg + +# Creating stage file +Create_stagefile -- cgit v1.2.3