live-build/helpers/lh_binary

95 lines
2.0 KiB
Plaintext
Raw Normal View History

2007-09-23 08:04:46 +00:00
#!/bin/sh
2007-09-23 08:04:48 +00:00
# lh_binary(1) - build binary images
2008-03-06 14:43:00 -01:00
# Copyright (C) 2006-2008 Daniel Baumann <daniel@debian.org>
2007-09-23 08:04:48 +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.
2007-09-23 08:04:46 +00:00
2007-09-23 08:04:48 +00:00
set -e
2007-09-23 08:05:11 +00:00
# Including common functions
LH_BASE="${LH_BASE:-/usr/share/live-helper}"
for FUNCTION in "${LH_BASE}"/functions/*.sh
2007-09-23 08:04:48 +00:00
do
2007-09-23 08:05:11 +00:00
. "${FUNCTION}"
2007-09-23 08:04:48 +00:00
done
2007-09-23 08:05:11 +00:00
# Setting static variables
2007-09-23 08:04:48 +00:00
DESCRIPTION="build binary images"
HELP=""
USAGE="${PROGRAM} [--force]"
Arguments "${@}"
2007-09-23 08:05:16 +00:00
# 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:16 +00:00
Set_defaults
2007-09-23 08:04:48 +00:00
# Preparing root filesystem
2007-09-23 08:04:52 +00:00
lh_binary_chroot ${*}
2007-09-23 08:04:46 +00:00
2007-09-23 08:05:17 +00:00
if [ "${LH_CHROOT_BUILD}" = "enabled" ]
2007-09-23 08:05:15 +00:00
then
# Configuring chroot
2007-10-31 09:20:03 -01:00
lh_chroot_devpts install ${*}
2007-09-23 08:05:15 +00:00
lh_chroot_proc install ${*}
lh_chroot_sysfs install ${*}
lh_chroot_hosts install ${*}
lh_chroot_resolv install ${*}
lh_chroot_hostname install ${*}
lh_chroot_sources install ${*}
fi
2007-09-23 08:04:48 +00:00
# Building root filesystem
2007-09-23 08:04:52 +00:00
lh_binary_rootfs ${*}
lh_binary_manifest ${*}
lh_binary_encryption ${*}
2007-09-23 08:04:46 +00:00
# Prepare images
2007-10-18 20:28:54 +00:00
lh_binary_local-packageslists ${*}
2007-09-23 08:05:09 +00:00
lh_binary_linux-image ${*}
2007-09-23 08:04:52 +00:00
lh_binary_debian-installer ${*}
lh_binary_memtest ${*}
lh_binary_grub ${*}
lh_binary_syslinux ${*}
lh_binary_yaboot ${*}
2007-09-23 08:05:13 +00:00
lh_binary_disk ${*}
2007-09-23 08:04:52 +00:00
lh_binary_includes ${*}
2007-09-23 08:05:09 +00:00
lh_binary_local-includes ${*}
2007-09-23 08:05:12 +00:00
lh_binary_local-hooks ${*}
2007-09-23 08:04:52 +00:00
lh_binary_md5sum ${*}
2007-09-23 08:04:46 +00:00
if [ "${LH_CHROOT_BUILD}" != "enabled" ]
then
lh_chroot_devpts install ${*}
lh_chroot_proc install ${*}
lh_chroot_sysfs install ${*}
fi
2007-09-23 08:04:46 +00:00
# Building images
2007-09-23 08:04:52 +00:00
lh_binary_iso ${*}
lh_binary_net ${*}
2007-09-23 08:05:11 +00:00
lh_binary_tar ${*}
2007-09-23 08:04:52 +00:00
lh_binary_usb-hdd ${*}
2007-09-23 08:04:46 +00:00
2007-09-23 08:05:17 +00:00
if [ "${LH_CHROOT_BUILD}" = "enabled" ]
2007-09-23 08:05:15 +00:00
then
# Deconfiguring chroot
rm -f .stage/chroot_sources
lh_chroot_hostname remove ${*}
lh_chroot_resolv remove ${*}
lh_chroot_hosts remove ${*}
fi
lh_chroot_sysfs remove ${*}
lh_chroot_proc remove ${*}
lh_chroot_devpts remove ${*}