2007-09-23 08:04:46 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2010-09-02 11:12:37 +00:00
|
|
|
## 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>
|
2010-09-02 11:12:37 +00:00
|
|
|
##
|
2012-07-29 23:59:00 +00:00
|
|
|
## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
|
2010-09-02 11:12:37 +00:00
|
|
|
## This is free software, and you are welcome to redistribute it
|
|
|
|
## under certain conditions; see COPYING for details.
|
|
|
|
|
2007-09-23 08:04:46 +00:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2007-09-23 08:05:11 +00:00
|
|
|
# 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
|
2007-09-23 08:04:46 +00:00
|
|
|
|
2007-09-23 08:05:11 +00:00
|
|
|
# Setting static variables
|
2015-02-05 02:30:47 -01:00
|
|
|
DESCRIPTION="Queue install of package lists into chroot"
|
2011-06-11 14:36:44 +00:00
|
|
|
USAGE="${PROGRAM} {install|live} [--force]"
|
|
|
|
|
|
|
|
_PASS="${1}"
|
|
|
|
shift
|
2007-09-23 08:04:48 +00:00
|
|
|
|
2015-02-05 02:30:47 -01:00
|
|
|
# Processing arguments and configuration files
|
|
|
|
Init_config_data "${@}"
|
2007-09-23 08:04:46 +00:00
|
|
|
|
2011-06-11 14:36:44 +00:00
|
|
|
Echo_message "Begin queueing installation of package lists (${_PASS} pass)..."
|
2007-09-23 08:04:49 +00:00
|
|
|
|
2007-09-23 08:04:46 +00:00
|
|
|
# Requiring stage file
|
2020-03-15 12:05:44 -01:00
|
|
|
Require_stagefiles config bootstrap
|
2007-09-23 08:04:46 +00:00
|
|
|
|
2020-03-17 21:09:51 -01:00
|
|
|
# Set non-default stage file name
|
2020-03-13 16:11:53 -01:00
|
|
|
# Setting to default name with appended action name
|
|
|
|
STAGE_FILE="$(Stagefile_name "${_PASS}")"
|
|
|
|
|
2007-09-23 08:04:46 +00:00
|
|
|
# Checking stage file
|
2020-03-12 00:21:39 -01:00
|
|
|
Check_stagefile "${STAGE_FILE}"
|
2007-09-23 08:04:46 +00:00
|
|
|
|
2020-03-13 15:19:59 -01:00
|
|
|
# Acquire lock file
|
2015-02-05 02:30:47 -01:00
|
|
|
Acquire_lockfile
|
2007-09-23 08:04:46 +00:00
|
|
|
|
2011-08-16 18:49:36 +00:00
|
|
|
# Handling local package lists
|
2013-03-27 11:22:58 -01:00
|
|
|
if ! ( ls config/package-lists/*.list > /dev/null 2>&1 || \
|
2011-08-16 18:49:36 +00:00
|
|
|
ls config/package-lists/*.list.chroot > /dev/null 2>&1 || \
|
2013-03-27 11:22:58 -01:00
|
|
|
ls config/package-lists/*.list.chroot_${_PASS} > /dev/null 2>&1 )
|
2011-08-16 18:49:36 +00:00
|
|
|
then
|
2013-03-27 11:22:58 -01:00
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2017-08-28 09:29:54 +00:00
|
|
|
# Checking depends
|
|
|
|
Check_package chroot /usr/bin/grep-aptavail dctrl-tools
|
|
|
|
|
|
|
|
# Restoring cache
|
2015-01-06 02:46:37 -01:00
|
|
|
Restore_package_cache chroot
|
2017-08-28 09:29:54 +00:00
|
|
|
|
|
|
|
# Installing depends
|
2020-05-05 15:42:44 +00:00
|
|
|
Install_packages
|
2013-03-27 11:22:58 -01:00
|
|
|
|
|
|
|
if [ -e "${LIVE_BUILD}/share/bin/Packages" ]
|
|
|
|
then
|
|
|
|
cp "${LIVE_BUILD}/share/bin/Packages" chroot/bin
|
|
|
|
else
|
|
|
|
cp /usr/share/live/build/bin/Packages chroot/bin
|
|
|
|
fi
|
|
|
|
|
|
|
|
for LIST in config/package-lists/*.list \
|
2020-02-10 14:48:49 -01:00
|
|
|
config/package-lists/*.list.chroot \
|
|
|
|
config/package-lists/*.list.chroot_${_PASS}
|
2013-03-27 11:22:58 -01:00
|
|
|
do
|
|
|
|
if [ -e "${LIST}" ]
|
2012-07-29 23:53:56 +00:00
|
|
|
then
|
2013-03-27 11:22:58 -01:00
|
|
|
# Generating package list
|
|
|
|
Expand_packagelist "$(basename ${LIST})" "config/package-lists" \
|
2021-01-12 12:48:27 -01:00
|
|
|
| grep -v '^#' >> chroot/root/packages.chroot || true
|
2012-07-29 23:53:56 +00:00
|
|
|
fi
|
2013-03-27 11:22:58 -01:00
|
|
|
done
|
|
|
|
|
2013-06-20 15:36:01 +00:00
|
|
|
# Discover unique package architectures in fully-expanded package list
|
|
|
|
for _PACKAGE_ARCHITECTURE in $(Discover_package_architectures "chroot/root/packages.chroot")
|
|
|
|
do
|
|
|
|
# If this is a foreign architecture, append to packages.foreign-architectures
|
2020-04-01 09:58:47 +00:00
|
|
|
if [ "${_PACKAGE_ARCHITECTURE}" != "${LB_ARCHITECTURE}" ]
|
2013-06-20 15:36:01 +00:00
|
|
|
then
|
2020-04-01 09:58:47 +00:00
|
|
|
Echo_message "Accepting foreign architecture: ${_PACKAGE_ARCHITECTURE}, live image architecture is: ${LB_ARCHITECTURE}"
|
2013-06-20 15:36:01 +00:00
|
|
|
echo "${_PACKAGE_ARCHITECTURE}" >> chroot/root/packages.foreign-architectures
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2013-03-27 11:22:58 -01:00
|
|
|
rm -f chroot/bin/Packages
|
2012-07-29 23:53:56 +00:00
|
|
|
|
2020-05-05 15:45:57 +00:00
|
|
|
Remove_packages
|
2017-08-28 09:29:54 +00:00
|
|
|
|
|
|
|
# Saving cache
|
2015-01-06 02:46:37 -01:00
|
|
|
Save_package_cache chroot
|
2013-03-27 11:22:58 -01:00
|
|
|
|
|
|
|
# Creating stage file
|
2020-03-12 00:21:39 -01:00
|
|
|
Create_stagefile "${STAGE_FILE}"
|