summaryrefslogtreecommitdiff
path: root/cross/build-rootfs.sh
diff options
context:
space:
mode:
authorBen Pye <ben@curlybracket.co.uk>2015-08-05 02:34:04 +0100
committerBen Pye <ben@curlybracket.co.uk>2015-08-05 02:34:04 +0100
commit3587984322e62e7035234ad72a2d22797e10fd9a (patch)
tree5be7b67818971af9937b10ce40a83b4e5362d2d0 /cross/build-rootfs.sh
parentdebf4830d417ea7846625028eea355a0aacd4f3c (diff)
downloadcoreclr-3587984322e62e7035234ad72a2d22797e10fd9a.tar.gz
coreclr-3587984322e62e7035234ad72a2d22797e10fd9a.tar.bz2
coreclr-3587984322e62e7035234ad72a2d22797e10fd9a.zip
Improve build-rootfs script.
Diffstat (limited to 'cross/build-rootfs.sh')
-rwxr-xr-xcross/build-rootfs.sh37
1 files changed, 5 insertions, 32 deletions
diff --git a/cross/build-rootfs.sh b/cross/build-rootfs.sh
index c070b2a449..32e437eda2 100755
--- a/cross/build-rootfs.sh
+++ b/cross/build-rootfs.sh
@@ -8,29 +8,12 @@ usage()
exit 1
}
-fix_symlinks()
-{
- echo "Adjusting the symlinks in $1 to be relative"
- cd $1
- find . -maxdepth 1 -type l | while read i
- do qualifies=$(file $i | sed -e "s/.*\`\(.*\)'/\1/g" | grep ^/lib)
- if [ -n "$qualifies" ]; then
- newPath=$(file $i | sed -e "s/.*\`\(.*\)'/\1/g" | sed -e "s,\`,,g" | sed -e "s,',,g" | sed -e "s,^/lib,$2/lib,g")
- echo $i
- echo $newPath
- sudo rm $i
- sudo ln -s $newPath $i
- fi
- done
- cd $__InitialDir
-}
-
__CrossDir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
__InitialDir=$PWD
__BuildArch=arm
__UbuntuArch=armhf
__UbuntuRepo="http://ports.ubuntu.com/"
-__UbuntuPackages="build-essential lldb-3.6-dev libunwind8-dev gettext"
+__UbuntuPackages="build-essential lldb-3.6-dev libunwind8-dev gettext symlinks"
__MachineTriple=arm-linux-gnueabihf
__UnprocessedBuildArgs=
for i in "$@"
@@ -45,14 +28,14 @@ for i in "$@"
__BuildArch=arm
__UbuntuArch=armhf
__UbuntuRepo="http://ports.ubuntu.com/"
- __UbuntuPackages="build-essential lldb-3.6-dev libunwind8-dev gettext"
+ __UbuntuPackages="build-essential lldb-3.6-dev libunwind8-dev gettext symlinks"
__MachineTriple=arm-linux-gnueabihf
;;
arm64)
__BuildArch=arm64
__UbuntuArch=arm64
__UbuntuRepo="http://ports.ubuntu.com/"
- __UbuntuPackages="build-essential libunwind8-dev gettext"
+ __UbuntuPackages="build-essential libunwind8-dev gettext symlinks"
__MachineTriple=aarch64-linux-gnu
;;
*)
@@ -66,21 +49,11 @@ if [[ -n "$ROOTFS_DIR" ]]; then
__RootfsDir=$ROOTFS_DIR
fi
-__RootfsDirMultiArchDir=$__RootfsDir/usr/lib/$__MachineTriple
-# On ARM64 libgcc_s.so is a symlink to /lib/ so we need to correct that too
-__RootfsDirGCCMultiArchDir=$__RootfsDir/usr/lib/gcc/$__MachineTriple/4.8
-
umount $__RootfsDir/*
rm -rf $__RootfsDir
qemu-debootstrap --arch $__UbuntuArch trusty $__RootfsDir $__UbuntuRepo
cp $__CrossDir/$__BuildArch/sources.list $__RootfsDir/etc/apt/sources.list
chroot $__RootfsDir apt-get update
chroot $__RootfsDir apt-get -y install $__UbuntuPackages
-umount $__RootfsDir/*
-fix_symlinks $__RootfsDir/usr/lib "../.."
-if [ -d "$__RootfsDirMultiArchDir" ]; then
- fix_symlinks $__RootfsDirMultiArchDir "../../.."
-fi
-if [ -d "$__RootfsDirGCCMultiArchDir" ]; then
- fix_symlinks $__RootfsDirGCCMultiArchDir "../../../../.."
-fi \ No newline at end of file
+chroot $__RootfsDir symlinks -cr /usr
+umount $__RootfsDir/* \ No newline at end of file