2002-07-11 22:01:44 +00:00
|
|
|
#!/bin/sh -e
|
1999-11-11 16:10:37 -01:00
|
|
|
|
2000-06-11 13:12:56 +00:00
|
|
|
# Script to build one arch
|
1999-11-11 16:10:37 -01:00
|
|
|
|
2004-06-29 22:13:17 +00:00
|
|
|
if [ -z "$CF" ] ; then
|
|
|
|
CF=CONF.sh
|
|
|
|
fi
|
|
|
|
. $CF
|
2000-06-11 13:12:56 +00:00
|
|
|
|
2006-11-22 23:34:27 -01:00
|
|
|
echo "Using defs from $CF" > /tmp/log
|
|
|
|
|
2004-08-20 09:19:49 +00:00
|
|
|
if [ -z "$COMPLETE" ] ; then
|
|
|
|
export COMPLETE=1
|
|
|
|
fi
|
|
|
|
|
2002-07-11 22:01:44 +00:00
|
|
|
if [ -n "$1" ] ; then
|
|
|
|
export ARCH=$1
|
|
|
|
fi
|
2000-06-11 13:12:56 +00:00
|
|
|
|
1999-11-11 16:10:37 -01:00
|
|
|
make distclean
|
|
|
|
make ${CODENAME}_status
|
2003-01-19 14:00:40 -01:00
|
|
|
if [ "$SKIPMIRRORCHECK" = "yes" ]; then
|
|
|
|
echo " ... WARNING: skipping mirror check"
|
|
|
|
else
|
|
|
|
echo " ... checking your mirror"
|
2006-10-07 00:11:28 +00:00
|
|
|
RET=""
|
|
|
|
make mirrorcheck-binary || RET=$?
|
|
|
|
if [ -z "$RET" ] && [ -z "$NOSOURCE" ]; then
|
|
|
|
make mirrorcheck-source || RET=$?
|
|
|
|
fi
|
|
|
|
if [ "$RET" ]; then
|
|
|
|
echo "ERROR: Your mirror has a problem, please correct it." >&2
|
|
|
|
exit 1
|
2003-01-19 14:00:40 -01:00
|
|
|
fi
|
2000-06-11 13:12:56 +00:00
|
|
|
fi
|
|
|
|
echo " ... selecting packages to include"
|
2004-07-11 09:34:59 +00:00
|
|
|
if [ -e ${MIRROR}/dists/${DI_CODENAME}/main/disks-${ARCH}/current/. ] ; then
|
|
|
|
disks=`du -sm ${MIRROR}/dists/${DI_CODENAME}/main/disks-${ARCH}/current/. | \
|
2001-12-16 22:15:07 -01:00
|
|
|
awk '{print $1}'`
|
|
|
|
else
|
|
|
|
disks=0
|
|
|
|
fi
|
2004-07-11 09:34:59 +00:00
|
|
|
if [ -f $BASEDIR/tools/boot/$DI_CODENAME/boot-$ARCH.calc ]; then
|
|
|
|
. $BASEDIR/tools/boot/$DI_CODENAME/boot-$ARCH.calc
|
2000-06-11 13:12:56 +00:00
|
|
|
fi
|
|
|
|
SIZE_ARGS=''
|
2004-07-09 14:50:34 +00:00
|
|
|
for CD in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do
|
2000-06-11 13:12:56 +00:00
|
|
|
size=`eval echo '$'"BOOT_SIZE_${CD}"`
|
|
|
|
[ "$size" = "" ] && size=0
|
|
|
|
[ $CD = "1" ] && size=$(($size + $disks))
|
2004-07-09 14:50:34 +00:00
|
|
|
mult=`eval echo '$'"SIZE_MULT_${CD}"`
|
|
|
|
[ "$mult" = "" ] && mult=100
|
2002-04-07 16:26:59 +00:00
|
|
|
FULL_SIZE=`echo "($DEFBINSIZE - $size) * 1024 * 1024" | bc`
|
2004-07-09 14:50:34 +00:00
|
|
|
echo "INFO: Reserving $size MB on CD $CD for boot files. SIZELIMIT=$FULL_SIZE."
|
|
|
|
if [ $mult != 100 ]; then
|
|
|
|
echo " INFO: Reserving "$((100-$mult))"% of the CD for extra metadata"
|
|
|
|
FULL_SIZE=`echo "$FULL_SIZE * $mult" / 100 | bc`
|
|
|
|
echo " INFO: SIZELIMIT now $FULL_SIZE."
|
|
|
|
fi
|
2002-04-07 16:26:59 +00:00
|
|
|
SIZE_ARGS="$SIZE_ARGS SIZELIMIT${CD}=$FULL_SIZE"
|
2000-06-11 13:12:56 +00:00
|
|
|
done
|
2004-07-09 14:50:34 +00:00
|
|
|
|
2002-04-07 16:26:59 +00:00
|
|
|
FULL_SIZE=`echo "($DEFSRCSIZE - $size) * 1024 * 1024" | bc`
|
2006-10-01 19:39:11 +00:00
|
|
|
|
|
|
|
LISTTARGET="list"
|
|
|
|
if [ -n "$NOSOURCE" ] ; then
|
|
|
|
LISTTARGET="bin-list"
|
|
|
|
fi
|
|
|
|
make $LISTTARGET $SIZE_ARGS SRCSIZELIMIT=$FULL_SIZE
|
|
|
|
|
|
|
|
# Setting IMAGETARGET directly is deprecated; NOSOURCE is preferred
|
2006-11-30 02:25:39 -01:00
|
|
|
if [ -z "$IMAGETARGET" ]; then
|
2006-11-29 21:57:52 -01:00
|
|
|
if [ -n "$NOSOURCE" ] ; then
|
|
|
|
IMAGETARGET="bin-official_images"
|
2006-12-04 10:41:28 -01:00
|
|
|
else
|
2006-11-29 21:57:52 -01:00
|
|
|
IMAGETARGET="official_images"
|
|
|
|
fi
|
2004-06-29 22:15:58 +00:00
|
|
|
fi
|
2006-12-04 10:41:28 -01:00
|
|
|
echo " ... building the images; using target(s) \"$IMAGETARGET\""
|
2004-10-06 20:38:25 +00:00
|
|
|
make $IMAGETARGET
|
2000-06-11 13:12:56 +00:00
|
|
|
|
|
|
|
make imagesums
|