config: s/LIVE_IMAGE_NAME/LB_IMAGE_NAME/

no backwards compatibility hack for reading the old var from existing
saved config used because this was previously stored in the alternate
format config/build file.

Gbp-Dch: Short
This commit is contained in:
Lyndon Brown 2020-04-06 18:43:41 +01:00 committed by Raphaël Hertzog
parent 41738b1932
commit 83d9145257
15 changed files with 67 additions and 66 deletions

View File

@ -59,7 +59,8 @@ Prepare_config ()
LB_DISTRIBUTION_CHROOT="${LB_DISTRIBUTION_CHROOT:-${LB_DISTRIBUTION}}"
LB_DISTRIBUTION_BINARY="${LB_DISTRIBUTION_BINARY:-${LB_DISTRIBUTION_CHROOT}}"
LIVE_IMAGE_NAME="${LIVE_IMAGE_NAME:-live-image}"
LB_IMAGE_NAME="${LB_IMAGE_NAME:-live-image}"
LIVE_IMAGE_NAME="${LB_IMAGE_NAME}" #for backwards compatibility with hooks
LIVE_IMAGE_TYPE="${LIVE_IMAGE_TYPE:-iso-hybrid}"
if [ -z "${LB_ARCHITECTURE}" ]; then

View File

@ -75,7 +75,7 @@ done
# File list
cd binary
find . | sed -e 's|^.||g' | grep "^/" | sort > ../${LIVE_IMAGE_NAME}-${LB_ARCHITECTURE}.contents
find . | sed -e 's|^.||g' | grep "^/" | sort > ../${LB_IMAGE_NAME}-${LB_ARCHITECTURE}.contents
cd "${OLDPWD}"
# Creating stage file

View File

@ -85,9 +85,9 @@ Restore_package_cache binary
Install_package
# Remove old binary
if [ -f ${LIVE_IMAGE_NAME}.img ]
if [ -f ${LB_IMAGE_NAME}.img ]
then
rm -f ${LIVE_IMAGE_NAME}.img
rm -f ${LB_IMAGE_NAME}.img
fi
case "${LB_BINARY_FILESYSTEM}" in
@ -344,7 +344,7 @@ if $MAKEDEV; then
mv chroot/dev.tmp chroot/dev
fi
mv chroot/binary.img ${LIVE_IMAGE_NAME}-${LB_ARCHITECTURE}.img
mv chroot/binary.img ${LB_IMAGE_NAME}-${LB_ARCHITECTURE}.img
# Saving cache
Save_package_cache binary

View File

@ -23,11 +23,11 @@ Init_config_data "${@}"
case "${LIVE_IMAGE_TYPE}" in
iso)
IMAGE="${LIVE_IMAGE_NAME}-${LB_ARCHITECTURE}.iso"
IMAGE="${LB_IMAGE_NAME}-${LB_ARCHITECTURE}.iso"
;;
iso-hybrid)
IMAGE="${LIVE_IMAGE_NAME}-${LB_ARCHITECTURE}.hybrid.iso"
IMAGE="${LB_IMAGE_NAME}-${LB_ARCHITECTURE}.hybrid.iso"
;;
*)

View File

@ -54,9 +54,9 @@ 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 ${LIVE_IMAGE_NAME}-${LB_ARCHITECTURE}.packages
cp chroot.packages.live ${LB_IMAGE_NAME}-${LB_ARCHITECTURE}.packages
cp chroot.files ${LIVE_IMAGE_NAME}-${LB_ARCHITECTURE}.files
cp chroot.files ${LB_IMAGE_NAME}-${LB_ARCHITECTURE}.files
# Creating stage file
Create_stagefile

View File

