bootdisk/trunk/batch-installer: installer-prep installer-raid-functions installer-validate installer...

hawk cvs at pld-linux.org
Tue Nov 22 17:01:23 CET 2005


Author: hawk
Date: Tue Nov 22 17:00:45 2005
New Revision: 6546

Modified:
   bootdisk/trunk/batch-installer/installer-prep
   bootdisk/trunk/batch-installer/installer-raid-functions
   bootdisk/trunk/batch-installer/installer-validate
   bootdisk/trunk/batch-installer/installer.conf
   bootdisk/trunk/batch-installer/pci/sh-scan-pci
   bootdisk/trunk/batch-installer/ui/ui-functions
   bootdisk/trunk/batch-installer/ui/ui-main
   bootdisk/trunk/batch-installer/ui/ui-makeform
   bootdisk/trunk/batch-installer/ui/ui-wizard
Log:
- rewritten hostadapters selection/detection code, now user must
  choose for which adapters he wants modules to be loaded


Modified: bootdisk/trunk/batch-installer/installer-prep
==============================================================================
--- bootdisk/trunk/batch-installer/installer-prep	(original)
+++ bootdisk/trunk/batch-installer/installer-prep	Tue Nov 22 17:00:45 2005
@@ -103,6 +103,7 @@
 	    fi
 	    
 	    if test "$first" ; then
+		nls "Module %s is not available, package %s must be loaded.\n" "$1" "$package"
 		nls "Please insert disk \"addons %d\" and press Enter\n" "$addons"
 		first=
 	    else
@@ -219,15 +220,6 @@
     load_module isofs
 }
 
-load_ide_modules () {
-    load_module ide-detect
-	sleep 1
-}
-
-load_scsi_modules () {
-    load_hostadapters scsi
-}
-
 load_nfs_modules () {
     load_module nfs
 }
@@ -378,111 +370,84 @@
 test "x$source_device" != "xauto" || die "cannot autodetect cdrom device, must specify one"
 }
 
-load_hostadapters () {
-    local modules_dir="/lib/modules/`uname -r`"
+# load modules needed for devices mentioned in $1
+load_device_modules () {
 
-    case "$1" in
-      scsi )
-	    if test "x$scsi_hostadapters" = "xauto"; then
-		adapters=`detect-pci-devices scsi -m || :`
-		test "$adapters" || \
-			die "No SCSI adapters detected, must specify module(s) by hand"
-	    else
-		adapters="$scsi_hostadapters"
-	    fi
-        ;;
-      ide )
-	    if test "x$ide_hostadapters" = "xauto"; then
-		adapters=`detect-pci-devices ide -m || :`
-		test "$adapters" || \
-			die "No IDE adapters detected, must specify module(s) by hand"
-	    else
-		adapters="$ide_hostadapters"
-	    fi
-        ;;
-      * )
-        die "unknown hostadapter: $1"
-    esac
-    
+  local detected_ide detectded_scsi
+  detected_ide=`detect-pci-devices ide -m`
+  detected_ide="$detected_ide ide-detect"
+  detected_scsi=`detect-pci-devices scsi -m`
+
+  # go through list of modules and load them or call required functions
+  for module in $1; do
+
+    if test "x$module" = "xcpqarray"; then
+      . installer-raid-functions
+      setup_cpqarray
+    elif test "x$module" = "xcciss"; then
+      . installer-raid-functions
+      setup_cciss
+    elif test "x$module" = "xDAC960"; then
+      . installer-raid-functions
+      setup_DAC960
+    elif test "x$module" = "xataraid"; then
+      . installer-raid-functions
+      setup_ataraid
+    elif test "x$module" = "xi20"; then
+      . installer-raid-functions
+      setup_i2o
+    else
+      load_module $module
+    fi
 
