summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLyndon Brown <jnqnfe@gmail.com>2020-03-28 03:31:15 +0000
committerLyndon Brown <jnqnfe@gmail.com>2020-04-23 11:52:13 +0100
commit673b8116279d4899eb3eb9a03d3abeed1926072c (patch)
tree0b2618b05a05f18ec2419cc0fc092d7e34870c47
parent9abdf31d9f97d3491532499b2f74177526636ba5 (diff)
downloadvyos-live-build-673b8116279d4899eb3eb9a03d3abeed1926072c.tar.gz
vyos-live-build-673b8116279d4899eb3eb9a03d3abeed1926072c.zip
config: support both comma and space separated to-cache stages
-rwxr-xr-xfunctions/defaults.sh3
-rw-r--r--manpages/en/lb_config.12
2 files changed, 3 insertions, 2 deletions
diff --git a/functions/defaults.sh b/functions/defaults.sh
index 85efca7df..02339aa4e 100755
--- a/functions/defaults.sh
+++ b/functions/defaults.sh
@@ -159,6 +159,7 @@ Set_config_defaults ()
LB_CACHE_PACKAGES="${LB_CACHE_PACKAGES:-true}"
LB_CACHE_STAGES="${LB_CACHE_STAGES:-bootstrap}"
fi
+ LB_CACHE_STAGES="$(echo "${LB_CACHE_STAGES}" | tr "," " ")"
# Setting debconf frontend
LB_DEBCONF_FRONTEND="${LB_DEBCONF_FRONTEND:-noninteractive}"
@@ -596,7 +597,7 @@ Check_config_defaults ()
if [ "${LB_DEBIAN_INSTALLER}" != "none" ]
then
# d-i true, no caching
- if ! echo ${LB_CACHE_STAGES} | grep -qs "bootstrap\b" || [ "${LB_CACHE}" != "true" ] || [ "${LB_CACHE_PACKAGES}" != "true" ]
+ if ! In_list "bootstrap" ${LB_CACHE_STAGES} || [ "${LB_CACHE}" != "true" ] || [ "${LB_CACHE_PACKAGES}" != "true" ]
then
Echo_warning "You have selected values of LB_CACHE, LB_CACHE_PACKAGES, LB_CACHE_STAGES and LB_DEBIAN_INSTALLER which will result in 'bootstrap' packages not being cached. This configuration is potentially unsafe as the bootstrap packages are re-used when integrating the Debian Installer."
fi
diff --git a/manpages/en/lb_config.1 b/manpages/en/lb_config.1
index 204ec8c16..e5946919b 100644
--- a/manpages/en/lb_config.1
+++ b/manpages/en/lb_config.1
@@ -304,7 +304,7 @@ defines if downloaded package indices and lists should be cached. This is false
.IP "\fB\-\-cache\-packages\fR true|false" 4
defines if downloaded packages files should be cached. This is true by default. Disabling it does save space consumption in your build directory, but remember that you will cause much unnecessary traffic if you do a couple of rebuilds. In general you should always leave it true, however, in some particular rare build setups, it can be faster to refetch packages from the network mirror, if using a local one, rather than to utilize the local disk.
.IP "\fB\-\-cache\-stages\fR \fISTAGE\fR|""\fISTAGES\fR""" 4
-sets which stages should be cached (space separated). By default this is set to 'bootstrap'. As an exception to the normal stage names, 'rootfs' can also be used here which means only cache the generated root filesystem in filesystem.{dir,ext*,squashfs}. This is useful during development if you want to rebuild the binary stage but not regenerate the root filesystem all the time.
+sets which stages should be cached (comma or space separated). By default this is set to 'bootstrap'. As an exception to the normal stage names, 'rootfs' can also be used here which means only cache the generated root filesystem in filesystem.{dir,ext*,squashfs}. This is useful during development if you want to rebuild the binary stage but not regenerate the root filesystem all the time.
.IP "\fB\-\-checksums\fR md5|sha1|sha224|sha256|sha384|sha512|none" 4
defines if the binary image should contain a file called XXXsums.txt, where XXX is one of the mentioned checksum types. This file lists all files on the image together with their checksums. This in turn can be used by \fIlive\-boot\fR(7)'s built\-in integrity\-check to verify the medium if specified at boot prompt. In general, this should not be none and is an important feature of live system released to the public. However, during development of very big images it can save some time by not calculating the checksums.
.IP "\fB\-\-chroot\-filesystem\fR ext2|ext3|ext4|squashfs|jffs2|none" 4