Latest dev update, postdownload driver script broken



  • 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



  • 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.


  • Senior Developer

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


  • Senior Developer

    #!/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 :-)"
    

  • Senior Developer

    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).



  • 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 :-)"
    

  • Senior Developer

    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.)



406
Online

39.3k
Users

11.0k
Topics

104.6k
Posts

Looks like your connection to FOG Project was lost, please wait while we try to reconnect.