Modifiying the Init Image - Help adding GPU info to Other data field.
-
Hello,
Great project by the way. Through trial and error I have managed to update fog.auto.reg to include some code to pull the GPU info for inventory, however itβs incomplete, I could use some guidance:Question:
Any suggestions on how to build and include pciutils (ie. lspci) in the x64 image(x32 in my case doesnβt matter, who cares about GPUs in x32 machines ) ? Has this been suggested or answered before?References(outdated and conflicting based on version):
https://wiki.fogproject.org/wiki/index.php/Create_Custom_Fog_Registration_menu
https://wiki.fogproject.org/wiki/index.php?title=Modifying_the_Init_Image
(mods if you are interested I can submit some suggested changes to the wiki, PM me if you are)cd ~
cp /var/www/html/fog/service/ipxe/init.xz .
xz -d init.xz
mkdir -p initmountdir
mount -o loop init initmountdir
cd ~/initmountdir/bin
pico fog.auto.reg (YOU COULD MAKE A COPY AND ADD ANOTHER MENU ENTRY AS SUGGESTED IN THE LINK ABOVE, DANGER MRS. ROBINSON)Add the following lines(I put them after the last ####=ββ statement perhaps not the best place):
other1=ββ
other1=$(GPU=$(lspci | grep VGA | cut -d β:β -f3);RAM=$(cardid=$(lspci | grep VGA |cut -d " " -f1);lspci -v -s $cardid | grep " prefetchable"| cut -d β=β -f2);echo $GPU $RAM | base64)
(https://askubuntu.com/questions/5417/how-to-get-the-gpu-info)Save, exit.
cd ~
umount initmountdir
xz -C crc32 init
cp init.xz /var/www/html/fog/service/ipxe/Architecture note:
use init_32.xz instead for 32-bit x86Notes regarding the wiki suggestions:
gunzip and gzip will not work with these instructions
I believe the /tftpboot/fog/images/ path is not used and should be updated to be /var/www/html/fog/service/ipxe/ (as per our example copied to and mounted in ~/ under the root user)Thanks so much for this project!
-
@mmw_canada lspci and lsusb is already built into the FOS Linux image. You should only need to patch fog.auto.reg if you need extra stuff. There is no need to unpack and repack init.xz unless you really want you. I have a tutorial on dynamically patching the init.xz file here: https://forums.fogproject.org/topic/14278/creating-custom-hostname-default-for-fog-man-reg