forked from mikeyusc/ScorchOS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
macbuild.sh
executable file
·49 lines (38 loc) · 1.35 KB
/
macbuild.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
#!/bin/sh
# ScorchOS Build Script (Linux)
# Copyright (C) 2008-2011 ScorchOS Developers
# For Terms see License.txt
echo '> Starting Build...'
# This makes sure the user is root (needed for the loop-back mount of the floppy
# image I created earlier with a grub bootloader
#if test "`whoami`" != "root" ; then
# echo "You must be logged in as root to build (for loopback mounting)"
# echo "Enter 'su' or 'sudo bash' to switch to root"
# exit
#fi
# This build script requires the presence of a cross-compiler
echo '> Assembling and Compiling ScorchOS Kernel...'
# (Primis) I've added the makefile support here to consolidate the build scripts
make all
#echo '> Adding Kernel to Floppy Image...'
#Time for that loop-back mount!
rm -rf tmp-loop
mkdir tmp-loop &&
hdiutil attach -mountpoint tmp-loop disk_images/scorch.img
# Remove previous kernel.x before adding the new one...
cd tmp-loop
rm -rf kernel.x || exit
cd ..
cp bin/kernel.x tmp-loop/kernel.x || exit
# Move included program binaries onto the floppy image (will be used with ScorchOS 0.2)
#echo '> Moving binaries in Apps Directory to Floppy Image...'
#cp app/*.app tmp-loop
sleep 0.2
echo '> Unmounting Loop-back Floppy...'
# Unmount the loop-back floppy
umount tmp-loop || exit
rm -rf tmp-loop
#echo '> Quick Cleanup...'
# A quick cleanup (comment this out while debugging)
make clean
echo '> Build Complete!'