This commit is contained in:
Gaurav Khanna 2017-02-01 10:34:32 -08:00
Родитель 903d115fb7
Коммит 48e6f16e30
1 изменённых файлов: 16 добавлений и 3 удалений

Просмотреть файл

@ -2,10 +2,11 @@
usage() usage()
{ {
echo "Usage: $0 [BuildArch] [UbuntuCodeName] [lldbx.y]" echo "Usage: $0 [BuildArch] [UbuntuCodeName] [lldbx.y] [--SkipUnmount]"
echo "BuildArch can be: arm(default), armel, x86" echo "BuildArch can be: arm(default), armel, x86"
echo "UbuntuCodeName - optional, Code name for Ubuntu, can be: trusty(default), vivid, wily, xenial. If BuildArch is armel, UbuntuCodeName is ignored." echo "UbuntuCodeName - optional, Code name for Ubuntu, can be: trusty(default), vivid, wily, xenial. If BuildArch is armel, UbuntuCodeName is ignored."
echo "lldbx.y - optional, LLDB version, can be: lldb3.6(default), lldb3.8" echo "lldbx.y - optional, LLDB version, can be: lldb3.6(default), lldb3.8"
echo "[--SkipUnmount] - do not unmount rootfs folders."
exit 1 exit 1
} }
@ -20,6 +21,7 @@ __UbuntuRepo="http://ports.ubuntu.com/"
__UbuntuPackagesBase="build-essential libunwind8-dev gettext symlinks liblttng-ust-dev libicu-dev" __UbuntuPackagesBase="build-essential libunwind8-dev gettext symlinks liblttng-ust-dev libicu-dev"
__LLDB_Package="lldb-3.6-dev" __LLDB_Package="lldb-3.6-dev"
__UnprocessedBuildArgs= __UnprocessedBuildArgs=
__SkipUnmount=0
for i in "$@" for i in "$@"
do do
@ -29,6 +31,9 @@ for i in "$@"
usage usage
exit 1 exit 1
;; ;;
--skipunmount)
__SkipUnmount=1
;;
arm) arm)
__BuildArch=arm __BuildArch=arm
__UbuntuArch=armhf __UbuntuArch=armhf
@ -97,7 +102,11 @@ if [[ -n "$ROOTFS_DIR" ]]; then
fi fi
if [ -d "$__RootfsDir" ]; then if [ -d "$__RootfsDir" ]; then
if [ $__SkipUnmount == 0 ]; then
umount $__RootfsDir/* umount $__RootfsDir/*
fi
rm -rf $__RootfsDir rm -rf $__RootfsDir
fi fi
@ -108,7 +117,11 @@ if [[ -n $__UbuntuCodeName ]]; then
chroot $__RootfsDir apt-get -f -y install chroot $__RootfsDir apt-get -f -y install
chroot $__RootfsDir apt-get -y install $__UbuntuPackages chroot $__RootfsDir apt-get -y install $__UbuntuPackages
chroot $__RootfsDir symlinks -cr /usr chroot $__RootfsDir symlinks -cr /usr
if [ $__SkipUnmount == 0 ]; then
umount $__RootfsDir/* umount $__RootfsDir/*
fi
elif [ "$__Tizen" == "tizen" ]; then elif [ "$__Tizen" == "tizen" ]; then
ROOTFS_DIR=$__RootfsDir $__CrossDir/$__BuildArch/tizen-build-rootfs.sh ROOTFS_DIR=$__RootfsDir $__CrossDir/$__BuildArch/tizen-build-rootfs.sh
else else