live-build/helpers/lh_binary_disk

109 lines
2.9 KiB
Plaintext
Raw Normal View History

2007-09-23 08:05:13 +00:00
#!/bin/sh
# lh_binary_disk (1) - install disk information into binary
2008-03-06 14:43:00 -01:00
# Copyright (C) 2006-2008 Daniel Baumann <daniel@debian.org>
2007-09-23 08:05:13 +00:00
#
# live-helper comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
# This is free software, and you are welcome to redistribute it
# under certain conditions; see COPYING for details.
set -e
# Including common functions
LH_BASE="${LH_BASE:-/usr/share/live-helper}"
for FUNCTION in "${LH_BASE}"/functions/*.sh
do
. "${FUNCTION}"
done
# Setting static variables
DESCRIPTION="install disk information into binary"
HELP=""
USAGE="${PROGRAM} [--force]"
Arguments "${@}"
# Reading configuration files
2008-04-07 10:10:21 +00:00
Read_conffile config/all config/common config/bootstrap config/chroot config/binary config/source
2007-09-23 08:05:13 +00:00
Set_defaults
2007-09-23 08:05:17 +00:00
if [ "${LH_BINARY_IMAGES}" != "iso" ]
2007-09-23 08:05:13 +00:00
then
exit 0
fi
Echo_message "Begin installing disk information..."
# Requiring stage file
Require_stagefile .stage/bootstrap
# Checking stage file
Check_stagefile .stage/binary_disk
# Checking lock file
Check_lockfile .lock
# Creating lock file
Create_lockfile .lock
mkdir -p binary/.disk
ARCHITECTURE="$(echo ${LH_ARCHITECTURE} | sed -e 's| |/|g')"
DISTRIBUTION="$(echo ${LH_DISTRIBUTION} | cut -b 1 | tr '[a-z]' '[A-Z]')"
DISTRIBUTION="${DISTRIBUTION}$(echo ${LH_DISTRIBUTION} | cut -b 2-)"
eval VERSION="$`echo VERSION_${LH_DISTRIBUTION}`"
2007-09-23 08:05:13 +00:00
if [ "${LH_DISTRIBUTION}" != "etch" ]
then
ARCHITECTURE="Snapshot ${ARCHITECTURE}"
fi
2007-10-19 10:45:57 +00:00
case "${LH_DEBIAN_INSTALLER}" in
cdrom)
echo "main" > binary/.disk/base_components
2007-09-23 08:05:13 +00:00
2007-10-19 10:45:57 +00:00
touch binary/.disk/base_installable
2007-09-23 08:05:13 +00:00
2007-10-19 10:45:57 +00:00
echo "full_cd" > binary/.disk/cd_type
2007-09-23 08:05:21 +00:00
2007-10-19 10:45:57 +00:00
echo "Debian GNU/Linux ${VERSION} \"${DISTRIBUTION}\" - Official ${ARCHITECTURE} CD Binary $(date +%Y%m%d-%H:%M)" > binary/.disk/info
2007-09-23 08:05:21 +00:00
2007-10-19 10:45:57 +00:00
cp "${LH_BASE}"/data/debian-cd/${LH_DISTRIBUTION}/${LH_ARCHITECTURE}_udeb_include binary/.disk/udeb_include
;;
2007-09-23 08:05:21 +00:00
2007-10-19 10:45:57 +00:00
enabled|netinst|live)
echo "main" > binary/.disk/base_components
2007-09-23 08:05:21 +00:00
2007-10-19 10:45:57 +00:00
touch binary/.disk/base_installable
2007-09-23 08:05:13 +00:00
2007-10-19 10:45:57 +00:00
echo "not_complete" > binary/.disk/cd_type
2007-09-23 08:05:13 +00:00
2007-10-19 10:45:57 +00:00
echo "Debian GNU/Linux ${VERSION} \"${DISTRIBUTION}\" - Official ${ARCHITECTURE} NETINST Binary $(date +%Y%m%d-%H:%M)" > binary/.disk/info
2007-09-23 12:05:10 +00:00
2007-10-19 10:45:57 +00:00
cp "${LH_BASE}"/data/debian-cd/${LH_DISTRIBUTION}/${LH_ARCHITECTURE}_netinst_udeb_include binary/.disk/udeb_include
2007-09-23 08:05:21 +00:00
2007-10-19 10:45:57 +00:00
if [ "${LH_DEBIAN_INSTALLER}" = "live" ]
then
echo "live-installer" >> binary/.disk/udeb_include
fi
;;
2007-09-23 08:05:21 +00:00
2007-10-19 10:45:57 +00:00
businesscard)
echo "main" > binary/.disk/base_components
2007-09-23 08:05:13 +00:00
2007-10-19 10:45:57 +00:00
echo "not_complete" > binary/.disk/cd_type
2007-09-23 08:05:13 +00:00
2007-10-19 10:45:57 +00:00
echo "Debian GNU/Linux ${VERSION} \"${DISTRIBUTION}\" - Official ${ARCHITECTURE} BC Binary $(date +%Y%m%d-%H:%M)" > binary/.disk/info
2007-09-23 08:05:21 +00:00
2007-10-19 10:45:57 +00:00
cp "${LH_BASE}"/data/debian-cd/${LH_DISTRIBUTION}/${LH_ARCHITECTURE}_businesscard_udeb_include binary/.disk/udeb_include
2007-09-23 08:05:21 +00:00
;;
2007-10-19 10:45:57 +00:00
disabled)
echo "Debian GNU/Linux ${VERSION} \"${DISTRIBUTION}\" - Official ${ARCHITECTURE} LIVE Binary $(date +%Y%m%d-%H:%M)" > binary/.disk/info
2007-09-23 08:05:21 +00:00
;;
esac
2007-09-23 08:05:13 +00:00
# Creating stage file
Create_stagefile .stage/binary_disk