Mybuild

From LocalizationWiki

#! /bin/sh
# Custom wrapper script for build.sh.
# See also CONF.sh for the meaning of variables used here.
IMAGE_TYPE="$1"
# The directory that contains the debian-cd code
export BASEDIR=$(pwd)
# The architecture for which to build the CD/DVD image
export ARCH=i386
# The path to the local mirror
export MIRROR=/srv/debmirror/debian
# The suite the installed system will be based on
export CODENAME=etch
# The suite the udebs for the installer will be taken from
export DI_CODENAME=etch
# D-I images will be retrieved from $MIRROR/dists/$DI_DIST/main/installer-$ARCH
# (unless DI_WWW_HOME or DI_DIR or LOCAL are set)
export DI_DIST=etch
# We should use the correct version of debootstrap to build the CD image.
DEBOOTUDEB=$(zcat $MIRROR/dists/$CODENAME/main/debian-installer/binary-$ARCH/Packages.gz | \
            /bin/sed -n \
            's/Filename: \(pool\/main\/d\/debootstrap\/debootstrap-udeb.*udeb\)$/\1/p')
if [ -z "$DEBOOTUDEB" ]; then
       exit 1
fi
echo Using ${DEBOOTUDEB##*/} to get packages used by d-i.
rm -rf ../debootstrap
dpkg -x "$MIRROR/$DEBOOTUDEB" /srv/debian-cd/debootstrap
export PATH="/srv/debian-cd/debootstrap/usr/sbin:$PATH"
export DEBOOTSTRAP_DIR="/srv/debian-cd/debootstrap/usr/lib/debootstrap/"
# Upgrade debian-installer's task files
if [ -d tasks ]; then
       cd tasks
       ../tools/generate_di_list
       ../tools/generate_di+k_list
       cd ..
else
       echo "Error: cannot find tasks directory"
       exit 1
fi
# Set configuration file to be used by build.sh
export CF=CONF-dzongkha.sh
# Set variables that determine the type of image to be built
case $IMAGE_TYPE in
   bc)
       export COMPLETE=0
       export TASK=tasks/debian-installer-$DI_CODENAME
       export INSTALLER_CD=1
       ;;
   netinst)
       export COMPLETE=0
       export TASK=tasks/debian-installer+kernel-$DI_CODENAME
       export INSTALLER_CD=2
       ;;
   full)
       export COMPLETE=1
       export TASK=tasks/debian-installer+kernel-$DI_CODENAME
       unset INSTALLER_CD
       ;;
   dvd)
       export COMPLETE=1
       export TASK=tasks/debian-installer+kernel-$DI_CODENAME
       export INSTALLER_CD=3
       export DEFBINSIZE=4440
       export DEFSRCSIZE=4432
       ;;
    *)
       echo "Usage: mybuild bc|netinst|full|dvd"
       exit 1
       ;;
esac
# Setting for sid CDs (to use daily images from http://people.debian.org)
# See tools/boot/etch/boot-$ARCH scripts
#DI_WWW_HOME=default
./build.sh