From: Hyung-Kyu Choi Date: Tue, 17 Jan 2017 14:45:38 +0000 (+0900) Subject: Update description related to ARM rootfs (dotnet/coreclr#8962) X-Git-Tag: submit/tizen/20210909.063632~11030^2~8438 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2dcaf605f3921ac3173c443c1a625c4ce6f2bdb3;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Update description related to ARM rootfs (dotnet/coreclr#8962) Update description in script and documentation related to ARM rootfs. 1. Change arm-softfp to armel to apply recent changes. 2. Change UbuntuCodeName to LinuxCodeName For arm and armel, rootfs are available from three different Linux distro. For arm, Ubuntu is available. For armel, Debian and Tizen are available. Signed-off-by: Hyung-Kyu Choi Commit migrated from https://github.com/dotnet/coreclr/commit/c73f3a1a5b2616d039a9bf69803fe9942976410e --- diff --git a/docs/coreclr/building/cross-building.md b/docs/coreclr/building/cross-building.md index ab5897a..30c7aca 100644 --- a/docs/coreclr/building/cross-building.md +++ b/docs/coreclr/building/cross-building.md @@ -21,11 +21,12 @@ and conversely for arm64: Generating the rootfs --------------------- -The `cross\build-rootfs.sh` script can be used to download the files needed for cross compilation. It will generate an Ubuntu 14.04 rootfs as this is what CoreCLR targets. +The `cross\build-rootfs.sh` script can be used to download the files needed for cross compilation. It will generate an rootfs as this is what CoreCLR targets. - Usage: build-rootfs.sh [BuildArch] [UbuntuCodeName] - BuildArch can be: arm, arm-softfp, arm64 - UbuntuCodeName - optional, Code name for Ubuntu, can be: trusty(default), vivid, wily + Usage: ./cross/build-rootfs.sh [BuildArch] [LinuxCodeName] [lldbx.y] [--skipunmount] + BuildArch can be: arm(default), armel, arm64, x86 + LinuxCodeName - optional, Code name for Linux, can be: trusty(default), vivid, wily, xenial. If BuildArch is armel, LinuxCodeName is jessie(default) or tizen. + lldbx.y - optional, LLDB version, can be: lldb3.6(default), lldb3.8 The `build-rootfs.sh` script must be run as root as it has to make some symlinks to the system, it will by default generate the rootfs in `cross\rootfs\` however this can be changed by setting the `ROOTFS_DIR` environment variable. @@ -33,7 +34,7 @@ For example, to generate an arm rootfs: ben@ubuntu ~/git/coreclr/ $ sudo ./cross/build-rootfs.sh arm -You can choose Ubuntu code name to match your target, give `vivid` for `15.04`, `wily` for `15.10`. Default is `trusty`, version `14.04`. +You can choose Linux code name to match your target, give `vivid` for `Ubuntu 15.04`, `wily` for `Ubuntu 15.10`. Default is `trusty`, version `Ubuntu 14.04`. ben@ubuntu ~/git/coreclr/ $ sudo ./cross/build-rootfs.sh arm wily @@ -41,6 +42,18 @@ and if you wanted to generate the rootfs elsewhere: ben@ubuntu ~/git/coreclr/ $ sudo ROOTFS_DIR=/home/ben/coreclr-cross/arm ./cross/build-rootfs.sh arm +For example, to generate an armel rootfs: + + hqu@ubuntu ~/git/coreclr/ $ sudo ./cross/build-rootfs.sh armel + +You can choose code name to match your target, give `jessie` for `Debian`, `tizen` for `Tizen`. Default is `jessie`. + + hque@ubuntu ~/git/coreclr/ $ sudo ./cross/build-rootfs.sh armel tizen + +and if you wanted to generate the rootfs elsewhere: + + hque@ubuntu ~/git/coreclr/ $ sudo ROOTFS_DIR=/home/ben/coreclr-cross/armel ./cross/build-rootfs.sh armel tizen + Cross compiling CoreCLR ----------------------- @@ -117,7 +130,7 @@ prajwal@ubuntu ~/coreclr $ ./tests/scripts/arm32_ci_script.sh \ --skipTests ``` -The Linux ARM Emulator is based on soft floating point and thus the native binaries in coreclr are built for the arm-softfp architecture. The coreclr binaries generated by the above command (native and mscorlib) can be found at `~/coreclr/bin/Product/Linux.arm-softfp.Release`. +The Linux ARM Emulator is based on soft floating point and thus the native binaries in coreclr are built for the armel architecture. The coreclr binaries generated by the above command (native and mscorlib) can be found at `~/coreclr/bin/Product/Linux.armel.Release`. To build libcoreclr and mscorlib, and run selected coreclr unit tests on the emulator, do the following: * Download the latest Coreclr unit test binaries (or build on Windows) from here: [Debug](http://dotnet-ci.cloudapp.net/job/dotnet_coreclr/job/master/job/debug_windows_nt_bld/lastSuccessfulBuild/artifact/bin/tests/tests.zip) and [Release](http://dotnet-ci.cloudapp.net/job/dotnet_coreclr/job/master/job/release_windows_nt_bld/lastSuccessfulBuild/artifact/bin/tests/tests.zip). diff --git a/src/coreclr/cross/build-rootfs.sh b/src/coreclr/cross/build-rootfs.sh index aa154f7..72ccc56 100755 --- a/src/coreclr/cross/build-rootfs.sh +++ b/src/coreclr/cross/build-rootfs.sh @@ -2,16 +2,16 @@ usage() { - echo "Usage: $0 [BuildArch] [UbuntuCodeName] [lldbx.y] [--skipunmount]" + echo "Usage: $0 [BuildArch] [LinuxCodeName] [lldbx.y] [--skipunmount]" echo "BuildArch can be: arm(default), armel, arm64, x86" - echo "UbuntuCodeName - optional, Code name for Ubuntu, can be: trusty(default), vivid, wily, xenial. If BuildArch is armel, UbuntuCodeName is jessie(default) or tizen." + echo "LinuxCodeName - optional, Code name for Linux, can be: trusty(default), vivid, wily, xenial. If BuildArch is armel, LinuxCodeName is jessie(default) or tizen." echo "lldbx.y - optional, LLDB version, can be: lldb3.6(default), lldb3.8" echo "--skipunmount - optional, will skip the unmount of rootfs folder." exit 1 } -__UbuntuCodeName=trusty +__LinuxCodeName=trusty __CrossDir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) __InitialDir=$PWD @@ -43,7 +43,7 @@ for i in "$@" __BuildArch=armel __UbuntuArch=armel __UbuntuRepo="http://ftp.debian.org/debian/" - __UbuntuCodeName=jessie + __LinuxCodeName=jessie ;; x86) __BuildArch=x86 @@ -57,22 +57,22 @@ for i in "$@" __LLDB_Package="lldb-3.8-dev" ;; vivid) - if [ "$__UbuntuCodeName" != "jessie" ]; then - __UbuntuCodeName=vivid + if [ "$__LinuxCodeName" != "jessie" ]; then + __LinuxCodeName=vivid fi ;; wily) - if [ "$__UbuntuCodeName" != "jessie" ]; then - __UbuntuCodeName=wily + if [ "$__LinuxCodeName" != "jessie" ]; then + __LinuxCodeName=wily fi ;; xenial) - if [ "$__UbuntuCodeName" != "jessie" ]; then - __UbuntuCodeName=xenial + if [ "$__LinuxCodeName" != "jessie" ]; then + __LinuxCodeName=xenial fi ;; jessie) - __UbuntuCodeName=jessie + __LinuxCodeName=jessie __UbuntuRepo="http://ftp.debian.org/debian/" ;; tizen) @@ -81,7 +81,7 @@ for i in "$@" usage; exit 1; fi - __UbuntuCodeName= + __LinuxCodeName= __UbuntuRepo= __Tizen=tizen ;; @@ -112,9 +112,9 @@ if [ -d "$__RootfsDir" ]; then rm -rf $__RootfsDir fi -if [[ -n $__UbuntuCodeName ]]; then - qemu-debootstrap --arch $__UbuntuArch $__UbuntuCodeName $__RootfsDir $__UbuntuRepo - cp $__CrossDir/$__BuildArch/sources.list.$__UbuntuCodeName $__RootfsDir/etc/apt/sources.list +if [[ -n $__LinuxCodeName ]]; then + qemu-debootstrap --arch $__UbuntuArch $__LinuxCodeName $__RootfsDir $__UbuntuRepo + cp $__CrossDir/$__BuildArch/sources.list.$__LinuxCodeName $__RootfsDir/etc/apt/sources.list chroot $__RootfsDir apt-get update chroot $__RootfsDir apt-get -f -y install chroot $__RootfsDir apt-get -y install $__UbuntuPackages