-    modules_o=""
-    for i in $adapters; do
-	if test -f $modules_dir/${i}.o; then
-	    :
-	else
-	    # ok download modules from source (assume we install _on_ scsi and have source already)
-	    # TODO: handle the case we need modules from addons (install _from_ scsi)
-	    modules_o="$modules_o ${i}.o"
-	fi
-    done
-
-    if test "$1" = scsi -a "$modules_o"; then 
-      # Ignore error here. The most possible reason is that we are installing
-      # from scsi cdrom/disk, and modules needs to be fetched from addon
-      # disk (load_module handles it).
-      load_package scsi-low-mod $modules_o || :
-    fi
-
-    for i in $adapters; do
-	load_module $i
-	## write info about scsi adapters into modules.conf/modprobe.conf
-	for j in /etc/modules.conf /etc/modprobe.conf; do
-		test ! -f $j || cp $j $j.tmp
-		echo "alias ${1}_hostadapter $i" >> $j.tmp
-		# alias for devfsd
-		echo "alias ${1}-hosts $i" >> $j.tmp
-		sort $j.tmp | uniq > $j
-		rm -f $j.tmp
-	done
-    done
-}
+  done
 
+  # check if any of modules to be loaded is for IDE device
+  # and if it is, load module ide-disk 
+  for ide in $detected_ide; do
+    if echo "$1" | grep -q $ide; then
+      ## write info about ide adapters into modules.conf/modprobe.conf
+      for i in /etc/modules.conf /etc/modprobe.conf; do
+        if ! cat $i | grep -q "^alias ide_hostadapter"; then
+          test ! -f $i || cp $i $i.tmp
+          echo "alias ide_hostadapter $ide" >> $i.tmp
+          # alias for devfsd
+          echo "alias ide-hosts $ide" >> $i.tmp
+          sort $i.tmp | uniq > $i
+          rm -f $i.tmp
+        fi
+      done
+      # if ide-disk is already loaded we havn't got anything to do.
+      # note that this ain't that simple with SCSI -- scsi_hostadapter
+      # might have been changed since last load etc.
+      if lsmod | grep -q '^ide-disk ' ; then
+        : skip
+      else
+        load_module ide-disk
+      fi
+    fi
+  done
 
-# load modules needed for disks mentioned in $1
-load_device_modules () {
-  if echo "$1" | grep -q '\(ide\|ataraid\)' ; then
-    # if ide-disk is already loaded we havn't got anything to do.
-    # note that this ain't that simple with SCSI -- scsi_hostadapter
-    # might have been changed since last load etc.
-    if lsmod | grep -q '^ide-disk ' ; then
-      : skip
-    else
-      load_package ide-mod
-      load_ide_modules
-      load_module ide-disk
-    fi
-  fi
-
-  if echo "$1" | grep -q 'scsi' ; then
-      load_package scsi-mod
-      load_scsi_modules
-      load_module sd_mod
-  fi
-
-  if echo "$1" | grep -q 'ida' ; then
-    . installer-raid-functions
-    setup_cpqarray
-  fi
-
-  if echo "$1" | grep -q 'cciss' ; then
-    . installer-raid-functions
-    setup_cciss
-  fi
-
-  if echo "$1" | grep -q 'dac960' ; then
-    . installer-raid-functions
-    setup_DAC960
-  fi
-
-  if echo "$1" | grep -q 'ataraid' ; then
-    . installer-raid-functions
-    setup_ataraid
-  fi
-  
-  if echo "$1" | grep -q 'i2o' ; then
-    . installer-raid-functions
-    setup_i2o
-  fi
+  # same for scsi
+  for scsi in $detected_scsi; do
+    if echo "$1" | grep -q $scsi; then
+      for i in /etc/modules.conf /etc/modprobe.conf; do
+        if ! cat $i | grep -q "^alias scsi_hostadapter"; then
+          test ! -f $i || cp $i $i.tmp
+          echo "alias scsi_hostadapter $scsi" >> $i.tmp
+          # alias for devfsd
+          echo "alias scsi-hosts $scsi" >> $i.tmp
+          sort $i.tmp | uniq > $i
+          rm -f $i.tmp
+        fi
+      done
+      if lsmod | grep -q '^sd_mod ' ; then
+        : skip
+      else
+        load_module sd_mod
+      fi
+    fi
+  done
 }
 
 ##################################
