summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2012-12-19 12:21:09 +0100
committerDaniel Baumann <mail@daniel-baumann.ch>2013-05-06 14:50:03 +0200
commit2a9486d108408006959bb77cac37f9eb0612728a (patch)
tree187ea8854beb1e93e3493d603ba24d9cafa15d06 /scripts
parent3cb7d3163af3f3e01bb974a57e71ee68ed1166a9 (diff)
downloadvyos-live-build-2a9486d108408006959bb77cac37f9eb0612728a.tar.gz
vyos-live-build-2a9486d108408006959bb77cac37f9eb0612728a.zip
Using image name from configuration to name binary output files.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build/binary_checksums2
-rwxr-xr-xscripts/build/binary_hdd6
-rwxr-xr-xscripts/build/binary_iso4
-rwxr-xr-xscripts/build/binary_manifest2
-rwxr-xr-xscripts/build/binary_netboot12
-rwxr-xr-xscripts/build/binary_tar17
-rwxr-xr-xscripts/build/binary_zsync10
-rwxr-xr-xscripts/build/clean12
-rwxr-xr-xscripts/build/config10
9 files changed, 40 insertions, 35 deletions
diff --git a/scripts/build/binary_checksums b/scripts/build/binary_checksums
index 244ee1439..af69add68 100755
--- a/scripts/build/binary_checksums
+++ b/scripts/build/binary_checksums
@@ -80,7 +80,7 @@ done
# File list
cd binary
-find . | sed -e 's|^.||g' | grep "^/" | sort > ../binary.contents
+find . | sed -e 's|^.||g' | grep "^/" | sort > ../${LIVE_IMAGE_NAME}.contents
cd "${OLDPWD}"
# Creating stage file
diff --git a/scripts/build/binary_hdd b/scripts/build/binary_hdd
index d4b2775ca..3d429d22a 100755
--- a/scripts/build/binary_hdd
+++ b/scripts/build/binary_hdd
@@ -88,9 +88,9 @@ Restore_cache cache/packages.binary
Install_package
# Remove old binary
-if [ -f binary.img ]
+if [ -f ${LIVE_iMAGE_NAME}.img ]
then
- rm -f binary.img
+ rm -f ${LIVE_iMAGE_NAME}.img
fi
# Enforce fat32 if we find individual files bigger than 2GB
@@ -294,7 +294,7 @@ then
mv chroot/dev.tmp chroot/dev
fi
-mv chroot/binary.img ./
+mv chroot/binary.img ${LIVE_IMAGE_NAME}
# Saving cache
Save_cache cache/packages.binary
diff --git a/scripts/build/binary_iso b/scripts/build/binary_iso
index 15638b288..3a63a574a 100755
--- a/scripts/build/binary_iso
+++ b/scripts/build/binary_iso
@@ -26,11 +26,11 @@ Set_defaults
case "${LIVE_IMAGE_TYPE}" in
iso)
- IMAGE="binary.iso"
+ IMAGE="${LIVE_IMAGE_NAME}.iso"
;;
iso-hybrid)
- IMAGE="binary.hybrid.iso"
+ IMAGE="${LIVE_IMAGE_NAME}.hybrid.iso"
;;
*)
diff --git a/scripts/build/binary_manifest b/scripts/build/binary_manifest
index 420d6b427..c40f2c50d 100755
--- a/scripts/build/binary_manifest
+++ b/scripts/build/binary_manifest
@@ -60,7 +60,7 @@ cp chroot.packages.live "binary/${INITFS}/filesystem.${SUFFIX}"
echo "$(diff chroot.packages.live chroot.packages.install | awk '/^< / { print $2 }')" \
> "binary/${INITFS}/filesystem.${SUFFIX}-remove"
-cp chroot.packages.live binary.packages
+cp chroot.packages.live ${LIVE_IMAGE_NAME}.packages
# Creating stage file
Create_stagefile .build/binary_manifest
diff --git a/scripts/build/binary_netboot b/scripts/build/binary_netboot
index 6b80bee27..a9b8e52e7 100755
--- a/scripts/build/binary_netboot
+++ b/scripts/build/binary_netboot
@@ -119,7 +119,7 @@ then
fi
# Remove old binary
-rm -f binary.netboot.tar binary.netboot.tar.gz binary.netboot.tar.bz2 binary.netboot.tar.xz binary.netboot.tar.xz
+rm -f ${LIVE_IMAGE_NAME}.netboot.tar ${LIVE_IMAGE_NAME}.netboot.tar.gz ${LIVE_IMAGE_NAME}.netboot.tar.bz2 ${LIVE_IMAGE_NAME}.netboot.tar.xz ${LIVE_IMAGE_NAME}.netboot.tar.xz
# Creating image file
ROOT_DIR=$(basename ${LB_NET_ROOT_PATH})
@@ -142,23 +142,23 @@ cd binary.tmp
mkdir tftpboot/live
mv */live/vmlinuz* */live/initrd* tftpboot/live
-tar cf ../binary.netboot.tar *
+tar cf ../${LIVE_IMAGE_NAME}.netboot.tar *
case "${LB_COMPRESSION}" in
bzip2)
- bzip2 ${BZIP2_OPTIONS} ../binary.netboot.tar
+ bzip2 ${BZIP2_OPTIONS} ../${LIVE_IMAGE_NAME}.netboot.tar
;;
gzip)
- gzip ${GZIP_OPTIONS} ../binary.netboot.tar
+ gzip ${GZIP_OPTIONS} ../${LIVE_IMAGE_NAME}.netboot.tar
;;
lzip)
- lzip ${LZIP_OPTIONS} ../binary.netboot.tar
+ lzip ${LZIP_OPTIONS} ../${LIVE_IMAGE_NAME}.netboot.tar
;;
xz)
- xz ${XZ_OPTIONS} ../binary.netboot.tar
+ xz ${XZ_OPTIONS} ../${LIVE_IMAGE_NAME}.netboot.tar
;;
none)
diff --git a/scripts/build/binary_tar b/scripts/build/binary_tar
index 870abec89..e5523012d 100755
--- a/scripts/build/binary_tar
+++ b/scripts/build/binary_tar
@@ -14,7 +14,7 @@ set -e
[ -e "${LIVE_BUILD}/scripts/build.sh" ] && . "${LIVE_BUILD}/scripts/build.sh" || . /usr/lib/live/build.sh
# Setting static variables
-DESCRIPTION="$(Echo 'build harddisk binary image')"
+DESCRIPTION="$(Echo 'build binary tarball')"
HELP=""
USAGE="${PROGRAM} [--force]"
@@ -29,7 +29,7 @@ then
exit 0
fi
-Echo_message "Begin building binary harddisk image..."
+Echo_message "Begin building binary tarball..."
# Requiring stage file
Require_stagefile .build/config .build/bootstrap
@@ -44,25 +44,24 @@ Check_lockfile .lock
Create_lockfile .lock
# Remove old binary
-rm -f binary.tar.bz2 binary.tar.gz binary.tar.lz binary.tar
-
-tar cf binary-tar.tar binary
+rm -f ${LIVE_IMAGE_NAME}.tar.bz2 ${LIVE_IMAGE_NAME}.tar.gz ${LIVE_IMAGE_NAME}.tar.lz ${LIVE_IMAGE_NAME}.tar
+tar cf ${LIVE_IMAGE_NAME}.tar.tar ${LIVE_IMAGE_NAME}.
case "${LB_COMPRESSION}" in
bzip2)
- bzip2 ${BZIP2_OPTIONS} binary-tar.tar
+ bzip2 ${BZIP2_OPTIONS} ${LIVE_IMAGE_NAME}.tar.tar
;;
gzip)
- gzip ${GZIP_OPTIONS} binary-tar.tar
+ gzip ${GZIP_OPTIONS} ${LIVE_IMAGE_NAME}.tar.tar
;;
lzip)
- lzip ${LZIP_OPTIONS} binary-tar.tar
+ lzip ${LZIP_OPTIONS} ${LIVE_IMAGE_NAME}.tar.tar
;;
xz)
- xz ${XZ_OPTIONS} binary-tar.tar
+ xz ${XZ_OPTIONS} ${LIVE_IMAGE_NAME}.tar.tar
;;
none)
diff --git a/scripts/build/binary_zsync b/scripts/build/binary_zsync
index fa761638c..aa5dcd5da 100755
--- a/scripts/build/binary_zsync
+++ b/scripts/build/binary_zsync
@@ -59,23 +59,23 @@ Install_package
case "${LIVE_IMAGE_TYPE}" in
iso)
- _IMAGES="binary.iso"
+ _IMAGES="${LIVE_IMAGE_NAME}.iso"
;;
iso-hybrid)
- _IMAGES="binary.hybrid.iso"
+ _IMAGES="${LIVE_IMAGE_NAME}.hybrid.iso"
;;
hdd)
- _IMAGES="binary.img"
+ _IMAGES="${LIVE_IMAGE_NAME}.img"
;;
net)
- _IMAGES="binary.netboot.tar*"
+ _IMAGES="${LIVE_IMAGE_NAME}.netboot.tar*"
;;
tar)
- _IMAGES="binary.tar*"
+ _IMAGES="${LIVE_IMAGE_NAME}.tar*"
;;
esac
diff --git a/scripts/build/clean b/scripts/build/clean
index 23667c06f..60161beb8 100755
--- a/scripts/build/clean
+++ b/scripts/build/clean
@@ -97,12 +97,12 @@ do
--binary)
${LB_ROOT_COMMAND} umount -f binary.tmp > /dev/null 2>&1 || true
rm -rf binary.tmp binary.deb binary.udeb
- rm -f binary*.iso
- rm -f binary*.img
- rm -f binary*.tar.gz
- rm -f binary*.zsync*
- rm -f binary.sh
- rm -f binary.contents binary.packages md5sum.txt
+ rm -f ${LIVE_IMAGE_NAME}*.iso
+ rm -f ${LIVE_IMAGE_NAME}*.img
+ rm -f ${LIVE_IMAGE_NAME}*.tar.gz
+ rm -f ${LIVE_IMAGE_NAME}*.zsync*
+ rm -f ${LIVE_IMAGE_NAME}.sh
+ rm -f ${LIVE_IMAGE_NAME}.contents ${LIVE_IMAGE_NAME}.packages md5sum.txt
rm -rf binary
rm -rf tftpboot
diff --git a/scripts/build/config b/scripts/build/config
index bb15ff34d..007e1703f 100755
--- a/scripts/build/config
+++ b/scripts/build/config
@@ -66,6 +66,7 @@ USAGE="${PROGRAM} [--apt apt|aptitude]\n\
\t [--initramfs auto|none|live-boot|casper]\n\
\t [--initramfs-compression bzip2|gzip|lzma]\n\
\t [--initsystem sysvinit|runit|systemd|upstart|none]\n\
+\t [--image-name [NAME]\n\
\t [--interactive shell]\n\
\t [--isohybrid-options OPTION|\"OPTIONS\"]\n\
\t [--hdd-label LABEL]\n\
@@ -150,7 +151,7 @@ Local_arguments ()
mirror-bootstrap:,mirror-chroot:,mirror-chroot-security:,mirror-chroot-updates:,mirror-chroot-backports:,mirror-binary:,
mirror-binary-security:,mirror-binary-updates:,mirror-binary-backports:,mirror-debian-installer:,
archives:,archive-areas:,parent-archive-areas:,chroot-filesystem:,exposed-root:,
- gzip-options:,hooks:,interactive:,keyring-packages:,linux-flavours:,linux-packages:,
+ gzip-options:,hooks:,image-name:,interactive:,keyring-packages:,linux-flavours:,linux-packages:,
security:,updates:,backports:,binary-filesystem:,binary-images:,
apt-indices:,bootappend-install:,bootappend-live:,bootappend-live-failsafe:,bootloader:,checksums:,compression:,config:,zsync:,build-with-chroot:,
debian-installer:,debian-installer-distribution:,debian-installer-preseedfile:,debian-installer-gui:,
@@ -520,6 +521,11 @@ Local_arguments ()
shift 2
;;
+ --image-name)
+ LIVE_IMAGE_NAME="${2}"
+ shift 2
+ ;;
+
--interactive)
LB_INTERACTIVE="${2}"
shift 2
@@ -1484,7 +1490,7 @@ fi
# New style configuration
Set_configuration "config/control" "Configuration-Version" "${LIVE_CONFIGURATION_VERSION}"
echo "" >> config/control
-Set_configuration "config/control" "Image" "binary"
+Set_configuration "config/control" "Name" "${LIVE_IMAGE_NAME}"
Set_configuration "config/control" "Architecture" "${LIVE_IMAGE_ARCHITECTURE}"
Set_configuration "config/control" "Type" "${LIVE_IMAGE_TYPE}"