--- trunk/installer-simple/bin/installer.sh.in 2014/01/03 14:58:22 2343 +++ trunk/installer-simple/bin/installer.sh.in 2014/01/03 15:02:43 2345 @@ -180,14 +180,14 @@ local i local hwtmp - if [ -x $(which mktemp &> /dev/null) ] + if [ -x $(type -P mktemp) ] then hwtmp="$(mktemp)" else hwtmp="/tmp/hwtmp.sh" fi - [[ ! -z ${installdevs} ]] && installdevs="" + run_hardware_detection_disks echo "dialog \\" > ${hwtmp} echo "--backtitle \"${TITLE}\" \\" >> ${hwtmp} @@ -197,37 +197,24 @@ echo "--msgbox \"Gefundene Hardware:\n\n \\" >> ${hwtmp} echo " Festplatten:\n \\" >> ${hwtmp} - if [[ ! -z ${scsidisks} ]] + if [[ ! -z ${ALL_DISKS} ]] then - for i in ${scsidisks} + for i in ${ALL_DISKS} do - if [[ ${i} != ${cdromdev} ]] - then - echo " \\Z7SCSI: \\Z3${i}\\Zn\n \\" >> ${hwtmp} - installdevs="${installdevs} ${i}" - fi + echo " \\Z3${i}\\Zn\n \\" >> ${hwtmp} done fi - if [[ ! -z ${idedisks} ]] + if [[ ! -z ${ALL_CDROMS} ]] then - for i in ${idedisks} + echo " \n \\" >> ${hwtmp} + echo " CDROM Laufwerke:\n \\" >> ${hwtmp} + for i in ${ALL_CDROMS} do - if [[ ${i} != ${cdromdev} ]] - then - echo " \\Z7IDE: \\Z3${i}\\Zn\n \\" >> ${hwtmp} - installdevs="${installdevs} ${i}" - fi + echo " \\Z3${i}\\Zn\n \\" >> ${hwtmp} done fi - if [[ ! -z ${cdromdev} ]] - then - echo " \n \\" >> ${hwtmp} - echo " \\Z7andere Laufwerke:\n \\" >> ${hwtmp} - echo " CDROM: \\Z3${cdromdev}\\Zn\n \\" >> ${hwtmp} - fi - # other devices run_hardware_detection case "${SPECIALDEVICE}" in @@ -367,6 +354,21 @@ fi } +run_hardware_detection_disks() +{ + local bootdev + + # all disks but exclude ramdisks + export ALL_DISKS=$(get_hwinfo disk | sed '/\/dev\/ram[0-9].*/d') + # remove the boot device from ALL_DISKS if it was an usbstick + if [[ $(grep '[[:space:]]/mnt/cdrom[[:space:]]' /proc/mounts | cut -d' ' -f3) != iso9660 ]] + then + bootdev="$(grep '[[:space:]]/mnt/cdrom[[:space:]]' /proc/mounts | cut -d' ' -f1 | sed 's:[0-9]::g')" + export ALL_DISKS=$(echo "${ALL_DISKS}" | grep -v "${bootdev}") + fi + export ALL_CDROMS="$(get_hwinfo cdrom)" +} + dialog_setup_hdd_create_partitions() { dialog \ @@ -829,7 +831,7 @@ is_uuid_supported() { - if [[ -x $(which busybox.mkinitrd &> /dev/null) ]] + if [[ -x $(type -P busybox.mkinitrd) ]] then # only detect uuids if supported if [[ ! -z $(busybox.mkinitrd | grep blkid) ]]