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

    Deploy image right after registration without a reboot

    Scheduled Pinned Locked Moved Unsolved
    FOG Problems
    4
    8
    394
    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.
    • Z
      zaboxmaster
      last edited by

      Hi

      I have been using FOG using a USB to boot and do the registration for some time now.

      I previously modified the fog.man.reg file to go directly to the fog.download before reboot to trigger the deployment.

      I would do this buy inserting the following at the end of the fog.man.reg file

          sysuuid=$(dmidecode -s system-uuid)
          sysuuid=${sysuuid,,}switch
          mac=$(getMACAddresses)
          curl -Lks -o /tmp/hinfo.txt --data "sysuuid=${sysuuid}&mac=$mac" "${web}service/hostinfo.php" -A ''
          [[ -f /tmp/hinfo.txt ]] && . /tmp/hinfo.txt
      . /bin/fog.download 
      

      Now I have updated to the latest Kernel (6.6.44) and Initrd file (2024.02.4) and it does not seem to work anymore.

      This is the error I get.

      determinos.png

      But if I reboot and boot back into the system it deploys no problem.

      Is there something I am doing wrong ?

      george1421G 1 Reply Last reply Reply Quote 0
      • george1421G
        george1421 Moderator @zaboxmaster
        last edited by

        @zaboxmaster This should work unless something changed in the inits.

        So first lets start a debug deployment. Tick the debug checkbox before you schedule the deployment. pxe boot the target computer. After a few screens of text that you need to clear by pressing the enter key you will be dropped at a the fos linux command prompt (I understand that you usb boot but we need to pxe boot here to get into the right mode).

        (insert flash back) you updated the fog.man.reg file and its copied over to the FOS image using the fog postinit script file. Its possible that the custom fog.man.reg file is not being delivered to fos linux.

        So what you will do is single step through the deployment until we get to the postinit section.

        (back to reality) at the fos linux command prompt key in fog At each breakpoint in the deployment you will need to press the enter key. Somewhere along the way before the partclone screen you will see the message about the postinit scripts running. Press the ctrl-c after the post init scripts run. Now verify that the fog.man.reg file in /bin on the fos linux engine has been updated with the curl command from your OP.

        If that file has been updated. then try to execute the curl command from your OP. That should create a file in /tmp as hinfo.txt look to see if it has content. It should have many lines of variables with its value.

        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!

        Tom ElliottT 1 Reply Last reply Reply Quote 0
        • Tom ElliottT
          Tom Elliott @george1421
          last edited by Tom Elliott

          @george1421 we added a little security bit now too as getting the hostinfo gave us the host sensitive information (ad user , domain , password, etccc.)

          https://github.com/FOGProject/fos/blob/master/Buildroot/board/FOG/FOS/rootfs_overlay/bin/fog#L9

          This is the main difference.

          We now need to get a token, and pass that token back to the hostinfo (it’s one time and locks upon initial request.)

          Edit: Apologies on not posting the direct example, this was written while from my phone, not at a computer so copy paste wasn’t really “suitable”.

          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! Get in contact with me (chat bubble in the top right corner) if you want to join in.

          Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

          Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

          george1421G 1 Reply Last reply Reply Quote 1
          • george1421G
            george1421 Moderator @Tom Elliott
            last edited by

            @Tom-Elliott Thank you for the update. I should have looked at the code.

            So the OP needs to update the current curl call with this ?

                base64mac=$(echo $mac | base64)
                token=$(curl -Lks --data "mac=$base64mac" "${web}status/hostgetkey.php")
                curl -Lks -o /tmp/hinfo.txt --data "sysuuid=${sysuuid}&mac=$mac&hosttoken=${token}" "${web}service/hostinfo.php" -A ''
            

            To make it work now?

            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!

            Tom ElliottT 1 Reply Last reply Reply Quote 1
            • Tom ElliottT
              Tom Elliott @george1421
              last edited by

              @george1421 I suspect so yes.

              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! Get in contact with me (chat bubble in the top right corner) if you want to join in.

              Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

              Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

              1 Reply Last reply Reply Quote 0
              • Z
                zaboxmaster
                last edited by

                Thank you so much. I will try this out and let you know.

                1 Reply Last reply Reply Quote 0
                • J
                  JamiesonCA092
                  last edited by

                  @zaboxmaster @george1421 @Tom-Elliott I have a possible solution for this issue that I just figured out today, I’ve been working on a similar situation but instead of using fog.man.reg Im using quick reg. So what I did to achieve this is I used the post init script to inject a modified version of fog.auto.reg into FOS that includes a section to call capone after the registration, I used information from this post and a past post https://forums.fogproject.org/topic/14278/creating-custom-hostname-default-for-fog-man-reg
                  to accomplish what I wanted to do on that part

                  bd8e24f0-df73-4d71-8d27-489e5b005a05-{D68C2661-0191-4990-A9AF-A0BBD9B0396C}.png

                  when adding this at first I got an invalid parameter for the dmi value error similiar to your osid error youre getting but when checking in the capone pxe menu I saw how it list mode=capone shutdown=0 and dmi=system-manufacturer so for giggles I added after mode=autoreg i included dmi=system-manufacturer and it went through like a charm.

                  8e64b045-9497-4750-86d2-996d026935ba-{66A203C4-3C74-4EBC-AD8E-7E1F4545B6F9}.png
                  So in the web interface go to the pxe menu settings and under fog.reginput try putting osid=9 beside it if your image is a windows image or the appropriate id based off the OS you’re using. Hopefully it will achieve the same thing for you as it did for me.

                  1 Reply Last reply Reply Quote 1
                  • J
                    JamiesonCA092
                    last edited by

                    The purpose of me using Capone for me is because we use all hps so I already have Capone configured to serve the golden image based off of the system-manufacturer matching HP

                    1 Reply Last reply Reply Quote 0
                    • george1421G george1421 referenced this topic on
                    • 1 / 1
                    • First post
                      Last post

                    143

                    Online

                    12.0k

                    Users

                    17.3k

                    Topics

                    155.2k

                    Posts
                    Copyright © 2012-2024 FOG Project