summaryrefslogtreecommitdiff
path: root/scripts/build/config
diff options
context:
space:
mode:
authorRaphaël Hertzog <raphael@offensive-security.com>2019-12-19 18:18:44 +0100
committerRaphaël Hertzog <raphael@offensive-security.com>2019-12-19 18:18:44 +0100
commit44b9b0a6501476de594ce3783cea5df0c141478c (patch)
treedd84f8ea71c77fc5774a736db95f7669e1e58c2b /scripts/build/config
parente7221c02f3baae0eaeb804b573551ad883d95290 (diff)
downloadvyos-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 'scripts/build/config')
-rwxr-xr-xscripts/build/config55
1 files changed, 50 insertions, 5 deletions
diff --git a/scripts/build/config b/scripts/build/config
index 2e3e39fd9..661ab6769 100755
--- a/scripts/build/config
+++ b/scripts/build/config
@@ -61,6 +61,8 @@ USAGE="${PROGRAM} [--apt apt|aptitude]\n\
\t [--debootstrap-script SCRIPT]\n\
\t [--debug]\n\
\t [-d|--distribution CODENAME]\n\
+\t [--distribution-binary CODENAME]\n\
+\t [--distribution-chroot CODENAME]\n\
\t [--dump]\n\
\t [--fdisk fdisk|fdisk.dist]\n\
\t [--firmware-binary true|false]\n\
@@ -110,6 +112,8 @@ USAGE="${PROGRAM} [--apt apt|aptitude]\n\
\t [--parent-archive-areas ARCHIVE_AREA|\"ARCHIVE_AREAS\"]\n\
\t [--parent-debian-installer-distribution CODENAME]\n\
\t [--parent-distribution CODENAME]\n\
+\t [--parent-distribution-binary CODENAME]\n\
+\t [--parent-distribution-chroot CODENAME]\n\
\t [--parent-mirror-binary URL]\n\
\t [--parent-mirror-binary-security URL]\n\
\t [-m|--parent-mirror-bootstrap URL]\n\
@@ -138,7 +142,10 @@ Local_arguments ()
cache-stages:,debconf-frontend:,debconf-priority:,dump,
initramfs:,initramfs-compression:,initsystem:,fdisk:,losetup:,mode:,system:,tasksel:,
architectures:,clean,
- distribution:,parent-distribution:,parent-debian-installer-distribution:,parent-mirror-bootstrap:,parent-mirror-chroot:,parent-mirror-chroot-security:,parent-mirror-binary:,
+ distribution:,parent-distribution:,parent-debian-installer-distribution:,
+ distribution-chroot:,parent-distribution-chroot:,
+ distribution-binary:,parent-distribution-binary:,
+ parent-mirror-bootstrap:,parent-mirror-chroot:,parent-mirror-chroot-security:,parent-mirror-binary:,
parent-mirror-binary-security:,parent-mirror-debian-installer:,
mirror-bootstrap:,mirror-chroot:,mirror-chroot-security:,mirror-binary:,
mirror-binary-security:,mirror-debian-installer:,
@@ -358,6 +365,26 @@ Local_arguments ()
shift 2
;;
+ --distribution-chroot)
+ LB_DISTRIBUTION_CHROOT="${2}"
+ shift 2
+ ;;
+
+ --parent-distribution-chroot)
+ LB_PARENT_DISTRIBUTION_CHROOT="${2}"
+ shift 2
+ ;;
+
+ --distribution-binary)
+ LB_DISTRIBUTION_BINARY="${2}"
+ shift 2
+ ;;
+
+ --parent-distribution-binary)
+ LB_PARENT_DISTRIBUTION_BINARY="${2}"
+ shift 2
+ ;;
+
-m|--parent-mirror-bootstrap)
LB_PARENT_MIRROR_BOOTSTRAP="${2}"
shift 2
@@ -900,10 +927,10 @@ Check_defaults
if [ ! -e config ]
then
- Echo_message "Creating config tree for a ${LB_MODE}/${LB_DISTRIBUTION}/${LB_ARCHITECTURES} system"
+ Echo_message "Creating config tree for a ${LB_MODE}/${LB_DISTRIBUTION_BINARY}/${LB_ARCHITECTURES} system"
mkdir config
else
- Echo_message "Updating config tree for a ${LB_MODE}/${LB_DISTRIBUTION}/${LB_ARCHITECTURES} system"
+ Echo_message "Updating config tree for a ${LB_MODE}/${LB_DISTRIBUTION_BINARY}/${LB_ARCHITECTURES} system"
fi
# Creating live-build configuration
@@ -1047,6 +1074,22 @@ LB_DISTRIBUTION="${LB_DISTRIBUTION}"
# (Default: ${LB_PARENT_DISTRIBUTION})
LB_PARENT_DISTRIBUTION="${LB_PARENT_DISTRIBUTION}"
+# \$LB_DISTRIBUTION_CHROOT: select distribution to use in the chroot
+# (Default: ${LB_DISTRIBUTION_CHROOT})
+LB_DISTRIBUTION_CHROOT="${LB_DISTRIBUTION_CHROOT}"
+
+# \$LB_PARENT_DISTRIBUTION_CHROOT: select parent distribution to use in the chroot
+# (Default: ${LB_PARENT_DISTRIBUTION_CHROOT})
+LB_PARENT_DISTRIBUTION_CHROOT="${LB_PARENT_DISTRIBUTION_CHROOT}"
+
+# \$LB_DISTRIBUTION_BINARY: select distribution to use in the final image
+# (Default: ${LB_DISTRIBUTION_BINARY})
+LB_DISTRIBUTION_BINARY="${LB_DISTRIBUTION_BINARY}"
+
+# \$LB_PARENT_DISTRIBUTION_BINARY: select parent distribution to use in the final image
+# (Default: ${LB_PARENT_DISTRIBUTION_BINARY})
+LB_PARENT_DISTRIBUTION_BINARY="${LB_PARENT_DISTRIBUTION_BINARY}"
+
# \$LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION: select parent distribution for debian-installer to use
# (Default: ${LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION})
LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION="${LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION}"
@@ -1433,7 +1476,8 @@ cat > config/build << EOF
[Image]
Architecture: ${LB_ARCHITECTURES}
Archive-Areas: ${LB_ARCHIVE_AREAS}
-Distribution: ${LB_DISTRIBUTION}
+Distribution-Chroot: ${LB_DISTRIBUTION_CHROOT}
+Distribution-Binary: ${LB_DISTRIBUTION_BINARY}
Mirror-Bootstrap: ${LB_MIRROR_BOOTSTRAP}
EOF
@@ -1443,7 +1487,8 @@ then
cat >> config/build << EOF
Parent-Archive-Areas: ${LB_ARCHIVE_AREAS}
-Parent-Distribution: ${LB_PARENT_DISTRIBUTION}
+Parent-Distribution-Chroot: ${LB_PARENT_DISTRIBUTION_CHROOT}
+Parent-Distribution-Binary: ${LB_PARENT_DISTRIBUTION_BINARY}
Parent-Mirror-Bootstrap: ${LB_PARENT_MIRROR_BOOTSTRAP}
EOF