@@ -513,6 +478,9 @@
 # invoked as load_nodule runs function load_module,
 if test "x`basename $0 || :`" = "xload_module"; then 
     load_module "$@"; exit $?
+# invoked as load_device_module, runs function load_device_modules
+elif test "x`basename $0`" = "xload_device_modules"; then
+    load_device_modules "$@"; exit $?
 elif test "x`basename $0 || :`" = "xinstaller-prep-source"; then
     # only source (and net) parts are prepared
     source_only=yes
@@ -546,11 +514,9 @@
 	load_cdrom_modules
 	case "$source_device" in 
 	/dev/hd* | auto) 
-	    load_ide_modules
 	    load_module ide-cd
 	    ;;
 	/dev/sd* | /dev/scd* )
-    	    load_scsi_modules
 	    load_module sr_mod
 	    ;;
 	esac
@@ -563,11 +529,9 @@
     disk)
 	case "$source_device" in 
 	/dev/hd*) 
-	    load_ide_modules
 	    load_module ide-disk
 	    ;;
 	/dev/sd*)
-    	    load_scsi_modules
 	    load_module sd_mod
 	    ;;
 	esac
@@ -594,8 +558,6 @@
 # invoked as load_device_module, runs function load_device_modules
 if test "x`basename $0 || :`" = "xload_package"; then 
     load_package "$@"; exit $?
-elif test "x`basename $0`" = "xload_device_modules"; then
-    load_device_modules "$@"; exit $?
 fi
 
 ############## install packages needed in next stage ##############

Modified: bootdisk/trunk/batch-installer/installer-raid-functions
==============================================================================
--- bootdisk/trunk/batch-installer/installer-raid-functions	(original)
+++ bootdisk/trunk/batch-installer/installer-raid-functions	Tue Nov 22 17:00:45 2005
@@ -273,29 +273,24 @@
 }
 
 setup_DAC960 () {
-  load_package hdraid-mod DAC960.o
   load_module DAC960
 
   mk_hdraid_devices /dev/rd 48 32
 }
 
 setup_cpqarray () {
-  load_package hdraid-mod cpqarray.o
   load_module cpqarray
 
   mk_hdraid_devices /dev/ida 72 16
 }
 
 setup_cciss () {
-  load_package hdraid-mod cciss.o
   load_module cciss
 
   mk_hdraid_devices /dev/cciss 104 16
 }
 
 setup_ataraid () {
-  load_ide_modules
-  load_package hdraid-mod ataraid.o hptraid.o pdcraid.o
   load_module ataraid
   if lsmod | grep -q "^hptraid " ; then
     :
@@ -344,8 +339,6 @@
 }
 
 setup_i2o () {
-  load_package scsi-mod scsi_mod.o
-  load_package i2o-mod
   load_module scsi_mod
   load_module i2o_pci
   load_module i2o_core

Modified: bootdisk/trunk/batch-installer/installer-validate
==============================================================================
--- bootdisk/trunk/batch-installer/installer-validate	(original)
+++ bootdisk/trunk/batch-installer/installer-validate	Tue Nov 22 17:00:45 2005
@@ -352,6 +352,7 @@
     cdrom)
     	# if one need other filesystem, notice me :)
     	is_equal source_filesystem iso9660
+        is_not_empty hostadapters_modules
 	case "$source_device" in 
 	/dev/[hs]d[a-h] | /dev/scd[0-9] | auto )
 		: ok
@@ -701,11 +702,7 @@
     esac
    
     is_disk $dev dest_devices
-    case $dev in 
-    /dev/sd[a-h] )
-	is_not_empty scsi_hostadapters
-	;;
-    esac
+    is_not_empty hostadapters_modules
   done
   
   if test "$actions"; then error dest_devices_actions "`nls "too many actions"`"; fi

