2007-09-23 08:04:46 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2010-09-02 11:12:37 +00:00
|
|
|
## live-build(7) - System Build Scripts
|
2012-02-04 19:41:41 -01:00
|
|
|
## Copyright (C) 2006-2012 Daniel Baumann <daniel@debian.org>
|
2010-09-02 11:12:37 +00:00
|
|
|
##
|
|
|
|
## live-build 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
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2007-09-23 08:05:11 +00:00
|
|
|
# Including common functions
|
2010-09-07 13:11:20 +00:00
|
|
|
. "${LB_BASE:-/usr/share/live/build}"/scripts/build.sh
|
2007-09-23 08:04:48 +00:00
|
|
|
|
2010-02-17 14:11:50 -01:00
|
|
|
# Automatically populating config tree
|
2012-06-03 20:42:41 +00:00
|
|
|
if [ -x auto/config ] && [ ! -e .build/config ]
|
2010-02-17 14:11:50 -01:00
|
|
|
then
|
|
|
|
Echo_message "Automatically populating config tree."
|
2010-09-02 13:14:29 +00:00
|
|
|
lb config
|
2010-02-17 14:11:50 -01:00
|
|
|
fi
|
|
|
|
|
2009-01-31 15:05:41 -01:00
|
|
|
# Read meta config
|
2010-04-18 12:38:14 +00:00
|
|
|
if [ "${1}" != "noauto" ] && [ -x auto/build ]
|
2009-01-31 15:05:41 -01:00
|
|
|
then
|
2010-04-18 12:40:09 +00:00
|
|
|
Echo_message "Executing auto/build script."
|
2010-11-22 18:30:09 -01:00
|
|
|
./auto/build "${@}"
|
2010-09-13 19:20:54 +00:00
|
|
|
exit ${?}
|
2009-01-31 15:05:41 -01:00
|
|
|
fi
|
|
|
|
|
2010-04-18 12:38:14 +00:00
|
|
|
if [ "${1}" = "noauto" ]
|
2009-01-31 15:05:41 -01:00
|
|
|
then
|
|
|
|
shift
|
|
|
|
fi
|
|
|
|
|
2007-09-23 08:05:11 +00:00
|
|
|
# Setting static variables
|
2009-01-15 01:37:42 -01:00
|
|
|
DESCRIPTION="$(Echo 'build a Debian Live system')"
|
2007-09-23 08:04:48 +00:00
|
|
|
HELP=""
|
|
|
|
USAGE="${PROGRAM} [--force]"
|
|
|
|
|
|
|
|
Arguments "${@}"
|
|
|
|
|
2008-06-20 00:33:15 +00:00
|
|
|
if [ ! -d config ]
|
|
|
|
then
|
|
|
|
Echo_warning "No config/ directory; using defaults for all options"
|
|
|
|
fi
|
|
|
|
|
2008-06-20 00:33:49 +00:00
|
|
|
if [ "$(pwd)" = "/" ]
|
|
|
|
then
|
|
|
|
Echo_error "Cannot build live image from the root directory (/)"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2008-07-10 04:13:57 +00:00
|
|
|
if echo $(pwd) | grep -qs " "
|
|
|
|
then
|
|
|
|
Echo_error "Cannot build live image from a directory containing spaces"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2008-08-07 19:04:47 +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
|
2008-08-07 19:04:47 +00:00
|
|
|
Set_defaults
|
|
|
|
|
|
|
|
# Checking defaults
|
|
|
|
Check_defaults
|
|
|
|
|
2007-09-23 08:04:46 +00:00
|
|
|
# Bootstrapping system
|
2010-09-02 13:14:29 +00:00
|
|
|
lb bootstrap ${*}
|
2007-09-23 08:04:46 +00:00
|
|
|
|
|
|
|
# Customizing chroot
|
2010-09-02 13:14:29 +00:00
|
|
|
lb chroot ${*}
|
2007-09-23 08:04:46 +00:00
|
|
|
|
2007-09-23 08:05:11 +00:00
|
|
|
# Building binary images
|
2010-09-02 13:14:29 +00:00
|
|
|
lb binary ${*}
|
2007-09-23 08:04:46 +00:00
|
|
|
|
2007-09-23 08:05:11 +00:00
|
|
|
# Building source images
|
2010-09-02 13:14:29 +00:00
|
|
|
lb source ${*}
|