-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.sh
executable file
·44 lines (36 loc) · 1.02 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
#!/bin/bash
# Run this script with Arch linux's pacman installed
# Requires arch-install-scripts squashfs-tools grub parallel
## build scripts to use, will be sourced in order and in parallel
buildscripts=('build-img.sh' 'build-squashed-root.sh' 'build-user-crypt-img.sh')
serial-build() {
## source build-scripts
for a in ${buildscripts[@]}; do
. "build-scripts/$a"
done
}
parallel-build() {
## build-user-crypt-img.sh requires user input, hence it serial
"build-scripts/build-user-crypt-img.sh"
## run build.parallel
./build.parallel build-img.sh build-squashed-root.sh
}
# Check to see if dependencies are available
deps=('pacstrap' 'grub-install' 'mkfs.fat' 'kpartx' 'parallel' 'cryptsetup' 'mksquashfs' 'arch-chroot')
unset deperr
for a in ${deps[@]}; do
which "$a" >/dev/null
if [ $? != 0 ]; then
deperr+=" $a"
fi
done
if [ ! -z "$deperr" ]; then
echo "Couldn't find $deperr"
exit
fi
if [ "$1" == "-p" ]; then
parallel-build
else
serial-build
fi
echo "Please read README on how to write baseOS.img to disk"