2007-09-23 08:05:13 +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:05:13 +00:00
|
|
|
|
|
|
|
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
|
2007-09-23 08:05:13 +00:00
|
|
|
|
|
|
|
# Setting static variables
|
2015-02-05 02:30:47 -01:00
|
|
|
DESCRIPTION="Install disk information into binary"
|
2007-09-23 08:05:13 +00:00
|
|
|
USAGE="${PROGRAM} [--force]"
|
|
|
|
|
2015-02-05 02:30:47 -01:00
|
|
|
# Processing arguments and configuration files
|
|
|
|
Init_config_data "${@}"
|
2007-09-23 08:05:13 +00:00
|
|
|
|
2020-04-06 17:46:47 +00:00
|
|
|
if ! In_list "${LB_IMAGE_TYPE}" iso iso-hybrid hdd; then
|
2020-03-28 04:13:11 -01:00
|
|
|
exit 0
|
|
|
|
fi
|
2007-09-23 08:05:13 +00:00
|
|
|
|
|
|
|
Echo_message "Begin installing disk information..."
|
|
|
|
|
|
|
|
# Requiring stage file
|
2020-03-15 12:05:44 -01:00
|
|
|
Require_stagefiles config bootstrap
|
2007-09-23 08:05:13 +00:00
|
|
|
|
|
|
|
# Checking stage file
|
2020-03-13 16:11:53 -01:00
|
|
|
Check_stagefile
|
2007-09-23 08:05:13 +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:05:13 +00:00
|
|
|
|
|
|
|
mkdir -p binary/.disk
|
|
|
|
|
2020-04-01 09:58:47 +00:00
|
|
|
ARCHITECTURE="$(echo ${LB_ARCHITECTURE} | sed -e 's| |/|g')"
|
2019-12-19 16:18:44 -01:00
|
|
|
DISTRIBUTION="$(echo ${LB_DISTRIBUTION_BINARY} | cut -b 1 | tr '[a-z]' '[A-Z]')"
|
|
|
|
DISTRIBUTION="${DISTRIBUTION}$(echo ${LB_DISTRIBUTION_BINARY} | cut -b 2-)"
|
2015-08-10 19:31:17 +00:00
|
|
|
|
|
|
|
if [ -e chroot/etc/os-release ]
|
|
|
|
then
|
|
|
|
VERSION="$(. chroot/etc/os-release && echo ${VERSION_ID})"
|
|
|
|
fi
|
|
|
|
|
|
|
|
VERSION="${VERSION:-none}"
|
2007-09-23 08:05:13 +00:00
|
|
|
|
2010-09-07 13:11:20 +00:00
|
|
|
case "${LB_MODE}" in
|
2009-02-08 09:55:56 -01:00
|
|
|
debian)
|
2011-11-29 14:28:17 -01:00
|
|
|
TITLE="Debian GNU/Linux"
|
2023-07-12 14:07:38 +00:00
|
|
|
STRING="Snapshot ${ARCHITECTURE}"
|
2009-02-08 09:55:56 -01:00
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
2011-11-29 14:28:17 -01:00
|
|
|
TITLE="Debian GNU/Linux"
|
2009-02-08 09:55:56 -01:00
|
|
|
STRING="Snapshot ${ARCHITECTURE}"
|
|
|
|
;;
|
|
|
|
esac
|
2007-09-23 11:59:19 +00:00
|
|
|
|
2010-09-07 13:11:20 +00:00
|
|
|
case "${LB_DEBIAN_INSTALLER}" in
|
2007-10-19 10:45:57 +00:00
|
|
|
cdrom)
|
2015-01-05 17:49:13 -01:00
|
|
|
DISK_LABEL="LIVE/CD"
|
|
|
|
DISK_TYPE="full_cd"
|
2007-10-19 10:45:57 +00:00
|
|
|
;;
|
2015-01-05 17:27:35 -01:00
|
|
|
netboot)
|
2015-01-05 17:49:13 -01:00
|
|
|
DISK_LABEL="LIVE/NETBOOT"
|
|
|
|
#FIXME: type?
|
|
|
|
DISK_TYPE=""
|
|
|
|
;;
|
|
|
|
netinst)
|
|
|
|
DISK_LABEL="LIVE/NETINST"
|
|
|
|
DISK_TYPE="not_complete"
|
|
|
|
;;
|
|
|
|
live)
|
|
|
|
DISK_LABEL="LIVE/INSTALL"
|
|
|
|
DISK_TYPE="live"
|
2015-01-05 17:27:35 -01:00
|
|
|
;;
|
2007-10-19 10:45:57 +00:00
|
|
|
businesscard)
|
2015-01-05 17:49:13 -01:00
|
|
|
DISK_LABEL="LIVE/BC"
|
|
|
|
DISK_TYPE="not_complete"
|
|
|
|
;;
|
|
|
|
none)
|
|
|
|
DISK_LABEL="LIVE"
|
|
|
|
DISK_TYPE=""
|
|
|
|
;;
|
|
|
|
esac
|
2007-09-23 08:05:13 +00:00
|
|
|
|
2020-10-04 11:48:03 +00:00
|
|
|
_DATE="$(date $DATE_UTC_OPTION -d@${SOURCE_DATE_EPOCH} +%Y%m%d-%H:%M)"
|
2020-05-03 19:24:33 +00:00
|
|
|
|
|
|
|
echo "${TITLE} ${VERSION} \"${DISTRIBUTION}\" - ${STRING} ${DISK_LABEL} Binary ${_DATE}" > binary/.disk/info
|
2007-09-23 08:05:21 +00:00
|
|
|
|
2015-01-05 17:49:13 -01:00
|
|
|
if [ -n "${DISK_TYPE}" ]; then
|
|
|
|
echo "${DISK_TYPE}" > binary/.disk/cd_type
|
|
|
|
fi
|
2012-07-19 17:37:26 +00:00
|
|
|
|
2015-01-05 17:49:13 -01:00
|
|
|
#FIXME review the netboot case
|
|
|
|
case "${LB_DEBIAN_INSTALLER}" in
|
|
|
|
none|netboot)
|
2007-09-23 08:05:21 +00:00
|
|
|
;;
|
2015-01-05 17:49:13 -01:00
|
|
|
businesscard)
|
|
|
|
echo "main" > binary/.disk/base_components
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "main" > binary/.disk/base_components
|
|
|
|
touch binary/.disk/base_installable
|
2007-09-23 08:05:21 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2023-01-08 15:27:35 -01:00
|
|
|
# If the same file exists in multiple locations, take the version from the first
|
|
|
|
LOCATIONS="/usr/share/live/build/data/debian-cd"
|
|
|
|
if [ -n "${LIVE_BUILD}" ]
|
|
|
|
then
|
|
|
|
LOCATIONS="${LIVE_BUILD}/data/debian-cd ${LOCATIONS}"
|
|
|
|
fi
|
|
|
|
for LOCATION in ${LOCATIONS}
|
2015-01-05 17:49:13 -01:00
|
|
|
do
|
2023-01-08 15:27:35 -01:00
|
|
|
if [ -e "${LOCATION}/${LB_PARENT_DISTRIBUTION_BINARY}" ] && [ ! -e binary/.disk/udeb_include ]
|
2015-01-05 17:49:13 -01:00
|
|
|
then
|
|
|
|
case "${LB_DEBIAN_INSTALLER}" in
|
|
|
|
cdrom)
|
2021-01-01 15:51:02 -01:00
|
|
|
cp -a "${LOCATION}/${LB_PARENT_DISTRIBUTION_BINARY}/${LB_ARCHITECTURE}_udeb_include" binary/.disk/udeb_include
|
2015-01-05 17:49:13 -01:00
|
|
|
;;
|
|
|
|
netinst|live)
|
2024-08-01 19:27:30 +00:00
|
|
|
if [ -r "${LOCATION}/${LB_PARENT_DISTRIBUTION_BINARY}/${LB_ARCHITECTURE}_netinst_udeb_include" ]
|
|
|
|
then
|
|
|
|
cp -a "${LOCATION}/${LB_PARENT_DISTRIBUTION_BINARY}/${LB_ARCHITECTURE}_netinst_udeb_include" binary/.disk/udeb_include
|
|
|
|
if [ "${LB_DEBIAN_INSTALLER}" = "live" ]
|
|
|
|
then
|
|
|
|
echo "live-installer" >> binary/.disk/udeb_include
|
|
|
|
fi
|
|
|
|
fi
|
2015-01-05 17:49:13 -01:00
|
|
|
;;
|
|
|
|
businesscard)
|
2021-01-01 15:51:02 -01:00
|
|
|
cp -a "${LOCATION}/${LB_PARENT_DISTRIBUTION_BINARY}/${LB_ARCHITECTURE}_businesscard_udeb_include" binary/.disk/udeb_include
|
2015-01-05 17:49:13 -01:00
|
|
|
;;
|
|
|
|
none|netboot)
|
2023-01-08 15:27:35 -01:00
|
|
|
#FIXME review the netboot case
|
2015-01-05 17:49:13 -01:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2007-09-23 08:05:13 +00:00
|
|
|
# Creating stage file
|
2020-03-13 16:11:53 -01:00
|
|
|
Create_stagefile
|