Custom iPXE Script / Host Inventory & ONLY Hostname
I’m trying to design a workflow for a massive amount of laptops and their associated imaging.
At the moment, SOME laptops come bundled with a sticker that has a barcode with a MAC Address. Part of my workflow integrates assigning a hostname to that MAC address, and importing the CSV into fog.
What I’d LIKE to do is basically a Semi Host Inventory of sorts, NOT full.
I’d like to boot to fog automatically, with simply a prompt of a hostname. The hostname is entered, RETURN is pressed, the machine restarts or shuts down (I’m not technically concerned with this but shutdown would be excellent)
Does anyone know how to go about doing this?
george1421 Moderator last edited by
@p4cm4n The short answer is that its possible. What you will need to do is create a customized version of the fog.man.reg file. ref: https://github.com/FOGProject/fos/blob/master/Buildroot/board/FOG/FOS/rootfs_overlay/bin/fog.man.reg
If you know programming (helpful to understand process flow) but not maybe php you can make adjustments to this file bypassing the prompts and filling in the static details.
Then you can use a postinit script to replace the FOG issued fog.man.reg with your custom coding.
The last bit I need to think about a bit. I know if the FOG server passes a parameter to FOS linux after FOG does it thing (registration, imaging, etc) it will shutdown instead of reboot. I think the parameter is
shutdown=1I think… you can also set that in your custom fog.man.reg and have FOG shutdown after taking inventory. I know you can set it at a global level, but you might only want to shutdown after registration but not imaging.
Now I’ve worked on a few big imaging projects. I have used a custom fog.man.reg file to speed up registration. I’ve also made use of barcodes. For one project the computer name was a composite of the country, city LUN code, and then the dell serial number. In one case I created a barcode with the country and lun code (i.e. USNYC) on a bit of paper. Our workflow would be then when entering the name we would scan the paper then scan the dell asset tag on the computer and finally press enter on the keyboard, From there all of the rest of the FOG required fields were defaulted.
Another project we didn’t register the computers with FOG because FOG would not manage them once imaged. In this workflow we used the fog ipxe menu Deploy Image. We picked the image, the image would deploy and then using a post install script the name of the computer was calculated. The country and city lun codes were calculated based on the client’s IP address and then we use dmidecode to read the dell asset tag. So once we picked deploy and the image to deploy we did not touch the computer until it was ready to move to the user’s desk.