-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.sh
executable file
·70 lines (59 loc) · 1.62 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
65
66
67
68
69
70
#!/bin/bash
archs=('x86_64')
user="${1}"
if [[ -z ${user} ]]; then
user=${USER}
if [[ ${EUID} -eq 0 ]]; then
echo "Warning: You should specify a username as first argument or run \
the script as a normal user."
echo "Some parts requires root access (like building the image and \
cleaning pacman's cache)."
echo "If you plan to build automatically, run the script as root and \
give a normal username as first argument."
fi
fi
# Clean local repository
echo "Cleaning local repository (as \"${user}\")"
cd repo && su ${user} -c './clean.sh'
cd ..
# Clean image folder
echo "Cleaning the image folder (as \"root\")"
cd iso && su -c './clean.sh'
cd ..
# Clean packages folder
echo "Cleaning packages folder (as \"${user}\")"
cd pkg && su ${user} -c './clean.sh'
cd ..
# Build custom packages.
echo "Building custom packages (as \"${user}\")"
cd pkg && su ${user} -c "./build.sh ${archs}"
if [ $? -ne 0 ]; then
echo "Failed to build custom packages!"
exit 1
fi
cd ..
# Build the custom local repository.
echo "Building the local repository (as \"${user}\")"
cd repo && su ${user} -c "./build.sh ${archs}"
if [ $? -ne 0 ]; then
echo "Failed to build the custom local repository!"
exit 1
fi
cd ..
# Build the latest Linux kernel and Nouveau DRM.
echo "Building Linux and Nouveau (as \"${user}\")"
cd src && su ${user} -c "./build.sh"
if [ $? -ne 0 ]; then
echo "Failed to build the latest Linux kernel or Nouveau DRM!"
exit 1
fi
cd ..
# Build the image.
echo "Building the image (as \"root\")"
cd iso && su -c "./build.sh -v ${archs}"
if [ $? -ne 0 ]; then
echo "Failed to build the image!"
exit 1
fi
cd ..
exit 0