18 if [ "`/usr/bin/whoami`" != "root" ]; then
19 echo "You must be root to run this script!"
23 if [ -z "${PROJECT}" ] || [ -z "${PLATFORM}" ] || [ -z "${PPATH}" ] || [ -z "${FSET}" ]; then
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"
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!"
45 for i
in `image-creator -c list-projects`; do
46 if [ $i = ${PROJECT} ]; then
47 echo "ERROR: A project called ${PROJECT} already exists!"
53 for i
in `image-creator -c list-platforms`; do
54 if [ $i = ${PLATFORM} ]; then
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
66 for i
in `image-creator -c list-fsets --platform-name ${PLATFORM}`; do
67 if [ $i = ${FSET} ]; then
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}
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} \
93 echo "Bailing out on project creation error!"
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" \
104 echo "Bailing out on target creation error!"
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" \
115 echo "Bailing out on fset install error!"
118 echo "Successfully installed FSET '${FSET}'"
120 if [ -z "${IMAGE}" ]; then
121 echo "No image specified. None created."
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
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}
136 echo "Bailing out on usb install creation error!"
139 echo "Succesfully built a USB install image at:"
140 echo "${PPATH}/targets/test/fs/image/${IMAGE}"