Notice: the grml team is migrating from Mercurial to Git.
Please visit git.grml.org instead!
| author | Michael Prokop |
| Wed Sep 19 23:42:06 2007 +0200 (14 months ago) | |
| changeset 95 | 748ff5a59ed2 |
| manifest | 748ff5a59ed2 |
| parent 94 | 63701b9f39a4 |
| child 96 | 465fcb072e4f |
--- a/etc/grml/grml-live.conf Wed Sep 19 21:36:11 2007 +0200+++ b/etc/grml/grml-live.conf Wed Sep 19 23:42:06 2007 +0200@@ -57,8 +57,11 @@ CLASSES="GRMLBASE,I386"# ... and the sources.list entry for the directory:# MIRROR_SOURCES="deb file:///mnt/mirror/debian sid main contrib non-free"-# Directory of configuration files for grml-live's FAI:-GRML_FAI_CONFIG=/etc/grml/fai+# Version number of ISO (limited to 5 chars):+VERSION="0.0-1"++# Codename of the release (limited to 30 chars):+CODENAME="grml-live just rocks!"# Specify hostname of the live-system:HOSTNAME=grml@@ -66,8 +69,14 @@ HOSTNAME=grml# Specify user with UID 1000 on live-system:USERNAME=grml+# Directory of configuration files for grml-live's FAI:+GRML_FAI_CONFIG=/etc/grml/fai+# Do you want to pass any additional arguments to FAI?# FAI_ARGS=""++# Where do you want to store grml-live.log?+# LOGDIR="/var/log/fai/dirinstall/$HOSTNAME"# Which architecture do you want to build?# It defaults to output of 'dpkg --print-architecture'
--- a/grml-live Wed Sep 19 21:36:11 2007 +0200+++ b/grml-live Wed Sep 19 23:42:06 2007 +0200@@ -4,7 +4,7 @@# 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: Tue Sep 18 22:46:28 CEST 2007 [mika]+# Latest change: Wed Sep 19 23:41:52 CEST 2007 [mika]################################################################################# read configuration files, set some misc variables {{{@@ -24,6 +24,15 @@ fi# make sure they are not set by defaultVERBOSE=''FORCE=''++if [ -r /etc/grml/lsb-functions ] ; then+ . /etc/grml/lsb-functions+else+ einfo() { echo " [*] $*" ;}+ eerror() { echo " [!] $*">&2 ;}+ ewarn() { echo " [x] $*" ;}+ eend() { return 0 ; }+fi# source main configuration file:LIVE_CONF=/etc/grml/grml-live.conf@@ -38,7 +47,7 @@ bailout() {# rm -f "$TMPFILE"[ -n "$MIRROR_DIRECTORY" ] && umount "${CHROOT_TARGET}/${MIRROR_DIRECTORY}"[ -n "$1" ] && EXIT="$1" || EXIT="1"- [ -n "$2" ] && echo "$2">&2+ [ -n "$2" ] && eerror "$2">&2exit "$EXIT"}trap bailout 1 2 3 15@@ -50,6 +59,62 @@ trap bailout 1 2 3 15[ -n "$USERNAME" ] || USERNAME=grml[ -n "$CLASSES" ] || CLASSES="GRML,I386"[ -n "$TARGET" ] || bailout 1 "${PN}: \$TARGET not specified. Please adjust $LIVE_CONF. Exiting."++[ -n "$VERSION" ] || VERSION="0.1"+[ -n "$CODENAME" ] || CODENAME="grml-live rocks"++[ -n "$LOGDIR" ] || LOGDIR="/var/log/fai/dirinstall/$HOSTNAME"+[ -d "$LOGDIR" ] || mkdir $LOGDIR+LOGFILE="$LOGDIR/grml-live.conf"+# }}}++# some important functions {{{++# log output:+# usage: log "string to log"+log() { echo "$*" >> $LOGFILE ; }++# cut string at character number int = $1+# usage: cut_string 5 "1234567890" will output "12345"+cut_string() {+ [ -n "$2" ] || return 1+ echo "$2" | head -c "$1"; echo -ne "\n"+}++# prepend int = $1 spaces before string = $2+# usage: extend_string_begin 5 "123" will output " 123"+extend_string_begin() {+ [ -n "$2" ] || return 1+ local COUNT="$(echo $2 | wc -c)"+ local FILL="$(expr $COUNT - $1)"+ while [ "$FILL" -gt 1 ] ; do+ echo -n " "+ local FILL=$(expr $FILL - 1)+ done+ while [ "$FILL" -lt 1 ] ; do+ echo -n " "+ local FILL=$(expr $FILL + 1)+ done+ echo "$2" | head -c "$1"; echo -ne "\n"+}++# append int = $1 spaces to string = $2+# usage: extend_string_begin 5 "123" will output "123 "+extend_string_end() {+ [ -n "$2" ] || return 1+ echo -n "$2" | head -c "$1"+ local COUNT="$(echo $2 | wc -c)"+ local FILL="$(expr $COUNT - $1)"+ while [ "$FILL" -gt 1 ] ; do+ echo -n " "+ local FILL=$(expr $FILL - 1)+ done+ while [ "$FILL" -lt 1 ] ; do+ echo -n " "+ local FILL=$(expr $FILL + 1)+ done+ echo -ne "\n"+}# }}}# usage information {{{@@ -79,11 +144,12 @@ http://grml.org/bugs/# command line parsing {{{-while getopts "c:s:t:Fhv" opt; do+while getopts "c:i:s:t:Fhv" opt; docase "$opt" inc) CLASSES="$OPTARG" ;;F) FORCE=1 ;;h) usage ; bailout 0 ;;+ i) ISO_NAME="$OPTARG" ;;s) SUITE="$OPTARG" ;;t) TARGET="$OPTARG"CHROOT_TARGET="$TARGET/grml_chroot"@@ -108,7 +174,7 @@ specify it on the command line using the# ask user whether the setup is ok {{{if [ -z "$FORCE" ] ; thenecho- echo "$PN - check your configuration (or invoke using -F to force execution without prompting):"+ echo "${PN}: check your configuration (or use -F to force execution without prompting):"echoecho " FAI classes: $CLASSES"echo " main directory: $TARGET"@@ -125,13 +191,18 @@ if [ -z "$FORCE" ] ; thenbailout 1 "Exiting as requested."fiecho++ start_seconds=$(cut -d . -f 1 /proc/uptime)+ log "------------------------------------------------------------------------------"+ log "Starting grml-live run [$(date)]"fi# }}}# on-the-fly configuration {{{if [ -n "$MIRROR_DIRECTORY" ] ; thenif ! [ -d "$MIRROR_DIRECTORY/debian" ] ; then- echo "Sorry, $MIRROR_DIRECTORY/debian does not seem to exist. Exiting.">&2+ eerror "Sorry, $MIRROR_DIRECTORY/debian does not seem to exist. Exiting."+ log "Sorry, $MIRROR_DIRECTORY/debian does not seem to exist. Exiting. [$(date)]"bailout 1fiecho "$MIRROR_SOURCES" > /etc/grml/fai/apt/sources.list@@ -163,33 +234,38 @@ fi# CHROOT_TARGET - execute FAI {{{[ -n "$CHROOT_TARGET" ] || CHROOT_TARGET="$TARGET/grml_chroot"-if [ -d "$CHROOT_TARGET" ] ; then- echo " [x] $CHROOT_TARGET exists already, skipping the stage 'fai dirinstall'"+if [ -d "$CHROOT_TARGET/bin" ] ; then+ ewarn "$CHROOT_TARGET exists already, skipping stage 'fai dirinstall'" ; eend 0+ log "$CHROOT_TARGET exists already, skipping stage 'fai dirinstall'"elsemkdir -p "$CHROOT_TARGET" || bailout 5 "Problem with creating $CHROOT_TARGET for FAI"if [ -n "${MIRROR_DIRECTORY}" ] ; thenmkdir -p "${CHROOT_TARGET}/${MIRROR_DIRECTORY}"mount --bind "${MIRROR_DIRECTORY}" "${CHROOT_TARGET}/${MIRROR_DIRECTORY}"fi- fai $VERBOSE -C "$GRML_FAI_CONFIG" -c"$CLASSES" dirinstall "$CHROOT_TARGET" $FAI_ARGS+ fai $VERBOSE -C "$GRML_FAI_CONFIG" -c"$CLASSES" dirinstall "$CHROOT_TARGET" $FAI_ARGS | tee -a $LOGFILEumount $CHROOT_TARGET/proc 2>/dev/null || /bin/trueumount $CHROOT_TARGET/sys 2>/dev/null || /bin/true[ -n "$MIRROR_DIRECTORY" ] && umount "${CHROOT_TARGET}/${MIRROR_DIRECTORY}"# notice: 'fai dirinstall' does not seem to exit appropriate, so:ERROR=''- [ -r "/var/log/fai/dirinstall/$HOSTNAME/software.log" ] &&- grep -q 'dpkg: error processing' /var/log/fai/dirinstall/$HOSTNAME/software.log && ERROR=1-- [ -r "/var/log/fai/dirinstall/$HOSTNAME/shell.log" ] &&- grep -q 'FAILED with exit code' /var/log/fai/dirinstall/$HOSTNAME/shell.log && ERROR=2+ if [ -r "/var/log/fai/dirinstall/$HOSTNAME/software.log" ] ; then+ grep 'dpkg: error processing' /var/log/fai/dirinstall/$HOSTNAME/software.log >> $LOGFILE && ERROR=1+ fi++ if [ -r "/var/log/fai/dirinstall/$HOSTNAME/shell.log" ] ; then+ grep 'FAILED with exit code' /var/log/fai/dirinstall/$HOSTNAME/shell.log >> $LOGFILE && ERROR=2+ fiif [ -n "$ERROR" ] ; then- echo " [!] There was an error during execution of stage 'fai dirinstall'"+ eerror "There was an error during execution of stage 'fai dirinstall'"echo " Check out /var/log/fai/dirinstall/$HOSTNAME/... for details. [exit ${ERROR}]"- exit 1+ log "There was an error during execution of stage 'fai dirinstall' [$(date)]"+ eend 1 ; exit 1else- echo " [*] Finished execution of stage 'fai dirinstall'"+ einfo "Finished execution of stage 'fai dirinstall'"+ log "Finished execution of stage 'fai dirinstall' [$(date)]"fifi# }}}@@ -202,12 +278,12 @@ mkdir -p "$BUILD_TARGET" || bailout 6 "P[ -n "$ARCH" ] || ARCH="$(dpkg --print-architecture)"if [ "$ARCH" = i386 ] ; thenif [ -d "$BUILD_TARGET"/boot/isolinux ] ; then- echo " [x] $BUILD_TARGET/boot/isolinux exists already - skipping stage 'boot/isolinux'"- continue+ ewarn "$BUILD_TARGET/boot exists already, skipping stage 'boot/isolinux'" ; eend 0+ log "$BUILD_TARGET/boot exists already, skipping stage 'boot/isolinux'"else# booting stuff:mkdir -p "$BUILD_TARGET"/boot/isolinux- mkdir "$BUILD_TARGET"/GRML+ [ -d "$BUILD_TARGET"/GRML ] || mkdir "$BUILD_TARGET"/GRMLcp /boot/memtest86+.bin "$BUILD_TARGET"/boot/isolinux/memtestcp "$CHROOT_TARGET"/boot/initrd* "$BUILD_TARGET"/boot/isolinux/initrd.gzcp "$CHROOT_TARGET"/boot/vmlinuz* "$BUILD_TARGET"/boot/isolinux/linux26@@ -223,6 +299,20 @@ if [ "$ARCH" = i386 ] ; thencp /usr/share/grml-live/i386_files/boot/isolinux/isolinux.cfg "$BUILD_TARGET"/boot/isolinux/cp /usr/share/grml-live/i386_files/boot/isolinux/logo.16 "$BUILD_TARGET"/boot/isolinux/cp /usr/share/grml-live/i386_files/boot/isolinux/syslinux.cfg "$BUILD_TARGET"/boot/isolinux/++ # adjust boot splash information:+ ISO_DATE="$(date +%Y-%m-%d)"+ VERSION="$(cut_string 5 "$VERSION")" ; VERSION="$(extend_string_end 5 "$VERSION")"+ CODENAME="$(cut_string 30 "$CODENAME")" ; CODENAME="$(extend_string_end 30 "$CODENAME")"++ sed -i "s/%VERSION%/$VERSION/" "$BUILD_TARGET"/boot/isolinux/boot.msg+ sed -i "s/%CODENAME%/$CODENAME/" "$BUILD_TARGET"/boot/isolinux/boot.msg+ sed -i "s/%DATE%/$ISO_DATE/" "$BUILD_TARGET"/boot/isolinux/boot.msg++ sed -i "s/%VERSION%/$VERSION/" "$BUILD_TARGET"/boot/isolinux/boot-beep.msg+ sed -i "s/%CODENAME%/$CODENAME/" "$BUILD_TARGET"/boot/isolinux/boot-beep.msg+ sed -i "s/%DATE%/$ISO_DATE/" "$BUILD_TARGET"/boot/isolinux/boot-beep.msg+# autostart for Windows:cp /usr/share/grml-live/windows/autostart/autorun.bat "$BUILD_TARGET"/cp /usr/share/grml-live/windows/autostart/autorun.inf "$BUILD_TARGET"/@@ -230,58 +320,67 @@ if [ "$ARCH" = i386 ] ; thencp /usr/share/grml-live/windows/autostart/cdrom.ico "$BUILD_TARGET"/# windows-binaries:if [ -n "$WINDOWS_BINARIES" ] ; then- if [ -d "$BUILD_TARGET"/windows ] ; then- echo " [x] $BUILD_TARGET/windows exists already - skipping stage 'WINDOWS_BINARIES'"- return 0+ if [ -f "$BUILD_TARGET"/windows/putty.exe ] ; then+ ewarn "$BUILD_TARGET/windows exists already, skipping stage 'WINDOWS_BINARIES'" ; eend 0+ log "$BUILD_TARGET/windows exists already, skipping stage 'WINDOWS_BINARIES'"elsemkdir "$BUILD_TARGET"/windows( cd "$BUILD_TARGET"/windowsfor file in pageant plink pscp psftp putty puttygen ; do- wget ${WINDOWS_BINARIES}/${file}.exe+ wget -O ${file}.exe ${WINDOWS_BINARIES}/${file}.exedone )fi- echo " [*] Finished execution of stage 'WINDOWS_BINARIES'"+ einfo "Finished execution of stage 'WINDOWS_BINARIES'" ; eend 0+ log "Finished execution of stage 'WINDOWS_BINARIES' [$(date)]"fi- echo " [*] Finished execution of stage 'boot/isolinux'"+ einfo "Finished execution of stage 'boot/isolinux'" ; eend 0fi# amd64:elif [ "$ARCH" = amd64 ] ; then- echo 'Warning: gebi, it is your turn. :)'>&2+ ewarn 'Warning: gebi, it is your turn. :)'>&2# ppc:elif [ "$ARCH" = powerpc ] ; then- echo 'Warning: formorer, it is your turn. :)'>&2+ ewarn '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'"+ eerror 'Error: Unsupported ARCH, sorry. Want to support it? Contribute!' ; eend 1+fi++if [ -f "$BUILD_TARGET"/live/grml.squashfs ] ; then+ ewarn "$BUILD_TARGET/live exists already, skipping stage 'squashfs'" ; eend 0+ log "$BUILD_TARGET/live exists already, skipping stage 'squashfs'"elsemkdir "$BUILD_TARGET"/livemksquashfs $CHROOT_TARGET/* $BUILD_TARGET/live/grml.squashfs -noappend-fi-echo " [*] Finished execution of stage 'squashfs'"+ einfo "Finished execution of stage 'squashfs'" ; eend 0+ log "Finished execution of stage 'squashfs' [$(date)]"+fi# }}}# ISO_TARGET - mkisofs {{{[ -n "$ISO_TARGET" ] || ISO_TARGET="$TARGET/grml_isos"if [ -d "$ISO_TARGET" ] ; then- echo " [x] $ISO_TARGET exists already, skipping the stage 'iso build'"+ ewarn "$ISO_TARGET exists already, skipping stage 'iso build'" ; eend 0+ log "$ISO_TARGET exists already, skipping stage 'iso build'"elsemkdir -p "$ISO_TARGET" || bailout 6 "Problem with creating $ISO_TARGET for stage 'iso build'"+ [ -n "$ISO_NAME" ] || ISO_NAME="grml_0.0-1.iso"( cd "$BUILD_TARGET" &&- mkisofs -V "Debian/etch grml" -publisher 'Michael Prokop <mika@grml.org>' \+ mkisofs -V "Debian/etch grml" -publisher 'grml-live | 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 .+ -o "${ISO_TARGET}"/"${ISO_NAME}" .)- echo " [*] Finished execution of stage 'iso build'"+ einfo "Finished execution of stage 'iso build'" ; eend 0+ log "Finished execution of stage 'iso build' [$(date)]"fi# }}}# finalize {{{-echo " [*] Sucessfully finished execution of $PN"+SECONDS="$[$(cut -d . -f 1 /proc/uptime)-$start_seconds]"+einfo "Sucessfully finished execution of $PN [running ${SECONDS} seconds]" ; eend 0+log "Sucessfully finished execution of $PN [running ${SECONDS} seconds]"+log "------------------------------------------------------------------------------"bailout 0# }}}
--- a/i386_files/boot/isolinux/boot-beep.msg Wed Sep 19 21:36:11 2007 +0200+++ b/i386_files/boot/isolinux/boot-beep.msg Wed Sep 19 23:42:06 2007 +0200@@ -1,5 +1,5 @@17logo.16Some information and boot options available via keys F2 - F10. http://grml.org/-grml 0.0-1 - Release Codename "grml-live rocks! http://grml.org - 2007-09-15+grml %VERSION% - Release Codename %CODENAME% %DATE%
--- a/i386_files/boot/isolinux/boot.msg Wed Sep 19 21:36:11 2007 +0200+++ b/i386_files/boot/isolinux/boot.msg Wed Sep 19 23:42:06 2007 +0200@@ -1,4 +1,4 @@17logo.16Some information and boot options available via keys F2 - F10. http://grml.org/-grml 0.0-1 - Release Codename "grml-live rocks! http://grml.org - 2007-09-15+grml %VERSION% - Release Codename %CODENAME% %DATE%
--- a/i386_files/boot/isolinux/f3 Wed Sep 19 21:36:11 2007 +0200+++ b/i386_files/boot/isolinux/f3 Wed Sep 19 23:42:06 2007 +0200@@ -1,9 +1,8 @@grml - Linux for sysadmins and users of texttools 09F307-70 This edition of grml boots with kernel 2.6.22-grml by default.- The following options can be used at the boot:-prompt:+70 The following options can be used at the boot:-prompt:- grml [options, list via F4-F10] grml default running 2.6.22+ grml [options, list via F4-F10] boot grml defaultmemtest memtest86+ (memory test program)fb1280x1024, fb1024x768 or fb800x600 use framebuffer mode (e.g. notebooks)nofb disable framebuffer mode@@ -15,7 +14,8 @@debug get interactive shells during startup processgrub start GRand Unified Bootloader (GRUB)dos start FreeDOS 1.0- vmware boot with special options for use in VMware+ qemu boot with special options for use in Qemu+ vmware boot with special options for use in VMwareA list with all supported boot options can be found at the CD at/cdrom/GRML/grml-cheatcodes.txt