Modified: bootdisk/trunk/batch-installer/installer.conf
==============================================================================
--- bootdisk/trunk/batch-installer/installer.conf	(original)
+++ bootdisk/trunk/batch-installer/installer.conf	Tue Nov 22 17:00:45 2005
@@ -2,6 +2,10 @@
 ## Generated automatically by ui at Mon Feb 17 23:20:34 CET 2003
 ##
 
+# hostadapters_modules: space delimited list of modules which are required
+#   by your adapters and/or storage devices, example: "piix aic7xxx"
+hostadapters_modules=""
+
 # source is one of:
 #  - net - ftp, http. source_filesystem has to be net
 #  - nfs - nfs server. source_filesystem has to be nfs
@@ -46,10 +50,6 @@
 net_v6=""
 net_proxy=""
 
-# space delimited SCSI hostadapters (can be auto, for PCI SCSI card)
-# hardware raid modules don't need to be listed here
-scsi_hostadapters="auto"
-
 # PCMCIA controller (can be auto)
 pcmcia_controller="auto"
 

Modified: bootdisk/trunk/batch-installer/pci/sh-scan-pci
==============================================================================
--- bootdisk/trunk/batch-installer/pci/sh-scan-pci	(original)
+++ bootdisk/trunk/batch-installer/pci/sh-scan-pci	Tue Nov 22 17:00:45 2005
@@ -15,6 +15,9 @@
   if [ "$id" = "$dev" ] ; then
     if test "x$2" = "x-m"; then 
 	echo "$module"
+    elif test "x$2" = "x-i"; then
+	echo -n "$module|"
+	echo "$name" | sed -e 's/|/ /g'
     else
 	echo "module=$module name=$name"
     fi

Modified: bootdisk/trunk/batch-installer/ui/ui-functions
==============================================================================
--- bootdisk/trunk/batch-installer/ui/ui-functions	(original)
+++ bootdisk/trunk/batch-installer/ui/ui-functions	Tue Nov 22 17:00:45 2005
@@ -130,6 +130,10 @@
 ## Generated automatically by ui at `date`
 ##
 
+# hostadapters_modules: space delimited list of modules which are required
+#   by your adapters and/or storage devices, example: "piix aic7xxx"
+hostadapters_modules="$hostadapters_modules"
+
 # source is one of:
 #  - net - ftp, http. source_filesystem has to be net
 #  - nfs - nfs server. source_filesystem has to be nfs
@@ -174,10 +178,6 @@
 net_v6="$net_v6"
 net_proxy="$net_proxy"
 
-# space delimited SCSI hostadapters (can be auto, for PCI SCSI card)
-# hardware raid modules don't need to be listed here
-scsi_hostadapters="$scsi_hostadapters"
-
 # PCMCIA controller (can be auto)
 pcmcia_controller="$pcmcia_controller"
 
@@ -203,7 +203,6 @@
 # set (while no dest_part3_device).
 # Numeration starts at 1.
 dest_devices="$dest_devices"
-dest_types="$dest_types"
 dest_devices_actions="$dest_devices_actions"
 
 EOF

Modified: bootdisk/trunk/batch-installer/ui/ui-main
==============================================================================
--- bootdisk/trunk/batch-installer/ui/ui-main	(original)
+++ bootdisk/trunk/batch-installer/ui/ui-main	Tue Nov 22 17:00:45 2005
@@ -638,61 +638,34 @@
 echo 'res=1'
 }
 
