-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathmkiso.sh
executable file
·38 lines (33 loc) · 898 Bytes
/
mkiso.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
ARCH=i386
BUILD_TYPE=Debug
args=(${@,,})
if [[ ${args[@]} =~ "release" ]]; then
BUILD_TYPE=Release
elif [[ ${args[@]} =~ "reldbginfo" ]]; then
BUILD_TYPE=RelWithDebInfo
fi
if [[ ${args[@]} =~ "amd64" ]]; then
ARCH=amd64
fi
BUILDDIR="build-$ARCH-${BUILD_TYPE,,}"
IMAGEDIR="images-$ARCH-${BUILD_TYPE,,}"
cd "$(dirname "$0")"
cd $BUILDDIR
mkdir -p iso/boot/grub
cp $IMAGEDIR/kernel iso/
cp $IMAGEDIR/ntos iso/
echo "set timeout=2" > iso/boot/grub/grub.cfg
echo "menuentry 'Neptune OS $ARCH ($BUILD_TYPE Build)' --class fedora --class gnu-linux --class gnu --class os {" >> iso/boot/grub/grub.cfg
cat <<EOF >> iso/boot/grub/grub.cfg
insmod all_video
insmod gzio
insmod part_msdos
insmod ext2
set gfxmode=1024x768
echo 'Loading seL4 Microkernel...'
multiboot2 /kernel
echo 'Loading NT Executive...'
module2 /ntos
}
EOF
grub-mkrescue -o boot.iso iso/