# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2 or any later version.
-# Latest change: Sat Sep 15 18:22:07 CEST 2007 [mika]
+# Latest change: Sat Sep 15 21:36:04 CEST 2007 [mika]
################################################################################
# read configuration files, set some misc variables {{{
VERBOSE=''
FORCE=''
-DEBUG='' # TODO / FIXME - not implemented yet
# source main configuration file:
. /etc/grml/grml-live.conf
[ -n "$HOSTNAME" ] || HOSTNAME=grml
[ -n "$USERNAME" ] || USERNAME=grml
[ -n "$CLASSES" ] || CLASSES="GRML"
-[ -n "$TARGET" ] || bailout 1 "${PN}: \$TARGET not specified. Please adjust /etc/grml/grml-live.conf. Exiting."
+[ -n "$CHROOT_TARGET" ] || bailout 1 "${PN}: \$CHROOT_TARGET not specified. Please adjust /etc/grml/grml-live.conf. Exiting."
# }}}
# usage information {{{
echo "
$PN - build process script for generating a (grml based) Linux Live-ISO
-Usage: $PN [-c <classe[s]>] [-t <target_directory>] [-F] [-h|--help] [addiontalarguments_for_fai]
+Usage: $PN [-c <classe[s]>] [-t <target_directory>] [-F] [-h|--help] [additional_arguments_for_fai]
Usage examples:
c) CLASSES="$OPTARG" ;;
F) FORCE=1 ;;
h) usage ; bailout 0 ;;
- t) TARGET="$OPTARG" ;;
- v) VERBOSE=1 ;;
+ t) CHROOT_TARGET="$OPTARG" ;;
+ v) VERBOSE="-v" ;;
?) echo "invalid option -$OPTARG" >&2; bailout 1 ;;
esac
done
# some misc checks before executing FAI {{{
[ -n "$CLASSES" ] || bailout 1 "Error: \$CLASSES unset, please set it in /etc/grml/grml-live.conf or
specify it on the command line using the -c|--classes option."
-[ -n "$TARGET" ] || bailout 1 "Error: \$TARGET unset, please set it in /etc/grml/grml-live.conf or
+[ -n "$CHROOT_TARGET" ] || bailout 1 "Error: \$CHROOT_TARGET unset, please set it in /etc/grml/grml-live.conf or
specify it on the command line using the -t|--target option."
if [ "$EXECUTE" != '1' ] ; then
echo
echo "$PN - check your configuration (or invoke using -F to force execution without prompting)"
echo
- echo " FAI classes: $CLASSES"
- echo " target / output directory: $TARGET"
+ echo " FAI classes: $CLASSES"
+ echo " chroot target: $CHROOT_TARGET"
+ echo " build target: $BUILD_TARGET"
+ echo " ISO target: $ISO_TARGET"
+
[ -n "$FAI_ARGS" ] && echo " additional arguments for FAI: $FAI_ARGS"
echo
echo -n "Is this ok for you? [y/N] "
fi
# execute FAI {{{
-fai -v -C "$GRML_FAI_CONFIG" -c"$CLASSES" dirinstall "$TARGET" $FAI_ARGS
+if [ -d "$CHROOT_TARGET" ] ; then
+ echo " [x] $CHROOT_TARGET exists already, skipping the stage 'fai dirnstall'"
+else
+ mkdir "$CHROOT_TARGET" || bailout 5 "Problem with creating $CHROOT_TARGET for FAI"
+ fai $VERBOSE -C "$GRML_FAI_CONFIG" -c"$CLASSES" dirinstall "$CHROOT_TARGET" $FAI_ARGS
+fi
# }}}
+mkdir -p "$BUILD_TARGET" || bailout 6 "Problem with creating $BUILD_TARGET for stage ARCH"
+
+# x86:
+if [ "$ARCH" = x86 ] ; then
+ if [ -d "$BUILD_TARGET"/boot/isolinux ] ; then
+ echo " [x] $BUILD_TARGET/boot/isolinux exists already - skipping stage 'boot/isolinux'"
+ continue
+ else
+ mkdir -p "$BUILD_TARGET"/boot/isolinux
+ mkdir "$BUILD_TARGET"/GRML
+ cp /boot/memtest86+.bin "$BUILD_TARGET"/boot/isolinux/memtest
+ cp "$CHROOT_TARGET"/boot/initrd* "$BUILD_TARGET"/boot/isolinux/initrd.gz
+ cp "$CHROOT_TARGET"/boot/vmlinuz* "$BUILD_TARGET"/boot/isolinux/linux26
+ cp /usr/lib/syslinux/chain.c32 "$BUILD_TARGET"/boot/isolinux/
+ cp /usr/lib/syslinux/isolinux.bin "$BUILD_TARGET"/boot/isolinux/
+ cp /usr/lib/syslinux/memdisk "$BUILD_TARGET"/boot/isolinux/
+ cp /usr/lib/syslinux/menu.c32 "$BUILD_TARGET"/boot/isolinux/
+ cp /usr/share/grml-live/x86_files/boot/isolinux/allinone.img "$BUILD_TARGET"/boot/isolinux/
+ cp /usr/share/grml-live/x86_files/boot/isolinux/balder10.imz "$BUILD_TARGET"/boot/isolinux/
+ cp /usr/share/grml-live/x86_files/boot/isolinux/boot-beep.msg "$BUILD_TARGET"/boot/isolinux/
+ cp /usr/share/grml-live/x86_files/boot/isolinux/boot.msg "$BUILD_TARGET"/boot/isolinux/
+ cp /usr/share/grml-live/x86_files/boot/isolinux/f* "$BUILD_TARGET"/boot/isolinux/
+ cp /usr/share/grml-live/x86_files/boot/isolinux/isolinux.cfg "$BUILD_TARGET"/boot/isolinux/
+ cp /usr/share/grml-live/x86_files/boot/isolinux/logo.16 "$BUILD_TARGET"/boot/isolinux/
+ cp /usr/share/grml-live/x86_files/boot/isolinux/syslinux.cfg "$BUILD_TARGET"/boot/isolinux/
+ # minirt26.gz
+ # boot.cat
+ if [ -n "$WINDOWS_BINARIES" ] ; then
+ if [ -d "$BUILD_TARGET"/windows ] ; then
+ echo " [x] $BUILD_TARGET/windows exists already - skipping stage WINDOWS_BINARIES"
+ return 0
+ else
+ mkdir "$BUILD_TARGET"/windows
+ ( cd "$BUILD_TARGET"/windows
+ for file in pageant plink pscp psftp putty puttygen ; do
+ wget ${WINDOWS_BINARIES}/${file}.exe
+ done )
+ fi
+ fi
+ fi
+# amd64:
+elif [ "$ARCH" = amd64 ] ; then
+ echo 'Warning: gebi, it is your turn. :)'>2
+# ppc:
+elif [ "$ARCH" = ppc ] ; then
+ echo 'Warning: formorer, it is your turn. :)'>2
+# unsuported:
+else
+ echo 'Warning: Unsupported ARCH, sorry. Want to support it? Contribute!'>&2
+fi
+
+if [ -d "$BUILD_TARGET"/live ] ; then
+ echo " [x] $BUILD_TARGET/live exists already, skipping stage 'squashfs'"
+else
+ mkdir "$BUILD_TARGET"/live
+ mksquashfs $CHROOT_TARGET/* $BUILD_TARGET/live/grml.squashfs -noappend
+fi
+
+if [ -d "$ISO_TARGET" ] ; then
+ echo " [x] $ISO_TARGET exists already, skipping the stage 'iso build'"
+else
+ mkdir -p "$ISO_TARGET" || bailout 6 "Problem with creating $ISO_TARGET for stage 'iso build'"
+ ( cd "$BUILD_TARGET" &&
+ mkisofs -V "Debian/etch grml" -publisher 'Michael Prokop <mika@grml.org>' \
+ -l -r -J -no-emul-boot -boot-load-size 4 -boot-info-table \
+ -c boot/isolinux/boot.cat -b boot/isolinux/isolinux.bin \
+ -o "$ISO_TARGET"/grml_0.0-1.iso .
+ )
+
+fi
+
+echo " [*] Sucessfully finished execution of $PN"
+bailout 0
+
## END OF FILE #################################################################
# vim:foldmethod=marker ts=2 ft=sh ai expandtab tw=80 sw=2