-ui-dest_types () {
+ui-hostadapters_modules () {
 dml <<EOF 
-    <br>`nls "Please select type of devices you want to use for"`
-    <br>`nls "installation. If unsure, select just IDE.")`
+    <br>`nls "Put the names of kernel modules for your IDE/SCSI/SATA adapters"`
+    <br>`nls "you wish to use. If unsure, type 'ide-detect' for Generic IDE."`
+    <br>`nls "If you have only one adapter, you may select appropriate from the list."`
     <br>
-    <meta title="$(nls "Destination device type selection")">
-    <menu id=res_menu res=1>
-    <item id=ide>`nls "IDE"`
-    <item id=scsi>`nls "SCSI or SATA"`
-    <item id=cciss>`nls "cciss raid controller"`
-    <item id=ida>`nls "cpqarray raid controller"`
-    <item id=dac960>`nls "DAC960 raid controller"`
-    <item id=ataraid>`nls "ATA raid controller"`
-    <item id=i2o>`nls "I2O disk device"`
-    </menu> 
-    $@
-EOF
-}
-
-
-# create scsi items
-scsi_hostadapter_items () {
-local automods=`detect-pci-devices scsi -m || :`
-local text=$(nls "_*_d_e_t_e_c_t_e_d_*")
-grep -vs '^~' /etc/scsi-low.list.in | while read line; do
-    dev=`echo $line | sed 's/\.o|.*//'`
-    for i in $automods; do 
-	if test "x$i" = "x$dev"; then
-	    auto="(${text})"
-	    break
-	else
-	    auto=""
-	fi
-    done
-    dev2=`echo $dev | sed 's/_/__/g'`
-    desc=`echo $line | sed 's/[^|]*|//' | sed 's/|.*//'`
-    echo "<item id=\"$dev\">$dev2: _$desc $auto"
-done
-}
-
-
-ui-scsi_hostadapters () {
-dml <<EOF
-    <br>`nls "Put the name of low-level module(s) for your SCSI adapter"`
-    <br>`nls "If you have only one adapter, you may select appropriate from the list"`
-    <br>`nls "Alternatively, you may choose %s to scan for adapters (PCI only)" "${auto_text}"`
-    <br>
-    <br>`nls "If you don't have any, leave it blank or set to %s" "${auto_text}"`
-    <br>
-    <meta title="$(nls "SCSI low-level modules")">
+    <meta title='$(nls "IDE/SCSI/SATA devices kernel module selection")'>
     <menu id=res_menu res=1>
     <item id=ui_custom>${custom_text}
-    <item id=auto>${auto_text}
-    `scsi_hostadapter_items`
-    </menu>
+    $(
+IFS="
+"
+      autoscsimods=`detect-pci-devices scsi -i | sort -u`
+      for entry in $autoscsimods; do
+        module=`echo $entry | awk -F "|" '{print $1}'`
+        name=`echo $entry | awk -F "|" '{printf "%.55s",$2}'`
+        echo "<item id=$module>$module: $name"
+      done
+      
+      autoidemods=`detect-pci-devices ide -i | sort -u`
+      for entry in $autoidemods; do
+        module=`echo $entry | awk -F "|" '{print $1}'`
+	name=`echo $entry | awk -F "|" '{printf "%.55s",$2}'`
+	echo "<item id=\"$module\">$module: $name"
+      done
+    )
+    <item id=ide-detect>ide-detect: `nls "Generic IDE driver"`
+    </menu> 
     $@
 EOF
 }
@@ -717,8 +690,6 @@
 EOF
 }
 
