127 |
local mode |
local mode |
128 |
local retval |
local retval |
129 |
|
|
130 |
mode=$(dialog \ |
mode=$(menubox -h $"[ Harddrive partitioning ]" $"\nSelect an installation mode" \ |
131 |
--backtitle "${TITLE}" \ |
$"1:Automatic setup (recommended)" \ |
132 |
--title "[ Festplatten Partitionierung ]" \ |
":" \ |
133 |
--cancel-label "Abbrechen" \ |
$":\Z1Expert modes:\Zn" \ |
134 |
--ok-label "Weiter" \ |
$"2:Common IDE-disk (manual setup)") |
|
--stdout \ |
|
|
--colors \ |
|
|
--menu "\nWaehlen Sie die Installations-Methode" 14 70 5 \ |
|
|
"1" "Automatisches Setup (Empfohlen)" \ |
|
|
"" "" \ |
|
|
"" "\Z1Experten Modi:\Zn" \ |
|
|
"2" "Normale IDE-Disk (Manuell)" \ |
|
135 |
retval=$? |
retval=$? |
136 |
[[ ${retval} -eq 1 ]] && return 1 |
[[ ${retval} -eq 1 ]] && return 1 |
137 |
if [[ ${retval} -eq 0 ]] |
if [[ ${retval} -eq 0 ]] |
138 |
then |
then |
139 |
case "${menu}" in |
case "${mode}" in |
140 |
"1") run_install_auto ;; |
"1") run_install_auto ;; |
141 |
"2") run_install_normal ;; |
"2") run_install_normal ;; |
142 |
"") dialog_setup_system_menu;; |
"") dialog_setup_system_menu;; |
146 |
|
|
147 |
dialog_hardware_detection() |
dialog_hardware_detection() |
148 |
{ |
{ |
149 |
local i |
local message |
|
local hwtmp |
|
|
|
|
|
if [ -x $(type -P mktemp) ] |
|
|
then |
|
|
hwtmp="$(mktemp)" |
|
|
else |
|
|
hwtmp="/tmp/hwtmp.sh" |
|
|
fi |
|
150 |
|
|
151 |
run_hardware_detection_disks |
run_hardware_detection_disks |
152 |
|
|
153 |
echo "dialog \\" > ${hwtmp} |
message+=$"Harddrives:\n" |
|
echo "--backtitle \"${TITLE}\" \\" >> ${hwtmp} |
|
|
echo "--ok-label \"Weiter\" \\" >> ${hwtmp} |
|
|
echo "--stdout \\" >> ${hwtmp} |
|
|
echo "--colors \\" >> ${hwtmp} |
|
|
echo "--msgbox \"Gefundene Hardware:\n\n \\" >> ${hwtmp} |
|
|
echo " Festplatten:\n \\" >> ${hwtmp} |
|
154 |
|
|
155 |
if [[ ! -z ${ALL_DISKS} ]] |
if [[ ! -z ${ALL_DISKS} ]] |
156 |
then |
then |
157 |
for i in ${ALL_DISKS} |
for i in ${ALL_DISKS} |
158 |
do |
do |
159 |
echo " \\Z3${i}\\Zn\n \\" >> ${hwtmp} |
message+="\Z3${i}\Zn " |
160 |
done |
done |
161 |
|
message+="\n" |
162 |
fi |
fi |
163 |
|
|
164 |
if [[ ! -z ${ALL_CDROMS} ]] |
if [[ ! -z ${ALL_CDROMS} ]] |
165 |
then |
then |
166 |
echo " \n \\" >> ${hwtmp} |
message+="\n" |
167 |
echo " CDROM Laufwerke:\n \\" >> ${hwtmp} |
message+=$"Optical disk drives:\n" |
168 |
for i in ${ALL_CDROMS} |
for i in ${ALL_CDROMS} |
169 |
do |
do |
170 |
echo " \\Z3${i}\\Zn\n \\" >> ${hwtmp} |
message+="\Z3${i}\Zn" |
171 |
done |
done |
172 |
|
message+="\n" |
173 |
fi |
fi |
174 |
|
|
175 |
# other devices |
# other devices |
176 |
run_hardware_detection |
run_hardware_detection |
177 |
case "${SPECIALDEVICE}" in |
case "${SPECIALDEVICE}" in |
178 |
zotac*) echo " \n\n\n \\Z2Zotac Device erkannt.\\Zn \\" >> ${hwtmp} ;; |
zotac*) message+=$"\n\Z2Zotac device detected.\Zn" ;; |
179 |
rangee) echo " \n\n\n \\Z2Rangee Device erkannt.\\Zn \\" >> ${hwtmp} ;; |
rangee) message+=$"\n\Z2Rangee device detected.\Zn" ;; |
180 |
maxdata) echo " \n\n\n \\Z2Maxdata Device erkannt.\\Zn \\" >> ${hwtmp} ;; |
maxdata) message+=$"\n\Z2Maxdata device detected.\Zn" ;; |
181 |
*) echo " \n\n\n \\ZnStandard Device erkannt.\\Zn \\" >> ${hwtmp} ;; |
*) message+=$"\n \\ZnCommon device detected.\Zn" ;; |
182 |
esac |
esac |
183 |
if [[ ${FORMFACTOR} = laptop ]] |
if [[ ${FORMFACTOR} = laptop ]] |
184 |
then |
then |
185 |
echo " \n \\ZnFormfactor Laptop, Powersave Modus 'ondemand' wird aktiviert.\\Zn \\" >> ${hwtmp} |
message+=$"\n\ZnFormfactor Laptop, activating 'ondemand' powersaving mode.\Zn" |
186 |
fi |
fi |
187 |
|
|
188 |
echo " \" 14 70" >> ${hwtmp} |
messagebox -y 15 -h $"Detected hardware:" "${message}" |
|
chmod a+x ${hwtmp} |
|
|
${hwtmp} |
|
|
|
|
|
# remove tmp file |
|
|
if [[ -f ${hwtmp} ]] |
|
|
then |
|
|
rm ${hwtmp} |
|
|
fi |
|
189 |
} |
} |
190 |
|
|
191 |
dialog_setup_hdd_partitions_manual() |
dialog_setup_hdd_partitions_manual() |
192 |
{ |
{ |
193 |
local i |
local i |
194 |
|
local retval |
195 |
|
|
196 |
if [[ -z ${installdevs} ]] |
if [[ -z ${ALL_DISKS} ]] |
197 |
then |
then |
198 |
dialog \ |
dialog_no_harddrive_found |
|
--backtitle "${TITLE}" \ |
|
|
--ok-label "Beenden" \ |
|
|
--msgbox "Kein geeignetes Laufwerk gefunden.\nDie Installation ist fehlgeschlagen." 6 70 |
|
199 |
exit 1 |
exit 1 |
200 |
else |
else |
201 |
|
HDD=$(dialog_select_target_harddrive) |
202 |
echo "dialog \\" > /tmp/hddtmp.sh |
retval=$? |
203 |
echo "--backtitle \"${TITLE}\" \\" >> /tmp/hddtmp.sh |
[[ ${retval} -eq 1 ]] && return 1 |
204 |
echo "--ok-label \"Weiter\" \\" >> /tmp/hddtmp.sh |
if [[ ${retval} -eq 0 ]] |
|
echo "--cancel-label \"Beenden\" \\" >> /tmp/hddtmp.sh |
|
|
echo "--stdout \\" >> /tmp/hddtmp.sh |
|
|
echo "--menu \"Installations Laufwerk auswaehlen:\" 10 70 3 \\" >> /tmp/hddtmp.sh |
|
|
|
|
|
for i in ${installdevs} |
|
|
do |
|
|
echo "\"${i}\" \"\" \\" >> /tmp/hddtmp.sh |
|
|
done |
|
|
echo -e "\n" >> /tmp/hddtmp.sh |
|
|
|
|
|
chmod a+x /tmp/hddtmp.sh |
|
|
HDD="$(/tmp/hddtmp.sh)" |
|
|
RES=$? |
|
|
[[ ${RES} -eq 1 ]] && return 1 |
|
|
if [[ ${RES} -eq 0 ]] |
|
205 |
then |
then |
206 |
dialog_setup_hdd_info |
dialog_setup_hdd_info |
207 |
setup_hdd_partitions_manual |
setup_hdd_partitions_manual |
212 |
dialog_setup_hdd_partitions_auto() |
dialog_setup_hdd_partitions_auto() |
213 |
{ |
{ |
214 |
local i |
local i |
215 |
|
local retval |
216 |
|
|
217 |
if [[ -z ${installdevs} ]] |
if [[ -z ${ALL_DISKS} ]] |
218 |
then |
then |
219 |
dialog \ |
dialog_no_harddrive_found |
|
--backtitle "${TITLE}" \ |
|
|
--ok-label "Beenden" \ |
|
|
--msgbox "Kein geeignetes Laufwerk gefunden.\nDie Installation ist fehlgeschlagen." 6 70 |
|
220 |
exit 1 |
exit 1 |
221 |
else |
else |
222 |
|
HDD=$(dialog_select_target_harddrive) |
223 |
echo "dialog \\" > /tmp/hddtmp.sh |
retval=$? |
224 |
echo "--backtitle \"${TITLE}\" \\" >> /tmp/hddtmp.sh |
[[ ${retval} -eq 1 ]] && return 1 |
225 |
echo "--ok-label \"Weiter\" \\" >> /tmp/hddtmp.sh |
if [[ ${retval} -eq 0 ]] |
|
echo "--cancel-label \"Beenden\" \\" >> /tmp/hddtmp.sh |
|
|
echo "--stdout \\" >> /tmp/hddtmp.sh |
|
|
echo "--menu \"Installations Laufwerk auswaehlen:\" 10 70 3 \\" >> /tmp/hddtmp.sh |
|
|
|
|
|
for i in ${installdevs} |
|
|
do |
|
|
echo "\"${i}\" \"\" \\" >> /tmp/hddtmp.sh |
|
|
done |
|
|
echo -e "\n" >> /tmp/hddtmp.sh |
|
|
|
|
|
chmod a+x /tmp/hddtmp.sh |
|
|
HDD="$(/tmp/hddtmp.sh)" |
|
|
RES=$? |
|
|
[[ ${RES} -eq 1 ]] && return 1 |
|
|
if [[ ${RES} -eq 0 ]] |
|
226 |
then |
then |
227 |
dialog_setup_hdd_info_auto |
dialog_setup_hdd_info_auto |
228 |
dialog_setup_hdd_create_partitions |
dialog_setup_hdd_create_partitions |
246 |
export ALL_CDROMS="$(get_hwinfo cdrom)" |
export ALL_CDROMS="$(get_hwinfo cdrom)" |
247 |
} |
} |
248 |
|
|
249 |
dialog_setup_hdd_create_partitions() |
install_meter() |
|
{ |
|
|
dialog \ |
|
|
--backtitle "${TITLE}" \ |
|
|
--infobox "Erstelle Disk Partitionen ..." 3 70 |
|
|
} |
|
|
|
|
|
dialog_setup_hdd_format() |
|
|
{ |
|
|
dialog \ |
|
|
--backtitle "${TITLE}" \ |
|
|
--infobox "Erstelle Datei-Systeme ..." 3 70 |
|
|
} |
|
|
|
|
|
dialog_install_settings() |
|
|
{ |
|
|
dialog \ |
|
|
--backtitle "${TITLE}" \ |
|
|
--infobox "Speichere System-Einstellungen ..." 3 70 |
|
|
} |
|
|
|
|
|
dialog_install_system_image() |
|
|
{ |
|
|
dialog \ |
|
|
--backtitle "${TITLE}" \ |
|
|
--gauge "Kopiere System-Image ..." 6 80 |
|
|
} |
|
|
|
|
|
dialog_install_meter() |
|
250 |
{ |
{ |
251 |
while [[ ${CURRENTLINE} != ${TOTALLINES} ]] |
while [[ ${CURRENTLINE} != ${TOTALLINES} ]] |
252 |
do |
do |
259 |
return 0 |
return 0 |
260 |
} |
} |
261 |
|
|
|
|
|
|
dialog_install_bootsector() |
|
|
{ |
|
|
dialog \ |
|
|
--backtitle "${TITLE}" \ |
|
|
--infobox "Schreibe den Bootsektor ..." 3 70 |
|
|
} |
|
|
|
|
|
dialog_install_successful() |
|
|
{ |
|
|
dialog \ |
|
|
--backtitle "${TITLE}" \ |
|
|
--colors \ |
|
|
--msgbox "Die Installation war \Z2erfolgreich\Zn." 5 81 |
|
|
} |
|
|
|
|
|
dialog_install_failure() |
|
|
{ |
|
|
dialog \ |
|
|
--backtitle "${TITLE}" \ |
|
|
--colors \ |
|
|
--msgbox "Die Installation ist \Z1Fehlgeschlagen\Zn.\n\n\ |
|
|
Fehler bei ${ERROR}, RetVal: ${RETVAL} \ |
|
|
" 10 81 |
|
|
} |
|
|
|
|
262 |
dialog_main() |
dialog_main() |
263 |
{ |
{ |
264 |
METHOD=0 |
local method=0 |
265 |
|
local retval |
266 |
|
|
267 |
while [[ ${METHOD} -le 2 ]] |
while [[ ${method} -le 2 ]] |
268 |
do |
do |
269 |
METHOD=$(dialog \ |
method=$(menubox $"Configuration:" \ |
270 |
--backtitle "${TITLE}" \ |
$"1:Install system" \ |
271 |
--no-cancel \ |
$"2:Show detected harddrives" \ |
272 |
--ok-label "Weiter" \ |
$"3:Exit and reboot" \ |
273 |
--stdout \ |
$"4:Exit and drop into a shell") |
274 |
--menu "Konfiguration" 14 70 5 \ |
retval=$? |
275 |
"1" "AutoSta_LX installieren" \ |
[[ ${retval} -eq 1 ]] && exit 1 |
276 |
"2" "Uebersicht gefundener Laufwerke" \ |
if [[ ${retval} -eq 0 ]] |
|
"3" "Beenden und neustarten" \ |
|
|
"4" "Beenden und eine Shell starten") |
|
|
RES=$? |
|
|
[[ ${RES} -eq 1 ]] && exit 1 |
|
|
if [[ ${RES} -eq 0 ]] |
|
277 |
then |
then |
278 |
case ${METHOD} in |
case ${method} in |
279 |
"1") dialog_setup_system_menu ;; |
"1") dialog_setup_system_menu ;; |
280 |
"2") dialog_hardware_detection ;; |
"2") dialog_hardware_detection ;; |
281 |
"3") install_do_reboot ;; |
"3") install_do_reboot ;; |
710 |
dialog_setup_hdd_format |
dialog_setup_hdd_format |
711 |
setup_hdd_format > /dev/null |
setup_hdd_format > /dev/null |
712 |
install_mount_rootfs |
install_mount_rootfs |
713 |
(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 | install_meter | dialog_install_system_image |
714 |
|
|
715 |
dialog_install_settings |
dialog_install_settings |
716 |
sleep 1 |
sleep 1 |
732 |
dialog_setup_hdd_format |
dialog_setup_hdd_format |
733 |
setup_hdd_format > /dev/null |
setup_hdd_format > /dev/null |
734 |
install_mount_rootfs |
install_mount_rootfs |
735 |
(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 | install_meter | dialog_install_system_image |
736 |
|
|
737 |
dialog_install_settings |
dialog_install_settings |
738 |
sleep 1 |
sleep 1 |