3 # Purpose: build process script for generating a (grml based) Linux Live-ISO
4 # Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports: see http://grml.org/bugs/
6 # License: This file is licensed under the GPL v2 or any later version.
7 # Latest change: Sat Sep 15 18:22:07 CEST 2007 [mika]
8 ################################################################################
10 # read configuration files, set some misc variables {{{
15 # we need root permissions for the build-process:
16 if [ "$(id -u 2>/dev/null)" != 0 ] ; then
17 echo "Error: please run this script with uid 0 (root)." >&2
23 DEBUG='' # TODO / FIXME - not implemented yet
25 # source main configuration file:
26 . /etc/grml/grml-live.conf
35 [ -n "$1" ] && EXIT="$1" || EXIT="1"
36 [ -n "$2" ] && echo "$2">&2
42 # check for important variables {{{
43 [ -n "$FAI_CONFIG" ] || FAI_CONFIG=/etc/grml/fai
44 [ -n "$HOSTNAME" ] || HOSTNAME=grml
45 [ -n "$USERNAME" ] || USERNAME=grml
46 [ -n "$CLASSES" ] || CLASSES="GRML"
47 [ -n "$TARGET" ] || bailout 1 "${PN}: \$TARGET not specified. Please adjust /etc/grml/grml-live.conf. Exiting."
50 # usage information {{{
54 $PN - build process script for generating a (grml based) Linux Live-ISO
56 Usage: $PN [-c <classe[s]>] [-t <target_directory>] [-F] [-h|--help] [addiontalarguments_for_fai]
61 $PN -c GRML -t /dev/shm/grml
62 $PN -c GRML,GRML_X -t /grml/chroot/grml_uncompressed
65 More details: man grml-live
66 /usr/share/doc/grml-live/grml-live.html
68 Please send your bug reports, feedback,.. to the grml-team.
74 # command line parsing {{{
76 while getopts ?c:f:t:Fhv: opt; do
78 c) CLASSES="$OPTARG" ;;
80 h) usage ; bailout 0 ;;
81 t) TARGET="$OPTARG" ;;
83 ?) echo "invalid option -$OPTARG" >&2; bailout 1 ;;
86 shift $(($OPTIND - 1)) # set ARGV to the first not parsed commandline parameter
91 # some misc checks before executing FAI {{{
92 [ -n "$CLASSES" ] || bailout 1 "Error: \$CLASSES unset, please set it in /etc/grml/grml-live.conf or
93 specify it on the command line using the -c|--classes option."
94 [ -n "$TARGET" ] || bailout 1 "Error: \$TARGET unset, please set it in /etc/grml/grml-live.conf or
95 specify it on the command line using the -t|--target option."
97 if [ "$EXECUTE" != '1' ] ; then
98 echo "Error: please set EXECUTE=1 in /etc/grml/grml-live.conf to really execute grml-live.">&2
100 echo "See 'man grml-live' for more details or execute '$PN --help'">&2
106 # ask user whether the setup is ok {{{
107 if [ -z "$FORCE" ] ; then
109 echo "$PN - check your configuration (or invoke using -F to force execution without prompting)"
111 echo " FAI classes: $CLASSES"
112 echo " target / output directory: $TARGET"
113 [ -n "$FAI_ARGS" ] && echo " additional arguments for FAI: $FAI_ARGS"
115 echo -n "Is this ok for you? [y/N] "
117 if ! [ "$a" = 'y' -o "$a" = 'Y' ] ; then
118 bailout 1 "Exiting as requested."
124 if [ -n "$GRML_LIVE_SOURCES" ] ; then
125 echo $GRML_LIVE_SOURCES > /etc/grml/fai/apt/sources.list
128 if [ -n "$FAI_DEBOOTSTRAP" ] ; then
129 sed -i "s#^FAI_DEBOOTSTRAP#FAI_DEBOOTSTRAP=$FAI_DEBOOTSTRAP#" /etc/grml/fai/make-fai-nfsroot.conf
133 fai -v -C "$FAI_CONFIG" -c"$CLASSES" dirinstall "$TARGET" $FAI_ARGS
136 ## END OF FILE #################################################################
137 # vim:foldmethod=marker ts=2 ft=sh ai expandtab tw=80 sw=2