From 0ac37a393a64a784cab20e74c63d0188776b62fc Mon Sep 17 00:00:00 2001 From: jihye kim Date: Tue, 24 Jul 2012 14:35:58 +0900 Subject: [Title] add build script for 64bit machine [Type] Enhancement [Module] emulator sdcard [Priority] major [Jira#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] --- package/build.ubuntu-32 | 4 --- package/build.ubuntu-64 | 82 ++++++++++++++++++++++++++++++++++++++++++++++++ package/pkginfo.manifest | 5 +++ 3 files changed, 87 insertions(+), 4 deletions(-) create mode 100755 package/build.ubuntu-64 (limited to 'package') diff --git a/package/build.ubuntu-32 b/package/build.ubuntu-32 index 9e91e44..d5a6150 100755 --- a/package/build.ubuntu-32 +++ b/package/build.ubuntu-32 @@ -4,10 +4,6 @@ set_var () { echo ==== Init ==== BASE_DIR=`pwd` echo $BASE_DIR - PKG_OS="ubuntu-32" - PKG_META="remove" - PKG="public" - PKG_UPLOAD="EMULATOR_PUBLIC" PKG_DIR=$BASE_DIR/EMUL_PKG PKG_BIN_DIR=$PKG_DIR/data/tools/emulator SWAP_IMG_NAME="swap.img" diff --git a/package/build.ubuntu-64 b/package/build.ubuntu-64 new file mode 100755 index 0000000..d5a6150 --- /dev/null +++ b/package/build.ubuntu-64 @@ -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" diff --git a/package/pkginfo.manifest b/package/pkginfo.manifest index c80b829..fe464d2 100644 --- a/package/pkginfo.manifest +++ b/package/pkginfo.manifest @@ -6,3 +6,8 @@ Package:emulator-storages OS:ubuntu-32, windows-32 Build-host-os:ubuntu-32 Description:sdcard for emulator + +Package:emulator-storages +OS:ubuntu-64 +Build-host-os:ubuntu-64 +Description:sdcard for emulator -- cgit v1.2.3