2012-07-18 17:09:16 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
## live-build(7) - System Build Scripts
|
2020-03-11 09:07:21 -01:00
|
|
|
## Copyright (C) 2016-2020 The Debian Live team
|
2015-01-04 18:05:39 -01:00
|
|
|
## Copyright (C) 2006-2015 Daniel Baumann <mail@daniel-baumann.ch>
|
2012-07-18 17:09:16 +00:00
|
|
|
##
|
2012-07-29 23:59:00 +00:00
|
|
|
## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
|
2012-07-18 17:09:16 +00:00
|
|
|
## This is free software, and you are welcome to redistribute it
|
|
|
|
## under certain conditions; see COPYING for details.
|
|
|
|
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# Including common functions
|
2012-08-27 13:52:29 +00:00
|
|
|
[ -e "${LIVE_BUILD}/scripts/build.sh" ] && . "${LIVE_BUILD}/scripts/build.sh" || . /usr/lib/live/build.sh
|
2012-07-18 17:09:16 +00:00
|
|
|
|
|
|
|
# Setting static variables
|
2015-02-05 02:30:47 -01:00
|
|
|
DESCRIPTION="Build zsync control files"
|
2012-07-18 17:09:16 +00:00
|
|
|
USAGE="${PROGRAM} [--force]"
|
|
|
|
|
2015-02-05 02:30:47 -01:00
|
|
|
# Processing arguments and configuration files
|
|
|
|
Init_config_data "${@}"
|
2012-07-18 17:09:16 +00:00
|
|
|
|
2012-12-19 08:52:13 -01:00
|
|
|
if [ "${LIVE_IMAGE_TYPE}" != "iso" ] && [ "${LIVE_IMAGE_TYPE}" != "iso-hybrid" ]
|
2012-09-30 15:34:08 +00:00
|
|
|
then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2012-07-18 17:09:16 +00:00
|
|
|
if [ "${LB_ZSYNC}" != "true" ]
|
|
|
|
then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
Echo_message "Begin building zsync control files..."
|
|
|
|
|
|
|
|
# Requiring stage file
|
|
|
|
Require_stagefile .build/config .build/bootstrap
|
|
|
|
|
|
|
|
# Checking stage file
|
|
|
|
Check_stagefile .build/binary_zsync
|
|
|
|
|
2015-02-05 02:30:47 -01:00
|
|
|
# Aquire lock file
|
|
|
|
Acquire_lockfile
|
2012-07-18 17:09:16 +00:00
|
|
|
|
|
|
|
# Checking depends
|
2015-01-04 16:08:09 -01:00
|
|
|
Check_package chroot /usr/bin/zsyncmake zsync
|
2012-07-18 17:09:16 +00:00
|
|
|
|
|
|
|
# Restoring cache
|
2015-01-06 02:46:37 -01:00
|
|
|
Restore_package_cache binary
|
2012-07-18 17:09:16 +00:00
|
|
|
|
|
|
|
# Installing depends
|
|
|
|
Install_package
|
|
|
|
|
2012-12-19 08:52:13 -01:00
|
|
|
case "${LIVE_IMAGE_TYPE}" in
|
2012-07-18 17:09:16 +00:00
|
|
|
iso)
|
2014-12-10 05:39:58 -01:00
|
|
|
_IMAGES="${LIVE_IMAGE_NAME}-${LB_ARCHITECTURES}.iso"
|
2012-07-18 17:09:16 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
iso-hybrid)
|
2014-12-10 05:39:58 -01:00
|
|
|
_IMAGES="${LIVE_IMAGE_NAME}-${LB_ARCHITECTURES}.hybrid.iso"
|
2012-07-18 17:09:16 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
hdd)
|
2014-12-10 05:39:58 -01:00
|
|
|
_IMAGES="${LIVE_IMAGE_NAME}-${LB_ARCHITECTURES}.img"
|
2012-07-18 17:09:16 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
net)
|
2014-12-10 05:39:58 -01:00
|
|
|
_IMAGES="${LIVE_IMAGE_NAME}-${LB_ARCHITECTURES}.netboot.tar*"
|
2012-07-18 17:09:16 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
tar)
|
2014-12-10 05:39:58 -01:00
|
|
|
_IMAGES="${LIVE_IMAGE_NAME}-${LB_ARCHITECTURES}.tar*"
|
2012-07-18 17:09:16 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
for _IMAGE in ${_IMAGES}
|
|
|
|
do
|
|
|
|
if [ -e "${_IMAGE}" ]
|
|
|
|
then
|
|
|
|
case "${LB_BUILD_WITH_CHROOT}" in
|
|
|
|
true)
|
|
|
|
mv ${_IMAGE} chroot
|
|
|
|
Chroot chroot "zsyncmake -C -b 2048 -u ${_IMAGE} ${_IMAGE}"
|
|
|
|
mv chroot/${_IMAGE} chroot/${_IMAGE}.zsync ./
|
|
|
|
;;
|
|
|
|
|
|
|
|
false)
|
|
|
|
zsyncmake -C -b 2048 -u "${_IMAGE}" "${_IMAGE}"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
case "${LB_COMPRESSION}" in
|
|
|
|
bzip2)
|
|
|
|
bzip2 ${BZIP2_OPTIONS} ${_IMAGE}.zsync
|
|
|
|
;;
|
|
|
|
|
|
|
|
gzip)
|
|
|
|
gzip ${GZIP_OPTIONS} ${_IMAGE}.zsync
|
|
|
|
;;
|
|
|
|
|
|
|
|
lzip)
|
|
|
|
lzip ${LZIP_OPTIONS} ${_IMAGE}.zsync
|
|
|
|
;;
|
|
|
|
|
2012-07-18 17:44:00 +00:00
|
|
|
xz)
|
|
|
|
xz ${XZ_OPTIONS} ${_IMAGE}.zsync
|
|
|
|
;;
|
|
|
|
|
2012-07-18 17:09:16 +00:00
|
|
|
none)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
#CHECKSUMS
|
|
|
|
|
|
|
|
# Saving cache
|
2015-01-06 02:46:37 -01:00
|
|
|
Save_package_cache binary
|
2012-07-18 17:09:16 +00:00
|
|
|
|
|
|
|
# Removing depends
|
|
|
|
Remove_package
|
|
|
|
|
|
|
|
# Creating stage file
|
|
|
|
Create_stagefile .build/binary_zsync
|