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

    Automatic hardware detection & driver installs in FOG

    Scheduled Pinned Locked Moved Solved
    General
    10
    37
    23.7k
    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.
    • G
      giejo63
      last edited by

      @Tom-Elliott said:

      @giejo63 give me a few minutes and I’ll host the files for you.

      Thanks in advance !!

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

        http://tinyurl.com/q4pta4s machinedrivers

        http://tinyurl.com/oy5pdm4 driverinstall

        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

        G 1 Reply Last reply Reply Quote 0
        • G
          giejo63 @Tom Elliott
          last edited by

          @Tom-Elliott said:

          http://tinyurl.com/q4pta4s machinedrivers

          http://tinyurl.com/oy5pdm4 driverinstall

          It works 👍
          Thanks a lot ! 🙂

          1 Reply Last reply Reply Quote 0
          • G
            giejo63
            last edited by giejo63

            Hi,
            My postdownloadscript driverinstall.sh is executable (chmod a+x) i’ve modified fog.postdownload but after image deployment (successfully) it doesn’t seem to run fog.postdownlad and driverinstall.sh .
            So nothing is put inside c:\Drivers (i ve put some drivers)

            Any ideas ?

            MRCURM 1 Reply Last reply Reply Quote 0
            • A
              ArchFan
              last edited by

              @Lee-Rowlett said:

              #!/bin/sh

              ceol=tput el;
              machine=dmidecode -s system-product-name;
              machine=“${machine%”${machine##[![:space:]]}“}” #Removes Trailing Space
              if [ $osid == “5” ]; then
              osn=“Win7”
              elif [ $osid == “6” ]; then
              osn=“Win8”
              elif [ $osid == “7” ]; then
              osn=“Win8.1”
              fi
              dots “Downloading Drivers”;
              mkdir /ntfs/Windows/DRV &>/dev/null;
              echo -n “In Progress”;
              cabextract -d /ntfs/Windows/DRV “/fog/Drivers/$osn/${machine}”/
              .CAB &>/dev/null;
              echo -e “\b\b\b\b\b\b\b\b\b\b\b${ceol}Done”;
              regfile=“/ntfs/Windows/System32/config/SOFTWARE”
              key=“\Microsoft\Windows\CurrentVersion\DevicePath”
              devpath=“%SystemRoot%\inf;%SystemRoot%\DRV”
              reged -e “$regfile” &>/dev/null <<EOFREG
              ed $key
              $devpath
              q
              y
              EOFREG

              code above will do what you want - change the paths to match your environment or wherever you want to store the cabs but using code example above. you’d put a copy of the cab into /fog/Drivers/Win7/OptiPlex 7010 for example then it will extract the cab and drivers will be installed during sysprep… shouldn’t need any postscripts

              @Lee-Rowlett - Where is it this script is supposed to be placed on the server and its name?

              1 Reply Last reply Reply Quote 0
              • cmlC
                cml Moderator
                last edited by

                @ArchFan
                Under: /images/postdownloadscripts/
                Name: driverinstall.sh

                Just make sure you call the script from fog.postdownload

                ${postdownloadpath}/driverinstall.sh
                
                A 1 Reply Last reply Reply Quote 1
                • A
                  ArchFan @cml
                  last edited by

                  @cml said:

                  @ArchFan
                  Under: /images/postdownloadscripts/
                  Name: driverinstall.sh

                  Just make sure you call the script from fog.postdownload

                  ${postdownloadpath}/driverinstall.sh
                  

                  Shouldn’t entering echo ${postdownloadpath}/driverinstall.sh on the server output /images/postdownloadscripts/driverinstall.sh, or no? I was having some issues at first and ended up putting the absolute path to rule that out as an issue

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

                    @ArchFan I don’t think so. Not on the server. The client/host during imaging or in the init process itself, yes, the server no.

                    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

                    A 1 Reply Last reply Reply Quote 0
                    • A
                      ArchFan @Tom Elliott
                      last edited by

                      @Tom-Elliott said:

                      @ArchFan I don’t think so. Not on the server. The client/host during imaging or in the init process itself, yes, the server no.

                      Gotcha - I’ve had some other issues getting it to work as intended, so it probably wasn’t an issue after all. Thanks Tom

                      1 Reply Last reply Reply Quote 0
                      • MRCURM
                        MRCUR Testers @giejo63
                        last edited by

                        @giejo63 I’m running into the same issues. I have a sysprepped Win 7 image that has the C:\drivers location set to look for drivers. I have the drivers on the FOG server in /images/drivers and the scripts are executable. The postdownload file is set to run the script, and I have SetupComplete.cmd on the image set as described in Andrew’s wiki page.

                        Anyone have some ideas?

                        G 1 Reply Last reply Reply Quote 1
                        • A
                          ArchFan
                          last edited by ArchFan

                          Feeling pretty discouraged at the moment 😞

                          My postdownloadscript works perfectly unless I use variables, at which point it no longer works. You can see a few of the things I’ve attempted and commented out. Even using ${postdownloadpath} doesn’t seem to work - I can only call my postdownload script if I specify the absolute path. My cabs are in /images/drivers/Win7/. So for the Optiplex 9020M, the location is /images/drivers/Win7/Optiplex 9020M/*.CAB - I’ve also tried Optiplex9020M - still doesn’t work. I’m on Rev 3606, Debian 7

                          The only things in /images/postdownloadscripts are fog.postdownload and driverinstall.sh. Permissions on both are 777

                          Contents of fog.postdownload:

                          #!/bin/sh
                          ## 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>
                          #. ${postdownloadpath}driverinstall.sh
                          . /images/postdownloadscripts/driverinstall.sh
                          
                          

                          Contents of driverinstall.sh:

                          #!/bin/sh
                          
                          #This script was adapted from Lee Rowlett's fog.drivers postdownload script (https://forums.fogproject.org/topic/4278/utilizing-postscripts-rename-joindomain-drivers-$
                          #This script assumes your image has been modified to look in C:\Windows\Drivers in addition to the default location for Windows drivers (http://technet.microsoft.com/$
                          #Make sure this script is called from your fog.postdownload file by adding ${postdownloadpath}/driverinstall.sh to the /images/postdownloadscripts/fog.postdownload fi$
                          mkdir /ntfs &>/dev/null; #Create new directory called ntfs and supress any system or error messages
                          mount.ntfs-3g /dev/sda2 /ntfs; #Mount the NTFS Windows OS partition to the new ntfs directory
                          machine=`dmidecode -s system-product-name`; #Get the model name of the computer being imaged
                          #machine=$(dmidecode -s system-product-name)
                          #machine=$(echo $machine | tr -d ' ') #Remove the trailing spaces from the model info
                          #Get the OS version info and set it equal to the osn variable for later use
                          #if [ $osid == "5" ]; then
                          osn="Win7"
                          #elif [ $osid == "6" ]; then
                          #osn="Win8"
                          #elif [ $osid == "7" ]; then
                          #osn="Win8.1"
                          #fi
                          #osn="Win7"
                          mkdir /ntfs/Windows/Drivers &>/dev/null; #Create the C:\Windows\Drivers directory and supress any system or error messages
                          echo -e "Extracting Drivers..."; #Tell the user that FOG is extracting the drivers within C:\Windows\Drivers
                          #cabextract -d /ntfs/Windows/Drivers "/images/drivers/$osn/Optiplex9020M/9020M-Win7-A04-JG7GH.CAB" &>/dev/null;
                          cabextract -d /ntfs/Windows/Drivers "/images/drivers/$osn/$machine"/*.CAB &>/dev/null
                          echo -e "DONE!"; #Tell the user that FOG has finished copying the drivers and finish the imaging process
                          
                          
                          1 Reply Last reply Reply Quote 0
                          • G
                            giejo63 @MRCUR
                            last edited by

                            @MRCUR Still no luck for me
                            image is correctly deployed but fog.postdownload doesn’t seem to run…
                            i don’t know why …

                            1 Reply Last reply Reply Quote 0
                            • G
                              giejo63
                              last edited by

                              Debugging 🙂 i found 2 problems:

                              • ${postdownloadpath} variable is not recognized

                              • when i put the full path /images/postdownloadscripts/driverinstall.sh, i have an error which says that /bin/bash^M: bad interpreter. -> i dont have any ^M at the end of the line.

                              Any ideas for the variable and bad interpreter ??
                              Thanks in advance

                              cmlC 1 Reply Last reply Reply Quote 0
                              • cmlC
                                cml Moderator @giejo63
                                last edited by

                                @giejo63

                                Did you by chance transfer the file from a windows machine? If so you may need to convert line endings.

                                dos2unix /images/postdownloadscripts/driverinstall.sh

                                G 1 Reply Last reply Reply Quote 0
                                • G
                                  giejo63 @cml
                                  last edited by

                                  @cml i will try that. Maybe it comes from a windows machine.
                                  Do you konw why i can’t use the ${postdownloadpath} variable ? (my fog server is a ubuntu 14.04)

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

                                    @giejo63 where are you check the variable? Is it on the server or the system downloading the image?

                                    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

                                    G 1 Reply Last reply Reply Quote 0
                                    • G
                                      giejo63 @Tom Elliott
                                      last edited by

                                      @Tom-Elliott it is the postdownloadscript location variable in fog.postdownload

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

                                        I mean where are you checking the variable being set?

                                        Are you checking directly on the fog server with echo $postdownloadscript or are you checking on the system receiving the image?

                                        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

                                        G 1 Reply Last reply Reply Quote 0
                                        • G
                                          giejo63 @Tom Elliott
                                          last edited by

                                          @Tom-Elliott as it is in the fog.postdownload script, i think it is the system receiving the image

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

                                          171

                                          Online

                                          12.0k

                                          Users

                                          17.3k

                                          Topics

                                          155.2k

                                          Posts
                                          Copyright © 2012-2024 FOG Project