#!/bin/bash
set -e

## Wrapper script for build.sh to build deepin server instalation cd.

BASEDIR=$(dirname $(dirname $(dirname $(readlink -f $(which $0)))))
pushd $BASEDIR

export CF=$BASEDIR/deepin/2015/CONF.sh
. $CF
export DEBIAN_CD_CONF_SOURCED=true

# The architecture(s) for which to build the CD/DVD image
ARCHES=amd64

## The debian-installer images to use. This must match the suite (DI_CODENAME)
## from which udebs will be taken.
## Use *only one* of the next four settings. The "%ARCH%" placeholder in the
## 2nd and 4th options will be magically expanded at runtime.
## See also: tools/boot/<codename>/boot-$ARCH scripts.

# Use official images from the local mirror
#export DI_DIST=$DI_CODENAME
# or, use official images from an outside mirror
#export DI_WWW_HOME="http://ftp.nl.debian.org/debian/dists/$DI_CODENAME/main/installer-%ARCH%/current/images/"
# or, use daily built d-i images (most from http://people.debian.org)
#export DI_WWW_HOME=default
# or, use custom / locally built images
#export DI_DIR="$HOME/mirrors/d-i/deepin/%ARCH%/"
export DI_DIR=/data/project/debian-installer/build/dest/

export DISKTYPE=DVD
export TASK=Deepin-DVD

./build.sh $ARCHES
