-
Notifications
You must be signed in to change notification settings - Fork 4
/
build
executable file
·55 lines (36 loc) · 856 Bytes
/
build
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
#!/bin/sh
SCRIPT=$(readlink -f $0)
BASEDIR=$(dirname $SCRIPT)
NP=$(nproc)
errexit() {
echo "#############################################"
echo "Build failed!"
echo "$1"
exit 1
}
ptxdist_clean()
{
cd $BASEDIR/$1
ptxdist -q clean || errexit "Error while cleaning $1"
}
ptxdist_build()
{
cd $BASEDIR/$1
CMD=${2-images}
if ! ptxdist go -j$NP; then
ptxdist go || errexit "Error while building $1"
fi
eval ptxdist $CMD
}
# Clean everything first
ptxdist_clean initramfs
ptxdist_clean root
ptxdist_clean boot
# Now build all images
ptxdist_build initramfs
ptxdist_build root
ptxdist_build boot "--collectionconfig=configs/system image system.img"
ptxdist_build boot "--collectionconfig=configs/install image install.img"
echo "#############################################"
echo "Build completed successfully!"
exit 0