diff options
author | Daniel Baumann <daniel@debian.org> | 2011-08-24 20:34:01 +0200 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2011-08-24 22:46:32 +0200 |
commit | 3ceb68b7d4eb5b28269c0780a808c3725c5f5668 (patch) | |
tree | ffcf3feed5e674de5a814b5e5269cd20c0042bfc /scripts/build | |
parent | 9d73420afc451a6367bec6873c74c649d08b9c01 (diff) | |
download | vyos-live-build-3ceb68b7d4eb5b28269c0780a808c3725c5f5668.tar.gz vyos-live-build-3ceb68b7d4eb5b28269c0780a808c3725c5f5668.zip |
Introducing --apt-sources option to control if the live system should have deb-src entries in sources.list.
Diffstat (limited to 'scripts/build')
-rwxr-xr-x | scripts/build/lb_binary | 2 | ||||
-rwxr-xr-x | scripts/build/lb_binary_rootfs | 12 | ||||
-rwxr-xr-x | scripts/build/lb_chroot | 4 | ||||
-rwxr-xr-x | scripts/build/lb_chroot_archives | 43 | ||||
-rwxr-xr-x | scripts/build/lb_config | 12 | ||||
-rwxr-xr-x | scripts/build/lb_source | 4 |
6 files changed, 45 insertions, 32 deletions
diff --git a/scripts/build/lb_binary b/scripts/build/lb_binary index 7cad80987..0aaf26631 100755 --- a/scripts/build/lb_binary +++ b/scripts/build/lb_binary @@ -50,7 +50,7 @@ then lb chroot_sysv-rc install ${*} lb chroot_upstart install ${*} lb chroot_apt install-binary ${*} - lb chroot_archives install ${*} + lb chroot_archives chroot install ${*} fi # Building root filesystem diff --git a/scripts/build/lb_binary_rootfs b/scripts/build/lb_binary_rootfs index 6f5ed21a9..6ee9d1590 100755 --- a/scripts/build/lb_binary_rootfs +++ b/scripts/build/lb_binary_rootfs @@ -145,7 +145,7 @@ case "${LB_CHROOT_FILESYSTEM}" in rm -f .lock mv chroot/chroot chroot.tmp - lb chroot_archives remove ${*} + lb chroot_archives binary remove ${*} lb chroot_apt remove ${*} lb chroot_hostname remove ${*} lb chroot_resolv remove ${*} @@ -174,7 +174,7 @@ case "${LB_CHROOT_FILESYSTEM}" in lb chroot_resolv install ${*} lb chroot_hostname install ${*} lb chroot_apt install ${*} - lb chroot_archives install ${*} + lb chroot_archives binary remove ${*} touch .lock else @@ -235,7 +235,7 @@ case "${LB_CHROOT_FILESYSTEM}" in rm -f .lock mv chroot/chroot chroot.tmp - lb chroot_archives remove ${*} + lb chroot_archives binary remove ${*} lb chroot_apt remove ${*} lb chroot_hostname remove ${*} lb chroot_resolv remove ${*} @@ -264,7 +264,7 @@ case "${LB_CHROOT_FILESYSTEM}" in lb chroot_resolv install ${*} lb chroot_hostname install ${*} lb chroot_apt install ${*} - lb chroot_archives install ${*} + lb chroot_archives binary remove ${*} touch .lock else @@ -380,7 +380,7 @@ case "${LB_CHROOT_FILESYSTEM}" in rm -f .lock mv chroot/chroot chroot.tmp - lb chroot_archives remove ${*} + lb chroot_archives binary remove ${*} lb chroot_apt remove ${*} lb chroot_hostname remove ${*} lb chroot_resolv remove ${*} @@ -409,7 +409,7 @@ case "${LB_CHROOT_FILESYSTEM}" in lb chroot_resolv install ${*} lb chroot_hostname install ${*} lb chroot_apt install ${*} - lb chroot_archives install ${*} + lb chroot_archives binary remove ${*} touch .lock else diff --git a/scripts/build/lb_chroot b/scripts/build/lb_chroot index 3ccbbfe91..7aacdfd07 100755 --- a/scripts/build/lb_chroot +++ b/scripts/build/lb_chroot @@ -49,7 +49,7 @@ lb chroot_hosts install ${*} lb chroot_resolv install ${*} lb chroot_hostname install ${*} lb chroot_apt install ${*} -lb chroot_archives install ${*} +lb chroot_archives chroot install ${*} # Customizing chroot lb chroot_linux-image ${*} @@ -78,7 +78,7 @@ lb chroot_interactive ${*} Chroot chroot "dpkg-query -W" > binary.packages.live # Deconfiguring chroot -lb chroot_archives remove ${*} +lb chroot_archives chroot remove ${*} lb chroot_apt remove ${*} lb chroot_hostname remove ${*} lb chroot_resolv remove ${*} diff --git a/scripts/build/lb_chroot_archives b/scripts/build/lb_chroot_archives index f91d3f32d..59f0d9d54 100755 --- a/scripts/build/lb_chroot_archives +++ b/scripts/build/lb_chroot_archives @@ -18,6 +18,9 @@ DESCRIPTION="$(Echo 'manage /etc/apt/sources.list')" HELP="" USAGE="${PROGRAM} {install|remove} [--force]" +_PASS="${1}" +shift + Arguments "${@}" # Reading configuration files @@ -53,7 +56,7 @@ cat > chroot/etc/apt/sources.list << EOF deb ${LB_PARENT_MIRROR_CHROOT} ${LB_PARENT_DISTRIBUTION} ${LB_PARENT_ARCHIVE_AREAS} EOF - if [ "${LB_SOURCE}" = "true" ] + if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE}" = "true" ] then echo "deb-src ${LB_PARENT_MIRROR_CHROOT} ${LB_PARENT_DISTRIBUTION} ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list fi @@ -81,7 +84,7 @@ EOF echo "deb ${LB_MIRROR_CHROOT} ${_DISTRIBUTION} ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list - if [ "${LB_SOURCE}" = "true" ] + if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE}" = "true" ] then echo "deb-src ${LB_MIRROR_CHROOT} ${_DISTRIBUTION} ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list fi @@ -100,7 +103,7 @@ EOF *) echo "deb ${LB_PARENT_MIRROR_CHROOT_SECURITY} ${LB_PARENT_DISTRIBUTION}/updates ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list - if [ "${LB_SOURCE}" = "true" ] + if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE}" = "true" ] then echo "deb-src ${LB_PARENT_MIRROR_CHROOT_SECURITY} ${LB_PARENT_DISTRIBUTION}/updates ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list fi @@ -117,7 +120,7 @@ EOF *) echo "deb ${LB_MIRROR_CHROOT_SECURITY} ${LB_DISTRIBUTION}-security ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list - if [ "${LB_SOURCE}" = "true" ] + if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE}" = "true" ] then echo "deb-src ${LB_MIRROR_CHROOT_SECURITY} ${LB_DISTRIBUTION}-security ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list fi @@ -128,7 +131,7 @@ EOF then echo "deb ${LB_MIRROR_CHROOT_SECURITY} ${LB_DISTRIBUTION}/updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list - if [ "${LB_SOURCE}" = "true" ] + if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE}" = "true" ] then echo "deb-src ${LB_MIRROR_CHROOT_SECURITY} ${LB_DISTRIBUTION}/updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list fi @@ -139,7 +142,7 @@ EOF ubuntu|kubuntu) echo "deb ${LB_PARENT_MIRROR_CHROOT_SECURITY} ${LB_PARENT_DISTRIBUTION}-security ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list - if [ "${LB_SOURCE}" = "true" ] + if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE}" = "true" ] then echo "deb-src ${LB_PARENT_MIRROR_CHROOT_SECURITY} ${LB_PARENT_DISTRIBUTION}-security ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list fi @@ -153,7 +156,7 @@ EOF debian|ubuntu|kubuntu) echo "deb ${LB_PARENT_MIRROR_CHROOT_VOLATILE} ${LB_PARENT_DISTRIBUTION}-updates ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list - if [ "${LB_SOURCE}" = "true" ] + if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE}" = "true" ] then echo "deb-src ${LB_PARENT_MIRROR_CHROOT_VOLATILE} ${LB_PARENT_DISTRIBUTION}-updates ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list fi @@ -164,7 +167,7 @@ EOF then echo "deb ${LB_MIRROR_CHROOT_VOLATILE} ${LB_DISTRIBUTION}-updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list - if [ "${LB_SOURCE}" = "true" ] + if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE}" = "true" ] then echo "deb-src ${LB_MIRROR_CHROOT_VOLATILE} ${LB_DISTRIBUTION}-updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list fi @@ -179,7 +182,7 @@ EOF then echo "deb ${LB_PARENT_MIRROR_CHROOT_BACKPORTS} ${LB_PARENT_DISTRIBUTION}-backports ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list - if [ "${LB_SOURCE}" = "true" ] + if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE}" = "true" ] then echo "deb-src ${LB_PARENT_MIRROR_CHROOT_BACKPORTS} ${LB_PARENT_DISTRIBUTION}-backports ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list fi @@ -191,7 +194,7 @@ EOF then echo "deb ${LB_MIRROR_CHROOT_BACKPORTS} ${LB_DISTRIBUTION}-backports ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list - if [ "${LB_SOURCE}" = "true" ] + if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE}" = "true" ] then echo "deb-src ${LB_MIRROR_CHROOT_BACKPORTS} ${LB_DISTRIBUTION}-backports ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list fi @@ -601,7 +604,7 @@ cat > chroot/etc/apt/sources.list << EOF deb ${LB_PARENT_MIRROR_BINARY} ${LB_PARENT_DISTRIBUTION} ${LB_PARENT_ARCHIVE_AREAS} EOF - if [ "${LB_SOURCE}" = "true" ] + if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE}" = "true" ] then echo "deb-src ${LB_PARENT_MIRROR_BINARY} ${LB_PARENT_DISTRIBUTION} ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list fi @@ -629,7 +632,7 @@ EOF echo "deb ${LB_MIRROR_BINARY} ${_DISTRIBUTION} ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list - if [ "${LB_SOURCE}" = "true" ] + if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE}" = "true" ] then echo "deb-src ${LB_MIRROR_BINARY} ${_DISTRIBUTION} ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list fi @@ -648,7 +651,7 @@ EOF *) echo "deb ${LB_PARENT_MIRROR_BINARY_SECURITY} ${LB_PARENT_DISTRIBUTION}/updates ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list - if [ "${LB_SOURCE}" = "true" ] + if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE}" = "true" ] then echo "deb-src ${LB_PARENT_MIRROR_BINARY_SECURITY} ${LB_PARENT_DISTRIBUTION}/updates ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list fi @@ -665,7 +668,7 @@ EOF *) echo "deb ${LB_MIRROR_BINARY_SECURITY} ${LB_DISTRIBUTION}-security ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list - if [ "${LB_SOURCE}" = "true" ] + if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE}" = "true" ] then echo "deb-src ${LB_MIRROR_BINARY_SECURITY} ${LB_DISTRIBUTION}-security ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list fi @@ -676,7 +679,7 @@ EOF then echo "deb ${LB_MIRROR_BINARY_SECURITY} ${LB_DISTRIBUTION}/updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list - if [ "${LB_SOURCE}" = "true" ] + if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE}" = "true" ] then echo "deb-src ${LB_MIRROR_BINARY_SECURITY} ${LB_DISTRIBUTION}/updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list fi @@ -687,7 +690,7 @@ EOF ubuntu|kubuntu) echo "deb ${LB_PARENT_MIRROR_BINARY_SECURITY} ${LB_PARENT_DISTRIBUTION}-security ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list - if [ "${LB_SOURCE}" = "true" ] + if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE}" = "true" ] then echo "deb-src ${LB_PARENT_MIRROR_BINARY_SECURITY} ${LB_PARENT_DISTRIBUTION}-security ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list fi @@ -701,7 +704,7 @@ EOF debian|ubuntu|kubuntu) echo "deb ${LB_PARENT_MIRROR_BINARY_VOLATILE} ${LB_PARENT_DISTRIBUTION}-updates ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list - if [ "${LB_SOURCE}" = "true" ] + if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE}" = "true" ] then echo "deb-src ${LB_PARENT_MIRROR_BINARY_VOLATILE} ${LB_PARENT_DISTRIBUTION}-updates ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list fi @@ -712,7 +715,7 @@ EOF then echo "deb ${LB_MIRROR_BINARY_VOLATILE} ${LB_DISTRIBUTION}-updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list - if [ "${LB_SOURCE}" = "true" ] + if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE}" = "true" ] then echo "deb-src ${LB_MIRROR_BINARY_VOLATILE} ${LB_DISTRIBUTION}-updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list fi @@ -727,7 +730,7 @@ EOF then echo "deb ${LB_PARENT_MIRROR_BINARY_BACKPORTS} ${LB_PARENT_DISTRIBUTION}-backports ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list - if [ "${LB_SOURCE}" = "true" ] + if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE}" = "true" ] then echo "deb-src ${LB_PARENT_MIRROR_BINARY_BACKPORTS} ${LB_PARENT_DISTRIBUTION}-backports ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list fi @@ -739,7 +742,7 @@ EOF then echo "deb ${LB_MIRROR_BINARY_BACKPORTS} ${LB_DISTRIBUTION}-backports ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list - if [ "${LB_SOURCE}" = "true" ] + if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE}" = "true" ] then echo "deb-src ${LB_MIRROR_BINARY_BACKPORTS} ${LB_DISTRIBUTION}-backports ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list fi diff --git a/scripts/build/lb_config b/scripts/build/lb_config index a3051b5e9..b4d66a1f7 100755 --- a/scripts/build/lb_config +++ b/scripts/build/lb_config @@ -38,6 +38,7 @@ USAGE="${PROGRAM} [--apt apt|aptitude]\n\ \t [--apt-pipeline DEPTH]\n\ \t [--apt-recommends true|false]\n\ \t [--apt-secure true|false]\n\ +\t [--apt-source true|false]\n\ \t [-a|--architectures ARCHITECTURE]\n\ \t [-b|--binary-images iso|iso-hybrid|net|tar|usb-hdd]\n\ \t [--binary-filesystem fat16|fat32|ext2]\n\ @@ -149,7 +150,7 @@ USAGE="${PROGRAM} [--apt apt|aptitude]\n\ Local_arguments () { LONG_OPTIONS="apt:,apt-ftp-proxy:,apt-http-proxy:,apt-options:,aptitute-options:, - apt-pipeline:,apt-recommends:,apt-secure:,bootstrap:,cache:,cache-indices:,cache-packages:, + apt-pipeline:,apt-recommends:,apt-secure:,apt-source:,bootstrap:,cache:,cache-indices:,cache-packages:, cache-stages:,debconf-frontend:,debconf-nowarnings:,debconf-priority:,dump, initramfs:,initramfs-compression:,initsystem:,fdisk:,losetup:,mode:,root-command:,use-fakeroot:,tasksel:,includes:, templates:,architectures:,bootstrap-flavour:,bootstrap-keyring:,clean, @@ -270,6 +271,11 @@ Local_arguments () shift 2 ;; + --apt-source) + LB_APT_SOURCE="${2}" + shift 2 + ;; + --bootstrap) LB_BOOTSTRAP="${2}" shift 2 @@ -909,6 +915,10 @@ LB_APT_RECOMMENDS="${LB_APT_RECOMMENDS}" # (Default: ${LB_APT_SECURE}) LB_APT_SECURE="${LB_APT_SECURE}" +# \$LB_APT_SOURCE: set apt/aptitude source entries in sources.list +# (Default: ${LB_APT_SOURCE}) +LB_APT_SOURCE="${LB_APT_SOURCE}" + # \$LB_BOOTSTRAP: set bootstrap program # (Default: ${LB_BOOTSTRAP}) LB_BOOTSTRAP="${LB_BOOTSTRAP}" diff --git a/scripts/build/lb_source b/scripts/build/lb_source index 627d046d7..61a3de2f5 100755 --- a/scripts/build/lb_source +++ b/scripts/build/lb_source @@ -40,7 +40,7 @@ Setup_cleanup lb chroot_hosts install ${*} lb chroot_resolv install ${*} lb chroot_hostname install ${*} -lb chroot_archives install ${*} +lb chroot_archives source install ${*} # Preparing images lb source_debian-live ${*} @@ -56,7 +56,7 @@ lb source_usb ${*} lb source_virtual-hdd ${*} # Deconfiguring chroot -rm -f .stage/chroot_archives +lb chroot_archives chroot remove ${*} lb chroot_hostname remove ${*} lb chroot_resolv remove ${*} lb chroot_hosts remove ${*} |