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
|
|
|
|
2020-04-06 17:46:47 +00:00
|
|
|
if [ "${LB_IMAGE_TYPE}" != "iso" ] && [ "${LB_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
|
2020-03-15 12:05:44 -01:00
|
|
|
Require_stagefiles config bootstrap
|
2012-07-18 17:09:16 +00:00
|
|
|
|
|
|
|
# Checking stage file
|
2020-03-13 16:11:53 -01:00
|
|
|
Check_stagefile
|
2012-07-18 17:09:16 +00:00
|
|
|
|
2020-03-13 15:19:59 -01:00
|
|
|
# Acquire lock file
|
2015-02-05 02:30:47 -01:00
|
|
|
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
|
2020-05-05 15:42:44 +00:00
|
|
|
Install_packages
|
2012-07-18 17:09:16 +00:00
|
|
|
|
2020-04-06 17:46:47 +00:00
|
|
|
case "${LB_IMAGE_TYPE}" in
|
2012-07-18 17:09:16 +00:00
|
|
|
iso)
|
2020-04-06 17:43:41 +00:00
|
|
|
_IMAGES="${LB_IMAGE_NAME}-${LB_ARCHITECTURE}.iso"
|
2012-07-18 17:09:16 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
iso-hybrid)
|
2020-04-06 17:43:41 +00:00
|
|
|
_IMAGES="${LB_IMAGE_NAME}-${LB_ARCHITECTURE}.hybrid.iso"
|
2012-07-18 17:09:16 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
hdd)
|
2020-04-06 17:43:41 +00:00
|
|
|
_IMAGES="${LB_IMAGE_NAME}-${LB_ARCHITECTURE}.img"
|
2012-07-18 17:09:16 +00:00
|
|
|
;;
|
|
|
|
|
2020-03-28 04:13:11 -01:00
|
|
|
netboot)
|
2020-04-06 17:43:41 +00:00
|
|
|
_IMAGES="${LB_IMAGE_NAME}-${LB_ARCHITECTURE}.netboot.tar*"
|
2012-07-18 17:09:16 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
tar)
|
2020-04-06 17:43:41 +00:00
|
|
|
_IMAGES="${LB_IMAGE_NAME}-${LB_ARCHITECTURE}.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
|
2020-05-05 15:45:57 +00:00
|
|
|
Remove_packages
|
2012-07-18 17:09:16 +00:00
|
|
|
|
|
|
|
# Creating stage file
|
2020-03-13 16:11:53 -01:00
|
|
|
Create_stagefile
|