]>
wirehaze git hosting - BOS.git/blob - scripts/install.sh
3 # BOS Linux Installer version 0.2
4 # You must be root to run this script because of the floppy/loopback device
7 echo -e "\E[33;1mBOS\E[0m - \E[32;1mLinux installer\E[0m"
10 if [ `id -u` != "0" ]; then
11 echo -e "\E[31;1mYou must be root to use this installer!\E[0m"
17 echo -e "\E[31m$0 image\E[0m - Creates a floppy image called bos.img"
18 echo -e "\E[31m$0 floppy\E[0m - Install BOS into a floppy ( must be inserted )"
20 echo "Note: this installer will create a bootable image/floppy."
21 echo "Floppy creation is not tested ( I don't have a floppy reader ) and it should be already formatted"
25 echo -e "\E[32mCompiling BOS...\E[0m"
26 ..
/utils
/fasm ..
/kernel
/kernel.asm ..
/kernel
/kernel.sys
27 ..
/utils
/fasm ..
/boot
/BOS_boot.asm ..
/boot
/BOS_boot.bin
29 if [ "$1" = "floppy" ]; then
30 echo -e "\E[32mStarting floppy installation...\E[0m"
32 #Install BOS_boot.bin as bootsector into bos.img
33 dd if=boot
/BOS_boot.bin of
=/dev
/fd0 bs
=1 count
=512
36 #Insert kernel.sys into image
37 cp ..
/kernel
/kernel.sys
/mnt
/floppy
42 echo -e "\E[33mBOS installed.\E[0m"
45 echo -e "\E[32mStarting image creation...\E[0m"
48 if [ -e ..
/bos.img
]; then
51 dd if=/dev
/zero of
=bos.img bs
=1k count
=1440
53 #Format image in MSDOS format and mount it
55 losetup
/dev
/loop3 ..
/bos.img
57 #Install BOS_boot.bin as bootsector into bos.img
58 dd if=..
/boot
/BOS_boot.bin of
=/dev
/loop3 bs
=1 count
=512
59 if [ ! -e tmpmnt
]; then
62 mount
-tmsdos /dev
/loop3 tmpmnt
64 #Insert kernel.sys into image
65 cp ..
/kernel
/kernel.sys tmpmnt
69 if [ -e tmpmnt
]; then
74 echo -e "\E[33mBOS image created! ( better do a chown on it now ;) )\E[0m"