@ -42,7 +42,7 @@ Check_stagefile
Acquire_lockfile
# Remove old binary
rm -f ${LIVE_IMAGE_NAME}-${LB_ARCHITECTURE}.netboot.tar ${LIVE_IMAGE_NAME}-${LB_ARCHITECTURE}.netboot.tar.gz ${LIVE_IMAGE_NAME}-${LB_ARCHITECTURE}.netboot.tar.bz2 ${LIVE_IMAGE_NAME}-${LB_ARCHITECTURE}.netboot.tar.xz ${LIVE_IMAGE_NAME}-${LB_ARCHITECTURE}.netboot.tar.xz
rm -f ${LB_IMAGE_NAME}-${LB_ARCHITECTURE}.netboot.tar ${LB_IMAGE_NAME}-${LB_ARCHITECTURE}.netboot.tar.gz ${LB_IMAGE_NAME}-${LB_ARCHITECTURE}.netboot.tar.bz2 ${LB_IMAGE_NAME}-${LB_ARCHITECTURE}.netboot.tar.xz ${LB_IMAGE_NAME}-${LB_ARCHITECTURE}.netboot.tar.xz
# Creating image file
ROOT_DIR=${LB_MODE}-live
@ -57,23 +57,23 @@ cd binary.tmp
mkdir tftpboot/live
mv */live/vmlinuz* */live/initrd* tftpboot/live
tar cf ../${LIVE_IMAGE_NAME}-${LB_ARCHITECTURE}.netboot.tar *
tar cf ../${LB_IMAGE_NAME}-${LB_ARCHITECTURE}.netboot.tar *
case "${LB_COMPRESSION}" in
bzip2)
bzip2 ${BZIP2_OPTIONS} ../${LIVE_IMAGE_NAME}-${LB_ARCHITECTURE}.netboot.tar
bzip2 ${BZIP2_OPTIONS} ../${LB_IMAGE_NAME}-${LB_ARCHITECTURE}.netboot.tar
;;
gzip)
gzip ${GZIP_OPTIONS} ../${LIVE_IMAGE_NAME}-${LB_ARCHITECTURE}.netboot.tar
gzip ${GZIP_OPTIONS} ../${LB_IMAGE_NAME}-${LB_ARCHITECTURE}.netboot.tar
;;
lzip)
lzip ${LZIP_OPTIONS} ../${LIVE_IMAGE_NAME}-${LB_ARCHITECTURE}.netboot.tar
lzip ${LZIP_OPTIONS} ../${LB_IMAGE_NAME}-${LB_ARCHITECTURE}.netboot.tar
;;
xz)
xz ${XZ_OPTIONS} ../${LIVE_IMAGE_NAME}-${LB_ARCHITECTURE}.netboot.tar
xz ${XZ_OPTIONS} ../${LB_IMAGE_NAME}-${LB_ARCHITECTURE}.netboot.tar
;;
none)

View File

@ -29,10 +29,10 @@ fi
case "${LIVE_IMAGE_TYPE}" in
iso)
IMAGE="${LIVE_IMAGE_NAME}-${LB_ARCHITECTURE}.iso"
IMAGE="${LB_IMAGE_NAME}-${LB_ARCHITECTURE}.iso"
;;
iso-hybrid)
IMAGE="${LIVE_IMAGE_NAME}-${LB_ARCHITECTURE}.hybrid.iso"
IMAGE="${LB_IMAGE_NAME}-${LB_ARCHITECTURE}.hybrid.iso"
;;
*)
exit 0

View File

