From 39307c34f716eb7f2e1c2e066960099c0b6e7c88 Mon Sep 17 00:00:00 2001 From: "K. Lange" Date: Fri, 16 Nov 2018 14:34:58 +0900 Subject: [PATCH] travis: new build script with uid juggling --- util/build-travis.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/util/build-travis.sh b/util/build-travis.sh index 1a6ad6d2..9ea23e88 100755 --- a/util/build-travis.sh +++ b/util/build-travis.sh @@ -1,5 +1,21 @@ #!/bin/bash +# Give other users access to /root +# (We probably should have just built the build tools somewhere else...) +chmod o+x /root + +# Who owns this directory? +NEWUID=`stat -c '%u' .` + +# Create a fake user with this name +useradd -u $NEWUID local + +# Map the build tools ln -s /root/gcc_local util/local -make -j4 +# Run make as local +runuser -u local -- make -j4 + +# Remove the build tools +rm util/local +