#!/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 arm64 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