SVN: bootdisk/trunk/batch-installer/ui/ui-wizard

hawk hawk at pld-linux.org
Sun Apr 8 19:37:30 CEST 2007


Author: hawk
Date: Sun Apr  8 19:37:29 2007
New Revision: 8447

Modified:
   bootdisk/trunk/batch-installer/ui/ui-wizard
Log:
- show input dialog instead of device list if no hardware was detected
- cosmetics, small visual changes


Modified: bootdisk/trunk/batch-installer/ui/ui-wizard
==============================================================================
--- bootdisk/trunk/batch-installer/ui/ui-wizard	(original)
+++ bootdisk/trunk/batch-installer/ui/ui-wizard	Sun Apr  8 19:37:29 2007
@@ -111,7 +111,7 @@
   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
+     return 0
   fi
 
   did_select_hostadapters_modules=yes
@@ -126,36 +126,42 @@
   dial <<EOF
 <meta title='$(nls "IDE/SCSI/SATA adapters 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 "%.66s",$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 "%.66s",$2}'`
-  echo "<item id=$module checked=0>$name"
-done
 
+if test -z "$autoscsimods" && test -z "$autoidemods" ; then
+  echo "$(nls "Module"): <input id=devmodules caption=$devmodules><br><br>"
+else
+  echo "$(nls "Please select for which IDE/SCSI/SATA adapters you want to load")<br>"
+  echo "$(nls "kernel module. If unsure, select Generic IDE.")<br><br>"
+  echo "$(nls "Detected hardware:")<br><br>"
+  echo "<menu id=devmodules checked="$hostadapters_modules">"
+  OLDIFS=$IFS
+  IFS="
+"
+  for entry in $autoscsimods; do
+    module=`echo $entry | awk -F "|" '{print $1}'`
+    name=`echo $entry | awk -F "|" '{printf "%.66s",$2}'`
+    echo "<item id=$module checked=0>$name"
+  done
+
+  for entry in $autoidemods; do
+    module=`echo $entry | awk -F "|" '{print $1}'`
+    name=`echo $entry | awk -F "|" '{printf "%.66s",$2}'`
+    echo "<item id=$module checked=0>$name"
+  done
+  IFS=$OLDIFS
+  echo "<item id=ide-generic checked=0>$(nls "Generic IDE driver")"
+  echo "</menu><br>"
+fi
 )
-  <item id=ide-generic checked=0>$(nls "Generic IDE driver")
-</menu><br>
 <check id=ide_dma checked=$dma> 
 $(nls "Try to enable DMA for IDE devices during installation")
 <br><br>
 $ok_cancel
 EOF
+
   if [ "$res" = 1 ] ; then
     if echo "$devmodules" | grep -q "^ *$" ; then
       return 1
@@ -508,48 +514,30 @@
 }
 
 display_netdev () {
-  local mods
- 
-  if [ $real_system = no ] ; then
-    mods=$(detect-pci-devices net -m || :)
-  else
-    mods=$(cd ../pci; ./sh-scan-pci -m || :)
-  fi
+  local autonetmods custom_module
 
-  if [ "$mods" = "" ] ; then
-    # couldn't detect...
-    if [ -x /bin/pcic_probe ] ; then
-      echo "<meta active=i_have_pcmcia>"
-    else
-      echo "<meta active=net_device_module>"
-    fi
-    echo "<menu id=net_device_module selected='$net_device_module' res=1002>"
-    grep -vs '^~' /etc/eth.list.in | while read line; do
-      dev=`echo $line | sed 's/\.o|.*//' | sed 's/_/__/'`
-      dev_esc=`echo $dev | sed 's/_/__/'`
-      desc=`echo $line | sed 's/[^|]*|//' | sed 's/|.*//'`
-      echo "<item id=\"$dev\">$dev_esc: _$desc"
+  autonetmods=`detect-pci-devices net -i | sort -u`
+  if ! test -z "$autonetmods" ; then
+    echo "$(nls "Detected hardware:")<br><br>"
+    echo "<menu id=net_device_module>"
+    OLDIFS=$IFS
+    IFS="
+"
+    for entry in $autonetmods; do
+      module=`echo $entry | awk -F "|" '{print $1}'`
+      name=`echo $entry | awk -F "|" '{printf "%.66s",$2}'`
+      echo "<item id=$module>$name"
     done
-    echo "</menu>"
-    echo "$(nls "Extra options (irq=10, etc.)"):" \
-         "<input id=net_device_module_options caption='$net_device_module_options'>"
+    IFS=$OLDIFS
+    echo "</menu><br>"
   else
-    if echo $mods | grep -q ' ' ; then
-      nls "Detected network devices: %s<br>" "$mods"
-      nls "First one will be used.<br>"
-      # TODO: maybe allow choice here?
-    else
-      nls "Detected network device: %s" "$mods"
-    fi
-    echo "<br><br>"
-    echo "$(nls "Module                      "): <input id=net_device_module caption='auto'><br>"
-    nls "Leave this on 'auto'.<br><br>"
-    echo "$(nls "Extra options (irq=10, etc.)"):" \
-   	"<input id=net_device_module_options caption='$net_device_module_options'><br>"
-    nls "If unsure, leave this blank."
+    echo "$(nls "Module                      "): <input id=net_device_module caption=$net_device_module><br><br>"
   fi
+  echo "$(nls "Extra options (irq=10, etc.)"):" \
+    "<input id=net_device_module_options caption='$net_device_module_options'><br>"
+  nls "If unsure, leave this blank."
 
-  echo "<br><button id=i_have_pcmcia res=1 caption='$(nls "I have _PCMCIA card.")'>"
+  echo "<br><br><button id=i_have_pcmcia res=1 caption='$(nls "I have _PCMCIA card.")'>"
 }
 
 post_netdev () {


More information about the pld-cvs-commit mailing list