2018-11-16 08:04:34 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-11-16 08:34:58 +03:00
|
|
|
# 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
|
2018-11-16 08:04:34 +03:00
|
|
|
ln -s /root/gcc_local util/local
|
|
|
|
|
2018-11-16 08:34:58 +03:00
|
|
|
# Run make as local
|
|
|
|
runuser -u local -- make -j4
|
|
|
|
|
|
|
|
# Remove the build tools
|
|
|
|
rm util/local
|
|
|
|
|