@ -37,25 +37,25 @@ Check_stagefile
Acquire_lockfile
# Remove old binary
rm -f ${LIVE_IMAGE_NAME}-${LB_ARCHITECTURE}.tar.bz2 ${LIVE_IMAGE_NAME}-${LB_ARCHITECTURE}.tar.gz ${LIVE_IMAGE_NAME}-${LB_ARCHITECTURE}.tar.lz ${LIVE_IMAGE_NAME}-${LB_ARCHITECTURE}.tar
rm -f ${LB_IMAGE_NAME}-${LB_ARCHITECTURE}.tar.bz2 ${LB_IMAGE_NAME}-${LB_ARCHITECTURE}.tar.gz ${LB_IMAGE_NAME}-${LB_ARCHITECTURE}.tar.lz ${LB_IMAGE_NAME}-${LB_ARCHITECTURE}.tar
tar cf ${LIVE_IMAGE_NAME}-${LB_ARCHITECTURE}.tar.tar binary
tar cf ${LB_IMAGE_NAME}-${LB_ARCHITECTURE}.tar.tar binary
case "${LB_COMPRESSION}" in
bzip2)
bzip2 ${BZIP2_OPTIONS} ${LIVE_IMAGE_NAME}-${LB_ARCHITECTURE}.tar.tar
bzip2 ${BZIP2_OPTIONS} ${LB_IMAGE_NAME}-${LB_ARCHITECTURE}.tar.tar
;;
gzip)
gzip ${GZIP_OPTIONS} ${LIVE_IMAGE_NAME}-${LB_ARCHITECTURE}.tar.tar
gzip ${GZIP_OPTIONS} ${LB_IMAGE_NAME}-${LB_ARCHITECTURE}.tar.tar
;;
lzip)
lzip ${LZIP_OPTIONS} ${LIVE_IMAGE_NAME}-${LB_ARCHITECTURE}.tar.tar
lzip ${LZIP_OPTIONS} ${LB_IMAGE_NAME}-${LB_ARCHITECTURE}.tar.tar
;;
xz)
xz ${XZ_OPTIONS} ${LIVE_IMAGE_NAME}-${LB_ARCHITECTURE}.tar.tar
xz ${XZ_OPTIONS} ${LB_IMAGE_NAME}-${LB_ARCHITECTURE}.tar.tar
;;
none)

View File

@ -53,23 +53,23 @@ Install_package
case "${LIVE_IMAGE_TYPE}" in
iso)
_IMAGES="${LIVE_IMAGE_NAME}-${LB_ARCHITECTURE}.iso"
_IMAGES="${LB_IMAGE_NAME}-${LB_ARCHITECTURE}.iso"
;;
iso-hybrid)
_IMAGES="${LIVE_IMAGE_NAME}-${LB_ARCHITECTURE}.hybrid.iso"
_IMAGES="${LB_IMAGE_NAME}-${LB_ARCHITECTURE}.hybrid.iso"
;;
hdd)
_IMAGES="${LIVE_IMAGE_NAME}-${LB_ARCHITECTURE}.img"
_IMAGES="${LB_IMAGE_NAME}-${LB_ARCHITECTURE}.img"
;;
netboot)
_IMAGES="${LIVE_IMAGE_NAME}-${LB_ARCHITECTURE}.netboot.tar*"
_IMAGES="${LB_IMAGE_NAME}-${LB_ARCHITECTURE}.netboot.tar*"
;;
tar)
_IMAGES="${LIVE_IMAGE_NAME}-${LB_ARCHITECTURE}.tar*"
_IMAGES="${LB_IMAGE_NAME}-${LB_ARCHITECTURE}.tar*"
;;
esac

View File

@ -91,13 +91,13 @@ do
--binary)
umount -f binary.tmp > /dev/null 2>&1 || true
rm -rf binary.tmp binary.deb binary.udeb
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 ${LIVE_IMAGE_NAME}*.files
rm -f ${LIVE_IMAGE_NAME}*.iso-ONIE.bin
rm -f ${LB_IMAGE_NAME}*.iso
rm -f ${LB_IMAGE_NAME}*.img
rm -f ${LB_IMAGE_NAME}*.tar.gz
rm -f ${LB_IMAGE_NAME}*.zsync*
rm -f ${LB_IMAGE_NAME}.sh
rm -f ${LB_IMAGE_NAME}*.contents ${LB_IMAGE_NAME}*.packages ${LB_IMAGE_NAME}*.files
rm -f ${LB_IMAGE_NAME}*.iso-ONIE.bin
rm -f MD5SUMS SHA1SUMS SHA256SUMS SHA512SUMS
rm -f md5sum.txt sha1sum.txt sha256sum.txt sha512sum.txt
@ -127,12 +127,12 @@ do
;;
--source)
rm -f ${LIVE_IMAGE_NAME}-source*.iso
rm -f ${LIVE_IMAGE_NAME}-source*.img
rm -f ${LIVE_IMAGE_NAME}-source*.tar
rm -f ${LIVE_IMAGE_NAME}-source*.tar.gz
rm -f ${LIVE_IMAGE_NAME}-source*.list
rm -f ${LIVE_IMAGE_NAME}-source-selection.txt
rm -f ${LB_IMAGE_NAME}-source*.iso
rm -f ${LB_IMAGE_NAME}-source*.img
rm -f ${LB_IMAGE_NAME}-source*.tar
rm -f ${LB_IMAGE_NAME}-source*.tar.gz
rm -f ${LB_IMAGE_NAME}-source*.list
rm -f ${LB_IMAGE_NAME}-source-selection.txt
rm -rf source

