[eeepc-i386-ubuntu-hardy-ppa] Added medibuntu.list for proprietary multimedia packages
[moblin-image-creator.eeepc.git] / build-clean-target.sh
blob9db2ea1d0e97a3b75f94415333d6a1645d7c3962
1 #!/bin/bash
3 PROJECT=$1
4 shift
6 PLATFORM=$1
7 shift
9 PPATH=$1
10 shift
12 FSET=$1
13 shift
15 IMAGE=$1
16 shift
18 if [ "`/usr/bin/whoami`" != "root" ]; then
19 echo "You must be root to run this script!"
20 exit 1
23 if [ -z "${PROJECT}" ] || [ -z "${PLATFORM}" ] || [ -z "${PPATH}" ] || [ -z "${FSET}" ]; then
24 echo ""
25 echo "USAGE: $0 projectname platformname path fset [image-name | 'xephyr']"
26 echo " projectname Name of project"
27 echo " platformname menlow-lpia or mccaslin-lpia"
28 echo " path Destination directory (needs ~1.5GB free, or ~2GB if creating image)"
29 echo " fset e.g. samsung-full-mobile-stack or crownBeach-full-mobile-stack"
30 echo " image | 'xephyr' Name of image file OR 'xephyr' to skip image creation and start xephyr"
31 echo ""
32 exit 1
35 if [ -z "${IMAGE}" ]; then
36 echo -e "\033[1m No image file name given. Image will NOT be created.\033[0m"
40 if [ -e ${PPATH} ]; then
41 echo "ERROR: Path already exists!"
42 exit 1
45 for i in `image-creator -c list-projects`; do
46 if [ $i = ${PROJECT} ]; then
47 echo "ERROR: A project called ${PROJECT} already exists!"
48 exit 1
50 done
52 FOUND=0
53 for i in `image-creator -c list-platforms`; do
54 if [ $i = ${PLATFORM} ]; then
55 FOUND=1
57 done
58 if [ ${FOUND} -eq 0 ]; then
59 echo "ERROR: A platform of the name ${PLATFORM} does not exists!"
60 echo "Available platforms include:"
61 image-creator -c list-platforms
62 exit 1
65 FOUND=0
66 for i in `image-creator -c list-fsets --platform-name ${PLATFORM}`; do
67 if [ $i = ${FSET} ]; then
68 FOUND=1
70 done
71 if [ ${FOUND} -eq 0 ]; then
72 echo "ERROR: A fset of the name ${FSET} does not exists!"
73 echo "Available fsets include:"
74 image-creator -c list-fsets --platform-name ${PLATFORM}
75 exit 1
78 echo "Building..."
79 echo -e "\tPlatform = ${PLATFORM}"
80 echo -e "\tPROJECT = ${PROJECT}"
81 echo -e "\tPPATH = ${PPATH}"
82 echo -e "\tFSET = ${FSET}"
83 echo -e "\tIMAGE = ${IMAGE}"
85 echo "Creating a new project..."
86 image-creator -c create-project \
87 --project-name ${PROJECT} \
88 --project-description "Clean build of ${PROJECT}" \
89 --project-path ${PPATH} \
90 --platform-name ${PLATFORM} \
91 --bypass-rootstrap
92 if [ $? != 0 ]; then
93 echo "Bailing out on project creation error!"
94 exit 1
96 echo "Successfully created project '${PROJECT}'"
98 echo "Creating a new target..."
99 image-creator -c create-target \
100 --project-name ${PROJECT} \
101 --target-name "test" \
102 --bypass-rootstrap
103 if [ $? != 0 ]; then
104 echo "Bailing out on target creation error!"
105 exit 1
107 echo "Successfully created target 'test'"
109 echo "Installing a new fset..."
110 image-creator -c install-fset \
111 --project-name ${PROJECT} \
112 --target-name "test" \
113 --fset-name ${FSET}
114 if [ $? != 0 ]; then
115 echo "Bailing out on fset install error!"
116 exit 1
118 echo "Successfully installed FSET '${FSET}'"
120 if [ -z "${IMAGE}" ]; then
121 echo "No image specified. None created."
122 exit 1
124 if [ ${IMAGE} == 'xephyr' ]; then
125 xhost +SI:localuser:root
126 image-creator --command run-target --project-name ${PROJECT} --target-name test --run-command ume-xephyr-start
127 exit 1
130 echo "Creating a new install USB key..."
131 image-creator -c create-install-usb \
132 --project-name ${PROJECT} \
133 --target-name "test" \
134 --image-name ${IMAGE}
135 if [ $? != 0 ]; then
136 echo "Bailing out on usb install creation error!"
137 exit 1
139 echo "Succesfully built a USB install image at:"
140 echo "${PPATH}/targets/test/fs/image/${IMAGE}"