live-build/helpers/lh_binary_disk

146 lines
3.3 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
# Copyright (C) 2006-2007 Daniel Baumann <daniel@debian.org>
#
# 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
Read_conffile config/common
Read_conffile config/bootstrap
Read_conffile config/chroot
Read_conffile config/binary
Read_conffile config/source
2007-09-23 08:05:18 +00:00
Read_conffile "${LH_CONFIG}"
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
2007-09-23 08:05:17 +00:00
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-09-23 08:05:13 +00:00
case "${LH_MODE}" in
debian)
2007-09-23 08:05:21 +00:00
case "${LH_DEBIAN_INSTALLER}" in
cdrom)
echo "main" > binary/.disk/base_components
2007-09-23 08:05:13 +00:00
2007-09-23 08:05:21 +00:00
touch binary/.disk/base_installable
2007-09-23 08:05:13 +00:00
2007-09-23 08:05:21 +00:00
echo "full_cd" > binary/.disk/cd_type
echo "Debian GNU/Linux ${VERSION} \"${DISTRIBUTION}\" - Official ${ARCHITECTURE} CD Binary `date +%Y%m%d-%H:%M`" > binary/.disk/info
cat > binary/.disk/udeb_include << EOF
netcfg
ethdetect
pcmcia-cs-udeb
pcmciautils-udeb
wireless-tools-udeb
EOF
;;
enabled|netinst)
2007-09-23 08:05:21 +00:00
echo "main" > binary/.disk/base_components
touch binary/.disk/base_installable
echo "not_complete" > binary/.disk/cd_type
2007-09-23 08:05:13 +00:00
2007-09-23 08:05:21 +00:00
echo "Debian GNU/Linux ${VERSION} \"${DISTRIBUTION}\" - Official ${ARCHITECTURE} NETINST Binary `date +%Y%m%d-%H:%M`" > binary/.disk/info
2007-09-23 08:05:13 +00:00
2007-09-23 08:05:21 +00:00
cat > binary/.disk/udeb_include << EOF
netcfg
ethdetect
pcmcia-cs-udeb
pcmciautils-udeb
wireless-tools-udeb
EOF
;;
businesscard)
echo "main" > binary/.disk/base_components
echo "not_complete" > binary/.disk/cd_type
2007-09-23 08:05:13 +00:00
2007-09-23 08:05:21 +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:13 +00:00
cat > binary/.disk/udeb_include << EOF
2007-09-23 08:05:21 +00:00
choose-mirror
2007-09-23 08:05:13 +00:00
netcfg
ethdetect
pcmcia-cs-udeb
pcmciautils-udeb
wireless-tools-udeb
EOF
2007-09-23 08:05:21 +00:00
;;
disabled)
echo "Debian GNU/Linux ${VERSION} \"${DISTRIBUTION}\" - Official ${ARCHITECTURE} LIVE Binary `date +%Y%m%d-%H:%M`" > binary/.disk/info
;;
esac
;;
ubuntu)
# FIXME
echo "Ubuntu Linux ${VERSION} \"${DISTRIBUTION}\" - Unofficial ${ARCHITECTURE} LIVE/NETINST Binary `date +%Y%m%d-%H:%M`" > binary/.disk/info
# Ubuntu 7.04 "Feisty Fawn" - Release i386 (20070418)
;;
esac
if [ -d binary/pool/main/l/live-installer ]
then
echo "live-installer" >> binary/.disk/udeb_include
2007-09-23 08:05:13 +00:00
fi
# Creating stage file
Create_stagefile .stage/binary_disk