1 |
#!/bin/sh |
#!/bin/sh |
2 |
# |
# |
3 |
# $Header: /home/cvsd/alx-cvs/alx-src/alxinstall-ng/bin/alxinstall-ng.sh,v 1.2 2005-04-18 20:27:57 niro Exp $ |
# $Header: /home/cvsd/alx-cvs/alx-src/alxinstall-ng/bin/alxinstall-ng.sh,v 1.13 2008-06-27 23:33:40 niro Exp $ |
4 |
# |
# |
5 |
# AutoSta_LX Installation Script |
# AutoSta_LX Installation Script |
|
# version: 0.8b |
|
6 |
# |
# |
7 |
# Niels Rogalla <niro@magellan-linux.de> |
# Niels Rogalla <niro@magellan-linux.de> |
8 |
# <rogalla@augusta-bochum.de> |
# <rogalla@augusta-bochum.de> |
11 |
# Install Navigation Gui |
# Install Navigation Gui |
12 |
# |
# |
13 |
|
|
|
#source /etc/alx_version |
|
|
#source /opt/alx-config/version |
|
|
|
|
|
#source /etc/alx-config/config.rc |
|
|
|
|
14 |
#images: (get ${CDIMAGENAME}) |
#images: (get ${CDIMAGENAME}) |
15 |
source /mnt/cdrom/system/images.conf |
source /mnt/cdrom/system/images.conf |
16 |
|
|
17 |
#Includes |
#Includes |
18 |
source /usr/lib/alxinstall-ng/functions/findhdd.sh > /dev/null |
source /usr/lib/alxinstall-ng/functions/findhdd.sh > /dev/null |
19 |
### bugfix ############################### |
### bugfix ############################### |
20 |
cdromdev="`echo $cdromdev|sed -e 's/ //'`" |
cdromdev="$(echo ${cdromdev} | sed 's/ //')" |
21 |
######################################## |
######################################## |
22 |
|
|
23 |
### System/Config Version |
### System/Config Version |
24 |
VERSION="0.1" |
VERSION="0.3" |
25 |
TITLE="alxinstall-ng - ${VERSION}" |
TITLE="alxinstall-ng - ${VERSION}" |
26 |
|
|
|
#CONFIGS_TEMPLATE="/opt/alx-config/configs" |
|
|
|
|
27 |
CDPATH="/mnt/cdrom" |
CDPATH="/mnt/cdrom" |
28 |
INSTALLPATH="/mnt/magellan" |
INSTALLPATH="/mnt/magellan" |
29 |
|
|
36 |
# DIALOG BOXEN # |
# DIALOG BOXEN # |
37 |
################################################# |
################################################# |
38 |
|
|
39 |
die() { |
die() |
40 |
#clear |
{ |
|
#echo -e "\nhuch, da ist ein script gestorben -> $?\n" |
|
|
#read |
|
|
#exit 0 |
|
41 |
ERROR=$1 |
ERROR=$1 |
42 |
RETVAL=$? |
RETVAL=$? |
43 |
dialog_install_failure |
dialog_install_failure |
44 |
exit 1 |
exit 1 |
45 |
} |
} |
46 |
|
|
47 |
dialog_warning() { |
dialog_warning() |
48 |
|
{ |
49 |
dialog \ |
dialog \ |
50 |
--backtitle "$TITLE" \ |
--backtitle "${TITLE}" \ |
51 |
--colors \ |
--colors \ |
52 |
--defaultno \ |
--defaultno \ |
53 |
--yesno "\Z1 !!! Achtung !!! \Zn\n\n\ |
--yesno "\Z1 !!! Achtung !!! \Zn\n\n\ |
54 |
Diese Festplatte wird unwiederruflich geloescht werden.\n\n\ |
Diese Festplatte wird unwiederruflich geloescht werden.\n\n\ |
55 |
Soll ich wirklich fortfahren ?" 10 70 |
Soll ich wirklich fortfahren ?" 10 70 |
56 |
RES=$? |
RES=$? |
57 |
if [ "$RES" == "1" ] |
if [[ ${RES} -eq 1 ]] |
58 |
then |
then |
59 |
clear |
clear |
60 |
echo "Der Vorgang wurde abgebrochen." |
echo "Der Vorgang wurde abgebrochen." |
62 |
fi |
fi |
63 |
} |
} |
64 |
|
|
65 |
dialog_setup_hdd_info(){ |
dialog_setup_hdd_info() |
66 |
local SHDD="`echo $HDD|sed -e 's/\/dev\///'`" |
{ |
67 |
|
local SHDD="$(echo ${HDD} | sed 's/\/dev\///')" |
68 |
|
|
69 |
dialog \ |
dialog \ |
70 |
--colors \ |
--colors \ |
71 |
--title "[ Festplatten Partitionierung ]" \ |
--title "[ Festplatten Partitionierung ]" \ |
72 |
--backtitle "$TITLE" \ |
--backtitle "${TITLE}" \ |
73 |
--ok-label "Weiter" \ |
--ok-label "Weiter" \ |
74 |
--msgbox "\nBitte legen Sie 3 Partitionen an.\n\n\ |
--msgbox "\nBitte legen Sie 3 Partitionen an.\n\n\ |
75 |
[ \Z3${SHDD}1\Zn ] Typ: \Z3Linux\Zn mit ca. 50MB\n\ |
[ \Z3${SHDD}1\Zn ] Typ: \Z3Linux\Zn mit ca. 50MB\n\ |
78 |
Bitte ${SHDD}1 als \Z3bootable\Zn markieren." 12 81 |
Bitte ${SHDD}1 als \Z3bootable\Zn markieren." 12 81 |
79 |
} |
} |
80 |
|
|
81 |
dialog_setup_hdd_menu() { |
dialog_setup_hdd_info_flash() |
82 |
|
{ |
83 |
|
local SHDD="$(echo $HDD | sed 's/\/dev\///')" |
84 |
|
|
85 |
|
dialog \ |
86 |
|
--colors \ |
87 |
|
--title "[ Festplatten Partitionierung ]" \ |
88 |
|
--backtitle "${TITLE}" \ |
89 |
|
--ok-label "Weiter" \ |
90 |
|
--msgbox "\nBitte legen Sie 1 Partition an.\n\n\ |
91 |
|
[ \Z3${SHDD}1\Zn ] Typ: \Z3Linux\Zn mit dem gesamten Speicher\n\ |
92 |
|
Bitte ${SHDD}1 als \Z3bootable\Zn markieren." 12 81 |
93 |
|
} |
94 |
|
|
95 |
|
dialog_setup_system_menu() |
96 |
|
{ |
97 |
|
local i |
98 |
|
|
99 |
I=`dialog \ |
i=$(dialog \ |
100 |
--backtitle "$TITLE" \ |
--backtitle "${TITLE}" \ |
101 |
--title "[ Festplatten Partitionierung ]" \ |
--title "[ Festplatten Partitionierung ]" \ |
102 |
--cancel-label "Abbrechen" \ |
--cancel-label "Abbrechen" \ |
103 |
--ok-label "Weiter" \ |
--ok-label "Weiter" \ |
104 |
--stdout \ |
--stdout \ |
105 |
--menu "\nWaehlen Sie zwischen Manuell und Automatisch" 14 70 5 \ |
--menu "\nWaehlen Sie die Installations-Methode" 14 70 5 \ |
106 |
"1" "Manuell" \ |
"1" "Normale IDE-Disk" \ |
107 |
"2" "Automatisch"` |
"2" "Flash-Speicher") |
108 |
RES=$? |
RES=$? |
109 |
if [ "$RES" == "1" ];then |
[[ ${RES} -eq 1 ]] && return 1 |
110 |
return 1 |
if [[ ${RES} -eq 0 ]] |
111 |
fi |
then |
112 |
if [ "$RES" == "0" ];then |
case "${i}" in |
113 |
case "$I" in |
"1") run_install_normal ;; |
114 |
"1") |
"2") run_install_flash ;; |
|
dialog_setup_hdd_found_manuell |
|
|
;; |
|
|
"2") |
|
|
dialog_warning |
|
|
setup_hdd_partitions_silent |
|
|
;; |
|
115 |
esac |
esac |
116 |
fi |
fi |
117 |
} |
} |
118 |
|
|
119 |
dialog_setup_hdd_found_manuell() { |
dialog_setup_hdd_found_manuell() |
120 |
if [ ! -z "$installdevs" ] |
{ |
121 |
then |
local i |
122 |
installdevs="" |
|
123 |
fi |
[[ ! -z ${installdevs} ]] && installdevs="" |
124 |
|
|
125 |
echo "dialog \\" > /tmp/hddtmp.sh |
echo "dialog \\" > /tmp/hddtmp.sh |
126 |
echo "--backtitle \"$TITLE\" \\" >> /tmp/hddtmp.sh |
echo "--backtitle \"${TITLE}\" \\" >> /tmp/hddtmp.sh |
127 |
echo "--ok-label \"Weiter\" \\" >> /tmp/hddtmp.sh |
echo "--ok-label \"Weiter\" \\" >> /tmp/hddtmp.sh |
128 |
echo "--stdout \\" >> /tmp/hddtmp.sh |
echo "--stdout \\" >> /tmp/hddtmp.sh |
129 |
echo "--colors \\" >> /tmp/hddtmp.sh |
echo "--colors \\" >> /tmp/hddtmp.sh |
130 |
echo "--msgbox \"Gefundene Hardware:\n\n \\" >> /tmp/hddtmp.sh |
echo "--msgbox \"Gefundene Hardware:\n\n \\" >> /tmp/hddtmp.sh |
131 |
echo " Festplatten:\n \\" >> /tmp/hddtmp.sh |
echo " Festplatten:\n \\" >> /tmp/hddtmp.sh |
132 |
|
|
133 |
if [ ! -z "$scsidisks" ] |
if [[ ! -z ${scsidisks} ]] |
134 |
then |
then |
135 |
for I in $scsidisks |
for i in ${scsidisks} |
136 |
do |
do |
137 |
if [ "$I" != "$cdromdev" ] |
if [[ ${i} != ${cdromdev} ]] |
138 |
then |
then |
139 |
echo " \\Z7SCSI: \\Z3$I\\Zn\n \\" >> /tmp/hddtmp.sh |
echo " \\Z7SCSI: \\Z3${i}\\Zn\n \\" >> /tmp/hddtmp.sh |
140 |
installdevs="$installdevs $I" |
installdevs="${installdevs} ${i}" |
141 |
fi |
fi |
142 |
done |
done |
143 |
fi |
fi |
144 |
|
|
145 |
if [ ! -z "$idedisks" ] |
if [[ ! -z ${idedisks} ]] |
146 |
then |
then |
147 |
for I in $idedisks |
for i in ${idedisks} |
148 |
do |
do |
149 |
if [ "$I" != "$cdromdev" ] |
if [[ ${i} != ${cdromdev} ]] |
150 |
then |
then |
151 |
echo " \\Z7IDE: \\Z3$I\\Zn\n \\" >> /tmp/hddtmp.sh |
echo " \\Z7IDE: \\Z3${i}\\Zn\n \\" >> /tmp/hddtmp.sh |
152 |
installdevs="$installdevs $I" |
installdevs="${installdevs} ${i}" |
153 |
fi |
fi |
154 |
done |
done |
155 |
fi |
fi |
156 |
|
|
157 |
if [ ! -z "$cdromdev" ] |
if [[ ! -z ${cdromdev} ]] |
158 |
then |
then |
159 |
echo " \n \\" >> /tmp/hddtmp.sh |
echo " \n \\" >> /tmp/hddtmp.sh |
160 |
echo " \\Z7andere Laufwerke:\n \\" >> /tmp/hddtmp.sh |
echo " \\Z7andere Laufwerke:\n \\" >> /tmp/hddtmp.sh |
161 |
echo " CDROM: \\Z3$cdromdev\\Zn\n \\" >> /tmp/hddtmp.sh |
echo " CDROM: \\Z3${cdromdev}\\Zn\n \\" >> /tmp/hddtmp.sh |
162 |
fi |
fi |
163 |
echo " \" 13 70" >> /tmp/hddtmp.sh |
echo " \" 13 70" >> /tmp/hddtmp.sh |
164 |
chmod a+x /tmp/hddtmp.sh |
chmod a+x /tmp/hddtmp.sh |
165 |
/tmp/hddtmp.sh |
/tmp/hddtmp.sh |
166 |
} |
} |
167 |
|
|
168 |
dialog_setup_hdd_partitions_manuell() { |
dialog_setup_hdd_partitions_manuell() |
169 |
if [ -z "$installdevs" ] |
{ |
170 |
|
local i |
171 |
|
|
172 |
|
if [[ -z ${installdevs} ]] |
173 |
then |
then |
174 |
dialog \ |
dialog \ |
175 |
--backtitle "$TITLE" \ |
--backtitle "${TITLE}" \ |
176 |
--ok-label "Beenden" \ |
--ok-label "Beenden" \ |
177 |
--msgbox "Kein geeignetes Laufwerk gefunden.\nDie Installation ist fehlgeschlagen." 6 70 |
--msgbox "Kein geeignetes Laufwerk gefunden.\nDie Installation ist fehlgeschlagen." 6 70 |
178 |
exit 1 |
exit 1 |
179 |
else |
else |
180 |
|
|
181 |
echo "dialog \\" > /tmp/hddtmp.sh |
echo "dialog \\" > /tmp/hddtmp.sh |
182 |
echo "--backtitle \"$TITLE\" \\" >> /tmp/hddtmp.sh |
echo "--backtitle \"${TITLE}\" \\" >> /tmp/hddtmp.sh |
183 |
echo "--ok-label \"Weiter\" \\" >> /tmp/hddtmp.sh |
echo "--ok-label \"Weiter\" \\" >> /tmp/hddtmp.sh |
184 |
echo "--cancel-label \"Beenden\" \\" >> /tmp/hddtmp.sh |
echo "--cancel-label \"Beenden\" \\" >> /tmp/hddtmp.sh |
185 |
echo "--stdout \\" >> /tmp/hddtmp.sh |
echo "--stdout \\" >> /tmp/hddtmp.sh |
186 |
echo "--menu \"Installations Laufwerk auswaehlen:\" 10 70 3 \\" >> /tmp/hddtmp.sh |
echo "--menu \"Installations Laufwerk auswaehlen:\" 10 70 3 \\" >> /tmp/hddtmp.sh |
187 |
|
|
188 |
for I in $installdevs |
for i in ${installdevs} |
189 |
do |
do |
190 |
echo "\"$I\" \"\" \\" >> /tmp/hddtmp.sh |
echo "\"${i}\" \"\" \\" >> /tmp/hddtmp.sh |
191 |
done |
done |
192 |
echo -e "\n" >> /tmp/hddtmp.sh |
echo -e "\n" >> /tmp/hddtmp.sh |
193 |
|
|
194 |
chmod a+x /tmp/hddtmp.sh |
chmod a+x /tmp/hddtmp.sh |
195 |
HDD="`/tmp/hddtmp.sh`" |
HDD="$(/tmp/hddtmp.sh)" |
196 |
RES=$? |
RES=$? |
197 |
if [ "$RES" == "1" ] |
[[ ${RES} -eq 1 ]] && return 1 |
198 |
then |
if [[ ${RES} -eq 0 ]] |
|
return 1 |
|
|
fi |
|
|
if [ "$RES" == "0" ] |
|
199 |
then |
then |
200 |
dialog_setup_hdd_info |
dialog_setup_hdd_info |
201 |
setup_hdd_partitions_manuell |
setup_hdd_partitions_manuell |
203 |
fi |
fi |
204 |
} |
} |
205 |
|
|
206 |
dialog_setup_hdd_partitions_silent() { |
dialog_setup_hdd_partitions_manuell_flash() |
207 |
dialog \ |
{ |
208 |
--backtitle "$TITLE" \ |
local i |
209 |
--infobox "Erstelle Partitionen ..." 3 70 |
|
210 |
|
if [[ -z ${installdevs} ]] |
211 |
|
then |
212 |
|
dialog \ |
213 |
|
--backtitle "${TITLE}" \ |
214 |
|
--ok-label "Beenden" \ |
215 |
|
--msgbox "Kein geeignetes Laufwerk gefunden.\nDie Installation ist fehlgeschlagen." 6 70 |
216 |
|
exit 1 |
217 |
|
else |
218 |
|
|
219 |
|
echo "dialog \\" > /tmp/hddtmp.sh |
220 |
|
echo "--backtitle \"${TITLE}\" \\" >> /tmp/hddtmp.sh |
221 |
|
echo "--ok-label \"Weiter\" \\" >> /tmp/hddtmp.sh |
222 |
|
echo "--cancel-label \"Beenden\" \\" >> /tmp/hddtmp.sh |
223 |
|
echo "--stdout \\" >> /tmp/hddtmp.sh |
224 |
|
echo "--menu \"Installations Laufwerk auswaehlen:\" 10 70 3 \\" >> /tmp/hddtmp.sh |
225 |
|
|
226 |
|
for i in ${installdevs} |
227 |
|
do |
228 |
|
echo "\"${i}\" \"\" \\" >> /tmp/hddtmp.sh |
229 |
|
done |
230 |
|
echo -e "\n" >> /tmp/hddtmp.sh |
231 |
|
|
232 |
|
chmod a+x /tmp/hddtmp.sh |
233 |
|
HDD="$(/tmp/hddtmp.sh)" |
234 |
|
RES=$? |
235 |
|
[[ ${RES} -eq 1 ]] && return 1 |
236 |
|
if [[ ${RES} -eq 0 ]] |
237 |
|
then |
238 |
|
dialog_setup_hdd_info_flash |
239 |
|
setup_hdd_partitions_manuell_flash |
240 |
|
fi |
241 |
|
fi |
242 |
} |
} |
243 |
|
|
244 |
dialog_setup_hdd_format() { |
dialog_setup_hdd_format() |
245 |
|
{ |
246 |
dialog \ |
dialog \ |
247 |
--backtitle "$TITLE" \ |
--backtitle "${TITLE}" \ |
248 |
--infobox "Erstelle Datei-Systeme ..." 3 70 |
--infobox "Erstelle Datei-Systeme ..." 3 70 |
249 |
} |
} |
250 |
|
|
251 |
dialog_install_settings() { |
dialog_install_settings() |
252 |
|
{ |
253 |
dialog \ |
dialog \ |
254 |
--backtitle "$TITLE" \ |
--backtitle "${TITLE}" \ |
255 |
--infobox "Speichere System-Einstellungen ..." 3 70 |
--infobox "Speichere System-Einstellungen ..." 3 70 |
256 |
} |
} |
257 |
|
|
258 |
dialog_install_system_image() { |
dialog_install_system_image() |
259 |
|
{ |
260 |
dialog \ |
dialog \ |
261 |
--backtitle "$TITLE" \ |
--backtitle "${TITLE}" \ |
262 |
--gauge "Kopiere System-Image ..." 6 80 |
--gauge "Kopiere System-Image ..." 6 80 |
263 |
} |
} |
264 |
|
|
265 |
dialog_install_meter() { |
dialog_install_meter() |
266 |
while [ "${CURRENTLINE}" != "${TOTALLINES}" ] ; do |
{ |
267 |
CURRENTLINE=`grep --count . /tmp/install.log` |
while [[ ${CURRENTLINE} != ${TOTALLINES} ]] |
268 |
PERCENT=`expr ${CURRENTLINE} \* 100 / ${TOTALLINES}` |
do |
269 |
|
CURRENTLINE=$(grep -c . /tmp/install.log) |
270 |
|
PERCENT=$(( ${CURRENTLINE} * 100 / ${TOTALLINES})) |
271 |
echo ${PERCENT} |
echo ${PERCENT} |
272 |
sleep 1 |
sleep 1 |
273 |
done |
done |
276 |
} |
} |
277 |
|
|
278 |
|
|
279 |
dialog_install_bootsector() { |
dialog_install_bootsector() |
280 |
|
{ |
281 |
dialog \ |
dialog \ |
282 |
--backtitle "$TITLE" \ |
--backtitle "${TITLE}" \ |
283 |
--infobox "Schreibe den Bootsektor ..." 3 70 |
--infobox "Schreibe den Bootsektor ..." 3 70 |
284 |
} |
} |
285 |
|
|
286 |
dialog_install_alxconfig() { |
dialog_install_successful() |
287 |
dialog \ |
{ |
|
--backtitle "$TITLE" \ |
|
|
--infobox "Installiere die ALX Setup-Tools ..." 3 70 |
|
|
} |
|
|
|
|
|
dialog_install_kernel_image() { |
|
|
dialog \ |
|
|
--backtitle "$TITLE" \ |
|
|
--infobox "Installiere den System-Kernel ..." 3 70 |
|
|
|
|
|
} |
|
|
|
|
|
dialog_install_hotfixes() { |
|
|
dialog \ |
|
|
--backtitle "$TITLE" \ |
|
|
--infobox "Installiere Hotfixes ..." 3 70 |
|
|
|
|
|
} |
|
|
|
|
|
dialog_install_successful() { |
|
288 |
dialog \ |
dialog \ |
289 |
--backtitle "$TITLE" \ |
--backtitle "${TITLE}" \ |
290 |
--colors \ |
--colors \ |
291 |
--msgbox "Die Installation war \Z2erfolgreich\Zn." 5 81 |
--msgbox "Die Installation war \Z2erfolgreich\Zn." 5 81 |
292 |
} |
} |
293 |
|
|
294 |
dialog_install_failure() { |
dialog_install_failure() |
295 |
|
{ |
296 |
dialog \ |
dialog \ |
297 |
--backtitle "$TITLE" \ |
--backtitle "${TITLE}" \ |
298 |
--colors \ |
--colors \ |
299 |
--msgbox "Die Installation ist \Z1Fehlgeschlagen\Zn.\n\n\ |
--msgbox "Die Installation ist \Z1Fehlgeschlagen\Zn.\n\n\ |
300 |
Fehler bei $ERROR, RetVal: $RETVAL \ |
Fehler bei ${ERROR}, RetVal: ${RETVAL} \ |
301 |
" 10 81 |
" 10 81 |
302 |
} |
} |
303 |
|
|
304 |
dialog_install_method() { |
dialog_main() |
305 |
|
{ |
|
METHOD=`dialog \ |
|
|
--backtitle "$TITLE" \ |
|
|
--cancel-label "Abbrechen" \ |
|
|
--ok-label "Weiter" \ |
|
|
--stdout \ |
|
|
--menu "Konfiguration" 14 70 5 \ |
|
|
"1" "Normale Installation" \ |
|
|
"2" "Silent Installation"` |
|
|
RES=$? |
|
|
if [ "$RES" == "1" ];then |
|
|
return 1 |
|
|
fi |
|
|
if [ "$RES" == "0" ];then |
|
|
case "$METHOD" in |
|
|
"1") |
|
|
run_install_normal |
|
|
;; |
|
|
"2") |
|
|
dialog_warning |
|
|
run_install_silent |
|
|
;; |
|
|
esac |
|
|
fi |
|
|
} |
|
|
|
|
|
dialog_main() { |
|
306 |
METHOD=0 |
METHOD=0 |
307 |
|
|
308 |
while [ $METHOD -le 2 ] |
while [[ ${METHOD} -le 2 ]] |
309 |
do |
do |
310 |
METHOD=`dialog \ |
METHOD=$(dialog \ |
311 |
--backtitle "$TITLE" \ |
--backtitle "${TITLE}" \ |
312 |
--no-cancel \ |
--no-cancel \ |
313 |
--ok-label "Weiter" \ |
--ok-label "Weiter" \ |
314 |
--stdout \ |
--stdout \ |
316 |
"1" "AutoSta_LX installieren" \ |
"1" "AutoSta_LX installieren" \ |
317 |
"2" "Uebersicht gefundener Laufwerke" \ |
"2" "Uebersicht gefundener Laufwerke" \ |
318 |
"3" "Beenden und neustarten" \ |
"3" "Beenden und neustarten" \ |
319 |
"4" "Beenden und eine Shell starten" ` |
"4" "Beenden und eine Shell starten") |
320 |
RES=$? |
RES=$? |
321 |
if [ "$RES" == "1" ];then |
[[ ${RES} -eq 1 ]] && exit 1 |
322 |
exit 1 |
if [[ ${RES} -eq 0 ]] |
323 |
fi |
then |
324 |
if [ "$RES" == "0" ];then |
case ${METHOD} in |
325 |
case "$METHOD" in |
"1") dialog_setup_system_menu ;; |
326 |
"1") |
"2") dialog_setup_hdd_found_manuell ;; |
327 |
#only for now later it will be used again |
"3") install_do_reboot ;; |
328 |
#with 6.1-r2 only one install method available |
"4") /bin/bash --login -i ;; |
|
#dialog_install_method |
|
|
run_install_normal |
|
|
;; |
|
|
"2") dialog_setup_hdd_found_manuell |
|
|
;; |
|
|
"3") install_do_reboot |
|
|
;; |
|
|
"4") /bin/bash --login -i |
|
|
;; |
|
329 |
esac |
esac |
330 |
fi |
fi |
331 |
done |
done |
334 |
################################################# |
################################################# |
335 |
# Install Komandos # |
# Install Komandos # |
336 |
################################################# |
################################################# |
337 |
setup_hdd_partitions_manuell() { |
setup_hdd_partitions_manuell() |
338 |
|
{ |
339 |
BOOTHDD="${HDD}1" |
BOOTHDD="${HDD}1" |
340 |
SWAPHDD="${HDD}2" |
SWAPHDD="${HDD}2" |
341 |
ROOTHDD="${HDD}3" |
ROOTHDD="${HDD}3" |
342 |
|
|
343 |
## hdds partitionieren manuell |
## hdds partitionieren manuell |
344 |
cfdisk $HDD || die |
cfdisk ${HDD} || die |
345 |
} |
} |
346 |
|
|
347 |
setup_hdd_partitions_silent() { |
setup_hdd_partitions_manuell_flash() |
348 |
## hdds löschen |
{ |
349 |
dd if=/dev/zero of=$HDD bs=1024k count=1 || die |
ROOTHDD="${HDD}1" |
|
## hdds partitionieren silent |
|
|
fdisk $HDD < $CONFIGS_TEMPLATE/fdisksettings #1> /dev/null 3> /dev/null || die |
|
|
|
|
|
read |
|
|
} |
|
350 |
|
|
351 |
setup_hdd_format() { |
## hdds partitionieren manuell |
352 |
mkswap $SWAPHDD || die |
cfdisk ${HDD} || die |
|
mke2fs -j -q $BOOTHDD || die |
|
|
mke2fs -j -q $ROOTHDD || die |
|
353 |
} |
} |
354 |
|
|
355 |
install_mount_rootfs() { |
setup_hdd_format() |
356 |
swapon $SWAPHDD || die |
{ |
357 |
mount $ROOTHDD $INSTALLPATH || die |
mkswap ${SWAPHDD} || die |
358 |
install -d $INSTALLPATH/boot || die |
mke2fs -j -q ${BOOTHDD} || die |
359 |
mount $BOOTHDD $INSTALLPATH/boot || die |
mke2fs -j -q ${ROOTHDD} || die |
|
cd $INSTALLPATH || die |
|
360 |
} |
} |
361 |
|
|
362 |
install_system_image() { |
setup_hdd_format_flash() |
363 |
#tar xvzpf $CDPATH/system/autosta_lx.tar.gz |
{ |
364 |
tar xvjpf ${CDPATH}/system/${CDIMAGENAME} -C ${INSTALLPATH} |
mke2fs -j -q ${ROOTHDD} || die |
365 |
} |
} |
366 |
|
|
367 |
|
install_mount_rootfs() |
368 |
install_kernel_image() { |
{ |
369 |
declare -i CPUTYPE=`cat /proc/cpuinfo |grep "cpu family"|cut -d ' ' -f3` |
swapon ${SWAPHDD} || die |
370 |
|
mount ${ROOTHDD} ${INSTALLPATH} || die |
371 |
if [ $CPUTYPE -le 5 ];then |
install -d ${INSTALLPATH}/boot || die |
372 |
#echo -e "\033[1;6m\033[36m""i386 Architektur gefunden.""\033[0m" |
mount ${BOOTHDD} ${INSTALLPATH}/boot || die |
373 |
#echo -e "Installiere i386 Kernel..." |
cd ${INSTALLPATH} || die |
|
|
|
|
lastdir="`pwd`" |
|
|
|
|
|
mkdir -p $INSTALLPATH/INSTALL/kernel || die |
|
|
cd $INSTALLPATH/INSTALL/kernel || die |
|
|
tar xzpf $CDPATH/kernels/kernel-i386.tar.gz || die |
|
|
source $INSTALLPATH/INSTALL/kernel/kernelversion || die |
|
|
|
|
|
cp -aRf $INSTALLPATH/INSTALL/kernel/$KRNLIB $INSTALLPATH/lib/modules || die |
|
|
cp -aRf $INSTALLPATH/INSTALL/kernel/$KRNIMG $INSTALLPATH/boot || die |
|
|
cp -aRf $INSTALLPATH/INSTALL/kernel/$KRNINITRD $INSTALLPATH/boot || die |
|
|
cp -aRf $INSTALLPATH/INSTALL/kernel/kernelversion $INSTALLPATH/boot || die |
|
|
|
|
|
cd $lastdir || die |
|
|
|
|
|
elif [ $CPUTYPE -ge 6 ];then |
|
|
#echo -e "\033[1;6m\033[36m""i686 Architektur gefunden.""\033[0m" |
|
|
#echo -e "Installiere i686 Kernel..." |
|
|
|
|
|
lastdir="`pwd`" |
|
|
|
|
|
mkdir -p $INSTALLPATH/INSTALL/kernel || die |
|
|
cd $INSTALLPATH/INSTALL/kernel || die |
|
|
tar xzpf $CDPATH/kernels/kernel-i686.tar.gz || die |
|
|
source $INSTALLPATH/INSTALL/kernel/kernelversion || die |
|
|
|
|
|
cp -aRf $INSTALLPATH/INSTALL/kernel/$KRNLIB $INSTALLPATH/lib/modules || die |
|
|
cp -aRf $INSTALLPATH/INSTALL/kernel/$KRNIMG $INSTALLPATH/boot || die |
|
|
cp -aRf $INSTALLPATH/INSTALL/kernel/$KRNINITRD $INSTALLPATH/boot || die |
|
|
cp -aRf $INSTALLPATH/INSTALL/kernel/kernelversion $INSTALLPATH/boot || die |
|
|
|
|
|
cd $lastdir || die |
|
|
fi |
|
374 |
} |
} |
375 |
|
|
376 |
install_bootsector() { |
install_mount_rootfs_flash() |
377 |
### grubconf schreiben |
{ |
378 |
source $INSTALLPATH/INSTALL/kernel/kernelversion |
mount ${ROOTHDD} ${INSTALLPATH} || die |
379 |
|
install -d ${INSTALLPATH}/boot || die |
380 |
if [ -z $KRNVER ] |
cd ${INSTALLPATH} || die |
381 |
then |
} |
|
KRNVER="AutoSta_LX" |
|
|
fi |
|
|
|
|
|
if [ -z $KRNIMG ] |
|
|
then |
|
|
KRNIMG="bzImage" |
|
|
fi |
|
|
|
|
|
if [ -z $KRNINITRD ] |
|
|
then |
|
|
KRNINITRD="initrd" |
|
|
fi |
|
|
|
|
|
echo -e "default 0" > $INSTALLPATH/boot/grub/grub.conf || die |
|
|
echo -e "timeout 03" >> $INSTALLPATH/boot/grub/grub.conf ||die |
|
|
#no support for splash image in 6.1-r2 |
|
|
#echo -e "splashimage=(hd0,0)/boot/grub/splash.xpm.gz" >> $INSTALLPATH/boot/grub/grub.conf || die |
|
|
echo -e "\ntitle=${KRNVER}" >> $INSTALLPATH/boot/grub/grub.conf || die |
|
|
echo -e "root (hd0,0)" >> $INSTALLPATH/boot/grub/grub.conf || die |
|
|
|
|
|
#s3 cards don't support this |
|
|
#echo -e "kernel (hd0,0)/boot/${KRNIMG} root=$ROOTHDD vga=0x317 video:vesa:ywrap,mtrr splash=silent quiet" >> $INSTALLPATH/boot/grub/grub.conf || die |
|
|
#that's more safer: |
|
|
echo -e "kernel (hd0,0)/boot/${KRNIMG} root=$ROOTHDD quiet" >> $INSTALLPATH/boot/grub/grub.conf || die |
|
|
|
|
|
#not needed without bootsplash support |
|
|
#echo -e "initrd=/boot/${KRNINITRD}" >> $INSTALLPATH/boot/grub/grub.conf || die |
|
382 |
|
|
383 |
### bootsector schreiben |
install_system_image() |
384 |
#grub --no-floppy < $CONFIGS_TEMPLATE/grubsettings || die |
{ |
385 |
/sbin/grub --no-floppy --batch << "EOF" 1> /dev/null 2> /dev/null || die |
tar xvjpf ${CDPATH}/system/${CDIMAGENAME} -C ${INSTALLPATH} |
|
root (hd0,0) |
|
|
setup (hd0) |
|
|
quit |
|
|
EOF |
|
386 |
} |
} |
387 |
|
|
388 |
install_bootsector_chroot() { |
install_bootsector_chroot() |
389 |
|
{ |
390 |
### grubconf schreiben |
### grubconf schreiben |
391 |
#source $INSTALLPATH/INSTALL/kernel/kernelversion |
source ${INSTALLPATH}/boot/kernelversion |
|
source $INSTALLPATH/boot/kernelversion |
|
392 |
|
|
393 |
#for alx only |
#for alx only |
394 |
if [ -e ${INSTALLPATH}/etc/alx_version ] |
if [ -e ${INSTALLPATH}/etc/alx_version ] |
398 |
KRNVER="ALX-${ALXVER}" |
KRNVER="ALX-${ALXVER}" |
399 |
ALXVER="${OLD_ALXVER}" |
ALXVER="${OLD_ALXVER}" |
400 |
fi |
fi |
|
|
|
|
if [ -z "$KRNVER" ] |
|
|
then |
|
|
KRNVER="AutoSta_LX" |
|
|
fi |
|
401 |
|
|
402 |
if [ -z "$KRNIMG" ] |
[[ -z ${KRNVER} ]] && KRNVER="AutoSta_LX" |
403 |
then |
[[ -z ${KRNINITRD} ]] && KRNINITRD="initrd" |
|
KRNIMG="bzImage" |
|
|
fi |
|
404 |
|
|
405 |
if [ -z "$KRNINITRD" ] |
echo "default 0" > ${INSTALLPATH}/boot/grub/grub.conf || die |
406 |
then |
echo "timeout 0" >> ${INSTALLPATH}/boot/grub/grub.conf ||die |
|
KRNINITRD="initrd" |
|
|
fi |
|
407 |
|
|
408 |
echo -e "default 0" > $INSTALLPATH/boot/grub/grub.conf || die |
echo -e "\ntitle=${KRNVER}" >> ${INSTALLPATH}/boot/grub/grub.conf || die |
409 |
echo -e "timeout 03" >> $INSTALLPATH/boot/grub/grub.conf ||die |
echo "root (hd0,0)" >> ${INSTALLPATH}/boot/grub/grub.conf || die |
410 |
|
|
411 |
#no support for splash image in 6.1-r2 |
echo "kernel /boot/vmlinuz root=${ROOTHDD} quiet" >> ${INSTALLPATH}/boot/grub/grub.conf || die |
412 |
#echo -e "splashimage=(hd0,0)/boot/grub/splash.xpm.gz" >> $INSTALLPATH/boot/grub/grub.conf || die |
echo "initrd /boot/initrd" >> ${INSTALLPATH}/boot/grub/grub.conf || die |
413 |
|
|
414 |
echo -e "\ntitle=${KRNVER}" >> $INSTALLPATH/boot/grub/grub.conf || die |
# bootsector schreiben chrooted schreiben (lfs/magellan) |
415 |
echo -e "root (hd0,0)" >> $INSTALLPATH/boot/grub/grub.conf || die |
cat > ${INSTALLPATH}/root/.bashrc << CHROOTEOF |
|
|
|
|
#s3 cards don't support this |
|
|
#echo -e "kernel (hd0,0)/boot/${KRNIMG} root=$ROOTHDD vga=0x317 video:vesa:ywrap,mtrr splash=silent quiet" >> $INSTALLPATH/boot/grub/grub.conf || die |
|
|
#that's more safer: |
|
|
echo -e "kernel (hd0,0)/boot/${KRNIMG} root=$ROOTHDD quiet" >> $INSTALLPATH/boot/grub/grub.conf || die |
|
|
|
|
|
#not needed without bootsplash support |
|
|
#echo -e "initrd=/boot/${KRNINITRD}" >> $INSTALLPATH/boot/grub/grub.conf || die |
|
|
|
|
|
|
|
|
### bootsector schreiben chrooted schreiben (gentoo) |
|
|
if [ -f $INSTALLPATH/sbin/grub ] |
|
|
then |
|
|
cat > $INSTALLPATH/root/.bashrc << CHROOTEOF |
|
|
/sbin/grub --no-floppy --batch << "EOF" 1> /dev/null 2> /dev/null |
|
|
root (hd0,0) |
|
|
setup (hd0) |
|
|
quit |
|
|
EOF |
|
|
exit 0 |
|
|
CHROOTEOF |
|
|
fi |
|
|
|
|
|
### bootsector schreiben chrooted schreiben (lfs/magellan) |
|
|
if [ -f $INSTALLPATH/usr/sbin/grub ] |
|
|
then |
|
|
cat > $INSTALLPATH/root/.bashrc << CHROOTEOF |
|
416 |
/usr/sbin/grub --no-floppy --batch << "EOF" 1> /dev/null 2> /dev/null |
/usr/sbin/grub --no-floppy --batch << "EOF" 1> /dev/null 2> /dev/null |
417 |
root (hd0,0) |
root (hd0,0) |
418 |
setup (hd0) |
setup (hd0) |
419 |
quit |
quit |
420 |
EOF |
EOF |
421 |
|
echo "MODULES=\"ext3 amd74xx piix sis5513 via82cxxx\"" > /etc/conf.d/mkinitrd |
422 |
|
mkinitrd -f /boot/$(readlink /boot/initrd) $(readlink /boot/vmlinuz | sed "s:kernel-::g") |
423 |
exit 0 |
exit 0 |
424 |
CHROOTEOF |
CHROOTEOF |
|
fi |
|
|
|
|
|
##enters chroot |
|
|
mount -t proc proc $INSTALLPATH/proc |
|
|
chroot $INSTALLPATH /bin/bash --rcfile /root/.bashrc -i |
|
|
umount $INSTALLPATH/proc |
|
|
rm $INSTALLPATH/root/.bashrc |
|
|
} |
|
|
|
|
|
install_alxconfig(){ |
|
|
lastdir="`pwd`" |
|
|
|
|
|
mkdir -p $INSTALLPATH/opt/alx-config || die |
|
|
cd $INSTALLPATH/opt/alx-config || die |
|
|
tar xzpf $CDPATH/alx-config/alx-config.tar.gz || die |
|
|
chmod a+x $INSTALLPATH/opt/alx-config/Configurator/config_functions.sh || die |
|
|
chmod a+x $INSTALLPATH/opt/alx-config/Configurator/config_menu.sh || die |
|
|
ln -sf /opt/alx-config/Configurator/config_menu.sh $INSTALLPATH/bin/ALXConfig || die |
|
425 |
|
|
426 |
cd $lastdir || die |
## enters chroot |
427 |
|
mount -t proc proc ${INSTALLPATH}/proc |
428 |
|
mount -t sysfs sysfs ${INSTALLPATH}/sys |
429 |
|
mount -o bind /dev ${INSTALLPATH}/dev |
430 |
|
chroot ${INSTALLPATH} /bin/bash --rcfile /root/.bashrc -i |
431 |
|
umount ${INSTALLPATH}/proc |
432 |
|
umount ${INSTALLPATH}/sys |
433 |
|
umount ${INSTALLPATH}/dev |
434 |
|
rm ${INSTALLPATH}/root/.bashrc |
435 |
|
} |
436 |
|
|
437 |
|
install_system_settings() |
438 |
|
{ |
439 |
|
# schreibe fstab |
440 |
|
echo -e "${BOOTHDD}\t/boot\text3\tnoatime,noauto\t1 1" > ${INSTALLPATH}/etc/fstab || die |
441 |
|
echo -e "${ROOTHDD}\t/\text3\tnoatime\t0 0" >> ${INSTALLPATH}/etc/fstab || die |
442 |
|
echo -e "${SWAPHDD}\tswap\tswap\tpri=1\t0 0" >> ${INSTALLPATH}/etc/fstab || die |
443 |
|
echo -e "proc\t/proc\tproc\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die |
444 |
|
echo -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die |
445 |
|
} |
446 |
|
|
447 |
|
install_system_settings_flash() |
448 |
|
{ |
449 |
|
# schreibe fstab |
450 |
|
echo -e "${ROOTHDD}\t/\text3\tnoatime\t0 0" > ${INSTALLPATH}/etc/fstab || die |
451 |
|
echo -e "proc\t/proc\tproc\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die |
452 |
|
echo -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die |
453 |
} |
} |
454 |
|
|
455 |
|
install_umount_rootfs() |
456 |
install_system_settings(){ |
{ |
457 |
### schreibe fstab |
cd / |
458 |
echo -e "$BOOTHDD\t/\text3\tnoatime,noauto\t1 1" > $INSTALLPATH/etc/fstab || die |
umount ${INSTALLPATH}/boot || die |
459 |
echo -e "$ROOTHDD\t/\text3\tnoatime\t0 0" >> $INSTALLPATH/etc/fstab || die |
umount ${INSTALLPATH} || die |
460 |
echo -e "$SWAPHDD\tswap\tswap\tpri=1\t0 0" >> $INSTALLPATH/etc/fstab || die |
swapoff ${SWAPHDD} || die |
|
echo -e "none\t/proc\tproc\tdefaults\t0 0" >> $INSTALLPATH/etc/fstab || die |
|
|
|
|
|
#deprecated |
|
|
#echo -e "devpts\t/dev/pts\tdevpts\tgid=4,mode=620\t0 0" >> $INSTALLPATH/etc/fstab || die |
|
|
|
|
|
echo -e "none\t/dev/shm\ttmpfs\tdefaults\t0 0" >> $INSTALLPATH/etc/fstab || die |
|
|
echo -e "none\t/proc/bus/usb\tusbfs\tdefaults\t0 0" >> $INSTALLPATH/etc/fstab || die |
|
|
} |
|
|
|
|
|
install_hotfixes(){ |
|
|
if [ -f $CDPATH/hotfixes/hotfixes.sh ] |
|
|
then |
|
|
dialog_hotfixes |
|
|
sleep1 |
|
|
$CDPATH/hotfixes/hotfixes.sh |
|
|
fi |
|
461 |
} |
} |
462 |
|
|
463 |
install_umount_rootfs() { |
install_umount_rootfs_flash() |
464 |
|
{ |
465 |
cd / |
cd / |
466 |
umount $INSTALLPATH/boot || die |
umount ${INSTALLPATH} || die |
|
umount $INSTALLPATH || die |
|
|
swapoff $SWAPHDD || die |
|
467 |
} |
} |
468 |
|
|
469 |
install_do_reboot() { |
install_do_reboot() |
470 |
|
{ |
|
#only for now later it will be used again |
|
|
#with 6.1-r2 these options are not available |
|
|
#cd / |
|
|
#umount $CDPATH |
|
|
#eject |
|
|
#clear |
|
|
|
|
471 |
reboot |
reboot |
472 |
} |
} |
473 |
|
|
475 |
# Install Ablauf Scripte # |
# Install Ablauf Scripte # |
476 |
################################################# |
################################################# |
477 |
|
|
478 |
run_install_normal() { |
run_install_normal() |
479 |
#only for now later it will be used again |
{ |
|
#with 6.1-r2 only one install method available |
|
|
#dialog_setup_hdd_menu |
|
480 |
dialog_setup_hdd_found_manuell |
dialog_setup_hdd_found_manuell |
481 |
|
|
482 |
dialog_setup_hdd_partitions_manuell |
dialog_setup_hdd_partitions_manuell |
483 |
dialog_setup_hdd_format |
dialog_setup_hdd_format |
484 |
setup_hdd_format > /dev/null |
setup_hdd_format > /dev/null |
485 |
install_mount_rootfs |
install_mount_rootfs |
486 |
(install_system_image > /tmp/install.log) 2> /tmp/install_errors.log | dialog_install_meter | dialog_install_system_image |
(install_system_image > /tmp/install.log) 2> /tmp/install_errors.log | dialog_install_meter | dialog_install_system_image |
487 |
|
|
|
#only for now later it will be used again |
|
|
#with 6.1-r2 variable kernels are not available |
|
|
#dialog_install_kernel_image |
|
|
#install_kernel_image |
|
|
|
|
488 |
dialog_install_bootsector |
dialog_install_bootsector |
489 |
install_bootsector_chroot |
install_bootsector_chroot |
490 |
|
|
|
#only for now later it will be used again |
|
|
#with 6.1-r2 highest version of alx-config is already included |
|
|
#dialog_install_alxconfig |
|
|
#sleep 1 |
|
|
#install_alxconfig |
|
|
|
|
491 |
dialog_install_settings |
dialog_install_settings |
492 |
sleep 1 |
sleep 1 |
493 |
install_system_settings |
install_system_settings |
|
install_hotfixes |
|
494 |
install_umount_rootfs |
install_umount_rootfs |
495 |
dialog_install_successful |
dialog_install_successful |
496 |
} |
} |
497 |
|
|
498 |
run_install_silent() { |
run_install_flash() |
499 |
echo "starting silent install ..." |
{ |
500 |
sleep 1 |
dialog_setup_hdd_found_manuell |
|
} |
|
501 |
|
|
502 |
run_install_unattended() { |
dialog_setup_hdd_partitions_manuell_flash |
503 |
echo "starting unattended install ..." |
dialog_setup_hdd_format |
504 |
|
setup_hdd_format_flash > /dev/null |
505 |
|
install_mount_rootfs_flash |
506 |
|
(install_system_image > /tmp/install.log) 2> /tmp/install_errors.log | dialog_install_meter | dialog_install_system_image |
507 |
|
|
508 |
|
dialog_install_bootsector |
509 |
|
install_bootsector_chroot |
510 |
|
|
511 |
|
dialog_install_settings |
512 |
sleep 1 |
sleep 1 |
513 |
|
install_system_settings_flash |
514 |
|
install_umount_rootfs_flash |
515 |
|
dialog_install_successful |
516 |
} |
} |
517 |
|
|
518 |
if [ "$1" == "unattended" ] |
dialog_main |
|
then |
|
|
run_install_unattended |
|
|
else |
|
|
dialog_main |
|
|
fi |
|
519 |
|
|
520 |
exit 0 |
exit 0 |