• Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
  • Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

Modifiying the Init Image - Help adding GPU info to Other data field.

Scheduled Pinned Locked Moved
Tutorials
2
2
293
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M
    mmw_canada
    last edited by mmw_canada May 22, 2023, 3:58 PM May 22, 2023, 9:52 PM

    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 x86

    Notes 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!

    G 1 Reply Last reply May 23, 2023, 12:16 AM Reply Quote 0
    • G
      george1421 Moderator @mmw_canada
      last edited by May 23, 2023, 12:16 AM

      @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

      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

      1 Reply Last reply Reply Quote 0
      • 1 / 1
      1 / 1
      • First post
        2/2
        Last post

      146

      Online

      12.0k

      Users

      17.3k

      Topics

      155.2k

      Posts
      Copyright Β© 2012-2024 FOG Project