PXE-less booting FOS client OS
-
@Tom-Elliott But it is very close to what we need. We would just have to post to the fog server that we wanted to image, refresh the hostinfo.php and then relaunch the main fog script. It sounds plausible.
The part 2 of this is I can see is someone will want to then (next) quick image an unregistered computer like they can do today with the iPXE menus. That wouldn’t be such an easy task since we would have to then query for available images (inside FOS) update the variables and then launch the quick image function.
[edit] Now that I think about it, except for the query image to deploy, the rest is possible without much headache.
-
@george1421 It’s not that difficult. In fact, quick image is probably even simpler.
-
For this part of the PXE-less boot the FOS client, I think its a wrap (finished). There is sure some nice to haves that can be done inside the inits but for the usb and the usb booting part I think I’ve reached the end. While I’ve only tested this on a bios system, I expect it to work under uefi too.
Here is the final grub menu for this iteration. I plan on writing a complete tutorial on how to build this usb later tonight.
set myfogip=192.168.1.88 set myimage=/boot/bzImage set myinits=/boot/init.xz set myloglevel=4 set timeout=-1 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=127000 keymap= web=$myfogip/fog/ boottype=usb consoleblank=0 rootfstype=ext4 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=127000 keymap= web=$myfogip/fog/ boottype=usb consoleblank=0 rootfstype=ext4 mode=manreg 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=127000 keymap= web=$myfogip/fog/ boottype=usb consoleblank=0 rootfstype=ext4 mode=autoreg 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=127000 keymap= web=$myfogip/fog/ boottype=usb consoleblank=0 rootfstype=ext4 mode=sysinfo echo loading the virtual hard drive initrd $myinits echo booting kernel... } menuentry "5. Run Memtest86+" { linux /boot/memdisk iso raw initrd /boot/memtest.bin } menuentry "6. FOG Debug Kernel" { echo loading the kernel linux $myimage loglevel=7 init=/sbin/init root=/dev/ram0 rw ramdisk_size=127000 keymap= boottype=usb consoleblank=0 rootfstype=ext4 isdebug=yes echo loading the virtual hard drive initrd $myinits echo booting kernel... }
-
Great stuff you’re coming up with here @george1421! Unfortunately I didn’t have the time to read it all to the last bit. So forgive me if I am asking things you already wrote about here. How are you going to put this all together to boot from USB/ISO? Are you using
grub-mkrescue
as mentioned here? Just curious… -
@Sebastian-Roth No I will (probably) just modify my bash script I used to create the FOS-L usb. That seemed to be the easiest and creates both bios and uefi usb images on the same usb. I need to review that tutorial I did and then just merge in the new GRUB boot menu. Really there is no magic that goes on in the flash drive other than the grub boot menu and a few tweaks Tom did to some files in the inits, well and the hostinfo.php from another feature request. The difficult part was just gluing all of the bits together.
-
@Tom-Elliott Just thinking about the next steps here…
I have to work on a few extra projects for my real job right now, but I’m thinking ahead a little.
In funcs.sh, can we move the code to pickup the kernel parameters and to call hostinfo.php into its own sub function? That we can reuse and call at different points in both the init scripts and via the post install scripts? That way I can reuse that code and have a consistent way of getting the parameters.
I could imagine a sub called getKernelParams() that could be called, and in that sub function if the ( boottype=usb ) then it would call a second function getHostInfo() to pick up the host info (that way too we can call getHostInfo() by its self to pick up the host details from the post install script(s) too (at this time I personally don’t care about the kernel parameters in the post install script, but if I did I could just call the getKernelParams instead). Then of course the /bin/fog script would need to take advantage of these new functions.