-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.sh
executable file
·54 lines (46 loc) · 859 Bytes
/
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
#!/bin/sh
# Building system for 2ndboot-ng
BOOT_MODULE="xbootmod/2ndboot.ko"
BOOT_USER="xbootuser/2ndboot"
BOOT_IMAGE="boot/boot.elf"
echo "Building kernel module"
cd xbootmod
make
echo "Building user tool"
cd ../xbootuser
make
echo "Building bootloader"
cd ../boot
make
echo "Done!"
cd ..
# Copying files in out directory
if [ -d out ]; then
echo "Directory in not empty! Erasing it!"
rm -rf out
fi
mkdir out
if [ -f $BOOT_MODULE ]; then
cp -f $BOOT_MODULE out/2ndboot.ko
else
echo "Kernel module not found!"
fi
if [ -f $BOOT_USER ]; then
cp -f $BOOT_USER out/2ndboot
else
echo "User utility not found!"
fi
if [ -f $BOOT_IMAGE ]; then
cp -f $BOOT_IMAGE out/boot.elf
else
echo "Boot image not found!"
fi
# Cleaning tree after building
cd xbootmod
make clean
cd ../xbootuser
make clean
cd ../boot
make clean
cd ..
echo "Enjoy!"