-
Notifications
You must be signed in to change notification settings - Fork 17
/
start.sh
executable file
·185 lines (162 loc) · 4.49 KB
/
start.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
#!/bin/bash
# This script is more important to do a right compilation..
#
# Coded by Osiris
# For any question about this or other, mail me to
# greez ;
#
# Contributor: odites
VERS="make vers"
CLEAN="make clean"
MAKE="make"
MAKE_IMG="make img"
MAKE_FS="make filesystem"
case $1 in
"help")
less doc/help.txt
exit 1
;;
"qemu")
qemu-system-i386 -fda boot/grub.img
;;
"bochs")
bochs -f .bochsrc -q
;;
"floppy_install")
echo "----------------floppy_install------ "
echo "Installation in progres.."
su -c "make install"
echo "done."
echo "---------------------- "
exit
;;
"grub")
echo "--------------------------------------------- "
echo "Creating backup of menu.lst (/boot/grub/menu.lst_backup) .."
su -c "cp /boot/grub/menu.lst /boot/grub/menu.lst_backup"
echo "done.."
echo "Launching grub installer script ..."
echo ""
su -c "python grub.py"
echo "done."
echo "--------------------------------------------- "
exit
;;
"create_iso")
echo "--------------------------------------------- "
echo "Launching ISO Creating script ..."
echo ""
mkisofs -o ISO/dreamos-image.iso -A DreamOS -b boot/grub.img `pwd`
echo "done."
echo "--------------------------------------------- "
echo "ISO Created in ISO/"
echo "---------------------------------------------"
exit
;;
"eltorito_iso")
echo "--------------------------------------------- "
echo "Launching ISO Creating script ..."
exit echo ""
sh utils/eltorito_gen.sh
echo "done."
echo "--------------------------------------------- "
exit
;;
"create_fs")
echo "--------------------------------------------- "
echo "Launching FS Creating script in progress.."
echo ""
utils/initfscp -m mp -m test `find files/* -exec echo {} +;` initfs
echo "done."
$MAKE_FS
# su -c "mount -o loop boot/grub.img boot/os && rm -rf boot/os/initfs && cp initfs boot/os/initfs && umount boot/os"
echo "--------------------------------------------- "
echo "FS Created and added to boot/grub.img"
echo "---------------------------------------------"
exit
;;
"--config")
case $2 in
"bochs")
echo "--------------------------------------------- "
echo "Configuring .bochsrc file configuration.."
echo "--------------------------------------------- "
./bochsconfig.sh
echo "done."
exit
;;
esac
;;
"--compile")
case $2 in
"qemu"|"bochs")
if [ "$3" == "it" ] || [ "$3" == "en" ]; then
echo "Setting up Language '$2', done."
make "$3"
echo "----------------------->"
else
echo "Warning: No language translation declared!"
echo "----------------------->"
fi
$VERS && $CLEAN && $MAKE && $MAKE_IMG
echo "--------------------------------------------- "
echo "Launching FS Creating script ..."
echo ""
utils/initfscp `find files/* -exec echo {} +;` initfs
echo "done."
$MAKE_FS
echo "--------------------------------------------- "
echo "FS Created and added to boot/grub.img"
echo "---------------------------------------------"
if [ "$2" == "qemu" ]
then
qemu-system-i386 -fda boot/grub.img
else
bochs -f .bochsrc -q
fi
exit
;;
"floppy_install")
$VERS && $CLEAN && $MAKE && $MAKE_IMG && $MAKE_FS
echo "---------------------- "
echo "Installation in progres.."
su -c "make install"
echo "done."
echo "---------------------- "
exit
;;
"grub")
$VERS && $CLEAN && $MAKE && $MAKE_IMG && $MAKE_FS
echo "--------------------------------------------- "
echo "Launching grub installer script in ..."
su -c "python grub.py"
echo "done."
echo "--------------------------------------------- "
exit
;;
"create_iso")
$VERS && $CLEAN && $MAKE && $MAKE_IMG && $MAKE_FS
echo "--------------------------------------------- "
echo "Launching ISO Creation script..."
echo ""
mkisofs -o ISO/dreamos-image.iso -A DreamOS -b boot/grub.img `pwd`
echo "done."
echo "--------------------------------------------- "
echo "ISO Created in ISO/"
echo "--------------------------------------------- "
exit
;;
*)
echo "'$2' is an unknown command to me, please read the help!"
echo "Usage: $0 help"
exit
;;
esac
;;
*)
echo "no command passed; please read the help!"
echo "Usage: $0 help"
exit
;;
esac