--- trunk/installer-simple/bin/installer.sh.in 2014/01/07 14:48:42 2442 +++ trunk/installer-simple/bin/installer.sh.in 2014/01/08 09:15:14 2476 @@ -7,8 +7,10 @@ # Niels Rogalla # -# ignore the environment -LC_ALL=C +# setup locales +TEXTDOMAIN=installer +LC_MESSAGES=C + # include dir INSTALLER_LIBDIR="%LIBDIR%" @@ -108,32 +110,12 @@ fi } -dialog_setup_hdd_info() -{ - local SHDD="${HDD//\/dev\/}" - - messagebox -h $"[ Harddrive partitioning ]" \ - $"\nPlease create 1 partition.\n\n\[ \Z3${SHDD}1\Zn ] type: \Z3linux\Zn with the whole diskspace\n\Please mark ${SHDD}1 \Z3bootable\Zn." -} - -dialog_setup_hdd_info_auto() -{ - local SHDD="${HDD//\/dev\/}" - - messagebox -h $"[ Harddrive partitioning ]" \ - $"\Z1Warning!\Zn\n\nAll data on disk [ \Z3${HDD}\Zn ] will be erased!" -} - -dialog_setup_system_menu() +task_setup_system_menu() { local mode local retval - mode=$(menubox -h $"[ Harddrive partitioning ]" $"\nSelect an installation mode" \ - $"1:Automatic setup (recommended)" \ - ":" \ - $":\Z1Expert modes:\Zn" \ - $"2:Common IDE-disk (manual setup)") + mode="$(dialog_setup_system_menu)" retval=$? [[ ${retval} -eq 1 ]] && return 1 if [[ ${retval} -eq 0 ]] @@ -141,7 +123,7 @@ case "${mode}" in "1") run_install_auto ;; "2") run_install_normal ;; - "") dialog_setup_system_menu;; + "") task_setup_system_menu;; esac fi } @@ -180,14 +162,14 @@ 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" ;; + *) message+=$"\n\ZnCommon device detected.\Zn" ;; esac if [[ ${FORMFACTOR} = laptop ]] then - message+=$"\n\ZnFormfactor Laptop, activating 'ondemand' powersaving mode.\Zn" + message+=$"\n\ZnFormfactor Laptop, activating 'ondemand' powersaving mode.\Zn" fi - messagebox -y 15 -h $"Detected hardware:" "${message}" + messagebox -y 12 -h $"Detected hardware:" "${message}" } dialog_setup_hdd_partitions_manual() @@ -253,7 +235,7 @@ while [[ ${method} -le 2 ]] do - method=$(menubox $"Configuration:" \ + method=$(CANCEL_LABEL=$"Exit" menubox $"Configuration:" \ $"1:Install system" \ $"2:Show detected harddrives" \ $"3:Exit and reboot" \ @@ -263,7 +245,7 @@ if [[ ${retval} -eq 0 ]] then case ${method} in - "1") dialog_setup_system_menu ;; + "1") task_setup_system_menu ;; "2") dialog_hardware_detection ;; "3") install_do_reboot ;; "4") /bin/bash --login -i ;; @@ -348,24 +330,6 @@ export ALL_CDROMS="$(get_hwinfo cdrom)" } -hdd_size_below_256mb() -{ - local hdd="$1" - local size - local retval - [[ -z ${hdd} ]] && dialog_die "Error: get_hdd_size() no \$hdd given!" - - size=$(fdisk -l ${hdd} | grep "Disk.*${hdd}" | sed 's:.*,\ \(.*\)\ byte.*:\1:') - if [[ ${size} -le 257000000 ]] - then - retval="0" - else - retval="1" - fi - - return "${retval}" -} - setup_hdd_partitions_auto() { ROOTHDD="${HDD}1" @@ -468,11 +432,11 @@ popd > /dev/null } -install_bootsector_chroot() +disabled_install_bootsector_chroot() { local my_roothdd - local grubconf=${INSTALLROOT}/boot/grub/grub.conf - local grub2conf=/boot/grub/grub.cfg + local grubconf="${INSTALLROOT}/boot/grub/grub.conf" + local grub2conf="/boot/grub/grub.cfg" # check for grub2 if [[ -f ${INSTALLROOT}/sbin/grub-mkconfig ]] @@ -488,19 +452,22 @@ then sed -i "s:^\(export GRUB_CMDLINE_LINUX_DEFAULT=\).*:\1\"${KERNELOPTS}\":" ${INSTALLROOT}/etc/conf.d/grub || dialog_die else - echo "export GRUB_CMDLINE_LINUX_DEFAULT=\"${KERNELOPTS}\"" > ${INSTALLROOT}/etc/conf.d/grub || dialog_die + CONFIG="${INSTALLROOT}/etc/conf.d/grub" + clearconfig + addconfig "export GRUB_CMDLINE_LINUX_DEFAULT=\"${KERNELOPTS}\"" fi - echo 'grub-mkdevicemap' > ${INSTALLROOT}/root/.installrc || dialog_die - echo "LC_ALL=C grub-mkconfig -o ${grub2conf} &> /dev/null" >> ${INSTALLROOT}/root/.installrc || dialog_die - echo "grub-install --no-floppy ${HDD} &> /dev/null" >> ${INSTALLROOT}/root/.installrc || dialog_die - echo "exit 0" >> ${INSTALLROOT}/root/.installrc || dialog_die + 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 - ### grubconf schreiben source ${INSTALLROOT}/boot/kernelversion - #for alx only if [ -e ${INSTALLROOT}/etc/alx_version ] then OLD_ALXVER="${ALXVER}" @@ -516,41 +483,42 @@ # uuid support my_roothdd="UUID=$(get_uuid ${ROOTHDD})" - : > ${grubconf} || dialog_die - echo "default 0" >> ${grubconf} || dialog_die - echo "timeout 3" >> ${grubconf} || dialog_die + CONFIG="${grubconf}" + clearconfig + addconfig "default 0" + addconfig "timeout 3" # using current root password - echo "password --md5 $(cat ${INSTALLROOT}/etc/shadow | grep root | cut -d: -f2)" >> ${grubconf} || dialog_die + addconfig "password --md5 $(cat ${INSTALLROOT}/etc/shadow | grep root | cut -d: -f2)" - echo >> ${grubconf} || dialog_die - echo "# normal boot" >> ${grubconf} || dialog_die - echo "title ${KRNVER}" >> ${grubconf} || dialog_die - echo "root (hd0,0)" >> ${grubconf} || dialog_die - echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS}" >> ${grubconf} || dialog_die + 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 - echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || dialog_die + addconfig "initrd /boot/${KRNINITRD}" fi - echo >> ${grubconf} || dialog_die - echo "# admin boot" >> ${grubconf} || dialog_die - echo "title ${KRNVER} - Re-run hardware-detection" >> ${grubconf} || dialog_die - echo "lock" >> ${grubconf} || dialog_die - echo "root (hd0,0)" >> ${grubconf} || dialog_die - echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS} hardware-auto-detection" >> ${grubconf} || dialog_die + 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 - echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || dialog_die + addconfig "initrd /boot/${KRNINITRD}" fi - echo >> ${grubconf} || dialog_die - echo "title ${KRNVER} - Reset *all* local settings" >> ${grubconf} || dialog_die - echo "lock" >> ${grubconf} || dialog_die - echo "root (hd0,0)" >> ${grubconf} || dialog_die - echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS} alx-reset-settings" >> ${grubconf} || dialog_die + 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 - echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || dialog_die + addconfig "initrd /boot/${KRNINITRD}" fi # bootsector schreiben chrooted schreiben (lfs/magellan) @@ -569,7 +537,7 @@ rm ${INSTALLROOT}/root/.installrc } -install_initrd_chroot() +disabled_install_initrd_chroot() { # only generate initrds if the cmd exists is_initrd_supported || return 0 @@ -597,13 +565,19 @@ # install an appropriate uvesafb.conf install -d ${INSTALLROOT}/etc/modprobe.d || dialog_die - echo "options uvesafb mode_option=1024x768-32@60 scroll=ywrap" > ${INSTALLROOT}/etc/modprobe.d/uvesafb.conf || 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 - echo "options viafb viafb_mode=1024x768 viafb_refresh=60" > ${INSTALLROOT}/etc/modprobe.d/viafb.conf || dialog_die + CONFIG="${INSTALLROOT}/etc/modprobe.d/viafb.conf" + clearconfig + addconfig "options viafb viafb_mode=1024x768 viafb_refresh=60" # install an appropriate i810fb.conf - echo "options i810fb xres=1024 yres=768 bpp=16 mtrr=1 hsync1=30 hsync2=62 vsync1=30 vsync2=60" > ${INSTALLROOT}/etc/modprobe.d/i810fb.conf || dialog_die + 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 @@ -618,15 +592,20 @@ install_system_settings() { - # schreibe fstab - echo -e "UUID=$(get_uuid ${ROOTHDD})\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" >> ${INSTALLROOT}/etc/fstab || dialog_die - # not needed busybox loads all with swapon -a, even if not mentioned in fstab - #echo -e "UUID='$(get_uuid ${SWAPHDD})'\tswap\tswap\tpri=1\t0 0" >> ${INSTALLROOT}/etc/fstab || dialog_die - echo -e "proc\t/proc\tproc\tdefaults\t0 0" >> ${INSTALLROOT}/etc/fstab || dialog_die - echo -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0" >> ${INSTALLROOT}/etc/fstab || dialog_die + local CONFIG + + # write fstab + CONFIG="${INSTALLROOT}/etc/fstab" + clearconfig + addconfig -e "UUID=$(get_uuid ${ROOTHDD})\t/\t${FORMAT_FILESYSTEM}\tnoatime,noauto\t1 1" + addconfig -e "proc\t/proc\tproc\tdefaults\t0 0" + addconfig -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0" # install network config skeleton - install -m0644 ${INSTALLROOT}/etc/alxconfig-ng/skel/net/net.eth0 ${INSTALLROOT}/etc/conf.d/ || dialog_die + CONFIG="${INSTALLROOT}/etc/conf.d/net.eth0" + clearconfig + addconfig 'ONBOOT="yes"' + addconfig 'NETWORKING="dhcp"' # intel framebuffer quirk if [ -e ${INSTALLROOT}/etc/splash/splash.conf ]