diff options
author | Raphaël Hertzog <raphael@offensive-security.com> | 2019-12-19 18:18:44 +0100 |
---|---|---|
committer | Raphaël Hertzog <raphael@offensive-security.com> | 2019-12-19 18:18:44 +0100 |
commit | 44b9b0a6501476de594ce3783cea5df0c141478c (patch) | |
tree | dd84f8ea71c77fc5774a736db95f7669e1e58c2b /functions | |
parent | e7221c02f3baae0eaeb804b573551ad883d95290 (diff) | |
download | vyos-live-build-44b9b0a6501476de594ce3783cea5df0c141478c.tar.gz vyos-live-build-44b9b0a6501476de594ce3783cea5df0c141478c.zip |
Support --distribution-binary and --distribution-chroot
This makes it possible to build an image against a first distribution
(--distribution-chroot) and have the resulting image point to another
distribution (--distribution-binary). We can use this to build against a
snapshot and have the result use the original distribution that was
snapshotted.
Closes: #888507
Diffstat (limited to 'functions')
-rwxr-xr-x | functions/defaults.sh | 20 | ||||
-rwxr-xr-x | functions/echo.sh | 2 |
2 files changed, 14 insertions, 8 deletions
diff --git a/functions/defaults.sh b/functions/defaults.sh index 1960d9c0a..a23424f92 100755 --- a/functions/defaults.sh +++ b/functions/defaults.sh @@ -128,18 +128,19 @@ Set_defaults () LB_DERIVATIVE="false" ;; esac + LB_DISTRIBUTION_CHROOT="${LB_DISTRIBUTION_CHROOT:-${LB_DISTRIBUTION}}" + LB_DISTRIBUTION_BINARY="${LB_DISTRIBUTION_BINARY:-${LB_DISTRIBUTION_CHROOT}}" + case "${LB_MODE}" in progress-linux) case "${LB_DISTRIBUTION}" in baureo|baureo-backports) LB_PARENT_DISTRIBUTION="${LB_PARENT_DISTRIBUTION:-wheezy}" - LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION="${LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION:-${LB_PARENT_DISTRIBUTION}}" ;; cairon|cairon-backports) LB_PARENT_DISTRIBUTION="${LB_PARENT_DISTRIBUTION:-sid}" - LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION="${LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION:-${LB_PARENT_DISTRIBUTION}}" ;; esac @@ -147,12 +148,17 @@ Set_defaults () ;; *) - LB_PARENT_DISTRIBUTION="${LB_PARENT_DISTRIBUTION:-${LB_DISTRIBUTION}}" - LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION="${LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION:-${LB_PARENT_DISTRIBUTION}}" - LB_BACKPORTS="${LB_BACKPORTS:-false}" ;; esac + if [ -n "$LB_PARENT_DISTRIBUTION" ]; then + LB_PARENT_DISTRIBUTION_CHROOT="${LB_PARENT_DISTRIBUTION_CHROOT:-${LB_PARENT_DISTRIBUTION}}" + LB_PARENT_DISTRIBUTION_BINARY="${LB_PARENT_DISTRIBUTION_BINARY:-${LB_PARENT_DISTRIBUTION}}" + else + LB_PARENT_DISTRIBUTION_CHROOT="${LB_PARENT_DISTRIBUTION_CHROOT:-${LB_DISTRIBUTION_CHROOT}}" + LB_PARENT_DISTRIBUTION_BINARY="${LB_PARENT_DISTRIBUTION_BINARY:-${LB_DISTRIBUTION_BINARY}}" + fi + LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION="${LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION:-${LB_PARENT_DISTRIBUTION_CHROOT}}" # Setting package manager LB_APT="${LB_APT:-apt}" @@ -487,7 +493,7 @@ Set_defaults () LB_LINUX_PACKAGES="${LB_LINUX_PACKAGES:-linux-image}" # Setting security updates option - case "${LB_PARENT_DISTRIBUTION}" in + case "${LB_PARENT_DISTRIBUTION_BINARY}" in sid) LB_SECURITY="${LB_SECURITY:-false}" ;; @@ -498,7 +504,7 @@ Set_defaults () esac # Setting updates updates option - case "${LB_PARENT_DISTRIBUTION}" in + case "${LB_PARENT_DISTRIBUTION_BINARY}" in sid) LB_UPDATES="${LB_UPDATES:-false}" ;; diff --git a/functions/echo.sh b/functions/echo.sh index 96b742cef..40e76ea6e 100755 --- a/functions/echo.sh +++ b/functions/echo.sh @@ -193,7 +193,7 @@ Echo_file () Echo_breakage () { - case "${LB_PARENT_DISTRIBUTION}" in + case "${LB_PARENT_DISTRIBUTION_BINARY}" in sid) Echo_message "If the following stage fails, the most likely cause of the problem is with your mirror configuration, a caching proxy or the sid distribution." ;; |