summaryrefslogtreecommitdiff
path: root/cross
diff options
context:
space:
mode:
authorSaeHie Park <saehie.park@gmail.com>2016-11-15 14:49:02 (GMT)
committerJan Kotas <jkotas@microsoft.com>2016-11-15 14:49:02 (GMT)
commit301ec423beaf8f31fe6172a846ec552c2cb9a14e (patch)
tree8dd431456abeb5c82ee3b8f506dd9100db507759 /cross
parent7bd7335b34b3e4ee650b5db4991d922e3fbc56ea (diff)
downloadcoreclr-301ec423beaf8f31fe6172a846ec552c2cb9a14e.zip
coreclr-301ec423beaf8f31fe6172a846ec552c2cb9a14e.tar.gz
coreclr-301ec423beaf8f31fe6172a846ec552c2cb9a14e.tar.bz2
clean build-roofs and add lldb option (#8123)
- clean unused __MachineTriple - add indents to case - add lld 3.6 or 3.8 as option
Diffstat (limited to 'cross')
-rwxr-xr-xcross/build-rootfs.sh92
1 files changed, 48 insertions, 44 deletions
diff --git a/cross/build-rootfs.sh b/cross/build-rootfs.sh
index e4915a8..5caf208 100755
--- a/cross/build-rootfs.sh
+++ b/cross/build-rootfs.sh
@@ -2,9 +2,10 @@
usage()
{
- echo "Usage: $0 [BuildArch] [UbuntuCodeName]"
- echo "BuildArch can be: arm, arm-softfp, arm64"
+ echo "Usage: $0 [BuildArch] [UbuntuCodeName] [lldbx.y]"
+ echo "BuildArch can be: arm(default), arm-softfp, arm64"
echo "UbuntuCodeName - optional, Code name for Ubuntu, can be: trusty(default), vivid, wily, xenial. If BuildArch is arm-softfp, UbuntuCodeName is ignored."
+ echo "lldbx.y - optional, LLDB version, can be: lldb3.6(default), lldb3.8"
exit 1
}
@@ -17,71 +18,74 @@ __BuildArch=arm
__UbuntuArch=armhf
__UbuntuRepo="http://ports.ubuntu.com/"
__UbuntuPackagesBase="build-essential libunwind8-dev gettext symlinks liblttng-ust-dev libicu-dev"
-if [ -z "$LLVM_ARM_HOME" ]; then
- __LLDB_Package="lldb-3.6-dev"
-fi
-__UbuntuPackages="$__UbuntuPackagesBase $__LLDB_Package"
-__MachineTriple=arm-linux-gnueabihf
+__LLDB_Package="lldb-3.6-dev"
__UnprocessedBuildArgs=
+
for i in "$@"
do
lowerI="$(echo $i | awk '{print tolower($0)}')"
case $lowerI in
-?|-h|--help)
- usage
- exit 1
- ;;
+ usage
+ exit 1
+ ;;
arm)
- __BuildArch=arm
- __UbuntuArch=armhf
- __MachineTriple=arm-linux-gnueabihf
- ;;
+ __BuildArch=arm
+ __UbuntuArch=armhf
+ ;;
arm64)
- __BuildArch=arm64
- __UbuntuArch=arm64
- __UbuntuPackages="$__UbuntuPackagesBase"
- __MachineTriple=aarch64-linux-gnu
- ;;
+ __BuildArch=arm64
+ __UbuntuArch=arm64
+ ;;
arm-softfp)
- __BuildArch=arm-softfp
- __UbuntuArch=armel
- __UbuntuRepo="http://ftp.debian.org/debian/"
- __MachineTriple=arm-linux-gnueabi
- __UbuntuCodeName=jessie
- ;;
+ __BuildArch=arm-softfp
+ __UbuntuArch=armel
+ __UbuntuRepo="http://ftp.debian.org/debian/"
+ __UbuntuCodeName=jessie
+ ;;
+ lldb3.6)
+ __LLDB_Package="lldb-3.6-dev"
+ ;;
+ lldb3.8)
+ __LLDB_Package="lldb-3.8-dev"
+ ;;
vivid)
- if [ "$__UbuntuCodeName" != "jessie" ]; then
- __UbuntuCodeName=vivid
- fi
- ;;
+ if [ "$__UbuntuCodeName" != "jessie" ]; then
+ __UbuntuCodeName=vivid
+ fi
+ ;;
wily)
- if [ "$__UbuntuCodeName" != "jessie" ]; then
- __UbuntuCodeName=wily
- fi
- ;;
+ if [ "$__UbuntuCodeName" != "jessie" ]; then
+ __UbuntuCodeName=wily
+ fi
+ ;;
xenial)
- if [ "$__UbuntuCodeName" != "jessie" ]; then
- __UbuntuCodeName=xenial
- fi
- ;;
+ if [ "$__UbuntuCodeName" != "jessie" ]; then
+ __UbuntuCodeName=xenial
+ fi
+ ;;
jessie)
- __UbuntuCodeName=jessie
- __UbuntuRepo="http://ftp.debian.org/debian/"
- ;;
+ __UbuntuCodeName=jessie
+ __UbuntuRepo="http://ftp.debian.org/debian/"
+ ;;
*)
- __UnprocessedBuildArgs="$__UnprocessedBuildArgs $i"
- ;;
+ __UnprocessedBuildArgs="$__UnprocessedBuildArgs $i"
+ ;;
esac
done
__RootfsDir="$__CrossDir/rootfs/$__BuildArch"
+__UbuntuPackages="$__UbuntuPackagesBase $__LLDB_Package"
if [[ -n "$ROOTFS_DIR" ]]; then
__RootfsDir=$ROOTFS_DIR
fi
-umount $__RootfsDir/*
-rm -rf $__RootfsDir
+if [ -d "$__RootfsDir" ]; then
+ umount $__RootfsDir/*
+ rm -rf $__RootfsDir
+fi
+
qemu-debootstrap --arch $__UbuntuArch $__UbuntuCodeName $__RootfsDir $__UbuntuRepo
cp $__CrossDir/$__BuildArch/sources.list.$__UbuntuCodeName $__RootfsDir/etc/apt/sources.list
chroot $__RootfsDir apt-get update