-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.sh
executable file
·64 lines (51 loc) · 1.2 KB
/
build.sh
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
#set -e
#. ./env.sh
export ARCH=aarch64
export RFS_WIFI_SSID=$WIFI_SSID
export RFS_WIFI_PASSWORD=$WIFI_PASSWORD
if [ -z "$DISTRO" ]; then
echo "Distro not set";
exit
fi
if [ -z "$TOP" ]; then
echo "TOP not set"
exit
fi
if [ -z "$SYSROOT" ]; then
echo "SYSROOT not set";
exit
fi
if [ ! -d "distros/$DISTRO" ]; then
echo "Distro \"$DISTRO\" not found!";
distros=$(ls distros)
echo "Distros available: $distros";
exit
fi
if [ ! -f "distros/$DISTRO/build.sh" ]; then
echo "distros/$DISTRO/build.sh not found!"
exit;
fi
if [ ! -d "$SYSROOT" ]; then
echo "SYSROOT directory not found!";
exit
fi
sudo chown -R $UID:$GID $SYSROOT
distros/$DISTRO/build.sh
if [ "$?" -ne "0" ]; then
exit 1;
fi
# Chmod
sudo chown -R 0:0 $SYSROOT/
sudo chown -R 1000:1000 $SYSROOT/home/pixelc || true
sudo chown -R 1000:1000 $SYSROOT/home/alarm || true
sudo chmod +s $SYSROOT/usr/bin/chfn
sudo chmod +s $SYSROOT/usr/bin/newgrp
sudo chmod +s $SYSROOT/usr/bin/passwd
sudo chmod +s $SYSROOT/usr/bin/chsh
sudo chmod +s $SYSROOT/usr/bin/gpasswd
sudo chmod +s $SYSROOT/bin/umount
sudo chmod +s $SYSROOT/bin/mount
sudo chmod +s $SYSROOT/bin/su
cd $SYSROOT
sudo tar -cpzf $TOP/out/${DISTRO}_rootfs.tar.gz .