• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login
    1. Home
    2. rodluz
    3. Posts
    R
    • Profile
    • Following 0
    • Followers 0
    • Topics 9
    • Posts 112
    • Best 27
    • Controversial 0
    • Groups 1

    Posts made by rodluz

    • RE: Very slow boot.php and bzImage during pxe boot

      @sebastian-roth Thanks for the help. I prefer to swap out the iPXE binaries first and see if that helps.

      Do I just copy those linked files into /tftpboot then change ownership to fogproject:root and chmod 655 the files, or is there something else I need to do?

      posted in FOG Problems
      R
      rodluz
    • RE: Very slow boot.php and bzImage during pxe boot

      @sebastian-roth Hello and thank you for the reply. I tried multiple times on the other FOG server just to make sure with different “bad” laptops and they all worked.

      The other FOG server is on 1.5.9.94.

      I took a “bad” laptop to the server room and plugged it in to the same switch that my FOG server is connected to and I am still having the same issue.

      I originally thought it could be the NIC on those “bad” laptops so ran speed tests using Windows and Linux(Ubuntu) and they are fine. Maybe it could be something with the MAC on the laptops and FOG not accepting it.
      I tried using a USB-C to Ethernet adapter to test and it works perfectly with that.

      I could just use multiple of those adapters to image the computers but they hold the host data after I register the laptops.

      EDIT:
      I originally had the kernel version using 4.19.64. Updated it last week to 5.10.34. Just updated it to 5.10.50 today and still having the same issue.

      posted in FOG Problems
      R
      rodluz
    • Very slow boot.php and bzImage during pxe boot

      FOG Version: 1.5.9
      OS: Ubuntu 20.04 - up to date

      Hello, I am having a very strange issue. I have 30 new HP EliteBook 850 G6 laptops with sequential serial numbers. Some of the laptops are working perfectly when trying to register them as hosts. Others, are not booting to the host registration screen because the bzImage part takes around a minute to go up 1%.
      When going into pxe boot, the laptop take a while to get to the iPXE menu items.

      http://10.27.70.100/fog/service/ipxe/boot.php... ok  #This happens instantly
      http://10.27.70.100/fog/service/ipxe/boot.php................ ok  # This takes around 10-15 seconds
      http://10.27.70.100/fog/service/ipxe/boot.php......... n%  # This takes about 5-10 seconds
      

      Once I press enter on the Perform Full Host Registration and Inventory menu option, I get:

      bzImage................................ n%  # Takes around a minute to go up 1%
      

      At first I thought I may have a batch of laptops that are bad, so I looked through the serial numbers and noticed its all over the place.

      I took a laptop that I know doesn’t work to a coworker’s area and used her FOG to see what would happen and there was no issue. This makes me think I screwed up on something with my FOG server.

      Only changes I have done to the server recently are post download scripts and add new images/snapins.

      Any ideas?

      Thanks in advanced!

      posted in FOG Problems
      R
      rodluz
    • RE: FOS not mounting drive for post download scripts.

      @george1421 @Sebastian-Roth So I modified my postdownload scripts to manually mount the correct drive if the code that was originally there didn’t do it. It is working for me so I am adding my post download scripts below in case anyone comes across this thread and finds it helpful for them. This works for me in my environment, but may not work for everyone.

      I took inspiration from the getHardDisk() function in https://github.com/FOGProject/fos/blob/master/Buildroot/board/FOG/FOS/rootfs_overlay/usr/share/fog/lib/funcs.sh

      The scripts are a bit of a mess but working

      fog.postdownload

      #!/bin/bash
      ## This file serves as a starting point to call your custom postimaging scripts.
      ## <SCRIPTNAME> should be changed to the script you're planning to use.
      ## Syntax of post download scripts are
      #. ${postdownpath}<SCRIPTNAME>
      
      clearScreen;
      
      dots "Running post download scripts."
      
      mkdir /ntfs &>/dev/null
      ntfs-3g -o force,rw $part /ntfs
      
      echo "Mounting Device";
      
      if [ "$?" = 0 ]; then
              if [ ! -d "/ntfs/Windows" ]; then
                      . ${postdownpath}mountLargestPartition
              fi
      
              echo "Done"
              debugPause
      
              . ${postdownpath}getMachineModel
              . ${postdownpath}getPlatformVersion
              . ${postdownpath}fog.drivers
              . ${postdownpath}fog.unattend
      
              if [ -z "$auditMode" ]; then
                      . ${postdownpath}fog.bcu
              fi
      
              echo "Unmounting Device";
              umount /ntfs;
              debugPause
      else
              echo "Failed to mount device";
              sleep 30;
              debugPause
      fi
      

      mountLargestPartition

      #!/bin/bash
      
      dots "Running the manual mount script"
      
      drive=$(lsblk -dpno KNAME -I 3,8,9,179,202,253,259 | uniq | sort -V)
      driveCleaned=${drive//'/dev/'/} #Remove `/dev/` from variable
      
      partition=""
      partSize=0
      
      # Get the largest partition
      while IFS= read -r line; do
              tempPartSize=$(blockdev --getsize64 /dev/$line)
      
              if [ $tempPartSize -gt $partSize ]; then
                      partSize=$tempPartSize
                      partition="/dev/$line"
              fi
      done < <(ls /dev | grep -E "${driveCleaned}[a-zA-Z0-9]+")
      
      umount /ntfs &> /dev/null
      ntfs-3g -o force,rw $partition /ntfs
      

      getMachineModel

      #!/bin/bash
      
      dots "Retrieving Machine Model"
      
      machine=$(dmidecode -s system-product-name) # Gets machine model
      machine="${machine// /_}"  # Replace spaces with underscores
      
      echo "${machine}"
      debugPause
      

      getPlatformVersion

      #!/bin/bash
      
      dots "Retrieving Platform Version from Registry"
      
      # Create a registry file to be able to search the ReleaseId from
      # reged -x gives out an abort error message but from all my testing it still works.
      reged -x /ntfs/Windows/System32/config/SOFTWARE HKEY_LOCAL_MACHINE\\SOFTWARE \\ /out.reg &> /dev/null || true
      
      if [ -f /out.reg ]
      then
              PlatformVersion=$(cat /out.reg | grep 'ReleaseId')
              PlatformVersion=${PlatformVersion:13:4} # Grab only actual the ReleaseId. Full text looks like "ReleaseId"="1909"
              echo "${PlatformVersion}"
      else
              echo "No registry file found."
              debugPause
      
              dots "Retrieving Platform Version from PlatformVersion.rek file"
      
              if [ -f "/ntfs/Windows/PlatformVersion.rek" ]
              then
                      PlatformVersion=$(<"/ntfs/Windows/PlatformVersion.rek")
                      echo "${PlatformVersion}"
                      debugPause
              else
                      echo "No platform version file found."
                      debugPause
              fi
      fi
      

      fog.drivers

      #!/bin/bash
      
      dots "Preparing Drivers"
      
      mkdir /ntfs/Drivers &>/dev/null;
      echo "In Progress"
      
      dots "Adding drivers to driver path"
      cp -ar "/images/drivers/${machine}/${PlatformVersion}/" /ntfs/Drivers
      
      if [ "$?" = 0 ]; then
              echo "Done"
      else
              echo "Failed!"
      fi
      
      debugPause
      
      regfile="/ntfs/Windows/System32/config/SOFTWARE"
      echo "regfile ${regfile}"
      
      key="\Microsoft\Windows\CurrentVersion\DevicePath"
      echo "key ${key}"
      
      devpath="%SystemRoot%\inf;%SystemDrive%\Drivers"
      echo "devpath ${devpath}"
      
      reged -e “$regfile” &>/dev/null <<EOFREG
      ed $key
      $devpath
      q
      y
      EOFREG
      
      echo “Drivers done.”
      

      fog.unattend

      #!/bin/bash
      
      dots "Searching for Platform Version"
      
      # If $PlatformVersion is not null/empty
      if [ -n "$PlatformVersion" ]; then
              echo "Found"
              debugPause
      
              dots "Removing old unattend file"
              rm -f /ntfs/Windows/Panther/*nattend.xml
              if [ "$?" = 0 ]; then
                      echo "Done"
              else
                      echo "Failed to remove file!"
                      echo "Aborting fog.unattend"
                      debugPause
                      sleep 60
                      return
              fi
              debugPause
      
      
              dots "Checking image mode"
              if [ -n "$auditMode" ] && [ "$auditMode" -eq 1 ]; then
                      echo "AUDIT"
                      debugPause
      
                      dots "Copying audit mode unattend file"
                      cp "/images/unattends/UnattendAuditMode.xml" "/ntfs/Windows/Panther/Unattend.xml"
                      if [ "$?" = 0 ]; then
                              echo "Done"
                      else
                              echo "Failed!"
                      fi
                      debugPause
              else
                      echo "OOBE"
                      debugPause
      
                      dots "Copying unattend file with driver path"
                      cp "/images/unattends/UnattendWithDriverPath.xml" "/ntfs/Windows/Panther/Unattend.xml"
                      if [ "$?" = 0 ]; then
                              echo "Done"
                      else
                              echo "Failed!"
                      fi
                      debugPause
              fi
      else
              echo "No valid Platform Version."
              echo "Skipping unattend."
              debugPause
      fi
      
      

      fog.bcu

      #!/bin/bash
      
      dots "Copying BIOS change script"
      
      if [ -f "/images/drivers/CMSL-BIOS_Change.ps1" ]
      then
              cp "/images/drivers/CMSL-BIOS_Change.ps1" "/ntfs/Drivers"
              echo "Done"
              debugPause
      else
              echo " Failed! Could not find bios change script."
              debugPause
              sleep 60
      fi
      
      echo "fog.bcu done."
      debugPause
      
      posted in General
      R
      rodluz
    • RE: FOS not mounting drive for post download scripts.

      I did a few more tests and realized that the $part variable is also not set on the image that is working, so probably not that. The other thing I realized, my working image has the NTFS partition on /dev/sda4 but the “bad” image has it on /dev/sda3. Not sure why the new image is different.

      A bit more context, in case it could be the issue:

      • The “good” image is Windows 10 Version 1909
      • The “bad” image is Windows 10 Version 20H2
      posted in General
      R
      rodluz
    • FOS not mounting drive for post download scripts.

      Hello, I am having an issue when deploying one of my images. After Partclone is done, my post download scripts start, however it seems that the $part variable is not set correctly so the /ntfs directory only has Recovery and System Volume Information and is not mounting my ntfs partition.

      I haven’t changed anything of the mounting part from fog.postdownload.

      dots "Running post download scripts."
      
      mkdir /ntfs &>/dev/null
      ntfs-3g -o force,rw $part /ntfs
      
      echo "Mounting Device";
      
      if [ "$?" = 0 ]; then
              echo "Done"
              debugPause
              . ${postdownpath}getMachineModel
      ...
      ...
      

      I’m pretty sure it’s something with the specific image I am using, since I tried a different image and I don’t have that problem. I don’t know how my new image could be affecting this, but I didn’t do anything different for the “bad” image.

      I’m not sure what I should try to figure out what the issue is.
      I was able to mount the /dev/sda3 partition manually using ntfs-3g -o force,rw /dev/sda3 /ntfs

      posted in General
      R
      rodluz
    • RE: Passing variable from ipxe menu to FOS

      @george1421 Thanks so much! So what fixed it for me was just removing all the other iPXE commands. So now my parameters are:

      login
      kernel bzImage loglevel=4 initrd=init.xz root=/dev/ram0 rw ramdisk_size=275000 web=http://10..../fog/ consoleblank=0 nvme_core.default_ps_max_latency_us=0 rootfstype=ext4 mac=${net0/mac} ftp=10.... storage=10....:/images/ storageip=10.... irqpoll chkdsk=0 capone=1 type=down img=1909GoldenImage imgType=n imgPartitionType=all imgid=43 osid=9 imgFormat=0 auditMode=1
      imgfetch init.xz
      boot || menu
      

      This works perfectly for what I need.

      posted in General
      R
      rodluz
    • RE: Passing variable from ipxe menu to FOS

      @george1421 I did make a selection but maybe I made I mistake on the kernel command?
      Also where would I put the sanboot option?

      posted in General
      R
      rodluz
    • RE: Passing variable from ipxe menu to FOS

      @george1421 Thanks for the response. I am not super familiar with all the ipxe menu stuff so I am doing something wrong.

      My custom menu parameters are:

      login
      params
      param mac0 ${net0/mac}
      param arch ${arch}
      param username ${username}
      param password ${password}
      isset ${net1/mac} && param mac1 ${net1/mac} || goto bootme
      isset ${net2/mac} && param mac2 ${net2/mac} || goto bootme
      kernel bzImage loglevel=4 initrd=init.xz root=/dev/ram0 rw ramdisk_size=275000 web=http://10..../fog/ consoleblank=0 nvme_core.default_ps_max_latency_us=0 rootfstype=ext4 mac= ftp=10.... storage=10....:/images/ storageip=10.... irqpoll chkdsk=0 capone=1 type=down img=1909GoldenImage imgType=n imgPartitionType=all imgid=43 osid=9 imgFormat=0 auditMode=1 isdebug=yes
      imgfetch init.xz
      boot
      

      I have the Menu Show with option set to All Hosts

      When I try to run it, I get this error:

      http://10..../fog/service/ipxe/boot.php... ok
      Booting from SAN device 0x80
      Boot from SAN device 0x80 failed: No such device (http://ipxe.org/2c222087)
      Could not boot: No such device (http://ipxe.org/2c222087)
      Could not boot: No such device (http://ipxe.org/2c222087)
      Chainloading failed, hit 's' for the iPXE shell: reboot in 10 seconds
      
      posted in General
      R
      rodluz
    • Passing variable from ipxe menu to FOS

      Hello, I am wondering if there is any way to pass a variable from a custom ipxe menu item that can then be read and used by FOS?
      I duplicated the fog.deployimage menu item and would want to pass a variable that would be used in my post download scripts.

      What I would want to do, is have my post download scripts only run some scripts depending if that variable is true/1 or false/0. So if I select that new menu item it would have the variable.

      posted in General
      R
      rodluz
    • RE: HostnameChanger Issue

      @Sebastian-Roth I know this thread is a bit old, but my question is exactly this thread.

      I am having the same issue as @jtappen. In my case, all of my hosts had the enforce checkbox selected on my prior FOG server. After I moved everything to a new server for some reason the checkboxes got unchecked.
      I tested with a few computers by clicking the checkbox and it works perfectly fine. My problem is that I have over 200 hosts so I would like to “checking ALL the checkboxes” by updating the database.

      Would anything break if I run UPDATE hosts SET hostEnforce='1'; to update all hosts in one blow?

      posted in FOG Problems
      R
      rodluz
    • RE: Post Download Scripts Included Variables

      @george1421 Ahh okay thank you!

      posted in General
      R
      rodluz
    • RE: Post Download Scripts Included Variables

      @george1421 Thank you so much that helps a lot! I’ll have to modify a few things and test it out.

      One question. What does the dots command do? I’ve tried to search what that command does in bash but I can’t find anything about it.

      EDIT: Also does the file have to be a .rek filetype or can it just be a txt?

      posted in General
      R
      rodluz
    • RE: Post Download Scripts Included Variables

      @george1421 I didn’t think of having a text file on the image itself, that is so simple to implement.
      I’ll try both things out next week when I am back at the office.

      Thank you so much!

      posted in General
      R
      rodluz
    • Post Download Scripts Included Variables

      Hello, I am trying to create a post download script to add drivers to my image.
      I have read many forum posts about this and have created my script. Most of those posts reference the $osid variable that can be used in these scripts.

      I have different drivers for different versions of Windows 10 (1909, 2004, 20H2, …) but I don’t see a way of figuring out what version I am imaging on a computer.
      So, I am thinking I could add the version number in the image name and add the logic to the script.
      That being said, is there a variable for the image name?
      I know that the images table in the database has and imageName field, but is there a variable for it that can be used in the post download scripts?

      Also, is there a link/file where I can see what other variables are available to the FOS at that moment?

      Thanks for the help!

      posted in General
      R
      rodluz
    • RE: FOG update broke rEFInd exit

      @Sebastian-Roth Thank you so much for telling me about the Reset Encryption Data, that worked!

      If you could please let me know the way to do that for all the computers en mass, I would greatly appreciate it!

      posted in FOG Problems
      R
      rodluz
    • RE: FOG update broke rEFInd exit

      @Sebastian-Roth @george1421 Thank you for your reply. I did do that from the link provided before submitting my last reply.

      This make me think that the issue I had with my old FOG server may have been a certificate issue.

      Since I copied the ssl certificate from the old FOG server and this still doesn’t work, does this mean I just have to redeploy the fog client from the new server on all the computers?

      If so, is there anything I must remove from the computer before doing that? (e.g. registry data)

      Once again, thank you so much for all your help!

      posted in FOG Problems
      R
      rodluz
    • RE: FOG update broke rEFInd exit

      @george1421 Hello once again!
      I just finished setting up my new FOG server following the links that you provided.

      I am getting a RSA ERROR: Certificate validation failed on the computer I am using to test snapins. Also, the host’s status is unknown for all my computers. What would be the best way to fix this issue?
      My thought was to write a script to reinstall the FOG client on the computers through a GPO but maybe there is something easier to fix this?

      Once again thank you so much for all your help!

      posted in FOG Problems
      R
      rodluz
    • RE: FOG update broke rEFInd exit

      @george1421 Hello once again.
      I have decided to just recreate my imaging server. I was able to get newer hardware so now is probably the best time.

      Would you be able to guide me in the right direction (with links) on how to setup my new server with FOG correctly and move over hosts, groups, images, and snapins?

      Thank you again for all your help!

      posted in FOG Problems
      R
      rodluz
    • RE: FOG update broke rEFInd exit

      @george1421 Hello again. Thank you for your help.
      I tried both suggestions and sadly still no luck.

      I decided to install FOG 1.5.5 using a clean Ubuntu install on another computer just to see what happens. When changing the DHCP to use the IP of the fresh install machine, the rEFInd Initializing... screen goes away after 3 seconds (how it should work). Since that worked, I used the refind.conf and refind.efi files and copied them to my FOG server running 1.5.8 and it still didn’t work.

      Then, I installed FOG 1.5.8 to see if I get the same issue on the clean machine and I do. The rEFInd Initializing... screen doesn’t go away.

      I then replaced all the files in /var/www/fog/service/ipxe/ to use the ones from the 1.5.5 install and it still didn’t work but I saw an error saying that it was looking for a refind_x64.efi file. I renamed the refind.efi to refind_x64.efi and it now works.

      Since that worked, I did the exact same thing on my production FOG server (using the files from the clean install computer that did work) and I am still stuck on the same screen.

      Other than reinstalling the OS and FOG on my server, what else could I try to check since I guess the issue isn’t the actual refind.efi or refind.conf files?

      EDIT:
      Could it have to do with some authentication issue?

      posted in FOG Problems
      R
      rodluz
    • 1 / 1