From e4040d5c109eedf9316190a415fe7bc90c0e30dc Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Tue, 24 Feb 2009 00:14:21 +0100 Subject: [PATCH] Update buildd/ setup --- buildd/execute.sh | 29 +++++++++++++++++++ buildd/functions.sh | 34 +++++++++++++++++------ buildd/grml-live_autobuild_grml-large_lenny.sh | 17 ++---------- buildd/grml-live_autobuild_grml-large_sid.sh | 17 ++---------- buildd/grml-live_autobuild_grml-medium_lenny.sh | 17 ++---------- buildd/grml-live_autobuild_grml-medium_sid.sh | 17 ++---------- buildd/grml-live_autobuild_grml-small_lenny.sh | 17 ++---------- buildd/grml-live_autobuild_grml-small_sid.sh | 17 ++---------- buildd/grml-live_autobuild_grml64-large_lenny.sh | 21 ++------------ buildd/grml-live_autobuild_grml64-large_sid.sh | 17 ++---------- buildd/grml-live_autobuild_grml64-medium_lenny.sh | 17 ++---------- buildd/grml-live_autobuild_grml64-medium_sid.sh | 17 ++---------- buildd/grml-live_autobuild_grml64-small_lenny.sh | 17 ++---------- buildd/grml-live_autobuild_grml64-small_sid.sh | 17 ++---------- debian/changelog | 12 +++++++- grml-live | 2 +- 16 files changed, 90 insertions(+), 195 deletions(-) create mode 100755 buildd/execute.sh diff --git a/buildd/execute.sh b/buildd/execute.sh new file mode 100755 index 0000000..614da44 --- /dev/null +++ b/buildd/execute.sh @@ -0,0 +1,29 @@ +# Filename: /usr/share/grml-live/buildd/execute.sh +# Purpose: main execution file for grml-live buildd +# Authors: grml-team (grml.org), (c) Michael Prokop +# Bug-Reports: see http://grml.org/bugs/ +# License: This file is licensed under the GPL v2 or any later version. +################################################################################ + +. /usr/share/grml-live/buildd/functions.sh || exit 1 + +# execute main grml-live +grml_live_run + +# store logs on remote server +upload_logs + +# store information about ISO size +iso_details + +# create logs for adding to mail, but only if it fails +create_logs +send_mail -e + +# move the ISO to final destination +store_iso + +# clean exit +bailout + +## END OF FILE ################################################################# diff --git a/buildd/functions.sh b/buildd/functions.sh index a440d3a..226b372 100755 --- a/buildd/functions.sh +++ b/buildd/functions.sh @@ -1,4 +1,3 @@ -#!/bin/sh # Filename: /usr/share/grml-live/buildd/functions.sh # Purpose: main function file for grml-live buildd # Authors: grml-team (grml.org), (c) Michael Prokop @@ -24,10 +23,10 @@ type -p mutt 1>/dev/null 2>&1 || die "mutt binary not found. Exiting." # some defaults: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11 -DATE=$(date +%Y%m%d) -TMP_DIR=$(mktemp -d) -MUTT_HEADERS=$(mktemp) -[ -n "$TMP_DIR" ] || die "Could not create \$TMP_DIR. Exiting." +DATE="$(date +%Y%m%d)" +TMP_DIR="$(mktemp -d)" +MUTT_HEADERS="$(mktemp)" +[ -n "$TMP_DIR" ] || die "Could not create \$TMP_DIR. Exiting." [ -n "$MUTT_HEADERS" ] || die "Could not create $\MUTT_HEADERS. Exiting." [ -n "$ARCH" ] && GRML_LIVE_ARCH="-a $ARCH" @@ -35,7 +34,7 @@ MUTT_HEADERS=$(mktemp) [ -n "$OUTPUT_DIR" ] || OUTPUT_DIR="${STORAGE}/grml-live_${DATE}.$$" [ -n "$ISO_DIR" ] || ISO_DIR=$STORAGE/grml-isos [ -n "$RECIPIENT" ] || RECIPIENT=root@localhost -[ -n "$ATTACHMENT" ] || ATTACHMENT=$TMP_DIR/grml-live-logs_$DATE.tar.gz +[ -n "$ATTACHMENT" ] || ATTACHMENT="$TMP_DIR/grml-live-logs_$DATE.tar.gz" [ -n "$FROM" ] || FROM=root@localhost if [ -n "$LOGFILE" ] ; then @@ -57,8 +56,20 @@ grml_live_run() { fi fi + # workaround the 32 chars limit of mkisofs -V .... + # 'grml64-small-daily-squeeze 090223' is too long + case $SUITE in + sid) CODENAME=sid ;; + squeeze) CODENAME=squ ;; + lenny) CODENAME=lenny ;; + etch) CODENAME=etch ;; + esac + + grml_name="$NAME-daily-$CODENAME" + shortdate="$(date +%y%m%d)" + grml-live -F $* $GRML_LIVE_ARCH -s $SUITE -c $CLASSES -o $OUTPUT_DIR \ - -g "$NAME-daily-$SUITE" -v $DATE -r grml-live-autobuild -i $ISO_NAME \ + -g "$grml_name" -v "$shortdate" -r grml-live-autobuild -i $ISO_NAME \ 1>/var/log/grml-buildd.stdout \ 2>/var/log/grml-buildd.stderr ; RC=$? @@ -71,7 +82,7 @@ grml_live_run() { # create log archive: create_logs() { - ( cd / && tar zcf $ATTACHMENT $FAI_LOGFILES $GRML_LOGFILE 1>/dev/null ) + ( cd / && tar zcf $ATTACHMENT $FAI_LOGFILES /var/log/grml-buildd.stderr /var/log/grml-buildd.stdout $GRML_LOGFILE 1>/dev/null ) } # store logs on remote server: @@ -93,6 +104,8 @@ iso_details() { # send status mail: send_mail() { + # create logs only if using 'send_mail -e' + [ "$1" = "-e" ] && create_logs # attach logs only if we have some: [ -r "$ATTACHMENT" ] && MUTT_ATTACH="-a $ATTACHMENT" || MUTT_ATTACH='' @@ -122,8 +135,11 @@ The following packages could not be installed: $(grep -i "Couldn't find.*package" $FAI_LOGFILES/software.log | sed 's/\(.*\)"\(.*\)"\(.*\)/\2/' | sort -u || echo "* nothing") +See attached files: +/var/log/grml-buildd.stderr /var/log/grml-buildd.stdout $ATTACHMENT + EOF " | \ - mutt -s "$SCRIPTNAME [${DATE}] - $RC_INFO" $MUTT_ATTACH "$RECIPIENT" + mutt -s "$SCRIPTNAME [${DATE}] - $RC_INFO" -a /var/log/grml-buildd.stderr -a /var/log/grml-buildd.stdout $MUTT_ATTACH "$RECIPIENT" } # make sure we store the final iso: diff --git a/buildd/grml-live_autobuild_grml-large_lenny.sh b/buildd/grml-live_autobuild_grml-large_lenny.sh index 593930e..b891d07 100755 --- a/buildd/grml-live_autobuild_grml-large_lenny.sh +++ b/buildd/grml-live_autobuild_grml-large_lenny.sh @@ -9,18 +9,5 @@ NAME=grml SCRIPTNAME="$(basename $0)" ARCH=i386 -. /usr/share/grml-live/buildd/functions.sh || exit 1 - -# execute grml-live: -grml_live_run - -# create_logs -upload_logs - -iso_details - -send_mail - -store_iso - -bailout +# finally just source main file +. /usr/share/grml-live/buildd/execute.sh || exit 1 diff --git a/buildd/grml-live_autobuild_grml-large_sid.sh b/buildd/grml-live_autobuild_grml-large_sid.sh index 1e21a89..209e583 100755 --- a/buildd/grml-live_autobuild_grml-large_sid.sh +++ b/buildd/grml-live_autobuild_grml-large_sid.sh @@ -9,18 +9,5 @@ NAME=grml SCRIPTNAME="$(basename $0)" ARCH=i386 -. /usr/share/grml-live/buildd/functions.sh || exit 1 - -# execute grml-live: -grml_live_run - -# create_logs -upload_logs - -iso_details - -send_mail - -store_iso - -bailout +# finally just source main file +. /usr/share/grml-live/buildd/execute.sh || exit 1 diff --git a/buildd/grml-live_autobuild_grml-medium_lenny.sh b/buildd/grml-live_autobuild_grml-medium_lenny.sh index 2303faa..3dce55b 100755 --- a/buildd/grml-live_autobuild_grml-medium_lenny.sh +++ b/buildd/grml-live_autobuild_grml-medium_lenny.sh @@ -9,18 +9,5 @@ NAME=grml-medium SCRIPTNAME="$(basename $0)" ARCH=i386 -. /usr/share/grml-live/buildd/functions.sh || exit 1 - -# execute grml-live: -grml_live_run - -# create_logs -upload_logs - -iso_details - -send_mail - -store_iso - -bailout +# finally just source main file +. /usr/share/grml-live/buildd/execute.sh || exit 1 diff --git a/buildd/grml-live_autobuild_grml-medium_sid.sh b/buildd/grml-live_autobuild_grml-medium_sid.sh index 3b3b17c..ecd9614 100755 --- a/buildd/grml-live_autobuild_grml-medium_sid.sh +++ b/buildd/grml-live_autobuild_grml-medium_sid.sh @@ -9,18 +9,5 @@ NAME=grml-medium SCRIPTNAME="$(basename $0)" ARCH=i386 -. /usr/share/grml-live/buildd/functions.sh || exit 1 - -# execute grml-live: -grml_live_run - -# create_logs -upload_logs - -iso_details - -send_mail - -store_iso - -bailout +# finally just source main file +. /usr/share/grml-live/buildd/execute.sh || exit 1 diff --git a/buildd/grml-live_autobuild_grml-small_lenny.sh b/buildd/grml-live_autobuild_grml-small_lenny.sh index d070e3a..71d46c5 100755 --- a/buildd/grml-live_autobuild_grml-small_lenny.sh +++ b/buildd/grml-live_autobuild_grml-small_lenny.sh @@ -9,18 +9,5 @@ NAME=grml-small SCRIPTNAME="$(basename $0)" ARCH=i386 -. /usr/share/grml-live/buildd/functions.sh || exit 1 - -# execute grml-live: -grml_live_run -z - -# create_logs -upload_logs - -iso_details - -send_mail - -store_iso - -bailout +# finally just source main file +. /usr/share/grml-live/buildd/execute.sh || exit 1 diff --git a/buildd/grml-live_autobuild_grml-small_sid.sh b/buildd/grml-live_autobuild_grml-small_sid.sh index 9897c67..d86bc87 100755 --- a/buildd/grml-live_autobuild_grml-small_sid.sh +++ b/buildd/grml-live_autobuild_grml-small_sid.sh @@ -9,18 +9,5 @@ NAME=grml-small SCRIPTNAME="$(basename $0)" ARCH=i386 -. /usr/share/grml-live/buildd/functions.sh || exit 1 - -# execute grml-live: -grml_live_run -z - -# create_logs -upload_logs - -iso_details - -send_mail - -store_iso - -bailout +# finally just source main file +. /usr/share/grml-live/buildd/execute.sh || exit 1 diff --git a/buildd/grml-live_autobuild_grml64-large_lenny.sh b/buildd/grml-live_autobuild_grml64-large_lenny.sh index 517852a..4905d7a 100755 --- a/buildd/grml-live_autobuild_grml64-large_lenny.sh +++ b/buildd/grml-live_autobuild_grml64-large_lenny.sh @@ -9,22 +9,5 @@ NAME=grml64 SCRIPTNAME="$(basename $0)" ARCH=amd64 -. /usr/share/grml-live/buildd/functions.sh || exit 1 - -# execute grml-live: -grml_live_run - -# create_logs -upload_logs - -iso_details - -send_mail - -store_iso - -if [ "$RC" = "0" ] ; then - bailout -else - echo "building ISO failed, keeping build files [${OUTPUT_DIR}]" -fi +# finally just source main file +. /usr/share/grml-live/buildd/execute.sh || exit 1 diff --git a/buildd/grml-live_autobuild_grml64-large_sid.sh b/buildd/grml-live_autobuild_grml64-large_sid.sh index 02e1bf0..93d66da 100755 --- a/buildd/grml-live_autobuild_grml64-large_sid.sh +++ b/buildd/grml-live_autobuild_grml64-large_sid.sh @@ -9,18 +9,5 @@ NAME=grml64 SCRIPTNAME="$(basename $0)" ARCH=amd64 -. /usr/share/grml-live/buildd/functions.sh || exit 1 - -# execute grml-live: -grml_live_run - -# create_logs -upload_logs - -iso_details - -send_mail - -store_iso - -bailout +# finally just source main file +. /usr/share/grml-live/buildd/execute.sh || exit 1 diff --git a/buildd/grml-live_autobuild_grml64-medium_lenny.sh b/buildd/grml-live_autobuild_grml64-medium_lenny.sh index 58ca297..92a1c1b 100755 --- a/buildd/grml-live_autobuild_grml64-medium_lenny.sh +++ b/buildd/grml-live_autobuild_grml64-medium_lenny.sh @@ -9,18 +9,5 @@ NAME=grml64-medium SCRIPTNAME="$(basename $0)" ARCH=amd64 -. /usr/share/grml-live/buildd/functions.sh || exit 1 - -# execute grml-live: -grml_live_run - -# create_logs -upload_logs - -iso_details - -send_mail - -store_iso - -bailout +# finally just source main file +. /usr/share/grml-live/buildd/execute.sh || exit 1 diff --git a/buildd/grml-live_autobuild_grml64-medium_sid.sh b/buildd/grml-live_autobuild_grml64-medium_sid.sh index 44ca460..b43db25 100755 --- a/buildd/grml-live_autobuild_grml64-medium_sid.sh +++ b/buildd/grml-live_autobuild_grml64-medium_sid.sh @@ -9,18 +9,5 @@ NAME=grml64-medium SCRIPTNAME="$(basename $0)" ARCH=amd64 -. /usr/share/grml-live/buildd/functions.sh || exit 1 - -# execute grml-live: -grml_live_run - -# create_logs -upload_logs - -iso_details - -send_mail - -store_iso - -bailout +# finally just source main file +. /usr/share/grml-live/buildd/execute.sh || exit 1 diff --git a/buildd/grml-live_autobuild_grml64-small_lenny.sh b/buildd/grml-live_autobuild_grml64-small_lenny.sh index 26828f9..953f232 100755 --- a/buildd/grml-live_autobuild_grml64-small_lenny.sh +++ b/buildd/grml-live_autobuild_grml64-small_lenny.sh @@ -9,18 +9,5 @@ NAME=grml64-small SCRIPTNAME="$(basename $0)" ARCH=amd64 -. /usr/share/grml-live/buildd/functions.sh || exit 1 - -# execute grml-live: -grml_live_run -z - -# create_logs -upload_logs - -iso_details - -send_mail - -store_iso - -bailout +# finally just source main file +. /usr/share/grml-live/buildd/execute.sh || exit 1 diff --git a/buildd/grml-live_autobuild_grml64-small_sid.sh b/buildd/grml-live_autobuild_grml64-small_sid.sh index 814a954..fe6cbeb 100755 --- a/buildd/grml-live_autobuild_grml64-small_sid.sh +++ b/buildd/grml-live_autobuild_grml64-small_sid.sh @@ -9,18 +9,5 @@ NAME=grml64-small SCRIPTNAME="$(basename $0)" ARCH=amd64 -. /usr/share/grml-live/buildd/functions.sh || exit 1 - -# execute grml-live: -grml_live_run -z - -# create_logs -upload_logs - -iso_details - -send_mail - -store_iso - -bailout +# finally just source main file +. /usr/share/grml-live/buildd/execute.sh || exit 1 diff --git a/debian/changelog b/debian/changelog index 06f2b40..fdc371b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,14 @@ +grml-live (0.9.10) unstable; urgency=low + + * buildd: + - Add workaround to get around the mkisofs volume label limit. + Otherwise with something like 'grml64-medium-daily-squeeze 20090223' + we would get: + "mkisofs: Volume ID string too long (cur. XX max. 32 chars)." + - add buildd/execute.sh to further simplify buildd/*.sh setup + + -- Michael Prokop Tue, 24 Feb 2009 00:12:01 +0100 + grml-live (0.9.9) unstable; urgency=low * Update to kernel 2.6.28-grml[64]. @@ -59,7 +70,6 @@ grml-live (0.9.9) unstable; urgency=low * Always skip mksquashfs part when using -q option. * Adjust configuration files on the fly only when the according lines aren't comments. - * -- Michael Prokop Mon, 23 Feb 2009 12:43:18 +0100 diff --git a/grml-live b/grml-live index babdd4e..a36d734 100755 --- a/grml-live +++ b/grml-live @@ -14,7 +14,7 @@ export LC_ALL=C # exit on any error: set -e -GRML_LIVE_VERSION='0.9.9' +GRML_LIVE_VERSION='0.9.10' PN="$(basename $0)" CMDLINE="$0 $@" ISO_DATE="$(date +%Y-%m-%d)" -- 2.1.4