Thank you so much. I will try this out and let you know.
Posts made by zaboxmaster
-
RE: Deploy image right after registration without a reboot
-
Deploy image right after registration without a reboot
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.
But if I reboot and boot back into the system it deploys no problem.
Is there something I am doing wrong ?
-
RE: Feature Modification Request - Image Task Email Addition
@Tom-Elliott My apologies. So what I meant is that, the inventory information is sent in the mail.
So for example the following information will come with the mail:
System Manufacturer Dell Inc.
System Product Latitude E5470
System Version Not Specified
System Serial Number H857NC2
System UUID 4c4c4544-0038-3510-8037-c8c04f4e4332
System Type Type: Laptop
BIOS Vendor Dell Inc.
BIOS Version 1.29.4
BIOS Date 12/21/2021
Motherboard Manufacturer Dell Inc.
Motherboard Product Name 0VHKV0
Motherboard Version A00
Motherboard Serial Number /H857NC2/CN129636920214/
Motherboard Asset Tag Not Specified
CPU Manufacturer Intel Corporation
CPU Version Intel Core i5-6300U CPU @ 2.40GHz
CPU Normal Speed Current Speed: 2400 MHz
CPU Max Speed Max Speed: 2400 MHz
Memory 7.66 GiB
Hard Disk Model SATA3 256GB SSD
Hard Disk Firmware U0506A0
Hard Disk Serial Number 2021120601747
Chassis Manufacturer Dell Inc.
Chassis Version
Chassis Serial H857NC2
Chassis Asset Not Specified -
RE: Feature Modification Request - Image Task Email Addition
@Tom-Elliott Is there anyway to post the whole inventory in the mail ? or is there a way I could customize want I want sent in the email ?
-
Acer 10th Gen - Deployment issues
Hi
So I have been having issues with the Acers, various 10th Gen or higher models. They all state they have NVME drives with Intel Optane without RAID.
The BIOS is very basic and cannot disable the Optane feature. There is no RAID either. I downloaded the latest Fog dev branch and ensured the kernels were up to date.
When I ran the debug I saw that the NVME drives are not picking up at all.
Do you have any ideas ?
-
Failed to read back partitions
So I am having a rather strange issue that I cannot work out what could be the cause.
I have done some remodeling to the fog.man.reg file in that it selects the correct image to deploy based on various factors (Ie EFI/Legacy, 32/64bit, Previous Windows versions etc. ) of the previous installation and triggers the fog.download file to start the deployment automatically.
This seems to work fine until it comes to the deployment. Specifically, Win 11.
Now when the Windows 11 image is assigned it brings up the Failed to read back partitions. But if I assign the image directly instead of my auto-selection it works 100% . As I said Windows 10 works perfectly it just seems to be Windows 11.
Please see below :
This is my fog.man.reg file:
#!/bin/bash . /usr/share/fog/lib/funcs.sh clearScreen displayBanner disks="" disk="" hd="" getHardDisk sysman="" sysproduct="" sysversion="" sysserial="" sysuuid="" systype="" biosversion="" biosvendor="" biosdate="" mbman="" mbproductname="" mbversion="" mbserial="" mbasset="" cpuman="" cpuversion="" cpucurrent="" cpumax="" mem="" hdinfo="" caseman="" casever="" caseserial="" caseasset="" sysman64="" sysproduct64="" sysversion64="" sysserial64="" sysuuid64="" systype64="" biosversion64="" biosvendor64="" biosdate64="" mbman64="" mbproductname64="" mbversion64="" mbserial64="" mbasset64="" cpuman64="" cpuversion64="" cpucurrent64="" cpumax64="" mem64="" hdinfo64="" caseman64="" casever64="" caseserial64="" caseasset64="" dots "Using disk device" echo $hd echo " * Starting host registration" echo "" echo "********PLEASE NOTE CONNEX / PROLINE / MECER Z140C ARE NOT SUPPORTED**********" echo "" mac=$(getMACAddresses | base64) sysuuid=$(dmidecode -s system-uuid) sysuuid=${sysuuid,,} sysuuid=$(echo $sysuuid | base64) exists=$(curl -Lks --data "sysuuid=${sysuuid}&mac=$mac" ${web}service/man.hostexists.php 2>/dev/null) dots "Getting previous installation details" echo "" # EXTRACT PREVIOUS WINDOWS VERSION blkid_output=$(blkid) windows_partitions=$(echo "$blkid_output" | grep -i 'TYPE="ntfs"' | cut -d':' -f1 | head -n1) mkdir /mnt/ntfs mount $windows_partitions /mnt/ntfs reged -x mnt/ntfs/Windows/System32/config/SOFTWARE "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\\CurrentVersion" \\ /out.reg &> /dev/null || true editionid=$(grep "EditionID" out.reg | tail -n 1 | awk -F= '{print $2}' | tr -d '"') if [ -f /out.reg ]; then currentbuild=$(grep CurrentBuild out.reg | head -n 1 | sed 's/[^0-9]//g') # Function to determine the Windows version based on the build number getWindowsVersion() { build=$1 if ((build >= 7000 && build <= 8000)); then echo "Windows 7" elif ((build >= 9000 && build <= 9999)); then echo "Windows 8" elif ((build >= 10000 && build <= 20000)); then echo "Windows 10" elif ((build >= 22000 && build <= 23000)); then echo "Windows 11" else echo "Unknown Windows Version" fi } # Determine the Windows version based on the build number version=$(getWindowsVersion $currentbuild) echo "" echo "Your previous Build was $currentbuild" echo "Your current Windows version is $version" echo "Your current Edition is $editionid" echo "Your Windows Partition is $windows_partitions" fi bootmode=$(dmesg | grep "EFI v") if [[ -z "$bootmode" ]] then bootmode="Legacy" echo "" echo "YOUR BOOT MODE IS LEGACY" else bootmode="EFI" echo "" echo "YOUR BOOT MODE IS UEFI" fi chiptype=$(arch) if [[ $chiptype = "x86_64" ]] then chiptype="64" else chiptype="32" fi licensekey=$(tail -c+57 /sys/firmware/acpi/tables/MSDM) deployimage="" if [[ "$version" = *"Windows 7"* ]] && [[ "$bootmode" = *"Legacy"* ]]; then #WIN10_LEG_32BIT_HOME deployimage="5" elif [[ "$version" = *"Windows 8"* ]] && [[ "$bootmode" = *"Legacy"* ]]; then #WIN10_LEG_32BIT_HOME deployimage="5" elif [[ "$version" = *"Windows 10"* ]] && [[ "$chiptype" = *"64"* ]] && [[ "$bootmode" = *"Legacy"* ]] && [[ "$editionid" = *"Home"* ]]; then #WIN10_LEG_64_HOME deployimage="6" elif [[ "$version" = *"Windows 10"* ]] && [[ "$chiptype" = *"64"* ]] && [[ "$bootmode" = *"EFI"* ]] && [[ "$editionid" = *"Home"* ]]; then #WIN10_EFI_64_HOME deployimage="1" elif [[ "$version" = *"Windows 10"* ]] && [[ "$chiptype" = *"64"* ]] && [[ "$bootmode" = *"EFI"* ]] && [[ "$editionid" = *"Professional"* ]]; then #WIN10_EFI_64_PRO deployimage="2" elif [[ "$version" = *"Windows 11"* ]] && [[ "$chiptype" = *"64"* ]] && [[ "$bootmode" = *"EFI"* ]] && [[ "$editionid" = *"Home"* ]]; then #WIN11_EFI_64_HOME deployimage="4" elif [[ "$version" = *"Windows 11"* ]] && [[ "$chiptype" = *"64"* ]] && [[ "$bootmode" = *"EFI"* ]] && [[ "$editionid" = *"Professional"* ]]; then #WIN11_EFI_64_PRO deployimage="3" else #WIN10_EFI_64_HOME deployimage="1" fi echo "" echo "Your pre-selected image number is $deployimage" echo "" checkAndSet() { local testvar="$1" local onlynum="$2" [[ -z $testvar ]] && return if [[ $onlynum =~ [Tt][Rr][Uu][Ee] && $testvar =~ ^[0-9]+$ ]]; then echo $testvar | base64 elif [[ $testvar =~ ^[0-9,]+$ ]]; then echo $testvar | base64 else return fi } setIDs() { local varVar="$1" local str="$2" local csvstyle="$3" local dummy="$4" local max="$5" local res="" local url="" local oIFS=$IFS local line="" while [[ -z ${!varVar} ]]; do # [[ $csvstyle =~ [Tt][Rr][Uu][Ee] ]] && echo -n " Enter the $str IDs separated with , to associate with computer (? for listing): " || echo -n " Enter the $str ID to associate with computer (? for listing): " dummy=$deployimage #read dummy dummy=$(echo $dummy | sed -e 's/^,//' -e 's/,$//') case $dummy in [?]) url="${web}service/${str}listing.php" clearScreen res=$(echo -e $(curl -ks $url 2>/dev/null)) i=0 IFS=$'\n' for line in $res; do let i+=1 echo $line if [[ $i -eq $max ]]; then [[ $csvstyle =~ [Tt][Rr][Uu][Ee] ]] && echo -n " Press [Enter] to proceed or enter the $str IDs separated with , to associate with computer: " || echo -n " Press [Enter] to proceed or enter the $str ID to associate with computer: " dummy=$deployimage #read dummy case $dummy in [?]|"") i=0 clearScreen continue ;; esac case $csvstyle in [Tt][Rr][Uu][Ee]) [[ $dummy =~ ^[0-9,]+$ ]] && printf -v "$varVar" $(checkAndSet $dummy) || setIDs "$varVar" "$str" "$csvstyle" "$dummy" "$max" break ;; *) [[ $dummy =~ ^[0-9]+$ ]] && printf -v "$varVar" $(checkAndSet $dummy "true") || setIDs "$varVar" "$str" "$csvstyle" "$dummy" "$max" break ;; esac i=0 dummy=$(echo $dummy | sed -e 's/^,//' -e 's/,$//') clearScreen fi done ;; ""|0) printf -v "$varVar" 0 ;; *) dummy=$(echo $dummy | sed -e 's/^,//' -e 's/,$//') [[ -z $dummy ]] && setIDs "$varVar" "$str" "$csvstyle" "$dummy" "$max" case $csvstyle in [Tt][Rr][Uu][Ee]) [[ $dummy =~ ^[0-9,]+$ ]] && printf -v "$varVar" $(checkAndSet $dummy) || setIDs "$varVar" "$str" "$csvstyle" "$dummy" "$max" ;; *) [[ $dummy =~ ^[0-9]+$ ]] && printf -v "$varVar" $(checkAndSet $dummy "true") || setIDs "$varVar" "$str" "$csvstyle" "$dummy" "$max" ;; esac ;; esac done IFS=$oIFS } [[ $exists != "#!ok" ]] && handleError "Unable to register host: $exists ($0)\n Args Passed: $* ****PLEASE CLEAR HOSTS****" host="" ip="" productKey="" imageid="" primaryuser="" other1="" other2="" blImage="" blDoAddGroup="" blDoAddSnapin="" keyEnter="" blDoAD="" res="" while [[ $res != "#!ok" ]]; do echo -n " * Enter the Stockcode for this computer: " read host if [[ ${#host} -gt 15 ]]; then host=${host:0:15} echo " | Truncated to 15 characters: $host" usleep 2000000 fi host=$(echo $host | base64) res=$(curl -Lks --data "host=$host" ${web}service/hostnameloop.php 2>/dev/null) [[ $res != "#!ok" ]] && echo "$res" done imageid="" setIDs "imageid" "image" "" "" 20 if [[ $(curl -Lks ${web}service/locationcheck.php 2>/dev/null) == "##" ]]; then while [[ -z $askme ]]; do #echo -n " Would you like to assign a location for this host? (y/N) " askme="n" case $askme in [Nn]|[Nn][Oo]|"") askme="N" ;; [Yy]|[Yy][Ee][Ss]) setIDs "locationid" "location" "" "" 20 location64=$locationid ;; *) askme="" echo " * Invalid input, please try again" ;; esac done fi askme="" if [[ $(curl -Lks ${web}service/oucheck.php 2>/dev/null) == "##" ]]; then while [[ -z $askme ]]; do #echo -n " Would you like to assign an ou for this host? (y/N) " askme="N" case $askme in [Nn]|[Nn][Oo]|"") askme="N" ;; [Yy]|[Yy][Ee][Ss]) setIDs "ouid" "ou" "" "" 20 ou64=$ouid ;; *) askme="" echo " * Invalid input, please try again" ;; esac done fi askme="" while [[ -z $askme ]]; do #echo -n " Would you like to associate this host with groups? (y/N) " askme="N" case $askme in [Nn]|[Nn][Oo]|"") askme="N" ;; [Yy]|[Yy][Ee][Ss]) setIDs "groupid" "group" "true" "" 20 group64=$groupid ;; *) askme="" echo " * Invalid input, please try again" ;; esac done askme="" while [[ -z $askme ]]; do #echo -n " Would you like to associate this host with snapins? (y/N) " askme="Y" case $askme in [Nn]|[Nn][Oo]|"") askme="N" ;; [Yy]|[Yy][Ee][Ss]) setIDs "snapinid" "snapin" "true" "" 20 snapin64=$snapinid ;; *) askme="" echo " * Invalid input, please try again" ;; esac done askme="" while [[ -z $askme ]]; do #echo -n " Would you like to associate a product key to this host? (y/N) " askme="N" case $askme in [Nn]|[Nn][Oo]|"") askme="N" ;; [Yy]|[Yy][Ee][Ss]) echo -n " * Enter the product key for this computer: " read productKey productKey=$(echo $productKey | base64) ;; *) askme="" echo " * Invalid input, please try again" ;; esac done askme="" while [[ -z $askme ]]; do #echo -n " Would you like this host to join a domain, (using default settings)? (y/N) " askme="N" case $askme in [Nn]|[Nn][Oo]|"") askme="N" ;; [Yy]|[Yy][Ee][Ss]) blDoAD=$(echo -n 1 | base64) askme="Y" ;; *) askme="" echo " * Invalid input, please try again" ;; esac done #echo -n " * Enter the primary user for this computer: " #read primaryuser #primaryuser=$(echo $primaryuser | base64) #echo -n " * Enter the other tag #1 for this computer: " #read other1 #other1=$(echo $other1 | base64) #echo -n " * Enter the other tag #2 for this computer: " #read other2 #other2=$(echo $other2 | base64) #echo " * You entered all required information, " askme="" while [[ -z $askme ]]; do #echo -n " Would you like to deploy image to this computer now? (y/N) " askme="y" case $askme in [Nn]|[Nn][Oo]|"") askme="N" ;; [Yy]|[Yy][Ee][Ss]) tmp="" ret="" retry=3 while [[ $ret != "#!ok" && ! $retry -eq 0 ]]; do echo " * Enter Username and Password" echo -n " Username: " read username echo -n " Password: " read -s password user64=$(echo $username | tr -d '\012' | base64) pass64=$(echo $password | tr -d '\012' | base64) ret=$(curl -Lks --data "sysuuid=${sysuuid}&mac=$mac&username=$user64&password=$pass64" ${web}service/checkcredentials.php 2>/dev/null) case $ret in '#!ok') echo echo " * This host will reboot and deployment will start!" ret=$tmp realdoimage=$(echo -n 1 | base64) break ;; '#!il') echo echo " * Error: Invalid Login! ($retry remaining)" let retry-=1 ;; esac done askme="Y" ;; *) askme="" echo " * Invalid input, please try again" ;; esac done dots "Attempting to register host" res="" while [[ -z $res ]]; do res=$(curl -Lks --data "sysuuid=${sysuuid}&mac=$mac&advanced=$(echo -n 1 | base64)&host=$host&imageid=$imageid&primaryuser=$primaryuser&other1=$other1&other2=$other2&doimage=$realdoimage&doad=$blDoAD&location=$location64&username=$user64&groupid=$group64&snapinid=$snapin64&productKey=$productKey" ${web}service/auto.register.php 2>/dev/null) echo "$res" usleep 2000000 done . /bin/fog.inventory curl -X POST --data "host= $host" --data "stockcode= $host" --data "sysman= $sysman" --data "sysproduct= $sysproduct" --data "sysver= $sysversion" --data "sysserial= $sysserial" --data "sysuuid= $sysuuid" --data "systype= $systype" --data "cpuman= $cpuman" --data "cpuversion= $cpuversion" --data "cpumax= $cpumax" --data "mem= $mem" --data "harddisk= $hdinfo" --data "caseserial= $caseserial" --data "mac= $mac" --data "productkey= $productkey" --data "licensekey= $licensekey" --data "ip= $ip" --data "repaircode= $other2" --data "bootmode= $bootmode" --data "chiptype= $chiptype" ${web}service/fogmailer.php echo -n "" echo -n "**********THE INSTALLATION WILL START AUTOMATICALLY NO USER INPUT IS NEEDED*************" echo -n "" 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 usleep 2000000
-
Checking current windows version
So what I am trying to do is when the computer is registered and is put through the fog.inventory file, I am trying to get what current Windows version is installed on the current drive and assign that to a certain image. IE. if it picks up that Windows 10 Home is installed, it then deploys the Windows 10 home image.
So I can see that we can use chntpw to run the command to determine the OS version.
chntpw -e /path/to/windisk/Windows/System32/config/SOFTWARE cat \Microsoft\Windows NT\CurrentVersion\ProductName
The question is how would I go about doing this if at all possible?
Where would the best place be to run it from? FOG.MAN.REG ???
Is the Windows mounted at all during registration? -
RE: problem : partition is too big for the disk (in deploy)
@UserBxl May I suggest looking at the BIOS . I see you captured an EFI image. Just check the boot settings on the Lenovo make sure it is booting to EFI and not the Auto setting . Also check if secure boot has been disabled.
-
Problem trying to Capture eMMC drive, Lenovo
Hi guys
So I have been trying to capture this very specific image from a Lenovo (since it cannot take a generic image deployment ).
The drives are eMMC and the capture goes perfectly but looking at the image size it says that is 2.5gb where the space used on the disk is 51gbs.
When capturing I selected Single disk resizeable as I normally select. I uninstalled fog and installed the latest dev version.
It’s not like I am getting an error it just seems to be missing a partition.
Oh and I am not Sysprepping the image.
Any ideas ?
Kind regards
-
RE: Is there a way to erase 2 separate hdds in the deployment process?
@Tom-Elliott Thank you , i will have a look
-
Is there a way to erase 2 separate hdds in the deployment process?
So I have a problem where we are deploying the machines but there is data still on a second HDD.
Is there a way in the deployment process to erase any other HDD in the computer at the same time ?
I know this would be a unique case example.
-
Fog Imaging reports
Hi Guys
I am trying to find the imaging logs of what hosts have been imaged but I noticed that when I ran the report it only shows the history of hosts still registered and displaying.
Ie. If I delete a host and then run an image report the host does not show up in the imaging log.
Is there a way to see all hosts registered/imaged even after they have been deleted and removed?
-
RE: Certificate of Data Destruction
@george1421 said in Certificate of Data Destruction:
e also trivial: https://www.geeksforgeeks.org/php-send-atta
Thank you so much . Makes perfect sense. Let me try that way .
-
Certificate of Data Destruction
Hi Guys
I am trying to create a certificate of data destruction to prove that the PC has been cleaned when put through FOG. I wanted to know if this has been done by anyone before.
So to explain what I have tried I must first explain that I only use Fog through a bootable USB and not PXE boot.
So what I tried to do is create a template HTML file called cert.html in the service directory. I then modified the fog.man.reg file to run an AWK command (see below) to insert the variables into the HTML file and create a new HTML file. This so far has been unsuccessful. I will need to email the report which I will be able to trigger once I create the file.
Every time I run the command I get a FILE or Directory cannot be found.
Any ideas ?
Here is my code :
awk -v host=$host -v stockcode=$other1 '{sub(/DIGICODE/,host);sub(/SYSMAN/,stockcode); print }' ${web}service/cert.html >> ${web}service/cert_new.html
-
Trigger a local script on the server from fog.imgcomplete
Hi Guys
I have a very strange one, the idea is that after I deploy the image I want to clear the hosts in the database so if I am using a USB-Ethernet adapter I do not have to log on and clear the previous hosts.
So I currently use the IPXE USB method : https://forums.fogproject.org/topic/7727/building-usb-booting-fos-image
I have the script in the /var/www/fog/service/ folder … deletehosts.sh.
Now the script works from the server but I cannot for the life of me work out how to trigger the script from the fog.imgcomplete file on the USB.
Am I being stupid in trying technics such as string to use the following in the script?
${web}service/deletehosts.sh
I even tried Curl -s but I cannot seem to get it right . What would the correct syntax be.
-
RE: FOG UEFI USB booting -snponly.efi / snp.efi
@george1421 Thank you so much … I updated the to the latest ipxe and it sorted out the issue .
-
FOG UEFI USB booting -snponly.efi / snp.efi
Good day
I have used the following tutorial below to create a bootable USB disk, which works well but it uses the ipxe.efi file. I want to try add / replace that file or create a new menu entry for HP laptops and use snponly.efi / snp.efi but I cannot seem to make it work.
snponly.efi works if I put it into the bootfilename .
Here is the link to the tutorial I was using [https://forums.fogproject.org/topic/7727/building-usb-booting-fos-image/21?page=2]
-
Automatic deletion of hosts after deployment
Good day
I am looking for a way once the host has been registered and the image has been deployed to automatically delete the host on completion.
The reason for this is we use a USB to ethernet dongle which keeps saying the device has been registered before.
We also do not need to keep a record of the deployment hence a simple reset after deployment.
-
USB to ethernet adapter
Hi guys,
I know this has been covered multiple times, but I have tried various methods, from the API post-deployment to remove the host to the I.M.I option or the I.M.C option. I cannot seem to get it right.
So the problem is I have one adapter and I am trying to avoid the constant deleting the host to re-register a new host with the adapter. Is there not a way that I can automatically delete the host after deployment?