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 {{{
18 # we need root permissions for the build-process:
19 if [ "$(id -u 2>/dev/null)" != 0 ] ; then
20 echo "Error: please run this script with uid 0 (root)." >&2
26 DEBUG='' # TODO / FIXME - not implemented yet
28 # source main configuration file:
29 . /etc/grml/grml-live.conf
38 [ -n "$1" ] && EXIT="$1" || EXIT="1"
39 [ -n "$2" ] && echo "$2">&2
45 # check for important variables {{{
46 [ -n "$GRML_FAI_CONFIG" ] || GRML_FAI_CONFIG=/etc/grml/fai
47 [ -n "$HOSTNAME" ] || HOSTNAME=grml
48 [ -n "$USERNAME" ] || USERNAME=grml
49 [ -n "$CLASSES" ] || CLASSES="GRML"
50 [ -n "$TARGET" ] || bailout 1 "${PN}: \$TARGET not specified. Please adjust /etc/grml/grml-live.conf. Exiting."
53 # usage information {{{
57 $PN - build process script for generating a (grml based) Linux Live-ISO
59 Usage: $PN [-c <classe[s]>] [-t <target_directory>] [-F] [-h|--help] [addiontalarguments_for_fai]
64 $PN -c GRML -t /dev/shm/grml
65 $PN -c GRML,GRML_X -t /grml/chroot/grml_uncompressed
68 More details: man grml-live
69 /usr/share/doc/grml-live/grml-live.html
71 Please send your bug reports, feedback,.. to the grml-team.
77 # command line parsing {{{
79 while getopts ?c:f:t:Fhv: opt; do
81 c) CLASSES="$OPTARG" ;;
83 h) usage ; bailout 0 ;;
84 t) TARGET="$OPTARG" ;;
86 ?) echo "invalid option -$OPTARG" >&2; bailout 1 ;;
89 shift $(($OPTIND - 1)) # set ARGV to the first not parsed commandline parameter
94 # some misc checks before executing FAI {{{
95 [ -n "$CLASSES" ] || bailout 1 "Error: \$CLASSES unset, please set it in /etc/grml/grml-live.conf or
96 specify it on the command line using the -c|--classes option."
97 [ -n "$TARGET" ] || bailout 1 "Error: \$TARGET unset, please set it in /etc/grml/grml-live.conf or
98 specify it on the command line using the -t|--target option."
100 if [ "$EXECUTE" != '1' ] ; then
101 echo "Error: please set EXECUTE=1 in /etc/grml/grml-live.conf to really execute grml-live.">&2
103 echo "See 'man grml-live' for more details or execute '$PN --help'">&2
109 # ask user whether the setup is ok {{{
110 if [ -z "$FORCE" ] ; then
112 echo "$PN - check your configuration (or invoke using -F to force execution without prompting)"
114 echo " FAI classes: $CLASSES"
115 echo " target / output directory: $TARGET"
116 [ -n "$FAI_ARGS" ] && echo " additional arguments for FAI: $FAI_ARGS"
118 echo -n "Is this ok for you? [y/N] "
120 if ! [ "$a" = 'y' -o "$a" = 'Y' ] ; then
121 bailout 1 "Exiting as requested."
127 if [ -n "$GRML_LIVE_SOURCES" ] ; then
128 echo "$GRML_LIVE_SOURCES" > /etc/grml/fai/apt/sources.list
131 if [ -n "$FAI_DEBOOTSTRAP" ] ; then
132 sed -i "s#^FAI_DEBOOTSTRAP#FAI_DEBOOTSTRAP=$FAI_DEBOOTSTRAP#" /etc/grml/fai/make-fai-nfsroot.conf
136 fai -v -C "$GRML_FAI_CONFIG" -c"$CLASSES" dirinstall "$TARGET" $FAI_ARGS
139 ## END OF FILE #################################################################
140 # vim:foldmethod=marker ts=2 ft=sh ai expandtab tw=80 sw=2