2006-11-20 22:50:45 -01:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# testingcds (c) 2005 Santiago Garcia Mantinan <manty@manty.net>
|
|
|
|
#
|
2008-11-23 16:59:53 -01:00
|
|
|
# Updates since then by:
|
|
|
|
# Joey Hess <joey@kitenet.net>
|
|
|
|
# Steve McIntyre <steve@einval.com>
|
2006-11-20 22:50:45 -01:00
|
|
|
#
|
2008-11-23 16:59:53 -01:00
|
|
|
# GPL v2
|
2006-11-20 22:50:45 -01:00
|
|
|
#
|
2008-11-23 16:59:53 -01:00
|
|
|
# See cronjob.weekly and cronjob.daily for examples of how to call this script
|
2006-11-20 22:50:45 -01:00
|
|
|
|
2008-11-13 22:19:38 -01:00
|
|
|
#set -x
|
|
|
|
|
2010-11-14 14:17:33 -01:00
|
|
|
if [ "$CONF"x = ""x ] ; then
|
2019-02-19 17:05:47 -01:00
|
|
|
CONF=~/build.${CODENAME}/CONF.sh
|
2010-11-14 14:17:33 -01:00
|
|
|
fi
|
2008-11-13 22:19:38 -01:00
|
|
|
export CF=$CONF
|
2019-02-19 17:05:47 -01:00
|
|
|
|
2012-07-06 00:30:17 +00:00
|
|
|
if [ "$DCD_DIR"x = ""x ] ; then
|
2019-02-19 17:05:47 -01:00
|
|
|
DCD_DIR=~/build.${CODENAME}/debian-cd
|
2012-07-06 00:30:17 +00:00
|
|
|
fi
|
2006-11-20 22:50:45 -01:00
|
|
|
|
2010-07-02 23:24:56 +00:00
|
|
|
now () {
|
|
|
|
date -u +%F:%H:%M:%S
|
|
|
|
}
|
|
|
|
|
2006-11-20 22:50:45 -01:00
|
|
|
# Set up and cleaning
|
2008-11-13 22:19:38 -01:00
|
|
|
if [ $# -lt 1 ] ; then
|
|
|
|
echo $0 \$ARCH
|
|
|
|
echo "variables: PUBDIR[ISO|JIG]"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! "$DATE_BUILD" ] ; then
|
|
|
|
DATE_BUILD=`/bin/date -u +%Y%m%d`
|
2006-11-20 22:50:45 -01:00
|
|
|
fi
|
|
|
|
|
2008-11-13 22:19:38 -01:00
|
|
|
export ARCH="$1"
|
|
|
|
NUM_ARCHES=`echo $ARCH | wc -w`
|
2006-11-20 22:50:45 -01:00
|
|
|
|
2008-11-13 22:19:38 -01:00
|
|
|
if [ ! "$JIGDOFALLBACKURLS" ] ; then
|
|
|
|
export JIGDOFALLBACKURLS="Debian=http://us.cdimage.debian.org/cdimage/snapshot/Debian/"
|
2006-11-20 22:50:45 -01:00
|
|
|
fi
|
2008-11-13 22:19:38 -01:00
|
|
|
|
2006-11-20 22:50:45 -01:00
|
|
|
# $DI is used to set DI_CODENAME and also to specify the directory for images
|
2008-11-13 22:19:38 -01:00
|
|
|
if [ "$DI" ] ; then
|
|
|
|
export DI_CODENAME="$DI"
|
2006-11-20 22:50:45 -01:00
|
|
|
fi
|
|
|
|
|
2008-11-13 22:19:38 -01:00
|
|
|
export LOG="`pwd`/log/"
|
|
|
|
if [ "$NUM_ARCHES"x = "1"x ] ; then
|
|
|
|
export OUTARCH=$ARCH
|
2006-11-20 22:50:45 -01:00
|
|
|
else
|
2010-11-14 14:17:33 -01:00
|
|
|
export OUTARCH="multi-arch"
|
2008-11-13 22:19:38 -01:00
|
|
|
fi
|
|
|
|
export RUN="$INSTALLER_CD$DI$OUTARCH$LOGAPPEND"
|
|
|
|
export LOGFILE="$LOG/$RUN"
|
|
|
|
|
|
|
|
case "$INSTALLER_CD" in
|
|
|
|
1)
|
|
|
|
export DISKTYPE=BC;;
|
2019-02-19 17:05:47 -01:00
|
|
|
2|7|8|C|F|G|H)
|
2008-11-13 22:19:38 -01:00
|
|
|
export DISKTYPE=NETINST;;
|
2017-06-06 12:10:48 +00:00
|
|
|
3|6|I|J)
|
2008-11-13 22:19:38 -01:00
|
|
|
export OUT_TYPE=dvd
|
|
|
|
export DISKTYPE=DVD;;
|
|
|
|
4)
|
|
|
|
export DISKTYPE=kde-CD;;
|
|
|
|
5)
|
|
|
|
export DISKTYPE=xfce-CD;;
|
2008-12-05 13:12:17 -01:00
|
|
|
A)
|
|
|
|
export DISKTYPE=lxde-CD;;
|
2008-12-05 13:12:21 -01:00
|
|
|
B)
|
|
|
|
export DISKTYPE=xfce+lxde-CD;;
|
2019-02-19 17:05:47 -01:00
|
|
|
9|K|L)
|
2008-11-13 22:19:38 -01:00
|
|
|
export OUT_TYPE=bd
|
|
|
|
export DISKTYPE=BD;;
|
2012-07-06 00:30:17 +00:00
|
|
|
D)
|
|
|
|
export OUT_TYPE=dlbd
|
|
|
|
export DISKTYPE=DLBD;;
|
2015-04-20 11:41:47 +00:00
|
|
|
E)
|
|
|
|
export DISKTYPE=gnome-CD;;
|
2008-12-05 13:12:17 -01:00
|
|
|
*) export DISKTYPE=CD;;
|
2008-11-13 22:19:38 -01:00
|
|
|
esac
|
|
|
|
|
2017-06-06 12:10:48 +00:00
|
|
|
if [ "$DEBIAN_EDU"x = "1"x ] ; then
|
|
|
|
# Different logo for the debian-edu images
|
|
|
|
export LOGOPNG="$DCD_DIR/data/$DI_CODENAME/debian-edu-installer-logo.png"
|
|
|
|
export SPLASHPNG="$DCD_DIR/data/$DI_CODENAME/splash-skolelinux.png"
|
|
|
|
fi
|
|
|
|
|
2008-11-13 22:19:38 -01:00
|
|
|
if [ "$OUT_TYPE"x = ""x ] ; then
|
|
|
|
OUT_TYPE=cd
|
2006-11-20 22:50:45 -01:00
|
|
|
fi
|
|
|
|
|
2008-11-13 22:19:38 -01:00
|
|
|
export IMAGETARGET=official_images
|
2012-07-06 00:30:17 +00:00
|
|
|
cd $DCD_DIR && . $CONF
|
2006-11-20 22:50:45 -01:00
|
|
|
|
2008-11-13 22:19:38 -01:00
|
|
|
if [ "$OUT"x = ""x ] ; then
|
|
|
|
echo Config error
|
|
|
|
exit 1
|
|
|
|
fi
|
2006-11-20 22:50:45 -01:00
|
|
|
|
2010-11-14 14:17:33 -01:00
|
|
|
if [ "$BUILDNAME"x = ""x ] ; then
|
2019-02-19 17:05:47 -01:00
|
|
|
BUILDNAME="$OUT_TYPE"
|
2010-11-14 14:17:33 -01:00
|
|
|
fi
|
2019-02-19 17:05:47 -01:00
|
|
|
TRACEFILE="$BUILDNAME-trace"
|
|
|
|
echo " Making $ARCH ${DISKTYPE} (${BUILDNAME}) in $OUT"
|
2010-11-14 14:17:33 -01:00
|
|
|
|
2008-11-13 22:19:38 -01:00
|
|
|
if [ "$INSTALLER_CD" = "1" ] ; then
|
|
|
|
export OFFICIAL="Official BusinessCard Snapshot"
|
|
|
|
elif [ "$INSTALLER_CD" = "2" ] ; then
|
|
|
|
export OFFICIAL="Official NetInst Snapshot"
|
|
|
|
elif [ "$INSTALLER_CD" = "4" ]; then
|
|
|
|
export OFFICIAL="Official KDE CD Snapshot"
|
|
|
|
elif [ "$INSTALLER_CD" = "5" ]; then
|
|
|
|
export OFFICIAL="Official Xfce CD Snapshot"
|
2008-12-05 13:12:17 -01:00
|
|
|
elif [ "$INSTALLER_CD" = "A" ]; then
|
|
|
|
export OFFICIAL="Official LXDE CD Snapshot"
|
2008-12-05 13:12:21 -01:00
|
|
|
elif [ "$INSTALLER_CD" = "B" ]; then
|
|
|
|
export OFFICIAL="Official Xfce/LXDE CD Snapshot"
|
2008-11-13 22:19:38 -01:00
|
|
|
elif [ "$INSTALLER_CD" = "6" ]; then
|
|
|
|
export OFFICIAL="Official Multi-Arch DVD"
|
|
|
|
elif [ "$INSTALLER_CD" = "7" ]; then
|
|
|
|
export OFFICIAL="Official Multi-Arch Netinst"
|
|
|
|
elif [ "$INSTALLER_CD" = "8" ]; then
|
|
|
|
export OFFICIAL="Official Multi-Arch Netinst"
|
2010-07-02 23:24:56 +00:00
|
|
|
elif [ "$INSTALLER_CD" = "C" ]; then
|
|
|
|
export OFFICIAL="Unofficial Netinst including firmware"
|
2015-04-20 11:41:47 +00:00
|
|
|
elif [ "$INSTALLER_CD" = "E" ]; then
|
|
|
|
export OFFICIAL="Official Gnome CD Snapshot"
|
|
|
|
elif [ "$INSTALLER_CD" = "F" ]; then
|
|
|
|
export OFFICIAL="Official Mac Netinst"
|
2017-06-06 12:10:48 +00:00
|
|
|
elif [ "$INSTALLER_CD" = "G" ]; then
|
2019-02-19 17:05:47 -01:00
|
|
|
export OFFICIAL="Official Debian-Edu Netinst"
|
2017-06-06 12:10:48 +00:00
|
|
|
elif [ "$INSTALLER_CD" = "H" ]; then
|
2019-02-19 17:05:47 -01:00
|
|
|
export OFFICIAL="Unofficial Debian-Edu Netinst including firmware"
|
2017-06-06 12:10:48 +00:00
|
|
|
elif [ "$INSTALLER_CD" = "I" ]; then
|
|
|
|
export OFFICIAL="Unofficial DVD including firmware"
|
|
|
|
elif [ "$INSTALLER_CD" = "J" ]; then
|
|
|
|
export OFFICIAL="Unofficial Multi-Arch DVD including firmware"
|
2019-02-19 17:05:47 -01:00
|
|
|
elif [ "$INSTALLER_CD" = "K" ]; then
|
|
|
|
export OFFICIAL="Debian-Edu Full USB image"
|
|
|
|
elif [ "$INSTALLER_CD" = "L" ]; then
|
|
|
|
export OFFICIAL="Unofficial Debian-Edu Full USB image including firmware"
|
2008-11-13 22:19:38 -01:00
|
|
|
fi
|
2006-11-20 22:50:45 -01:00
|
|
|
|
|
|
|
rm -rf "$OUT"
|
|
|
|
mkdir -p "$OUT"
|
2010-11-14 14:17:33 -01:00
|
|
|
rm -f "$PUBDIRJIG"/$OUTARCH/$TRACEFILE
|
2008-11-13 22:19:38 -01:00
|
|
|
#mkdir -p "$LOG"
|
2006-11-20 22:50:45 -01:00
|
|
|
|
|
|
|
overview_log="$LOG/overview"
|
|
|
|
overview () {
|
|
|
|
if [ -e $overview_log ]; then
|
|
|
|
grep -v " $1 " $overview_log > $overview_log.new
|
|
|
|
mv $overview_log.new $overview_log
|
|
|
|
fi
|
|
|
|
LANG=C echo "$(dpkg --print-architecture) ($(date)) $(whoami)@$(hostname | cut -d . -f 1) $1 $2" >> $overview_log
|
|
|
|
}
|
|
|
|
|
2008-11-13 22:19:38 -01:00
|
|
|
> $LOGFILE
|
2006-11-20 22:50:45 -01:00
|
|
|
|
2015-04-20 11:41:47 +00:00
|
|
|
# Make sure we have an extension for all builds, so we don't have
|
|
|
|
# multiple processes tripping over each other when generating checksum
|
|
|
|
# files
|
|
|
|
if [ "$INSTALLER_CD" = ""x ] ; then
|
|
|
|
SUMS_EXTENSION=".cd"
|
|
|
|
else
|
|
|
|
SUMS_EXTENSION=".${INSTALLER_CD}"
|
|
|
|
fi
|
|
|
|
|
2017-06-06 12:10:48 +00:00
|
|
|
if [ "$FORCE_FIRMWARE"x = "1"x ] ; then
|
|
|
|
if [ "${DI}" = "sid" ] ; then
|
|
|
|
ARCHDIR=$OUT_FW_SID/$OUTARCH
|
|
|
|
else
|
|
|
|
ARCHDIR=$OUT_FW_TST/$OUTARCH
|
|
|
|
fi
|
|
|
|
else # non-FW build
|
|
|
|
if [ "${DI}" = "sid" ] ; then
|
|
|
|
ARCHDIR=$OUT_FREE_SID/$OUTARCH
|
|
|
|
else
|
|
|
|
ARCHDIR=$OUT_FREE_TST/$OUTARCH
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2006-11-20 22:50:45 -01:00
|
|
|
# Do the actual building
|
2010-11-14 14:17:33 -01:00
|
|
|
START=`now`
|
2008-11-13 22:19:38 -01:00
|
|
|
if ./build.sh "$ARCH" >>"$LOGFILE" 2>&1 ; then
|
|
|
|
# if it went ok get things ready for publishing
|
|
|
|
# we treat the daily netinst images in a different way
|
2017-06-06 12:10:48 +00:00
|
|
|
if [ "$DISKTYPE" = "NETINST" ] || \
|
|
|
|
[ "$DISKTYPE" = "BC" ] ; then
|
2008-11-13 22:19:38 -01:00
|
|
|
|
|
|
|
##################################
|
2009-08-22 22:44:44 +00:00
|
|
|
# NETINST STUFF
|
2008-11-13 22:19:38 -01:00
|
|
|
##################################
|
|
|
|
|
2013-04-30 18:54:11 +00:00
|
|
|
mkdir -p $ARCHDIR/list-cd $ARCHDIR/jigdo-cd $ARCHDIR/iso-cd
|
2008-11-13 22:19:38 -01:00
|
|
|
# put the isos and jigdos in their place
|
2013-04-30 18:54:11 +00:00
|
|
|
|
2008-11-13 22:19:38 -01:00
|
|
|
for i in "$OUT"/*-1.iso; do
|
|
|
|
BASE=`basename $i .iso`
|
|
|
|
NETINSTNAME=`echo $BASE | sed 's/-BC-1/-businesscard/g;s/-NETINST-1/-netinst/g'`
|
2010-11-14 14:17:33 -01:00
|
|
|
mv $OUT/$BASE.iso $ARCHDIR/iso-cd/$NETINSTNAME.iso
|
2008-11-13 22:19:38 -01:00
|
|
|
cat $OUT/$BASE.jigdo | \
|
|
|
|
sed 's/-BC-1/-businesscard/g;s/-NETINST-1/-netinst/g' | \
|
2010-11-14 14:17:33 -01:00
|
|
|
gzip --best --no-name > $ARCHDIR/jigdo-cd/$NETINSTNAME.jigdo
|
2008-11-13 22:19:38 -01:00
|
|
|
rm $OUT/$BASE.jigdo
|
2010-11-14 14:17:33 -01:00
|
|
|
mv $OUT/$BASE.template $ARCHDIR/jigdo-cd/$NETINSTNAME.template
|
2010-07-02 23:24:56 +00:00
|
|
|
# Make sure that the ISO is as new/newer than the jigdo file; #587774
|
2010-11-14 14:17:33 -01:00
|
|
|
touch $ARCHDIR/iso-cd/$NETINSTNAME.iso
|
2012-07-06 00:30:17 +00:00
|
|
|
mv $OUT/$BASE.list.gz $ARCHDIR/list-cd/$NETINSTNAME.list.gz
|
2008-11-13 22:19:38 -01:00
|
|
|
done
|
|
|
|
rm -f "$OUT"/*
|
2010-11-14 14:17:33 -01:00
|
|
|
END=`now`
|
|
|
|
mkdir -p "$PUBDIRJIG"/$OUTARCH
|
2012-07-06 00:30:17 +00:00
|
|
|
echo -e "start=$START\nend=$END\nerror=0\nlogfile=$RUN\n" > "$PUBDIRJIG"/$OUTARCH/$TRACEFILE
|
2010-11-14 14:17:33 -01:00
|
|
|
|
2006-11-20 22:50:45 -01:00
|
|
|
else
|
|
|
|
|
2008-11-13 22:19:38 -01:00
|
|
|
#######################################
|
|
|
|
# NORMAL STUFF - full builds (weekly)
|
|
|
|
#######################################
|
2006-11-20 22:50:45 -01:00
|
|
|
|
2008-11-13 22:19:38 -01:00
|
|
|
# finish up the jigdos (compress & move them)
|
|
|
|
gzip --best --no-name "$OUT"/*.jigdo
|
|
|
|
for i in "$OUT"/*.jigdo.gz; do
|
|
|
|
mv $i ${i%.gz}
|
|
|
|
done
|
2006-11-20 22:50:45 -01:00
|
|
|
|
2010-07-02 23:24:56 +00:00
|
|
|
# Make sure that the ISOs are as new/newer than the jigdo files; #587774
|
2010-11-14 14:17:33 -01:00
|
|
|
for file in "$OUT"/*.iso; do
|
|
|
|
if [ -e $file ] ; then
|
|
|
|
touch $file
|
|
|
|
fi
|
|
|
|
done
|
2010-07-02 23:24:56 +00:00
|
|
|
|
2017-06-06 12:10:48 +00:00
|
|
|
mkdir -p $ARCHDIR/jigdo-${OUT_TYPE}
|
|
|
|
mv "$OUT"/*.template $ARCHDIR/jigdo-${OUT_TYPE}
|
|
|
|
mv "$OUT"/*.jigdo $ARCHDIR/jigdo-${OUT_TYPE}
|
2006-11-20 22:50:45 -01:00
|
|
|
|
2017-06-06 12:10:48 +00:00
|
|
|
mkdir -p $ARCHDIR/iso-${OUT_TYPE}
|
2013-04-30 18:54:11 +00:00
|
|
|
for file in "$OUT"/*.iso; do
|
|
|
|
if [ -e $file ] ; then
|
2017-06-06 12:10:48 +00:00
|
|
|
mv $file $ARCHDIR/iso-${OUT_TYPE}
|
2013-04-30 18:54:11 +00:00
|
|
|
fi
|
|
|
|
done
|
2006-11-20 22:50:45 -01:00
|
|
|
|
2017-06-06 12:10:48 +00:00
|
|
|
mkdir -p $ARCHDIR/list-${OUT_TYPE}
|
|
|
|
mv "$OUT"/*list*gz $ARCHDIR/list-${OUT_TYPE}
|
2012-07-06 00:30:17 +00:00
|
|
|
|
2010-11-14 14:17:33 -01:00
|
|
|
END=`now`
|
2012-07-06 00:30:17 +00:00
|
|
|
echo -e "start=$START\nend=$END\nerror=0\nlogfile=$RUN\n" > "$PUBDIRJIG"/$OUTARCH/$TRACEFILE
|
2008-11-13 22:19:38 -01:00
|
|
|
fi
|
2006-11-20 22:50:45 -01:00
|
|
|
|
2008-11-23 17:57:25 -01:00
|
|
|
touch $TDIR/$CODENAME/1.pkgs_extracted # so we don't get errors below
|
|
|
|
for file in `cat $TDIR/$CODENAME/*.pkgs_extracted | sort | uniq`; do
|
|
|
|
basefile=`basename $file`
|
|
|
|
if [ ! -e $EXTRACTED_SOURCES/$file ] ; then
|
2008-11-24 22:10:36 -01:00
|
|
|
cp -a $MIRROR/$file $EXTRACTED_SOURCES
|
2008-11-23 17:57:25 -01:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2008-11-13 22:19:38 -01:00
|
|
|
# Mail the sizes of the images
|
|
|
|
if [ -e "../.debian-cd.mail" ] ; then
|
|
|
|
MYEMAIL=`grep -v "^#" "../.debian-cd.mail"`
|
|
|
|
else
|
|
|
|
MYEMAIL=`whoami`
|
|
|
|
fi
|
2006-11-20 22:50:45 -01:00
|
|
|
|
2008-11-13 22:19:38 -01:00
|
|
|
for i in $MYEMAIL
|
|
|
|
do
|
2019-02-19 17:05:47 -01:00
|
|
|
grep -e "extents written" -e "Written to medi." "$LOGFILE"|mail -s "$RELEASE_BUILD testingcds $RUN ($OUTARCH $BUILDNAME) went ok" "$i"
|
2008-11-13 22:19:38 -01:00
|
|
|
done
|
|
|
|
overview "$RUN" success
|
2006-11-20 22:50:45 -01:00
|
|
|
|
|
|
|
else
|
2008-11-13 22:19:38 -01:00
|
|
|
# Run failed
|
|
|
|
if [ -e "../.debian-cd.mail" ] ; then
|
|
|
|
MYEMAIL=`grep -v "^#" "../.debian-cd.mail"`
|
|
|
|
else
|
|
|
|
MYEMAIL=`whoami`
|
|
|
|
fi
|
|
|
|
for i in $MYEMAIL
|
|
|
|
do
|
|
|
|
(echo Error when trying to create cds for $RUN ; cat $LOGFILE) | \
|
2019-02-19 17:05:47 -01:00
|
|
|
mail -s "$RELEASE_BUILD testingcds $RUN ($OUTARCH $BUILDNAME) has failed; log included" "$i"
|
2008-11-13 22:19:38 -01:00
|
|
|
done
|
|
|
|
overview "$RUN" failed
|
2010-11-14 14:17:33 -01:00
|
|
|
END=`now`
|
2010-07-02 23:24:56 +00:00
|
|
|
mkdir -p "$PUBDIRJIG"/$OUTARCH
|
2012-07-06 00:30:17 +00:00
|
|
|
echo -e "start=$START\nend=$END\nerror=1\nlogfile=$RUN\n" > "$PUBDIRJIG"/$OUTARCH/$TRACEFILE
|
2010-07-02 23:24:56 +00:00
|
|
|
exit 1
|
2006-11-20 22:50:45 -01:00
|
|
|
fi
|