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

Latest dev update, postdownload driver script broken

Scheduled Pinned Locked Moved Solved
FOG Problems
postdownload driver ftp ftplogin
2
7
2.1k
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.
  • C
    Chris Shipley
    last edited by Chris Shipley May 4, 2017, 10:10 AM May 4, 2017, 4:03 PM

    Server
    • FOG Version: 1.4.0-RC-9.3
    • OS: Centos CentOS Release 6.8
    Client
    • Service Version: what came with 1.4.0-RC-9.3
    • OS: Windows 10
    Description

    Prior to the latest update, drivers were downloading great. Now they are not, however. Please see attached screenshot for the error message. It’s not very detailed. I tried to ftp://foghost/images but it came up with an authentication screen: neither the CentOS root or fog user has access to it - not sure if that’s normal.
    0_1493913781989_IMG_20170504_113949.jpg

    1 Reply Last reply Reply Quote 0
    • T
      Tom Elliott
      last edited by May 4, 2017, 4:12 PM

      The information tells you what’s wrong.

      I’m assuming you’re using the “driver injection” postdownload script?

      It can’t find the location of the drivers, at least how it matches your device there.

      This script is a “speciality” and should be customized for your specific environment.

      If you can post your script it would certainly go a lot further to helping you out.

      Your reason ftp failed could be any number of things. What “fog” user password were you using, the linux fog user, or the fog GUI password? (They are very different.)

      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
      • C
        Chris Shipley
        last edited by May 4, 2017, 4:16 PM

        this system downloaded drivers fine before the update, same system. and yes, using the driver injection.
        For user names, I tried the UI user not the linux fog user. I’m not positive what password it uses. Here is the fog.drivers script:

        #!/bin/bash
        ceol=`tput el`;
        manu=`dmidecode -s system-manufacturer`;
        case $manu in
            [Ll][Ee][Nn][Oo][Vv][Oo])
                machine=$(dmidecode -s system-version)
                ;;
            *[Dd][Ee][Ll][Ll]*)
                machine=$(dmidecode -s system-product-name) #pruduct is typo, just realized sorry :(
                ;;
            *)
                machine=$(dmidecode -s system-product-name) # Technically, we can remove the dell one as it's the "default"
                ;;
        esac
        [[ -z $machine ]] && return #assuming you want it to break if it is not lenovo or dell?
        machine="${machine%"${machine##*[![:space:]]}"}" #Removes Trailing Spaces
        system64="/ntfs/Windows/SysWOW64/regedit.exe" # sloppy detect if 64bit or not
        [[ ! -f $system64 ]] && setarch="x86" || setarch="x64"
        #############################################
        #this is not section necessary needed, it's just to make the path "human readable"
        #rather than using osid for filepath
        case $osid in
            5) osn="Win7" ;;
            6) osn="Win8" ;;
            7) osn="Win8.1" ;;
            9) osn="Win10" ;;
        esac
        #############################################
        dots "Preparing Drivers"
        # below creates local folder on imaged pc
        # this can be anywhere you want just remember
        # to make sure it matches throughout!
        clientdriverpath="/ntfs/Windows/DRV"
        remotedriverpath="/images/Drivers/$osn/$machine"
        [[ ! -d $clientdriverpath ]] && mkdir -p "$clientdriverpath" >/dev/null 2>&1
        echo -n "In Progress"
        #there's 3 ways you could handle this,
        #driver cab file, extracted driver files or both
        #so on the server put extracted driver files to match below folder tree
        #i.e. Model Latitude E5410, Windows 7 x86 image would be:
        #/images/Drivers/Win7/Latitude E5410/x86
        rsync -aqz "$remotedriverpath" "$clientdriverpath" >/dev/null 2>&1
        [[ ! $? -eq 0 ]] && handleError "Failed to download driver information"
        
        #if you wanted to use driver.cab use this line below.
        #i.e. /images/Drivers/Win7/Latitude E5410/E5410-Win7-A07-KTT4G.CAB
        #cabextract -d "$clientdriverpath" "$remotedriverpath/*.CAB" >/dev/null 2>&1
        
        #if you wanted to mix both cab and extracted use these:
        #rsync -aqz --exclude='*.CAB' "$remotedriverpath" "$clientdriverpath" >/dev/null 2>&1
        #[[ ! $? -eq 0 ]] && handleError "Failed to sync cab and non-cab drivers"
        #cabextract -d "$clientdriverpath" "$remotedriverpath/*.CAB" >/dev/null 2>&1
        #[[ ! $? -eq 0 ]] && handleError "Failed to extract cab files"
        
        #this next bit adds driver location on pc to devicepath in registry (so sysprep uses it to reference)
        # remember to make devicepath= match the path you've used locally
        #also do not remove %SystemRoot%\inf
        #and to add more locations just use ; in between each location
        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
        echo -e "\b\b\b\b\b\b\b\b\b\b\b${ceol}Done"; # this just removes "In Progress and replaces it with done :-)"
        
        1 Reply Last reply Reply Quote 0
        • T
          Tom Elliott
          last edited by May 4, 2017, 4:18 PM

          The fog linux user is the password used for FTP.

          This password is typically found in UI under Storage Management Page->Selec tyour relevant storage node for this device, Near bottom of the page is Management Username and Password (the password here is the fog linux user password).

          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

          T 1 Reply Last reply May 4, 2017, 4:23 PM Reply Quote 0
          • T
            Tom Elliott @Tom Elliott
            last edited by May 4, 2017, 4:23 PM

            #!/bin/bash
            ceol=`tput el`;
            manu=`dmidecode -s system-manufacturer`;
            case $manu in
                [Ll][Ee][Nn][Oo][Vv][Oo])
                    machine=$(dmidecode -s system-version)
                    ;;
                *[Dd][Ee][Ll][Ll]*)
                    machine=$(dmidecode -s system-product-name) #pruduct is typo, just realized sorry :(
                    ;;
                *)
                    machine=$(dmidecode -s system-product-name) # Technically, we can remove the dell one as it's the "default"
                    ;;
            esac
            [[ -z $machine ]] && return #assuming you want it to break if it is not lenovo or dell?
            machine="${machine%"${machine##*[![:space:]]}"}" #Removes Trailing Spaces
            system64="/ntfs/Windows/SysWOW64/regedit.exe" # sloppy detect if 64bit or not
            [[ ! -f $system64 ]] && setarch="x86" || setarch="x64"
            #############################################
            #this is not section necessary needed, it's just to make the path "human readable"
            #rather than using osid for filepath
            case $osid in
                5) osn="Win7" ;;
                6) osn="Win8" ;;
                7) osn="Win8.1" ;;
                9) osn="Win10" ;;
            esac
            #############################################
            dots "Preparing Drivers"
            # below creates local folder on imaged pc
            # this can be anywhere you want just remember
            # to make sure it matches throughout!
            clientdriverpath="/ntfs/Windows/DRV"
            remotedriverpath="/images/Drivers/$osn/$machine"
            [[ ! -d $clientdriverpath ]] && mkdir -p "$clientdriverpath" >/dev/null 2>&1
            echo -n "In Progress"
            #there's 3 ways you could handle this,
            #driver cab file, extracted driver files or both
            #so on the server put extracted driver files to match below folder tree
            #i.e. Model Latitude E5410, Windows 7 x86 image would be:
            #/images/Drivers/Win7/Latitude E5410/x86
            #########################################
            # THIS IS WHERE IT'S BREAKING CURRENTLY #
            #########################################
            #     Does this path actually exist?    #
            #########################################
            [[ ! -r $remotedriverpath ]] && handleError "$remotedriverpath Does not exist or is not readable on your fog server"
            [[ ! -r $clientdriverpath ]] && handleError "$clientdriverpath Does not exist or is not readable on your client machine"
            rsync -aqz "$remotedriverpath" "$clientdriverpath" >/dev/null 2>&1
            [[ ! $? -eq 0 ]] && handleError "Failed to download driver information"
            
            #if you wanted to use driver.cab use this line below.
            #i.e. /images/Drivers/Win7/Latitude E5410/E5410-Win7-A07-KTT4G.CAB
            #cabextract -d "$clientdriverpath" "$remotedriverpath/*.CAB" >/dev/null 2>&1
            
            #if you wanted to mix both cab and extracted use these:
            #rsync -aqz --exclude='*.CAB' "$remotedriverpath" "$clientdriverpath" >/dev/null 2>&1
            #[[ ! $? -eq 0 ]] && handleError "Failed to sync cab and non-cab drivers"
            #cabextract -d "$clientdriverpath" "$remotedriverpath/*.CAB" >/dev/null 2>&1
            #[[ ! $? -eq 0 ]] && handleError "Failed to extract cab files"
            
            #this next bit adds driver location on pc to devicepath in registry (so sysprep uses it to reference)
            # remember to make devicepath= match the path you've used locally
            #also do not remove %SystemRoot%\inf
            #and to add more locations just use ; in between each location
            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
            echo -e "\b\b\b\b\b\b\b\b\b\b\b${ceol}Done"; # this just removes "In Progress and replaces it with done :-)"
            

            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
            • T
              Tom Elliott
              last edited by May 4, 2017, 4:23 PM

              Modified the script a little bit to try to give you more verbose information.

              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
              • C
                Chris Shipley
                last edited by May 4, 2017, 4:26 PM

                thanks. I emptied the drivers folder and it went through - perhaps the extra script information will assist me to find out why it failed when i had drivers in it. let’s mark this resolved.

                1 Reply Last reply Reply Quote 0
                • 1 / 1
                1 / 1
                • First post
                  4/7
                  Last post

                187

                Online

                12.1k

                Users

                17.3k

                Topics

                155.4k

                Posts
                Copyright © 2012-2024 FOG Project