[PC-BSD Commits] r4997 - in pcbsd/trunk/pc-sysinstall: . backend examples

svn at pcbsd.org svn at pcbsd.org
Fri Nov 13 09:04:05 PST 2009


Author: kris
Date: 2009-11-13 09:04:05 -0800 (Fri, 13 Nov 2009)
New Revision: 4997

Added:
   pcbsd/trunk/pc-sysinstall/examples/pcinstall.cfg.rsync
Modified:
   pcbsd/trunk/pc-sysinstall/backend/functions-networking.sh
   pcbsd/trunk/pc-sysinstall/backend/parseconfig.sh
   pcbsd/trunk/pc-sysinstall/pcinstall.cfg
Log:

Updated pc-sysinstall, now we detect and setup wlan* devices for wifi cards in rc.conf,
and create tray icon desktop files for PC-BSD installs



Modified: pcbsd/trunk/pc-sysinstall/backend/functions-networking.sh
===================================================================
--- pcbsd/trunk/pc-sysinstall/backend/functions-networking.sh	2009-11-13 10:03:50 UTC (rev 4996)
+++ pcbsd/trunk/pc-sysinstall/backend/functions-networking.sh	2009-11-13 17:04:05 UTC (rev 4997)
@@ -1,6 +1,33 @@
 #!/bin/sh
 # Functions which perform our networking setup
 
+# Function which creates a kde4 .desktop file for the PC-BSD net tray
+create_desktop_nettray()
+{
+  NIC="${1}"
+  echo "#!/usr/bin/env xdg-open
+[Desktop Entry]
+Exec=/usr/local/kde4/bin/pc-nettray ${NIC}
+Icon=network
+StartupNotify=false
+Type=Application" > ${FSMNT}/usr/share/skel/.kde4/Autostart/tray-${NIC}.desktop
+  chmod 744 ${FSMNT}/usr/share/skel/.kde4/Autostart/tray-${NIC}.desktop
+
+};
+
+# Function which checks is a nic is wifi or not
+check_is_wifi()
+{
+  NIC="$1"
+  ifconfig ${NIC} | grep "802.11" >/dev/null 2>/dev/null
+  if [ "$?" = "0" ]
+  then
+    return 0
+  else 
+    return 1
+  fi
+};
+
 # Function which detects available nics, and runs sets them to DHCP on the
 # system
 save_auto_dhcp()
@@ -12,13 +39,33 @@
   if [ -e "${TMPDIR}/.niclist" ]
   then
     echo "# Auto-Enabled NICs from pc-sysinstall" >>${FSMNT}/etc/rc.conf
-
+    WLANCOUNT="0"
     while read line
     do
       NIC="`echo $line | cut -d ':' -f 1`"
       DESC="`echo $line | cut -d ':' -f 2`"
       echo_log "Setting $NIC to DHCP on the system."
-      echo "ifconfig_${NIC}=\"DHCP\"" >>${FSMNT}/etc/rc.conf
+      check_is_wifi ${NIC}
+      if [ "$?" = "0" ]
+      then
+        # We have a wifi device, setup a wlan* entry for it
+        WLAN="wlan${WLANCOUNT}"
+        echo "wlans_${NIC}=\"${WLAN}\"" >>${FSMNT}/etc/rc.conf
+        echo "ifconfig_${WLAN}=\"DHCP\"" >>${FSMNT}/etc/rc.conf
+        CNIC="${WLAN}"
+        WLANCOUNT="`expr ${WLANCOUNT} + 1`"
+      else
+        echo "ifconfig_${NIC}=\"DHCP\"" >>${FSMNT}/etc/rc.conf
+        CNIC="${NIC}"
+      fi
+ 
+        
+      # If we are installing PC-BSD, lets create .desktop links
+      if [ "$INSTALLTYPE" = "PCBSD" ]
+      then
+        ceate_desktop_nettray "${CNIC}" 
+      fi
+
     done < ${TMPDIR}/.niclist 
   fi
 

Modified: pcbsd/trunk/pc-sysinstall/backend/parseconfig.sh
===================================================================
--- pcbsd/trunk/pc-sysinstall/backend/parseconfig.sh	2009-11-13 10:03:50 UTC (rev 4996)
+++ pcbsd/trunk/pc-sysinstall/backend/parseconfig.sh	2009-11-13 17:04:05 UTC (rev 4997)
@@ -94,15 +94,15 @@
   # Do any localization in configuration
   run_localize
   
+  # Save any networking config on the installed system
+  save_networking_install
+
   # Now add any users
   setup_users
 
   # Now run any commands specified
   run_commands
   
-  # Save any networking config on the installed system
-  save_networking_install
-
   # Do any last cleanup / setup before unmounting
   run_final_cleanup
 

Modified: pcbsd/trunk/pc-sysinstall/pcinstall.cfg
===================================================================
--- pcbsd/trunk/pc-sysinstall/pcinstall.cfg	2009-11-13 10:03:50 UTC (rev 4996)
+++ pcbsd/trunk/pc-sysinstall/pcinstall.cfg	2009-11-13 17:04:05 UTC (rev 4997)
@@ -13,7 +13,7 @@
 # Setup the disk label
 # All sizes are expressed in MB
 # Avail FS Types, UFS, UFS+S, UFS+J, ZFS, SWAP
-disk0-part=UFS 2000 / 
+disk0-part=UFS 1000 / 
 disk0-part=SWAP 2000 none
 disk0-part=UFS 0 /usr
 # Size 0 means use the rest of the slice size
@@ -27,19 +27,42 @@
 #netNameServer=208.67.222.222
 #netDefaultRouter=192.168.0.1
 
+netSaveDev=AUTO-DHCP
+#netSaveDev=nfe0
+#netSaveIP=192.168.0.49
+#netSaveMask=255.255.255.0
+#netSaveNameServer=208.67.222.222
+#netSaveDefaultRouter=192.168.0.1
+
 # Set if we are installing via optical, USB, or FTP
 #installType=PCBSD
 installType=FreeBSD
 #installMedium=dvd
-installMedium=rsync
+installMedium=ftp
 
-rsyncPath=life-preserver/back-2009-11-12T14_53_14
-rsyncUser=lifep
-rsyncHost=192.168.0.50
-rsyncPort=22
+ftpPath=ftp://192.168.0.2/netinstall
 
 #packageType=uzip
 packageType=tar
 #installComponents=ports,src
 commitInstall
 
+#autoLoginUser=kris
+
+# Set the root pass
+rootPass=root
+
+# Setup our users
+userName=kris
+userComment=Kris Moore
+userPass=kris
+userShell=/bin/csh
+userHome=/home/kris
+userGroups=wheel,operator
+commitUser
+
+# Options for localizing an install
+localizeLang="ru"
+localizeKeyLayout="ru"
+localizeKeyModel="pc104"
+localizeKeyVariant="intl"



More information about the Commits mailing list