-
-
 ui-pkgs_installer () {
 dml <<EOF 
     <br>`nls "Choose installer for RPM software packages"`

Modified: bootdisk/trunk/batch-installer/ui/ui-makeform
==============================================================================
--- bootdisk/trunk/batch-installer/ui/ui-makeform	(original)
+++ bootdisk/trunk/batch-installer/ui/ui-makeform	Tue Nov 22 17:00:45 2005
@@ -99,7 +99,7 @@
 item source_additional "$(nls "Additional sources of RPMS")" 
 
 separator "$(nls "Other options")"
-item scsi_hostadapters "$(nls "SCSI adapters, if you have any")"
+item hostadapters_modules "$(nls "List of kernel modules for IDE/SCSI/SATA adapters")" 
 item pcmcia_controller "$(nls "PCMCIA controller, if you have any")"
 
 item pkgs_installer "$(nls "Which installer use to install RPM packages")" 
@@ -113,7 +113,6 @@
 
 separator "$(nls "Destination options")"
 item dest_devices "$(nls "List of hard disks to install on")" 
-item dest_types "$(nls "List of destination device types")" 
 item dest_devices_actions "$(nls "What to do with partitions of proper disks?")" 
 
 

Modified: bootdisk/trunk/batch-installer/ui/ui-wizard
==============================================================================
--- bootdisk/trunk/batch-installer/ui/ui-wizard	(original)
+++ bootdisk/trunk/batch-installer/ui/ui-wizard	Tue Nov 22 17:00:45 2005
@@ -105,6 +105,62 @@
 # prep
 ###
 
+did_select_hostadapters_modules=
+
+select_hostadapters_modules () {
+  if test "$did_select_hostadapters_modules" && \
+     test "$(echo "$hostadapters_modules" | sed -e 's/ //g')" && \
+     yes_no yes $(nls "Do you want to keep IDE/SCSI/SATA adapters modules with:<br>%s" "$hostadapters_modules") ; then
+    return 0
+  fi
+
+  did_select_hostadapters_modules=yes
+
+  local entry module name
+
+  dial <<EOF
+<meta title='$(nls "IDE/SCSI/SATA devices kernel module selection")'>
+<br>
+$(nls "Please select for which IDE/SCSI/SATA adapters you want to load.")<br>
+$(nls "kernel module. If unsure, select Generic IDE.")<br><br>
+$(nls "Detected hardware:")<br><br>
+<menu id=devmodules checked="$hostadapters_modules">
+$(
+IFS="
+"
+
+autoscsimods=`detect-pci-devices scsi -i | sort -u`
+for entry in $autoscsimods; do
+  module=`echo $entry | awk -F "|" '{print $1}'`
+  name=`echo $entry | awk -F "|" '{printf "%.72s",$2}'`
+  echo "<item id=$module checked=0>$name"
+done
+
+autoidemods=`detect-pci-devices ide -i | sort -u`
+for entry in $autoidemods; do
+  module=`echo $entry | awk -F "|" '{print $1}'`
+  name=`echo $entry | awk -F "|" '{printf "%.72s",$2}'`
+  echo "<item id=$module checked=0>$name"
+done
+
+)
+  <item id=ide-detect checked=0>$(nls "Generic IDE driver")
+</menu><br>
+$ok_cancel
+EOF
+  if [ "$res" = 1 ] ; then
+    if echo "$devmodules" | grep -q "^ *$" ; then
+      return 1
+    fi
+    hostadapters_modules="$devmodules"
+  else
+    did_select_hostadapters_modules=
+    return 1
+  fi
+
+  return 0
+}
+
 pre_prep () {
   # skip it on real system (testing)
   #[ $real_system = no ] || return 1
@@ -173,50 +229,74 @@
 ###
 
 pre_source2 () {
-  local ok
+  local ok detected_ide detected_scsi scds cscd
   
-  if [ $source = cdrom ] ; then
-    ok=
-    autocdrom=
-
-    if [ "$real_system" = no ] ; then
-      load_module ide-detect
-      load_module ide-cd
-      load_module isofs
+  if [ $source = cdrom ] || [ $source = disk ]; then
+    if select_hostadapters_modules ; then
+      load_device_modules "$hostadapters_modules"
     fi
+    if [ $source = cdrom ] ; then
+      ok=
+      autocdrom=
+
+      if [ "$real_system" = no ] ; then
+        detected_ide=`detect-pci-devices ide -m`
+	detected_ide="$detected_ide ide-detect"
+        detected_scsi=`detect-pci-devices scsi -m`
+	for ide in $detected_ide; do
+	  if echo "$hostadapters_modules" | grep -q $ide; then
+            load_module ide-cd
+	    break
+	  fi
+	done
+	for scsi in $detected_scsi; do
+	  if echo "$hostadapters_modules" | grep -q $scsi; then
+            load_module sr_mod
+	    break
+	  fi
+	done
+        load_module isofs
+      fi
     
-    if [ -d /proc/ide ] ; then
-      for f in /proc/ide/hd* ; do
-        if [ -f $f/media ] && [ "$(cat $f/media)" = "cdrom" ] ; then
-          autocdrom="$autocdrom /dev/`basename $f`"
-        fi
-      done
-    fi
+      if [ -d /proc/ide ] ; then
+        for f in /proc/ide/hd* ; do
+          if [ -f $f/media ] && [ "$(cat $f/media)" = "cdrom" ] ; then
+            autocdrom="$autocdrom /dev/`basename $f`"
+          fi
+        done
+	scds=`cat /proc/scsi/scsi | grep "CD-ROM" | wc -l`
+	cscd=0
+	while [ $cscd -lt $scds ]; do
+          autocdrom="$autocdrom /dev/scd$cscd"
+	  cscd=$(($cscd+1))
+        done
+      fi
 
-    autocdrom=$(echo "$autocdrom" | sed -e 's/^ //')
+      autocdrom=$(echo "$autocdrom" | sed -e 's/^ //')
  
-    if grep -q /src /proc/mounts ; then
-      umount /src
-    fi
-
-    for f in $autocdrom ; do
-      if mount -t iso9660 -o ro $f /src > /dev/null 2> /dev/null ; then
-        if [ -d /src/PLD/inst ] ; then
-          source_device=$f
-	  source_dir=/
-	  source_filesystem=iso9660
-	  ok=x
-        fi
-	rm -f /tmp/is-mini-iso
-	if is_mini_iso ; then
-	  echo yes >/tmp/is-mini-iso
-	fi
+      if grep -q /src /proc/mounts ; then
         umount /src
       fi
-    done
+
+      for f in $autocdrom ; do
+        if mount -t iso9660 -o ro $f /src > /dev/null 2> /dev/null ; then
+          if [ -d /src/PLD/inst ] ; then
+            source_device=$f
+            source_dir=/
+            source_filesystem=iso9660
+            ok=x
+          fi
+          rm -f /tmp/is-mini-iso
+          if is_mini_iso ; then
+            echo yes >/tmp/is-mini-iso
+          fi
+          umount /src
+        fi
+      done
   
-    if test "$ok" ; then
-      return 1 # skip section, not needed.
+      if test "$ok" ; then
+        return 1 # skip section, not needed.
+      fi
     fi
   fi
 
@@ -269,7 +349,7 @@
   cat <<EOF
 $(nls "CD-ROM device"):
 <menu id=source_device res=1002 selected="$autocdrom">
-<item id=/dev/hda>/dev/hda $(nls "(Primary Master (not likely))") $(det /dev/hda)
+<item id=/dev/hda>/dev/hda $(nls "(Primary Master)") $(det /dev/hda)
 <item id=/dev/hdb>/dev/hdb $(nls "(Primary Slave)") $(det /dev/hdb)
 <item id=/dev/hdc>/dev/hdc $(nls "(Secondary Master)") $(det /dev/hdc)
 <item id=/dev/hdd>/dev/hdd $(nls "(Secondary Slave)") $(det /dev/hdd)
@@ -345,36 +425,6 @@
   esac
 }
 
-set_scsi_hostadapters () {
-  if test -z "$scsi_hostadapters" ; then
-    scsi_hostadapters=auto
-  fi
-
-  if test "x$scsi_hostadapters" = "xauto"; then
-    adapters=`detect-pci-devices scsi -m || :`
-    if test "$adapters" ; then
-      return 0 # ok, detected
-    fi
-  else
-    # ok, some other module..
-    return 0
-  fi
-
-  # oops... wasn't able to detect host adapter, ask the user, maybe
-  # it was an error...
-  
-  if yes_no no $(nls "Are you sure you have SCSI controller installed?") ; then
-    info "$(nls "You can select hostadapter from list.<br>Select '%s' from main menu to do so." \
-    	  "$(nls "Regular setup UI")")"
-    #get_input scsi_hostadapters "" $(nls "Please enter scsi hostadapter(s) modules:") 
-    scsi_hostadapters=unknown
-    return 0
-  else
-    # ok, it was an error, return error, so we'll get back
-    return 1
-  fi
-}
-
 post_source2 () {
   # we must save config, or we will lose variable values after
   # going back in installer
@@ -388,12 +438,6 @@
 	  ;;
       esac
       ;;
-    cdrom | disk )
-      case $source_device in
-        /dev/sd* | /dev/scsi/* )
-	  set_scsi_hostadapters
-	  ;;
-      esac
   esac
 }
 
@@ -653,46 +697,6 @@
   save_config
 }
 
-did_select_dest_types=
-
-select_dest_types () {
-  if test "$did_select_dest_types" && \
-     test "$(echo "$dest_types" | sed -e 's/ //g')" && \
-     yes_no yes $(nls "Do you want to keep destination device types with:<br>%s" "$dest_types") ; then
-    return 0
-  fi
-
-  did_select_dest_types=yes
-
-  dial <<EOF
-<meta title='$(nls "Destination device type selection")'>
-<br>
-$(nls "Please select type of devices you want to use for")<br>
-$(nls "installation. If unsure, select just IDE.")<br><br>
-<menu id=ddt checked="$dest_types">
-  <item id=ide checked=0>$(nls "IDE")
-  <item id=scsi checked=0>$(nls "SCSI or SATA")
-  <item id=cciss checked=0>$(nls "cciss raid controller")
-  <item id=ida checked=0>$(nls "cpqarray raid controller")
-  <item id=dac960 checked=0>$(nls "DAC960 raid controller")
-  <item id=ataraid checked=0>$(nls "ATA raid controller")
-  <item id=i2o checked=0>$(nls "I2O disk device")
-</menu><br>
-$ok_cancel
-EOF
-  if [ "$res" = 1 ] ; then
-    if echo "$ddt" | grep -q "^ *$" ; then
-      return 1
-    fi
-    dest_types="$ddt"
-  else
-    did_select_dest_devices=
-    return 1
-  fi
-
-  return 0
-}
-
 did_select_dest_devices=
 
 select_dest_devices () {
@@ -702,48 +706,6 @@
   avail_dest_devices=`awk '{print $4" "$5}' /proc/partitions | \
                       grep -v ' 0$' | awk '/[1-9]/ {print "/dev/"$1}' |
                       grep -v $source_device | sort`
-  # filter out devices not matching selected device types
-  tmp_devices=
-  for f in $avail_dest_devices; do
-    case "$f" in
-      /dev/hd[a-i] )
-        if test -n "`echo $dest_types | awk '/ide/'`"; then
-          tmp_devices="$tmp_devices $f"
-        fi
-        ;;
-      /dev/sd[a-i] )
-        if test -n "`echo $dest_types | awk '/scsi/'`"; then
-          tmp_devices="$tmp_devices $f"
-        fi
-        ;;
-      /dev/ida/* )
-        if test -n "`echo $dest_types | awk '/ida/'`"; then
-          tmp_devices="$tmp_devices $f"
-        fi
-        ;;
-      /dev/rd/* )
-        if test -n "`echo $dest_types | awk '/dac960/'`"; then
-          tmp_devices="$tmp_devices $f"
-        fi
-        ;;
-      /dev/cciss/* )
-        if test -n "`echo $dest_types | awk '/cciss/'`"; then
-          tmp_devices="$tmp_devices $f"
-        fi
-        ;;
-      /dev/ataraid/* )
-        if test -n "`echo $dest_types | awk '/ataraid/'`"; then
-          tmp_devices="$tmp_devices $f"
-        fi
-        ;;
-      /dev/i2o/* )
-        if test -n "`echo $dest_types | awk '/i2o/'`"; then
-          tmp_devices="$tmp_devices $f"
-        fi
-        ;;
-    esac
-  done
-  avail_dest_devices=$tmp_devices
 
   if test -z "$avail_dest_devices"; then
     info $(nls "No available destination devices found.")
@@ -817,8 +779,8 @@
 post_dest () {
   case "$res" in
     1002 )
-      if select_dest_types ; then
-        load_device_modules "$dest_types"
+      if select_hostadapters_modules ; then
+        load_device_modules "$hostadapters_modules"
         case "$way" in
           manual )
 	    if select_dest_devices "all"; then



More information about the pld-cvs-commit mailing list