summaryrefslogtreecommitdiff
path: root/package/build.ubuntu-32
diff options
context:
space:
mode:
authorjihye kim <jihye1128.kim@samsung.com>2012-09-18 15:25:34 +0900
committerjihye kim <jihye1128.kim@samsung.com>2012-09-18 15:25:34 +0900
commit55b7080ed41cb325b40b143974e854cbaec36b28 (patch)
tree3a7cdc0ba3e8d87ea10c2b8621efda9d63563d70 /package/build.ubuntu-32
parent8c14a59ae34795e831c0fb927b786299986f75b2 (diff)
downloademulator-storages-55b7080ed41cb325b40b143974e854cbaec36b28.tar.gz
emulator-storages-55b7080ed41cb325b40b143974e854cbaec36b28.tar.bz2
emulator-storages-55b7080ed41cb325b40b143974e854cbaec36b28.zip
upload 2.0 alpha source2.0_alphamaster2.0alpha
Change-Id: I6ec083dedf0eec450b79fcf808998495b9a27833
Diffstat (limited to 'package/build.ubuntu-32')
-rwxr-xr-xpackage/build.ubuntu-3282
1 files changed, 82 insertions, 0 deletions
diff --git a/package/build.ubuntu-32 b/package/build.ubuntu-32
new file mode 100755
index 0000000..d5a6150
--- /dev/null
+++ b/package/build.ubuntu-32
@@ -0,0 +1,82 @@
+#!/bin/sh -xe
+# clean
+set_var () {
+ echo ==== Init ====
+ BASE_DIR=`pwd`
+ echo $BASE_DIR
+ PKG_DIR=$BASE_DIR/EMUL_PKG
+ PKG_BIN_DIR=$PKG_DIR/data/tools/emulator
+ SWAP_IMG_NAME="swap.img"
+ SWAP_DIR=$PKG_BIN_DIR/storages/swap
+
+ mkdir -p $PKG_BIN_DIR/storages/sdcard
+ mkdir -p $SWAP_DIR
+}
+
+create_sdcard_image () {
+ echo ==== Start creating sdcard image ====
+ cd $PKG_BIN_DIR/storages/sdcard
+ qemu-img create -f raw raw_4G.img 4G
+ mkfs.ext3 -F raw_4G.img
+ qemu-img convert -O qcow2 raw_4G.img sdcard_4G.img
+ rm raw_4G.img
+
+ qemu-img create -f raw raw_8G.img 8G
+ mkfs.ext3 -F raw_8G.img
+ qemu-img convert -O qcow2 raw_8G.img sdcard_8G.img
+ rm raw_8G.img
+
+ qemu-img create -f raw raw_16G.img 16G
+ mkfs.ext3 -F raw_16G.img
+ qemu-img convert -O qcow2 raw_16G.img sdcard_16G.img
+ rm raw_16G.img
+
+ qemu-img create -f raw raw_32G.img 32G
+ mkfs.ext3 -F raw_32G.img
+ qemu-img convert -O qcow2 raw_32G.img sdcard_32G.img
+ rm raw_32G.img
+ echo ==== Finish creating sdcard image ====
+}
+
+check_swap_image () {
+ echo ==== Start checking swap image ====
+ if [ -f ${BASE_DIR}/${SWAP_IMG_NAME} ]
+ then
+ cp "${BASE_DIR}/${SWAP_IMG_NAME}" "${SWAP_DIR}/${SWAP_IMG_NAME}"
+ else
+ echo "CAUTION!! There's no ${SWAP_IMG_NAME} file."
+ echo "Packaging is failed."
+ exit 1;
+ fi
+ echo ==== Finish checking swap image ====
+}
+
+set_var
+
+clean()
+{
+ echo "$SRCDIR"
+ rm -rf $PKG_DIR
+ rm -rf $BASE_DIR/*.zip
+ rm -rf $BASE_DIR/package/emulator-storages.package.$TARGET_OS
+}
+
+# build
+build()
+{
+ create_sdcard_image
+ check_swap_image
+}
+
+# install
+install()
+{
+ mkdir -p $SRCDIR/package/emulator-storages.package.$TARGET_OS
+ cp -r $PKG_DIR/* $SRCDIR/package/emulator-storages.package.$TARGET_OS/
+}
+
+[ "$1" = "clean" ] && clean
+[ "$1" = "build" ] && build
+[ "$1" = "install" ] && install
+
+echo "success"