-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_all
executable file
·46 lines (33 loc) · 933 Bytes
/
build_all
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
DIR=$(dirname $(readlink -f $0))
if [ ! -f /.dockerenv ]; then
docker run --rm -ti -v "$DIR:/work" archlinux:base-devel /work/build_all
exit $?
fi
# At this point we're inside a docker container running as root
cd "$DIR"
if [ $(id -u) == 0 ]; then
rm -rf work
mkdir work
chmod 777 work
pacman -Sy
echo "MAKEFLAGS=\"-j$(nproc)\"" >> /etc/makepkg.conf
useradd -m build
echo 'build ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/build
su build /work/build_all
exit $?
fi
# At this point we're running as the `build` user
set -e
cd work
cp -r ../packages/* ./
cd glib2-static
makepkg -src --noconfirm --skippgpcheck --nocheck --install
cd ..
cd pcre-static
makepkg -src --noconfirm --skippgpcheck --nocheck --install
cd ..
cd qemu-user-static
makepkg -src --noconfirm --skippgpcheck --nocheck --install
tar xf qemu-user-static-*.pkg.*
cp usr/bin/qemu-riscv64-static ../../