forked from openSUSE/obs-build
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinitscript_sb2
More file actions
28 lines (25 loc) · 906 Bytes
/
initscript_sb2
File metadata and controls
28 lines (25 loc) · 906 Bytes
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
#!/bin/bash
# Set ABUILD_UID and ABUILD_GID from saved data
. /.build/build.data
echo "Setting up abuild user in $BUILD_ROOT for SB2"
echo "abuild::${ABUILD_UID}:${ABUILD_GID}:Autobuild:/home/abuild:/bin/bash" >> /etc/passwd
echo 'abuild:*:::::::' >>/etc/shadow # This is needed on Mandriva 2009
echo 'abuild:*::' >>/etc/gshadow # This is needed on Ubuntu
echo "abuild::${ABUILD_GID}:" >>/etc/group
mkdir -p /target /home/abuild
chmod 775 /target
# Ensure that .build is visible in the /target too
mv /.build /target
ln -s /target/.build /.build
chown -R "$ABUILD_UID:$ABUILD_GID" /target /home/abuild
if [ -e /home/abuild/sb2-session-needroot ]; then
rm -rf /home/abuild/sb2-session-needroot
fi
if [ -e /home/abuild/sb2-session-needuser ]; then
rm -rf /home/abuild/sb2-session-needuser
fi
if [ -e /target/.sb2inited ]; then
rm -rf /target/.sb2inited
fi
unset BUILD_DIR BUILD_ROOT
exec /.build/build