Using image name from configuration to name binary output files.

This commit is contained in:
Daniel Baumann 2012-12-19 12:21:09 +01:00
parent 7bc281edde
commit 9a28d557e6
10 changed files with 43 additions and 37 deletions

View File

@ -41,8 +41,9 @@ New_configuration ()
export LIVE_CONFIGURATION_VERSION
# Image
#LIVE_IMAGE="$(Get_configuration config/control Image)"
#LIVE_IMAGE="${LIVE_IMAGE:-binary}"
LIVE_IMAGE_NAME="$(Get_configuration config/control Name)"
LIVE_IMAGE_NAME="${LIVE_IMAGE_NAME:-live}"
export LIVE_IMAGE_NAME
# Image: Architecture (FIXME: Support and default to 'any')
LIVE_IMAGE_ARCHITECTURE="$(Get_configuration config/control Architecture)"

View File

@ -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

View File

@ -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

View File

@ -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"
;;
*)

View File

@ -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

View File

@ -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)

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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}"