Adding wifi capabilities to FOS Linux
-
First let me preface this with I don’t feel wifi is the proper technology to use for imaging. I do acknowledge there are certain circumstances where it is the only option. For that reason I worked out a path to image over wifi. To be able to successfully do this the FOG tech will need to be able to boot the target device using FOS loaded onto a usb flash drive. Since we are dealing with WIFI leaving iPXE out of the solution was the best route. To that end if you use the usb booting methodology you the FOG tech will give up certain features that are supplied by iPXE.
I’m mainly documenting this process in case has to duplicate the process some time in the future. To successfully build the wifi option you will need to have a buildroot and linux kernel environment. For buildroot I used 2019.02.4 and for the linux kernel linux-4.19.65
For the linux kernel here is the patch from the FOS 1.5.7 base image
kernel_4.19.65_wifi.patch-1.5.7.txtFor buildroot here is the patch from the FOS 1.5.7 base image
BR-wireless.patch-1.5.7.txtIn the build root environment these are the applications I added to the build
Target packages ---> Networking applications ---> [*] iw [*] wireless-regdb [*] wireless tools [*] Install shared library [ ] wireshark [*] wpa_supplicant [*] Enable nl80211 support [ ] Enable AP mode [*] Enable autoscan [*] Enable EAP [*] Enable HS20 [*] Enable syslog support [*] Enable WPS [*] Install wpa_cli binary [*] Install wpa_client shared library [*] Install wpa_passphrase binary
In addition I had to create and patch 2 startup files that go into …/board/FOG/FOS/rootfs_overlay/etc/init.d directory.
S35wifiset.txtand I added a bit of code to S40network
S40network.txtThat code would be in this section of S40network
Here are two wifi configuration files that go into the …/board/FOG/FOS/rootfs_overlay/etc directory
wpa_default.conf.txt
wpa_supplicant.conf.txtKernel parameters added:
ssid == SSID to connect to
ssidpw == SSID Password of the wifi SSID
ssidkeymgmt == Key Managment method will set thekey_mgmt=
value in the wpa_supplicant.conf file.echo "Starting $iface interface and waiting for the link to come up" echo -e "auto $iface\niface $iface inet dhcp\n\n" >> /etc/network/interfaces /sbin/ip link set $iface up ## New code start if [ ! -z "$ssid" ] then read isWifi <<< $(/sbin/iwconfig $iface 2> >(awk '{print toupper($2)}')) if [ "$isWifi" != "NO" ]; then echo "Assigning WiFi drivers to $iface" /usr/sbin/wpa_supplicant -B -i$iface -c/etc/wpa_supplicant.conf -Dnl80211,wext -s -I/etc/wpa_default.conf sleep 10 fi fi ## New code end # Wait till the interface is fully up and ready (spanning tree) timeout=0 linkstate=0
The FOS Linux USB grub configuration file would look like this to support wifi.
set myfogip=192.168.1.100 set myimage=/boot/bzImageWiFi set myinits=/boot/initwifi.xz set myloglevel=4 set timeout=-1 set ssid=mudpuppy set ssidpw=idontknowit insmod all_video menuentry "1. FOG Image Deploy/Capture" { echo loading the kernel linux $myimage loglevel=$myloglevel initrd=init.xz root=/dev/ram0 rw ramdisk_size=275000 keymap= web=$myfogip/fog/ boottype=usb consoleblank=0 rootfstype=ext4 ssid=$ssid ssidpw=$ssidpw echo loading the virtual hard drive initrd $myinits echo booting kernel... } menuentry "2. Perform Full Host Registration and Inventory" { echo loading the kernel linux $myimage loglevel=$myloglevel initrd=init.xz root=/dev/ram0 rw ramdisk_size=275000 keymap= web=$myfogip/fog/ boottype=usb consoleblank=0 rootfstype=ext4 mode=manreg ssid=$ssid ssidpw=$ssidpw echo loading the virtual hard drive initrd $myinits echo booting kernel... } menuentry "3. Quick Registration and Inventory" { echo loading the kernel linux $myimage loglevel=$myloglevel initrd=init.xz root=/dev/ram0 rw ramdisk_size=275000 keymap= web=$myfogip/fog/ boottype=usb consoleblank=0 rootfstype=ext4 mode=autoreg ssid=$ssid ssidpw=$ssidpw echo loading the virtual hard drive initrd $myinits echo booting kernel... } menuentry "4. Client System Information (Compatibility)" { echo loading the kernel linux $myimage loglevel=$myloglevel initrd=init.xz root=/dev/ram0 rw ramdisk_size=275000 keymap= web=$myfogip/fog/ boottype=usb consoleblank=0 rootfstype=ext4 mode=sysinfo ssid=$ssid ssidpw=$ssidpw echo loading the virtual hard drive initrd $myinits echo booting kernel... } menuentry "5. Quick Deploy an Image" { echo loading the kernel linux $myimage root=/dev/ram0 rw ramdisk_size=275000 ip=dhcp web=$myfogip/fog/ consoleblank=0 loglevel=4 type=down img=Win7SP1x64 ftp=$myfogip imgType=n imgPartitionType=all osid=5 storage=$myfogip:/images/ capone=1 boottype=usb ssid=$ssid ssidpw=$ssidpw echo loading the virtual hard drive initrd $myinits echo booting kernel... } menuentry "6. FOG Debug Kernel" { echo loading the kernel linux $myimage loglevel=7 init=/sbin/init root=/dev/ram0 rw ramdisk_size=275000 keymap= boottype=usb consoleblank=0 rootfstype=ext4 isdebug=yes ssid=$ssid ssidpw=$ssidpw echo loading the virtual hard drive initrd $myinits echo booting kernel... }