summaryrefslogtreecommitdiff
path: root/build_cross.sh
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2018-01-27 21:36:39 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2018-01-27 21:36:39 +0100
commit54ebd1dea1dd4ad68d28e27f7a20ce843f1d2f59 (patch)
treea443d2726ef379fd281bffe6141f1f6321ab8681 /build_cross.sh
parentd81584556c99356f42d30c87f9b87989f7653987 (diff)
downloadbootstrap32-54ebd1dea1dd4ad68d28e27f7a20ce843f1d2f59.tar.xz
added more variables and cleaned up phase 1
Diffstat (limited to 'build_cross.sh')
-rwxr-xr-xbuild_cross.sh17
1 files changed, 14 insertions, 3 deletions
diff --git a/build_cross.sh b/build_cross.sh
index f40ce98..6689c50 100755
--- a/build_cross.sh
+++ b/build_cross.sh
@@ -18,6 +18,17 @@ if test ! -f /etc/sudoers.d/cross; then
echo "cross ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/cross
fi
+# we need the github keys
+if test ! -d $CROSS_HOME/.ssh; then
+ mkdir $CROSS_HOME/.ssh
+ chown cross:cross $CROSS_HOME/.ssh
+fi
+if test ! -f $CROSS_HOME/.ssh/id_rsa.pub; then
+ cp $HOME/.ssh/id_rsa.pub $CROSS_HOME/.ssh/.
+ cp $HOME/.ssh/id_rsa $CROSS_HOME/.ssh/.
+ chown cross:cross $CROSS_HOME/.ssh/id_rsa*
+fi
+
if test ! -x /usr/local/bin/ct-ng; then
echo "Installing crosstool-ng:"
su - cross <<EOF
@@ -34,8 +45,8 @@ EOF
echo "Done crosstool-ng."
fi
-if test ! -x $CROSS_HOME/x-tools/i486-unknown-linux-gnu/bin/i486-unknown-linux-gnu-gcc; then
- echo "Building cross compiler for i486-unknown-linux-gnu-gcc:"
+if test ! -x $CROSS_HOME/x-tools/${TARGET_ARCH}/bin/${TARGET_ARCH}-gcc; then
+ echo "Building cross compiler for ${TARGET_ARCH}=gcc:"
rm -rf $CROSS_HOME/{x-tools,.build,build.log,.wget-hsts,.config,.config.old}
cp ct-ng.config $CROSS_HOME/.config
CPUS=$(nproc)
@@ -48,5 +59,5 @@ EOF
fi
echo -n "Cross-compiler ready: "
-CROSS_MSG="$($CROSS_HOME/x-tools/i486-unknown-linux-gnu/bin/i486-unknown-linux-gnu-gcc --version | head -n 1)"
+CROSS_MSG="$($CROSS_HOME/x-tools/${TARGET_ARCH}/bin/${TARGET_ARCH}-gcc --version | head -n 1)"
echo $CROSS_MSG