Turn off preview image.
[profile/ivi/image-configurations-panda.git] / scripts / create-daily.sh
1 #!/bin/sh
2 #
3 #A simple script to batch generate all release-able images for MeeGo. 
4 #
5 #This script will check out all MeeGo Image Kickstart files and execute 
6 #image generation based on repository type selected for all release-able images. 
7 #
8 # Written for MeeGo by Chris Ferron <chris.e.ferron@linux.intel.com> based on an initial
9 # effort buy Anas Nashif.
10
11
12 ID=$1
13 REPOTYPE=$2
14 RELEASE=$3
15
16 # Preparation Section
17 #export http_proxy=http://192.168.50.99:3128/
18
19 rm -f *.log
20
21 if [ "$RELEASE" = "MeeGo1.1" ]; then
22    git checkout -f MeeGo1.1 
23 elif [ "$RELEASE" = "Trunk" ]; then 
24    git checkout -f master
25 else
26    git checkout -f master
27    echo "No release type given, default to Trunk. Current support is for Trunk and MeeGo1.1"
28 fi
29
30 git pull
31
32
33 if [ "$REPOTYPE" = "1" ]; then
34   str="s/\@BUILD_ID\@/$ID/"
35 elif [ "$REPOTYPE" = "2" ]; then 
36   str="s/\@BUILD_ID\@/preview/"
37 elif [ "$REPOTYPE" = "3" ]; then 
38   str="s/\@BUILD_ID\@/daily/" 
39 elif [ "$REPOTYPE" = "4" ]; then 
40   # Replace .ks to use the trunk-daily repos
41   echo "Creating trunk-daily image-configurations"
42   str="s/repo.meego.com\/MeeGo/download.meego.com\/trunk-daily/"
43   find -name \*.ks -exec perl  -pi -e $str '{}' \;
44   str="s/\@BUILD_ID\@/$ID/"
45 elif [ "$REPOTYPE" = "5" ]; then 
46   # Replace .ks to use the test-daily repos
47   echo "Creating testing-daily image-configurations"
48   str="s/repo.meego.com\/MeeGo/download.meego.com\/testing-daily/"
49   find -name \*.ks -exec perl  -pi -e $str '{}' \;
50   str="s/\@BUILD_ID\@/$ID/"
51 else
52  echo " Repository Type needs to be 1 for Weekly or 4 for trunk-daily or 5 for testing-daily" 
53  exit 1 
54 fi
55
56 find -name \*.ks -exec perl  -pi -e $str '{}' \;
57
58 # mk_image expects at minimal, one arg- the first arg must be the path to the ks file.
59 # all further args are passed through to 'mic create'
60 # finally, a --release argument is automatically prepended.
61 mk_image() {
62    local ks="$1";
63    shift
64    local name="meego-$(basename "$ks")"
65    name="${name%.ks}"
66    local dirname="$(dirname "$ks")"
67    rm -rf "${ID}/${dirname}/images/${name}"
68    mic create -c "$ks" --release="${ID}" "$@" 2>&1 | tee "${name}-${ID}.log"
69    if [ ! -d "${ID}/${dirname}/images/${name}" ]; then
70       echo "error: no ${ID}/${dirname}/images/${name} directory created"
71       return 1
72    fi
73    md5sum "${name}-${ID}.log" >> "${ID}/${dirname}/images/${name}/MANIFEST"
74    cp "${name}-${ID}.log" "$ID/${dirname}/images/${name}/"
75 }
76
77
78 #Core Image Section
79 #mk_image core/core-armv7l-n900.ks -f raw --save-kernel --arch armv7
80 mk_image core/core-armv7l-madde-sysroot.ks --format=fs --compress-disk-image=none --package=tar.bz2 --arch=armv7l --save-kernel
81 mk_image core/core-ia32-madde-sysroot.ks --format=fs --compress-disk-image=none --package=tar.bz2
82
83 #Netbook Image Section
84 mk_image netbook/netbook-ia32.ks -f livecd
85 mk_image netbook/netbook-ia32-qemu.ks --format=raw --compress-disk-image=none --package=tar.bz2
86
87 #IVI Image Section
88 mk_image ivi/ivi-ia32.ks -f livecd
89
90 #Handset Image Section
91 #mk_image handset/handset-ia32-aava-mtf.ks -f nand
92 mk_image handset/handset-ia32-mtf.ks -f nand
93 #mk_image handset/handset-ia32-aava-mtf-devel.ks -f nand
94 mk_image handset/handset-ia32-mtf-devel.ks -f nand
95 mk_image handset/handset-armv7l-n900.ks -f raw --save-kernel --arch=armv7l
96 mk_image handset/handset-armv7l-n900-devel.ks -f raw --save-kernel --arch=armv7l
97 mk_image handset/handset-armv7hl-n900.ks -f raw --save-kernel --arch=armv7hl
98 mk_image handset/handset-ia32-pinetrail-mtf.ks -f livecd
99 mk_image handset/handset-armv7l-qemu.ks --format=raw --compress-disk-image=none --package=tar.bz2 --arch=armv7l --save-kernel
100 mk_image handset/handset-ia32-qemu.ks --format=raw --compress-disk-image=none --package=tar.bz2
101 mk_image handset/handset-armv7l-madde-sysroot.ks --format=fs --compress-disk-image=none --package=tar.bz2 --arch=armv7l --save-kernel
102 mk_image handset/handset-ia32-madde-sysroot.ks --format=fs --compress-disk-image=none --package=tar.bz2
103
104 exit 0