forked from ivandavidov/minimal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path05_prepare_sysroot.sh
executable file
·34 lines (24 loc) · 977 Bytes
/
05_prepare_sysroot.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh
set -e
# Load common properties and functions in the current script.
. ./common.sh
echo "*** PREPARE SYSROOT BEGIN ***"
echo "Cleaning existing sysroot. This may take a while."
rm -rf $SYSROOT
mkdir -p $SYSROOT
echo "Preparing glibc. This may take a while."
# 1) Copy everything from glibc to the new sysroot area.
cp -r $GLIBC_INSTALLED/* $SYSROOT
# 2) Copy all kernel headers to the sysroot folder.
cp -r $KERNEL_INSTALLED/include $SYSROOT
# 3) Hack for the missing '/work/sysroot/usr' folder. We link
# the existing libraries and the kernel headers. Without
# this hack the Busybox compilation process fails. The proper
# way to handle this is to use '--prefix=/usr' in the glibc
# build process but then we have to deal with other issues.
# For now this hack is the easiest and the simplest solution.
mkdir -p $SYSROOT/usr
ln -s ../include $SYSROOT/usr/include
ln -s ../lib $SYSROOT/usr/lib
cd $SRC_DIR
echo "*** PREPARE SYSROOT END ***"