View File

@ -553,7 +553,7 @@ Local_arguments ()
;;
--image-name)
LIVE_IMAGE_NAME="${2}"
LB_IMAGE_NAME="${2}"
shift 2
;;
@ -1030,8 +1030,8 @@ LB_MODE="${LB_MODE}"
# \$LB_SYSTEM: set system type
LB_SYSTEM="${LB_SYSTEM}"
# \$LIVE_IMAGE_NAME: set base name of the image
LIVE_IMAGE_NAME="${LIVE_IMAGE_NAME}"
# \$LB_IMAGE_NAME: set base name of the image
LB_IMAGE_NAME="${LB_IMAGE_NAME}"
# \$APT_OPTIONS: set options to use with apt
APT_OPTIONS="${APT_OPTIONS}"

View File

@ -79,7 +79,7 @@ EOF
# File list
cd ${DIRECTORY}
find . | sed -e 's|^.||g' | grep "^/" | sort > ../../${LIVE_IMAGE_NAME}-source.$(basename ${DIRECTORY}).contents
find . | sed -e 's|^.||g' | grep "^/" | sort > ../../${LB_IMAGE_NAME}-source.$(basename ${DIRECTORY}).contents
cd "${OLDPWD}"
done

View File

@ -51,15 +51,15 @@ Check_package host /sbin/losetup mount
Install_package
# Remove old source
if [ -f ${LIVE_IMAGE_NAME}-source.img ]
if [ -f ${LB_IMAGE_NAME}-source.img ]
then
rm -f ${LIVE_IMAGE_NAME}-source.img
rm -f ${LB_IMAGE_NAME}-source.img
fi
# Everything which comes here needs to be cleaned up,
DU_DIM="$(du -ms source | cut -f1)"
REAL_DIM="$(Calculate_partition_size ${DU_DIM} ${LB_BINARY_FILESYSTEM})"
dd if=/dev/zero of=${LIVE_IMAGE_NAME}-source.img bs=1024k count=0 seek=${REAL_DIM}
dd if=/dev/zero of=${LB_IMAGE_NAME}-source.img bs=1024k count=0 seek=${REAL_DIM}
MAKEDEV=false
FREELO="$(losetup -f)"
if [ ! -b chroot/${FREELO} ]
@ -90,12 +90,12 @@ case "${LB_BINARY_FILESYSTEM}" in
esac
Echo_warning "!!! The following error/warning messages can be ignored !!!"
Losetup $FREELO ${LIVE_IMAGE_NAME}-source.img 0
Losetup $FREELO ${LB_IMAGE_NAME}-source.img 0
Chroot chroot "parted -s ${FREELO} mklabel msdos" || true
Chroot chroot "parted -a optimal -s ${FREELO} mkpart primary ${PARTITION_TYPE} 0.0 100%" || true
Lodetach ${FREELO}
Losetup $FREELO ${LIVE_IMAGE_NAME}-source.img 1
Losetup $FREELO ${LB_IMAGE_NAME}-source.img 1
case "${LB_BINARY_FILESYSTEM}" in
ext2|ext3|ext4)
@ -134,7 +134,7 @@ Lodetach ${FREELO}
Echo_warning "!!! The above error/warning messages can be ignored !!!"
FREELO="$(losetup -f)"
Losetup "$FREELO" ${LIVE_IMAGE_NAME}-source.img 0
Losetup "$FREELO" ${LB_IMAGE_NAME}-source.img 0
Chroot chroot "parted -s ${FREELO} set 1 lba off" || true
Lodetach ${FREELO}

View File

