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

hawk hawk at pld-linux.org
Sun Apr 8 19:38:48 CEST 2007


Author: hawk
Date: Sun Apr  8 19:38:47 2007
New Revision: 8449

Modified:
   bootdisk/trunk/batch-installer/ui/ui-dialogs
Log:
- show detected network adapters instead of outdated device list


Modified: bootdisk/trunk/batch-installer/ui/ui-dialogs
==============================================================================
--- bootdisk/trunk/batch-installer/ui/ui-dialogs	(original)
+++ bootdisk/trunk/batch-installer/ui/ui-dialogs	Sun Apr  8 19:38:47 2007
@@ -98,32 +98,40 @@
 net_device_items () {
 local automods=`detect-pci-devices net -m || :`
 local text=$(nls "_*_d_e_t_e_c_t_e_d_*")
-grep -vs '^~' /etc/eth.list.in | while read line; do
-    dev=`echo $line | sed 's/\.o|.*//'`
+cat /etc/sh-scan-pci.list-net | sort -k 2 | while read id mod desc; do
+    desc=`echo $desc | sed -e 's/|/ /g' | awk -F "|" '{ printf "%.66s",$1; }'`
     for i in $automods; do 
-	if test "x$i" = "x$dev"; then
+	if test "x$i" = "x$mod"; 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"
+    echo "<item id=\"$mod\">$mod: _$desc $auto"
 done
 }
 
 ui-net_device_module () {
 dml <<EOF 
-    <br>`nls "Select one of network device modules below"`
-    <br>`nls "If you have PCI card you may try"` ${auto_text}
+    <br>`nls "Put the names of kernel modules for your network adapters"`
+    <br>`nls "you wish to use. If unsure, type 'auto' (PCI only)."`
+    <br>`nls "If you have only one adapter, you may select it from the list."`
+    <br>
     <meta title="$(nls "Network card")">
     <menu id=res_menu res=1>
     <item id=ui_custom>${custom_text}
-    <item id=auto>${auto_text} (detect during installation, PCI only)
-    `net_device_items`
-    </menu>
+    $(
+IFS="
+"
+      autonetmods=`detect-pci-devices net -i | sort -u`
+      for entry in $autonetmods; do
+        module=`echo $entry | awk -F "|" '{print $1}'`
+        name=`echo $entry | awk -F "|" '{printf "%.58s",$2}'`
+        echo "<item id=$module>$module: $name"
+      done
+    )
+    </menu> 
     $@
 EOF
 }


More information about the pld-cvs-commit mailing list