summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLyndon Brown <jnqnfe@gmail.com>2020-05-04 18:20:02 +0100
committerLyndon Brown <jnqnfe@gmail.com>2020-05-04 22:15:09 +0100
commita542d52141acef0e2d2bb78253d6b5df4305dcd1 (patch)
treed503cb2cdef233f4edba842f55749afb19dbf7ef
parent3a523c3fc12ef23e720020e2bad151fc91b8b35d (diff)
downloadvyos-live-build-a542d52141acef0e2d2bb78253d6b5df4305dcd1.tar.gz
vyos-live-build-a542d52141acef0e2d2bb78253d6b5df4305dcd1.zip
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
-rw-r--r--manpages/en/live-build.78
-rwxr-xr-xscripts/build/binary2
-rwxr-xr-xscripts/build/binary_grub-efi4
-rwxr-xr-xscripts/build/binary_grub-pc4
-rwxr-xr-xscripts/build/binary_grub_cfg (renamed from scripts/build/binary_loopback_cfg)15
5 files changed, 18 insertions, 15 deletions
diff --git a/manpages/en/live-build.7 b/manpages/en/live-build.7
index 1920f6744..0c17afb3c 100644
--- a/manpages/en/live-build.7
+++ b/manpages/en/live-build.7
@@ -119,12 +119,14 @@ creates checksums (md5, sha1, and/or sha256) for live image content
duplicates the chroot directory, to place a copy of what would be the completed live OS root filesystem to one side, allowing the original to continue to be used in executing certain parts of the remainder of the build process
.IP "\fBlb binary_disk\fR(1)" 4
creates disk information files to be added to live image
+.IP "\fBlb binary_grub_cfg\fR(1)" 4
+creates the config for grub-pc and grub-efi, and also enables loopback support (which depends upon it) in the live image
.IP "\fBlb binary_grub-efi\fR(1)" 4
-installs grub2-efi into live image to provide image boot capability
+installs grub-efi (grub2 for EFI) into live image to provide image boot capability. It relies upon \fBlb binary_grub_cfg\fR to create the config.
.IP "\fBlb binary_grub-legacy\fR(1)" 4
installs grub into live image to provide image boot capability
.IP "\fBlb binary_grub-pc\fR(1)" 4
-installs grub2 into live image to provide image boot capability
+installs grub-pc (grub2 for BIOS) into live image to provide image boot capability. It relies upon \fBlb binary_grub_cfg\fR to create the config.
.IP "\fBlb binary_hdd\fR(1)" 4
compiles the final live image into an HDD image file
.IP "\fBlb binary_hooks\fR(1)" 4
@@ -137,8 +139,6 @@ compiles the final live image into an ISO file
copies the linux\-image into the live image
.IP "\fBlb binary_loadlin\fR(1)" 4
bundles a copy of loadlin into the live image
-.IP "\fBlb binary_loopback_cfg\fR(1)" 4
-install loopback-cfg into the live image
.IP "\fBlb binary_manifest\fR(1)" 4
creates manifest of packages installed into live OS filesystem, and list of packages to be excluded by a persistence mechanism installing the live OS to disk
.IP "\fBlb binary_memtest\fR(1)" 4
diff --git a/scripts/build/binary b/scripts/build/binary
index a759a7899..aa1d06ab2 100755
--- a/scripts/build/binary
+++ b/scripts/build/binary
@@ -54,7 +54,7 @@ lb binary_linux-image "${@}"
lb binary_memtest "${@}"
lb binary_grub-legacy "${@}"
lb binary_grub-pc "${@}"
-lb binary_loopback_cfg "${@}"
+lb binary_grub_cfg "${@}"
lb binary_syslinux "${@}"
lb binary_disk "${@}"
lb binary_loadlin "${@}"
diff --git a/scripts/build/binary_grub-efi b/scripts/build/binary_grub-efi
index 2ee26f40d..a7181bfed 100755
--- a/scripts/build/binary_grub-efi
+++ b/scripts/build/binary_grub-efi
@@ -31,6 +31,8 @@ fi
Echo_message "Begin preparing Grub based EFI support..."
+# NOTE: We rely on `binary_grub_cfg` to generate grub.cfg and other configuration files!
+
# Requiring stage file
Require_stagefiles config bootstrap
@@ -295,7 +297,5 @@ rm -rf chroot/grub-efi-temp-arm-efi
rm -rf chroot/grub-efi-temp-cfg
rm -rf chroot/grub-efi-temp
-# We rely on: binary_loopback_cfg to generate grub.cfg and other configuration files
-
# Creating stage file
Create_stagefile
diff --git a/scripts/build/binary_grub-pc b/scripts/build/binary_grub-pc
index f639b1aa1..9fca63272 100755
--- a/scripts/build/binary_grub-pc
+++ b/scripts/build/binary_grub-pc
@@ -31,6 +31,8 @@ fi
Echo_message "Begin installing grub-pc..."
+# NOTE: We rely on `binary_grub_cfg` to generate grub.cfg and other configuration files!
+
# Requiring stage file
Require_stagefiles config bootstrap
@@ -71,8 +73,6 @@ then
FILES="$(echo ${FILES} | sed -e 's|chroot||g')"
fi
-# We rely on: binary_loopback_cfg to generate grub.cfg and other configuration files
-
# Copying grub
cp ${FILES} binary/boot/grub/i386-pc
diff --git a/scripts/build/binary_loopback_cfg b/scripts/build/binary_grub_cfg
index 4f4e1b95d..54649e187 100755
--- a/scripts/build/binary_loopback_cfg
+++ b/scripts/build/binary_grub_cfg
@@ -15,17 +15,19 @@ set -e
[ -e "${LIVE_BUILD}/scripts/build.sh" ] && . "${LIVE_BUILD}/scripts/build.sh" || . /usr/lib/live/build.sh
# Setting static variables
-DESCRIPTION="Installs loopback.cfg into binary"
+DESCRIPTION="Generates config for grub-pc and grub-efi, and installs loopback support"
USAGE="${PROGRAM} [--force]"
# Processing arguments and configuration files
Init_config_data "${@}"
-# We avoid checking if we need to be running this bootloader
-# on purpose. The reason: You will always want to have
-# a loopback.cfg file
-# TODO: Add an option to be able to disable this file creation
-Echo_message "Begin installing loopback.cfg..."
+# 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
@@ -280,6 +282,7 @@ sed -i \
sed -i -e 's|//|/|g' "${_TARGET}"/*.cfg
sed -i -e 's|\ $||g' "${_TARGET}"/*.cfg
+# Add loopback support
echo "source /boot/grub/grub.cfg" > "${_TARGET}"/loopback.cfg
# Creating stage file