@ -53,9 +53,9 @@ Check_package chroot /usr/bin/xorriso xorriso
Install_package
# Remove old iso image
if [ -f ${LIVE_IMAGE_NAME}-source.iso ]
if [ -f ${LB_IMAGE_NAME}-source.iso ]
then
rm -f ${LIVE_IMAGE_NAME}-source.iso
rm -f ${LB_IMAGE_NAME}-source.iso
fi
# Handle xorriso generic options
@ -107,7 +107,7 @@ Chroot chroot "sh source.sh"
# Move image
mv chroot/source ./
mv chroot/source.iso ${LIVE_IMAGE_NAME}-source.iso
mv chroot/source.iso ${LB_IMAGE_NAME}-source.iso
rm -f chroot/source.sh
# Removing depends

View File

@ -43,31 +43,31 @@ Check_stagefile
Acquire_lockfile
# Remove old source
rm -f ${LIVE_IMAGE_NAME}-source.debian.tar.bz2 ${LIVE_IMAGE_NAME}-source.debian.tar.gz ${LIVE_IMAGE_NAME}-source.debian.tar.lz ${LIVE_IMAGE_NAME}-source.debian.tar
rm -f ${LIVE_IMAGE_NAME}-source.live.tar.bz2 ${LIVE_IMAGE_NAME}-source.live.tar.gz ${LIVE_IMAGE_NAME}-source.live.tar.lz ${LIVE_IMAGE_NAME}-source.live.tar
rm -f ${LB_IMAGE_NAME}-source.debian.tar.bz2 ${LB_IMAGE_NAME}-source.debian.tar.gz ${LB_IMAGE_NAME}-source.debian.tar.lz ${LB_IMAGE_NAME}-source.debian.tar
rm -f ${LB_IMAGE_NAME}-source.live.tar.bz2 ${LB_IMAGE_NAME}-source.live.tar.gz ${LB_IMAGE_NAME}-source.live.tar.lz ${LB_IMAGE_NAME}-source.live.tar
tar cf ${LIVE_IMAGE_NAME}-source.debian.tar source/debian
tar cf ${LIVE_IMAGE_NAME}-source.live.tar source/live
tar cf ${LB_IMAGE_NAME}-source.debian.tar source/debian
tar cf ${LB_IMAGE_NAME}-source.live.tar source/live
case "${LB_COMPRESSION}" in
bzip2)
bzip2 ${BZIP2_OPTIONS} ${LIVE_IMAGE_NAME}-source.debian.tar
bzip2 ${BZIP2_OPTIONS} ${LIVE_IMAGE_NAME}-source.live.tar
bzip2 ${BZIP2_OPTIONS} ${LB_IMAGE_NAME}-source.debian.tar
bzip2 ${BZIP2_OPTIONS} ${LB_IMAGE_NAME}-source.live.tar
;;
gzip)
gzip ${GZIP_OPTIONS} ${LIVE_IMAGE_NAME}-source.debian.tar
gzip ${GZIP_OPTIONS} ${LIVE_IMAGE_NAME}-source.live.tar
gzip ${GZIP_OPTIONS} ${LB_IMAGE_NAME}-source.debian.tar
gzip ${GZIP_OPTIONS} ${LB_IMAGE_NAME}-source.live.tar
;;
lzip)
lzip ${LZIP_OPTIONS} ${LIVE_IMAGE_NAME}-source.debian.tar
lzip ${LZIP_OPTIONS} ${LIVE_IMAGE_NAME}-source.live.tar
lzip ${LZIP_OPTIONS} ${LB_IMAGE_NAME}-source.debian.tar
lzip ${LZIP_OPTIONS} ${LB_IMAGE_NAME}-source.live.tar
;;
xz)
xz ${XZ_OPTIONS} ${LIVE_IMAGE_NAME}-source.debian.tar
xz ${XZ_OPTIONS} ${LIVE_IMAGE_NAME}-source.live.tar
xz ${XZ_OPTIONS} ${LB_IMAGE_NAME}-source.debian.tar
xz ${XZ_OPTIONS} ${LB_IMAGE_NAME}-source.live.tar
;;
none)