forked from AlexAltea/orbital
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·72 lines (66 loc) · 1.64 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
71
72
#!/bin/bash
# Configuration
path_bin='./bin'
path_bios='./orbital-bios'
path_grub='./orbital-grub'
path_qemu='./orbital-qemu'
path_orbital=`pwd`
function build_bios() {
cd ${path_orbital}
cd ${path_bios}
make -j$(nproc)
mv out/bios.bin ../${path_bin}/ubios.bin
}
function build_grub() {
# Dependencies
if [ -x "$(command -v apt)" ]; then
sudo apt-get -qq install python \
dh-autoreconf \
bison flex
fi
# Building
cd ${path_orbital}
cd ${path_grub}
./autogen.sh
./configure --target=x86_64 --disable-werror
make -j$(nproc)
}
function build_qemu() {
# Dependencies
if [ -x "$(command -v apt)" ]; then
sudo apt -qq install git \
zlib1g-dev \
libglib2.0-dev libfdt-dev libpixman-1-dev \
libsdl2-dev libvulkan-dev
fi
# Building
cd ${path_orbital}
cd ${path_qemu}
./configure --target-list=ps4-softmmu \
--enable-sdl --enable-vulkan --enable-debug --disable-capstone \
--enable-hax
make -j$(nproc)
}
function generate_image() {
cd ${path_orbital}
tar -c -f ${path_bin}/memdisk.tar -C resources boot
${path_grub}/grub-mkimage -d ${path_grub}/grub-core \
-O i386-pc -o bin/boot.img -m bin/memdisk.tar -c resources/boot/grub/boot.cfg \
memdisk biosdisk part_msdos part_gpt gfxterm_menu fat tar bsd memrw configfile
}
if [ "$1" == "clean" ]; then
cd ${path_orbital}
cd ${path_bios}
make clean
cd ${path_orbital}
cd ${path_grub}
make clean
cd ${path_orbital}
cd ${path_qemu}
make clean
else
build_bios
build_grub
build_qemu
generate_image
fi