have different dists
[camarabuntu.git] / bin / do_it_all.sh
blob81cbdf26f4b710193b6d1cc2f52b529f1e37a8ce
1 #!/bin/bash
3 set -e
5 stage=0
6 UPDATE_INSTALLER=
8 function usage {
9 cat <<FOO
10 $0 [ <options> ]
12 -i | update-installer - rsync the files to the network installer
13 -q | --qemu - run qemu
14 -v | --vmware - run vmware
16 default is to run all stages.
18 stages:
19 1: extract-cd-contents.sh
20 2: update_vanilla_cd.sh
21 3: add-debs-to-cd-image.py
22 4: make-cd-iso.py
23 5: qemu
25 FOO
30 while [ "$1" != "" ]; do
31 case $1 in
32 -h | --help ) usage
33 exit
35 -s | --) shift
36 stage=$1
38 -i | --update-installer ) UPDATE_INSTALLER=TRUE
40 -q | --qemu ) QEMU=TRUE
42 -v | --vmware ) VMWARE=TRUE
44 * ) usage
45 exit 1
46 esac
47 shift
48 done
51 base_dir=$(echo $0 | sed "s/$(basename $0)$//")
53 # read in configuration vars
54 . $base_dir/do_it_all.conf
56 if [ $stage -le 1 ] ; then
57 $base_dir/extract-cd-contents.sh $VANILLA_ISO $EXTRACTED_CD_DIR
60 if [ $stage -le 2 ] ; then
61 $base_dir/update_vanilla_cd.sh $GIT_DIR $EXTRACTED_CD_DIR
64 if [ "$UBUNTU_KEYRING" ] ; then
65 keyring_param="--ubuntu-keyring=$UBUNTU_KEYRING"
66 else
67 keyring_param=""
70 if [ $stage -le 3 ] ; then
71 $base_dir/add-debs-to-cd-image.py --cd-dir=$EXTRACTED_CD_DIR --gpg-key=$GPGKEY $keyring_param --indices=$INDICES_DIR $DEBS_DIR/*.deb
74 if [ $stage -le 4 ] ; then
75 if [ -n "$UPDATE_INSTALLER" ] ; then
76 echo "updating installer"
77 rsync -av $EXTRACTED_CD_DIR/ installer:/var/www/camarabuntu/6.06/
79 echo "creating iso"
80 $base_dir/make-cd-iso.py --iso-file=$OUTPUT_ISO --dir=$EXTRACTED_CD_DIR --name=Camarabuntu
83 if [ $stage -le 5 -a -n "$QEMU" ] ; then
84 sudo modprobe kqemu
85 [ -e /dev/kqemu ] || sudo mknod /dev/kqemu c 250 0
86 sudo chmod 666 /dev/kqemu
88 qemu -monitor stdio -cdrom $OUTPUT_ISO -hda $QEMU_HDA -boot d