72 |
FORMFACTOR="${DEFAULT_FORMFACTOR}" |
FORMFACTOR="${DEFAULT_FORMFACTOR}" |
73 |
FORMAT_FILESYSTEM="${DEFAULT_FILESYSTEM}" |
FORMAT_FILESYSTEM="${DEFAULT_FILESYSTEM}" |
74 |
|
|
75 |
################################################# |
|
76 |
# DIALOG BOXEN # |
### helper scripts ### |
|
################################################# |
|
77 |
|
|
78 |
trap_exit() |
trap_exit() |
79 |
{ |
{ |
87 |
exit 1 |
exit 1 |
88 |
} |
} |
89 |
|
|
|
dialog_die() |
|
|
{ |
|
|
ERROR="$1" |
|
|
RETVAL="$?" |
|
|
dialog_install_failure |
|
|
exit 1 |
|
|
} |
|
|
|
|
|
dialog_warning() |
|
|
{ |
|
|
local retval |
|
|
|
|
|
yesnobox $"\Z1 !!! Warning !!! \Zn\n\n\This harddrive will be irreversibly erased.\n\n\Do you want to continue ?" |
|
|
retval=$? |
|
|
if [[ ${retval} -eq 1 ]] |
|
|
then |
|
|
clear |
|
|
echo $"The process was aborted." |
|
|
exit 1 |
|
|
fi |
|
|
} |
|
|
|
|
|
task_setup_system_menu() |
|
|
{ |
|
|
local mode |
|
|
local retval |
|
|
|
|
|
mode="$(dialog_setup_system_menu)" |
|
|
retval=$? |
|
|
[[ ${retval} -eq 1 ]] && return 1 |
|
|
if [[ ${retval} -eq 0 ]] |
|
|
then |
|
|
case "${mode}" in |
|
|
"1") run_install_auto ;; |
|
|
"2") run_install_normal ;; |
|
|
"") task_setup_system_menu;; |
|
|
esac |
|
|
fi |
|
|
} |
|
|
|
|
|
dialog_hardware_detection() |
|
|
{ |
|
|
local message |
|
|
|
|
|
run_hardware_detection_disks |
|
|
|
|
|
message+=$"Harddrives:\n" |
|
|
|
|
|
if [[ ! -z ${ALL_DISKS} ]] |
|
|
then |
|
|
for i in ${ALL_DISKS} |
|
|
do |
|
|
message+="\Z3${i}\Zn " |
|
|
done |
|
|
message+="\n" |
|
|
fi |
|
|
|
|
|
if [[ ! -z ${ALL_CDROMS} ]] |
|
|
then |
|
|
message+="\n" |
|
|
message+=$"Optical disk drives:\n" |
|
|
for i in ${ALL_CDROMS} |
|
|
do |
|
|
message+="\Z3${i}\Zn" |
|
|
done |
|
|
message+="\n" |
|
|
fi |
|
|
|
|
|
# other devices |
|
|
run_hardware_detection |
|
|
case "${SPECIALDEVICE}" in |
|
|
zotac*) message+=$"\n\Z2Zotac device detected.\Zn" ;; |
|
|
rangee) message+=$"\n\Z2Rangee device detected.\Zn" ;; |
|
|
maxdata) message+=$"\n\Z2Maxdata device detected.\Zn" ;; |
|
|
*) message+=$"\n\ZnCommon device detected.\Zn" ;; |
|
|
esac |
|
|
if [[ ${FORMFACTOR} = laptop ]] |
|
|
then |
|
|
message+=$"\n\ZnFormfactor Laptop, activating 'ondemand' powersaving mode.\Zn" |
|
|
fi |
|
|
|
|
|
messagebox -y 12 -h $"Detected hardware:" "${message}" |
|
|
} |
|
|
|
|
|
task_setup_hdd_partitions_manual() |
|
|
{ |
|
|
local i |
|
|
local retval |
|
|
|
|
|
if [[ -z ${ALL_DISKS} ]] |
|
|
then |
|
|
dialog_no_harddrive_found |
|
|
exit 1 |
|
|
else |
|
|
HDD=$(dialog_select_target_harddrive) |
|
|
retval=$? |
|
|
[[ ${retval} -eq 1 ]] && return 1 |
|
|
if [[ ${retval} -eq 0 ]] |
|
|
then |
|
|
dialog_setup_hdd_info |
|
|
setup_hdd_partitions_manual |
|
|
fi |
|
|
fi |
|
|
} |
|
|
|
|
|
task_setup_hdd_partitions_auto() |
|
|
{ |
|
|
local i |
|
|
local retval |
|
|
|
|
|
if [[ -z ${ALL_DISKS} ]] |
|
|
then |
|
|
dialog_no_harddrive_found |
|
|
exit 1 |
|
|
else |
|
|
HDD=$(dialog_select_target_harddrive) |
|
|
retval=$? |
|
|
[[ ${retval} -eq 1 ]] && return 1 |
|
|
if [[ ${retval} -eq 0 ]] |
|
|
then |
|
|
dialog_setup_hdd_info_auto |
|
|
dialog_setup_hdd_create_partitions |
|
|
setup_hdd_partitions_auto |
|
|
fi |
|
|
fi |
|
|
} |
|
|
|
|
90 |
install_meter() |
install_meter() |
91 |
{ |
{ |
92 |
while [[ ${CURRENTLINE} != ${TOTALLINES} ]] |
while [[ ${CURRENTLINE} != ${TOTALLINES} ]] |
100 |
return 0 |
return 0 |
101 |
} |
} |
102 |
|
|
|
task_main() |
|
|
{ |
|
|
local method=0 |
|
|
local retval |
|
103 |
|
|
|
while [[ ${method} -le 2 ]] |
|
|
do |
|
|
method=$(dialog_main) |
|
|
retval=$? |
|
|
[[ ${retval} -eq 1 ]] && exit 1 |
|
|
if [[ ${retval} -eq 0 ]] |
|
|
then |
|
|
case ${method} in |
|
|
"1") task_setup_system_menu ;; |
|
|
"2") dialog_hardware_detection ;; |
|
|
"3") install_do_reboot ;; |
|
|
"4") /bin/bash --login -i ;; |
|
|
esac |
|
|
fi |
|
|
done |
|
|
} |
|
|
|
|
|
################################################# |
|
|
# Install Komandos # |
|
|
################################################# |
|
104 |
run_hardware_detection() |
run_hardware_detection() |
105 |
{ |
{ |
106 |
local hwinfo |
local hwinfo |
276 |
popd > /dev/null |
popd > /dev/null |
277 |
} |
} |
278 |
|
|
|
disabled_install_bootsector_chroot() |
|
|
{ |
|
|
local my_roothdd |
|
|
local grubconf="${INSTALLROOT}/boot/grub/grub.conf" |
|
|
local grub2conf="/boot/grub/grub.cfg" |
|
|
|
|
|
# check for grub2 |
|
|
if [[ -f ${INSTALLROOT}/sbin/grub-mkconfig ]] |
|
|
then |
|
|
# needed by grub-mkconfig on the first run |
|
|
if [[ ! -f ${INSTALLROOT}/boot/grub/video.lst ]] |
|
|
then |
|
|
install -m0644 ${INSTALLROOT}/lib/grub/*/video.lst ${INSTALLROOT}/boot/grub/video.lst || dialog_die |
|
|
fi |
|
|
|
|
|
# set kernelopts |
|
|
if [[ -f ${INSTALLROOT}/etc/conf.d/grub ]] |
|
|
then |
|
|
sed -i "s:^\(export GRUB_CMDLINE_LINUX_DEFAULT=\).*:\1\"${KERNELOPTS}\":" ${INSTALLROOT}/etc/conf.d/grub || dialog_die |
|
|
else |
|
|
CONFIG="${INSTALLROOT}/etc/conf.d/grub" |
|
|
clearconfig |
|
|
addconfig "export GRUB_CMDLINE_LINUX_DEFAULT=\"${KERNELOPTS}\"" |
|
|
fi |
|
|
CONFIG="${INSTALLROOT}/root/.installrc" |
|
|
clearconfig |
|
|
# only grub 1.99 |
|
|
addconfig 'type -P grub-mkdevicemap && grub-mkdevicemap' |
|
|
addconfig "grub-install --no-floppy ${HDD} &> /dev/null" |
|
|
addconfig "LC_ALL=C grub-mkconfig -o ${grub2conf} &> /dev/null" |
|
|
addconfig "exit 0" |
|
|
|
|
|
# grub-legacy |
|
|
else |
|
|
source ${INSTALLROOT}/boot/kernelversion |
|
|
|
|
|
if [ -e ${INSTALLROOT}/etc/alx_version ] |
|
|
then |
|
|
OLD_ALXVER="${ALXVER}" |
|
|
source ${INSTALLROOT}/etc/alx_version |
|
|
KRNVER="ALX-${ALXVER}" |
|
|
ALXVER="${OLD_ALXVER}" |
|
|
fi |
|
|
|
|
|
[[ -z ${KRNVER} ]] && KRNVER="AutoSta_LX" |
|
|
[[ -z ${KRNINITRD} ]] && KRNINITRD="initrd" |
|
|
[[ -z ${KRNIMG} ]] && KRNIMG="vmlinuz" |
|
|
|
|
|
# uuid support |
|
|
my_roothdd="UUID=$(get_uuid ${ROOTHDD})" |
|
|
|
|
|
CONFIG="${grubconf}" |
|
|
clearconfig |
|
|
addconfig "default 0" |
|
|
addconfig "timeout 3" |
|
|
# using current root password |
|
|
addconfig "password --md5 $(cat ${INSTALLROOT}/etc/shadow | grep root | cut -d: -f2)" |
|
|
|
|
|
addconfig |
|
|
addconfig "# normal boot" |
|
|
addconfig "title ${KRNVER}" |
|
|
addconfig "root (hd0,0)" |
|
|
addconfig "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS}" |
|
|
if is_initrd_supported |
|
|
then |
|
|
addconfig "initrd /boot/${KRNINITRD}" |
|
|
fi |
|
|
|
|
|
addconfig |
|
|
addconfig "# admin boot" |
|
|
addconfig "title ${KRNVER} - Re-run hardware-detection" |
|
|
addconfig "lock" |
|
|
addconfig "root (hd0,0)" |
|
|
addconfig "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS} hardware-auto-detection" |
|
|
if is_initrd_supported |
|
|
then |
|
|
addconfig "initrd /boot/${KRNINITRD}" |
|
|
fi |
|
|
|
|
|
addconfig |
|
|
addconfig "title ${KRNVER} - Reset *all* local settings" |
|
|
addconfig "lock" |
|
|
addconfig "root (hd0,0)" |
|
|
addconfig "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS} alx-reset-settings" |
|
|
if is_initrd_supported |
|
|
then |
|
|
addconfig "initrd /boot/${KRNINITRD}" |
|
|
fi |
|
|
|
|
|
# bootsector schreiben chrooted schreiben (lfs/magellan) |
|
|
cat > ${INSTALLROOT}/root/.installrc << CHROOTEOF |
|
|
/usr/sbin/grub --no-floppy --batch << "EOF" 1> /dev/null 2> /dev/null |
|
|
root (hd0,0) |
|
|
setup (hd0) |
|
|
quit |
|
|
EOF |
|
|
exit 0 |
|
|
CHROOTEOF |
|
|
fi |
|
|
|
|
|
# run installrc |
|
|
chrooted /bin/bash --rcfile /root/.installrc -i |
|
|
rm ${INSTALLROOT}/root/.installrc |
|
|
} |
|
|
|
|
|
disabled_install_initrd_chroot() |
|
|
{ |
|
|
# only generate initrds if the cmd exists |
|
|
is_initrd_supported || return 0 |
|
|
|
|
|
DISKMODS="sd_mod" |
|
|
OLDPATAMODS="amd74xx piix sis5513 via82cxxx" |
|
|
PATAMODS="ata_piix pata_amd pata_mpiix pata_oldpiix pata_sis pata_via" |
|
|
SATAMODS="sata_via sata_sis sata_nv" |
|
|
DRMMODS="i915 mga nouveau r128 radeon savage sis tdfx ttm via" |
|
|
OTHERMODS="" |
|
|
case ${SPECIALDEVICE} in |
|
|
zotac_intel) FBMODS=""; DRMMODS="i915" ;; |
|
|
zotac_nvidia) FBMODS=""; DRMMODS="nouveau" ;; |
|
|
rangee) FBMODS="" ;; ## fallback to vesafb, viafb does not run on all CLE266 boards |
|
|
# not working with kms enabled drivers -> segfaults |
|
|
#maxdata) FBMODS="i810fb" ;; ## check for maxdata / i810/ i815 Chipsets and disable KMS and use i810fb frambuffer |
|
|
maxdata) FBMODS="" ;; |
|
|
*) FBMODS="uvesafb" ;; |
|
|
esac |
|
|
|
|
|
if [[ ${FORMFACTOR} = laptop ]] |
|
|
then |
|
|
OTHERMODS="acpi-cpufreq cpufreq_ondemand cpufreq_conservative cpufreq_powersave" |
|
|
fi |
|
|
|
|
|
# install an appropriate uvesafb.conf |
|
|
install -d ${INSTALLROOT}/etc/modprobe.d || dialog_die |
|
|
CONFIG="${INSTALLROOT}/etc/modprobe.d/uvesafb.conf" |
|
|
clearconfig |
|
|
addconfig "options uvesafb mode_option=1024x768-32@60 scroll=ywrap" |
|
|
|
|
|
# install an appropriate viafb.conf |
|
|
CONFIG="${INSTALLROOT}/etc/modprobe.d/viafb.conf" |
|
|
clearconfig |
|
|
addconfig "options viafb viafb_mode=1024x768 viafb_refresh=60" |
|
|
|
|
|
# install an appropriate i810fb.conf |
|
|
CONFIG="${INSTALLROOT}/etc/modprobe.d/i810fb.conf" |
|
|
clearconfig |
|
|
addconfig "options i810fb xres=1024 yres=768 bpp=16 mtrr=1 hsync1=30 hsync2=62 vsync1=30 vsync2=60" |
|
|
|
|
|
cat > ${INSTALLROOT}/root/.installrc << CHROOTEOF |
|
|
echo "MODULES=\"${FORMAT_FILESYSTEM} ${DISKMODS} ${OLDATAMODS} ${PATAMODS} ${SATAMODS} ${DRMMODS} ${FBMODS} ${OTHERMODS}\"" > /etc/conf.d/mkinitrd |
|
|
mkinitrd -f /boot/$(readlink /boot/initrd) $(readlink /boot/vmlinuz | sed "s:kernel-::g") > /dev/null |
|
|
exit 0 |
|
|
CHROOTEOF |
|
|
|
|
|
# run installrc |
|
|
chrooted /bin/bash --rcfile /root/.installrc -i |
|
|
rm ${INSTALLROOT}/root/.installrc |
|
|
} |
|
|
|
|
279 |
install_system_settings() |
install_system_settings() |
280 |
{ |
{ |
281 |
local CONFIG |
local CONFIG |
321 |
reboot |
reboot |
322 |
} |
} |
323 |
|
|
324 |
################################################# |
|
325 |
# Install Ablauf Scripte # |
### installer dialogs ### |
326 |
################################################# |
|
327 |
|
dialog_die() |
328 |
|
{ |
329 |
|
ERROR="$1" |
330 |
|
RETVAL="$?" |
331 |
|
dialog_install_failure |
332 |
|
exit 1 |
333 |
|
} |
334 |
|
|
335 |
|
dialog_warning() |
336 |
|
{ |
337 |
|
local retval |
338 |
|
|
339 |
|
yesnobox $"\Z1 !!! Warning !!! \Zn\n\n\This harddrive will be irreversibly erased.\n\n\Do you want to continue ?" |
340 |
|
retval=$? |
341 |
|
if [[ ${retval} -eq 1 ]] |
342 |
|
then |
343 |
|
clear |
344 |
|
echo $"The process was aborted." |
345 |
|
exit 1 |
346 |
|
fi |
347 |
|
} |
348 |
|
|
349 |
|
|
350 |
|
### installer tasks ### |
351 |
|
|
352 |
|
task_setup_system_menu() |
353 |
|
{ |
354 |
|
local mode |
355 |
|
local retval |
356 |
|
|
357 |
|
mode="$(dialog_setup_system_menu)" |
358 |
|
retval=$? |
359 |
|
[[ ${retval} -eq 1 ]] && return 1 |
360 |
|
if [[ ${retval} -eq 0 ]] |
361 |
|
then |
362 |
|
case "${mode}" in |
363 |
|
"1") run_install_auto ;; |
364 |
|
"2") run_install_normal ;; |
365 |
|
"") task_setup_system_menu;; |
366 |
|
esac |
367 |
|
fi |
368 |
|
} |
369 |
|
|
370 |
|
task_hardware_detection() |
371 |
|
{ |
372 |
|
local message |
373 |
|
|
374 |
|
run_hardware_detection_disks |
375 |
|
|
376 |
|
message+=$"Harddrives:\n" |
377 |
|
|
378 |
|
if [[ ! -z ${ALL_DISKS} ]] |
379 |
|
then |
380 |
|
for i in ${ALL_DISKS} |
381 |
|
do |
382 |
|
message+="\Z3${i}\Zn " |
383 |
|
done |
384 |
|
message+="\n" |
385 |
|
fi |
386 |
|
|
387 |
|
if [[ ! -z ${ALL_CDROMS} ]] |
388 |
|
then |
389 |
|
message+="\n" |
390 |
|
message+=$"Optical disk drives:\n" |
391 |
|
for i in ${ALL_CDROMS} |
392 |
|
do |
393 |
|
message+="\Z3${i}\Zn" |
394 |
|
done |
395 |
|
message+="\n" |
396 |
|
fi |
397 |
|
|
398 |
|
# other devices |
399 |
|
run_hardware_detection |
400 |
|
case "${SPECIALDEVICE}" in |
401 |
|
zotac*) message+=$"\n\Z2Zotac device detected.\Zn" ;; |
402 |
|
rangee) message+=$"\n\Z2Rangee device detected.\Zn" ;; |
403 |
|
maxdata) message+=$"\n\Z2Maxdata device detected.\Zn" ;; |
404 |
|
*) message+=$"\n\ZnCommon device detected.\Zn" ;; |
405 |
|
esac |
406 |
|
if [[ ${FORMFACTOR} = laptop ]] |
407 |
|
then |
408 |
|
message+=$"\n\ZnFormfactor Laptop, activating 'ondemand' powersaving mode.\Zn" |
409 |
|
fi |
410 |
|
|
411 |
|
messagebox -y 12 -h $"Detected hardware:" "${message}" |
412 |
|
} |
413 |
|
|
414 |
|
task_setup_hdd_partitions_manual() |
415 |
|
{ |
416 |
|
local i |
417 |
|
local retval |
418 |
|
|
419 |
|
if [[ -z ${ALL_DISKS} ]] |
420 |
|
then |
421 |
|
dialog_no_harddrive_found |
422 |
|
exit 1 |
423 |
|
else |
424 |
|
HDD=$(dialog_select_target_harddrive) |
425 |
|
retval=$? |
426 |
|
[[ ${retval} -eq 1 ]] && return 1 |
427 |
|
if [[ ${retval} -eq 0 ]] |
428 |
|
then |
429 |
|
dialog_setup_hdd_info |
430 |
|
setup_hdd_partitions_manual |
431 |
|
fi |
432 |
|
fi |
433 |
|
} |
434 |
|
|
435 |
|
task_setup_hdd_partitions_auto() |
436 |
|
{ |
437 |
|
local i |
438 |
|
local retval |
439 |
|
|
440 |
|
if [[ -z ${ALL_DISKS} ]] |
441 |
|
then |
442 |
|
dialog_no_harddrive_found |
443 |
|
exit 1 |
444 |
|
else |
445 |
|
HDD=$(dialog_select_target_harddrive) |
446 |
|
retval=$? |
447 |
|
[[ ${retval} -eq 1 ]] && return 1 |
448 |
|
if [[ ${retval} -eq 0 ]] |
449 |
|
then |
450 |
|
dialog_setup_hdd_info_auto |
451 |
|
dialog_setup_hdd_create_partitions |
452 |
|
setup_hdd_partitions_auto |
453 |
|
fi |
454 |
|
fi |
455 |
|
} |
456 |
|
|
457 |
|
task_main() |
458 |
|
{ |
459 |
|
local method=0 |
460 |
|
local retval |
461 |
|
|
462 |
|
while [[ ${method} -le 2 ]] |
463 |
|
do |
464 |
|
method=$(dialog_main) |
465 |
|
retval=$? |
466 |
|
[[ ${retval} -eq 1 ]] && exit 1 |
467 |
|
if [[ ${retval} -eq 0 ]] |
468 |
|
then |
469 |
|
case ${method} in |
470 |
|
"1") task_setup_system_menu ;; |
471 |
|
"2") task_hardware_detection ;; |
472 |
|
"3") install_do_reboot ;; |
473 |
|
"4") /bin/bash --login -i ;; |
474 |
|
esac |
475 |
|
fi |
476 |
|
done |
477 |
|
} |
478 |
|
|
479 |
run_install_normal() |
run_install_normal() |
480 |
{ |
{ |
481 |
dialog_hardware_detection |
task_hardware_detection |
482 |
|
|
483 |
task_setup_hdd_partitions_manual |
task_setup_hdd_partitions_manual |
484 |
dialog_setup_hdd_format |
dialog_setup_hdd_format |
506 |
|
|
507 |
run_install_auto() |
run_install_auto() |
508 |
{ |
{ |
509 |
dialog_hardware_detection |
task_hardware_detection |
510 |
|
|
511 |
task_setup_hdd_partitions_auto |
task_setup_hdd_partitions_auto |
512 |
dialog_setup_hdd_format |
dialog_setup_hdd_format |