2007-09-23 08:04:46 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2007-09-23 08:04:48 +00:00
|
|
|
# lh_binary(1) - build binary images
|
2010-03-04 11:43:04 -01:00
|
|
|
# Copyright (C) 2006-2010 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
|
2010-08-14 18:29:05 +00:00
|
|
|
. "${LH_BASE:-/usr/share/live/build}"/scripts/build.sh
|
2007-09-23 08:04:48 +00:00
|
|
|
|
2007-09-23 08:05:11 +00:00
|
|
|
# Setting static variables
|
2009-01-15 01:37:42 -01:00
|
|
|
DESCRIPTION="$(Echo 'build binary images')"
|
2007-09-23 08:04:48 +00:00
|
|
|
HELP=""
|
|
|
|
USAGE="${PROGRAM} [--force]"
|
|
|
|
|
|
|
|
Arguments "${@}"
|
|
|
|
|
2007-09-23 08:05:16 +00:00
|
|
|
# Reading configuration files
|
2008-10-28 14:26:17 -01:00
|
|
|
Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
|
2007-09-23 08:05:16 +00:00
|
|
|
Set_defaults
|
|
|
|
|
2008-10-19 15:58:16 +00:00
|
|
|
# Setup cleanup function
|
|
|
|
Setup_cleanup
|
|
|
|
|
2007-09-23 08:04:48 +00:00
|
|
|
# Preparing root filesystem
|
2009-10-20 18:40:09 +00:00
|
|
|
lh binary_chroot ${*}
|
2007-09-23 08:04:46 +00:00
|
|
|
|
2010-05-21 08:55:55 +00:00
|
|
|
if [ "${LH_BUILD_WITH_CHROOT}" = "true" ]
|
2007-09-23 08:05:15 +00:00
|
|
|
then
|
|
|
|
# Configuring chroot
|
2009-10-20 18:40:09 +00:00
|
|
|
lh chroot_devpts install ${*}
|
|
|
|
lh chroot_proc install ${*}
|
|
|
|
lh chroot_selinuxfs install ${*}
|
|
|
|
lh chroot_sysfs install ${*}
|
|
|
|
lh chroot_hosts install ${*}
|
|
|
|
lh chroot_resolv install ${*}
|
|
|
|
lh chroot_hostname install ${*}
|
2010-02-18 09:24:10 -01:00
|
|
|
lh chroot_sysv-rc install ${*}
|
2010-03-04 11:36:28 -01:00
|
|
|
lh chroot_upstart install ${*}
|
2009-10-20 18:40:09 +00:00
|
|
|
lh chroot_apt install-binary ${*}
|
|
|
|
lh chroot_sources install ${*}
|
2007-09-23 08:05:15 +00:00
|
|
|
fi
|
2007-09-23 08:04:48 +00:00
|
|
|
|
|
|
|
# Building root filesystem
|
2009-10-20 18:40:09 +00:00
|
|
|
lh binary_rootfs ${*}
|
|
|
|
lh binary_manifest ${*}
|
|
|
|
lh binary_encryption ${*}
|
2007-09-23 08:04:46 +00:00
|
|
|
|
|
|
|
# Prepare images
|
2009-10-20 18:40:09 +00:00
|
|
|
lh binary_local-packageslists ${*}
|
|
|
|
lh binary_linux-image ${*}
|
|
|
|
lh binary_debian-installer ${*}
|
|
|
|
lh binary_memtest ${*}
|
|
|
|
lh binary_grub ${*}
|
2009-10-28 11:15:30 -01:00
|
|
|
lh binary_grub2 ${*}
|
2009-10-20 18:40:09 +00:00
|
|
|
lh binary_syslinux ${*}
|
|
|
|
lh binary_yaboot ${*}
|
|
|
|
lh binary_silo ${*}
|
|
|
|
lh binary_disk ${*}
|
|
|
|
lh binary_win32-loader ${*}
|
|
|
|
lh binary_includes ${*}
|
|
|
|
lh binary_local-includes ${*}
|
|
|
|
lh binary_local-hooks ${*}
|
2010-05-01 05:39:49 +00:00
|
|
|
lh binary_checksums ${*}
|
2007-09-23 08:04:46 +00:00
|
|
|
|
2010-05-21 08:55:55 +00:00
|
|
|
if [ "${LH_BUILD_WITH_CHROOT}" != "true" ]
|
2007-11-14 08:13:58 -01:00
|
|
|
then
|
2009-10-20 18:40:09 +00:00
|
|
|
lh chroot_devpts install ${*}
|
|
|
|
lh chroot_proc install ${*}
|
|
|
|
lh chroot_selinuxfs install ${*}
|
|
|
|
lh chroot_sysfs install ${*}
|
2007-11-14 08:13:58 -01:00
|
|
|
fi
|
|
|
|
|
2007-09-23 08:04:46 +00:00
|
|
|
# Building images
|
2009-10-20 18:40:09 +00:00
|
|
|
lh binary_iso ${*}
|
|
|
|
lh binary_net ${*}
|
|
|
|
lh binary_tar ${*}
|
2010-02-18 15:12:59 -01:00
|
|
|
lh binary_usb ${*}
|
2009-10-20 18:40:09 +00:00
|
|
|
lh binary_virtual-hdd ${*}
|
2007-09-23 08:04:46 +00:00
|
|
|
|
2010-05-21 08:55:55 +00:00
|
|
|
if [ "${LH_BUILD_WITH_CHROOT}" = "true" ]
|
2007-09-23 08:05:15 +00:00
|
|
|
then
|
|
|
|
# Deconfiguring chroot
|
|
|
|
rm -f .stage/chroot_sources
|
2009-10-20 18:40:09 +00:00
|
|
|
lh chroot_hostname remove ${*}
|
|
|
|
lh chroot_resolv remove ${*}
|
|
|
|
lh chroot_hosts remove ${*}
|
2007-09-23 08:05:15 +00:00
|
|
|
fi
|
2007-11-14 08:13:58 -01:00
|
|
|
|
2009-10-20 18:40:09 +00:00
|
|
|
lh chroot_apt remove ${*}
|
2010-02-18 09:24:10 -01:00
|
|
|
lh chroot_sysv-rc remove ${*}
|
2009-10-20 18:40:09 +00:00
|
|
|
lh chroot_sysfs remove ${*}
|
2010-03-04 11:36:28 -01:00
|
|
|
lh chroot_upstart remove ${*}
|
2009-10-20 18:40:09 +00:00
|
|
|
lh chroot_selinuxfs remove ${*}
|
|
|
|
lh chroot_proc remove ${*}
|
|
|
|
lh chroot_devpts remove ${*}
|