summaryrefslogtreecommitdiff
path: root/build_cross.sh
diff options
context:
space:
mode:
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