2007-09-23 08:04:46 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2007-09-23 08:04:48 +00:00
|
|
|
# lh_build(1) - build a Debian Live system
|
2009-01-26 15:39:27 -01:00
|
|
|
# Copyright (C) 2006-2009 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
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2007-09-23 08:05:11 +00:00
|
|
|
# Including common functions
|
2009-11-22 12:40:20 -01:00
|
|
|
. "${LH_BASE:-/usr/share/live-helper}"/live-helper.sh
|
2007-09-23 08:04:48 +00:00
|
|
|
|
2009-01-31 15:05:41 -01:00
|
|
|
# Read meta config
|
|
|
|
if [ "${1}" != "noautoconfig" ] && [ -x scripts/build ]
|
|
|
|
then
|
|
|
|
./scripts/build ${@}
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "${1}" = "noautoconfig" ]
|
|
|
|
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
|
2009-10-20 18:40:09 +00:00
|
|
|
lh bootstrap ${*}
|
2007-09-23 08:04:46 +00:00
|
|
|
|
|
|
|
# Customizing chroot
|
2009-10-20 18:40:09 +00:00
|
|
|
lh chroot ${*}
|
2007-09-23 08:04:46 +00:00
|
|
|
|
2007-09-23 08:05:11 +00:00
|
|
|
# Building binary images
|
2009-10-20 18:40:09 +00:00
|
|
|
lh binary ${*}
|
2007-09-23 08:04:46 +00:00
|
|
|
|
2007-09-23 08:05:11 +00:00
|
|
|
# Building source images
|
2009-10-20 18:40:09 +00:00
|
|
|
lh source ${*}
|