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

    Windows 7 : universal image with Postdownload script : issues

    Scheduled Pinned Locked Moved Solved
    Windows Problems
    5
    40
    9.8k
    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.
    • george1421G
      george1421 Moderator @Jonathan Cool
      last edited by

      @Jonathan-Cool said in Windows 7 : universal image with Postdownload script : issues:

      After the reboot, i need to insert admin id …
      Next, Windows install the drivers and i can show the files into C:\Windows\DRV
      Now, i need to search a solution to reboot the computer AFTER the drivers installation …
      I know the trick to open the administrator session once time (AutoAdminLogoon in registry) …
      Next steps :

      autologin in administrator once to open a session for drivers installation

      Just for clarity, if you have the drivers on the target computer AND you either update the registry (Win7) or the unattend.xml (Win7/Win10) the drivers are installed during OOBE process. There is no need to login for drivers to be installed.

      find a way to reboot computer after drivers installation

      If you want to reboot the computer after OOBE, you can do it in the SetupComplete.cmd batch file (which is executed just before the login prompt is displayed). Or you can setup the first login section of the unattend.xml file and call the shutdown.exe command from one of the first run steps. Two ways to accomplish what needs to be done depending on requirements.

      try with others models.

      Just a question : can i create my own CAB ? Especially for HP … ?

      There is no need to create your own CAB. The requirement for this “work flow” is that the drivers you use must be in the extracted INF format. You can not deploy driver images this way if the drivers are contained in a self installer .exe file. You MUST use the .INF drivers. If you have this, then you can build your own driver directories and move that to the fog server.

      Moving hardware other than Dell, you may need to change where the script looks for the model number. Once you know the new location then you can adjust the script to match. You will also need to adjust the directory structure based on how the manufacturer calls its models.

      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!

      Jonathan CoolJ 1 Reply Last reply Reply Quote 0
      • Jonathan CoolJ
        Jonathan Cool @george1421
        last edited by Jonathan Cool

        @george1421
        Thanks you for your answer.
        I need to learn more about the SetupComplete.cmd to populate it correctly.
        I know what is OOBE and why it exist but i don’t kown how to use it correctly.
        I will do some tests with it and with my VM.

        But, i have no time to do it … i hope i could do new tests soon …

        My stuff :
        Server :
        FOG Version : Running Version 1.5.9
        OS : Debian GNU/Linux 10
        FOG Client Version : 0.12
        Specifications :
        > All images are on a Synology NAS storage : mounted with NAS_ip:/images
        > French user :)
        > “If everything would work the first time, what would you have learned?”
        Challenges make knowledge growth … by George1421 ;)

        1 Reply Last reply Reply Quote 0
        • Jonathan CoolJ
          Jonathan Cool
          last edited by

          Hello,
          After some research and an very interessting discuss with George, i’m back to understand why the drivers injections works with my Optiplex 7010 and not with my HP 8000 EliteBook.
          The facts :
          I use another fog.postdownload (https://forums.fogproject.org/topic/8889/fog-post-install-script-for-win-driver-injection/7) to find the good partition for the mount /ntfs :

          #!/bin/bash
          . /usr/share/fog/lib/funcs.sh
          [[ -z $postdownpath ]] && postdownpath="/images/postdownloadscripts/"
          case $osid in
              5|6|7|9)
                  clear
                  [[ ! -d /ntfs ]] && mkdir -p /ntfs
                  getHardDisk
                  if [[ -z $hd ]]; then
                      handleError "Could not find hdd to use"
                  fi
                  getPartitions $hd
                  for part in $parts; do
                      umount /ntfs >/dev/null 2>&1
                      fsTypeSetting "$part"
                      case $fstype in
                          ntfs)
                              dots "Testing partition $part"
                              ntfs-3g -o force,rw $part /ntfs
                              ntfsstatus="$?"
                              if [[ ! $ntfsstatus -eq 0 ]]; then
                                  echo "Skipped"
                                  continue
                              fi
                              if [[ ! -d /ntfs/windows && ! -d /ntfs/Windows && ! -d /ntfs/WINDOWS ]]; then
                                  echo "Not found"
                                  umount /ntf >/dev/null 2>&1
                                  continue
                              fi
                              echo "Success"
                              break
                              ;;
                          *)
                              echo " * Partition $part not NTFS filesystem"
                              ;;
                      esac
                  done
                  if [[ ! $ntfsstatus -eq 0 ]]; then
                      echo "Failed"
                      debugPause
                      handleError "Failed to mount $part ($0)\n    Args: $*"
                  fi
                  echo "Done"
                  debugPause
                  #. ${postdownpath}fog.log
                  . ${postdownpath}fog.drivers
                 # . ${postdownpath}fog.ad
                  umount /ntfs
                  ;;
              *)
                  echo "Non-Windows Deployment"
                  debugPause
                  return
                  ;;
          esac
          

          On the HP 8000 EliteBook, i ran a debug task with an Windows 7 x64 image.
          I hit “CTRL+C” just after the “Preparing Drivers” process :

          • cd /ntfs : i see boot files (BOOTSEC.BAK, Boot, System Volume Information, bootmgr), not the Windows partition files
          • lsblk : the wrong partition is mounted (/dev/sda1 instead of /dev/sda2)
          • i type “reboot”. i go back into Windows 7. I can’t seen anyfiles into C:\Windows\DRV. None driver installed (i think of Win7 tried install drivers with generic drivers).

          Same operation with Optiplex 7010 :
          I hit “CTRL+C” just after the “Preparing Drivers” process :

          • cd /ntfs : i see boot files, not the Windows partition files
          • lsblk : the wrong partition is mounted (/dev/sda1 instead of /dev/sda2)
          • i type “reboot”. Go back into Windows 7. I CAN seen drivers files into C:\Windows\DRV.

          One question : why, with the same script, it’s work for the Optiplex7010 and not for the HP 8000 ?
          I don’t undersand why i saw the wrong partition with “lsblk” in command prompt of Optiplex 7010 but, it finally works …

          My stuff :
          Server :
          FOG Version : Running Version 1.5.9
          OS : Debian GNU/Linux 10
          FOG Client Version : 0.12
          Specifications :
          > All images are on a Synology NAS storage : mounted with NAS_ip:/images
          > French user :)
          > “If everything would work the first time, what would you have learned?”
          Challenges make knowledge growth … by George1421 ;)

          george1421G Q 3 Replies Last reply Reply Quote 0
          • george1421G
            george1421 Moderator @Jonathan Cool
            last edited by george1421

            @Jonathan-Cool This is difficult to say, but the lsblk command only shows you the block devices (disks and their partitions) available on the computer. Its not a good prediction of where the windows partition is.

            I think I would start debugging this on the HP computer. Since you are testing the bash script I would run a your deployment in debug mode. When you get to the point where it should be copying the drivers exit out of the deployment script. Then execute the script you posted command by command.

            The script will mount each partition one by one. It checks to ensure its a ntfs type partition if it is, then it mounts it and checks to see if there is a Windows directory on that partition. If there is the script assumes that it found the right partition.

            From our discussion yesterday the script seems to be picking partition 1 which is the boot partition. Is it possible that HP has done something “special” with that boot partition and placed a windows directory on it? IF so that may trick your postdownload script into saying that partition 1 is the windows partition.

            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!

            Lee RowlettL 1 Reply Last reply Reply Quote 0
            • george1421G
              george1421 Moderator @Jonathan Cool
              last edited by

              @Jonathan-Cool said in Windows 7 : universal image with Postdownload script : issues:

              I think for debugging this what I would do is update your fog.postdownload script insert the echo and debugPause (scripted breakpoint). Then save the postdownload script. Schedule a debug deployment and when the script gets to that point use ctrl-C to break out of the fog deployment script.

              Then key in . /usr/share/fog/lib/funcs.sh into the command line to setup your environment variables and then execute the script line by line (copy and paste commands into the linux console) trying to understand why the script is picking sda1 over the right answer of sda2.

              #!/bin/bash
               . /usr/share/fog/lib/funcs.sh
               [[ -z $postdownpath ]] && postdownpath="/images/postdownloadscripts/"
               case $osid in
                   5|6|7|9)
                       clear
                       [[ ! -d /ntfs ]] && mkdir -p /ntfs
              echo "Scripted breakpoint"
              debugPause
                       getHardDisk
                       if [[ -z $hd ]]; then
                           handleError "Could not find hdd to use"
                       fi
                       getPartitions $hd
              

              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!

              1 Reply Last reply Reply Quote 0
              • Lee RowlettL
                Lee Rowlett Developer @george1421
                last edited by

                @george1421 I’m pretty sure from when we use to have HP’s that the first partition was a system recovery partition which when browsing contained snapshot of OS files so would confirm your theory!.. Slightly off topic but line 27 in fog.postdownload got a typo, ntf should be ntfs

                george1421G 1 Reply Last reply Reply Quote 2
                • george1421G
                  george1421 Moderator @Lee Rowlett
                  last edited by

                  @Lee-Rowlett said in Windows 7 : universal image with Postdownload script : issues:

                  that the first partition was a system recovery partition

                  Then maybe its safe to assume that there IS a /Windows directory on that recover partition?? If so that would explain why the detection code is failing (Ugh!)

                  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!

                  Tom ElliottT george1421G 2 Replies Last reply Reply Quote 0
                  • Tom ElliottT
                    Tom Elliott @george1421
                    last edited by

                    @george1421 I think the typo didn’t allow the NTFS directory to me unmounted leaving the last mounted partition in place when it tried to do any action.

                    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 1
                    • Q
                      Quazz Moderator @Jonathan Cool
                      last edited by Quazz

                      Well, I think why that script won’t work 100% is because the script has a tiny bug in it.

                                          if [[ ! -d /ntfs/windows && ! -d /ntfs/Windows && ! -d /ntfs/WINDOWS ]]; then
                                              echo "Not found"
                                              umount /ntf >/dev/null 2>&1
                                              continue
                                          fi
                      

                      Should be

                                          if [[ ! -d /ntfs/windows && ! -d /ntfs/Windows && ! -d /ntfs/WINDOWS ]]; then
                                              echo "Not found"
                                              umount /ntfs >/dev/null 2>&1
                                              continue
                                          fi
                      

                      The problem being that when the script loops through the mounting of parts, but can’t find the Windows folder, it fails to unmount the ntfs folder, which will not allow the system to then mount anything else to it, and thusly it fails.

                      Not sure why it would work for your optiplex, but fix that and try again, imo.

                      edit: Did not see Tom’s post, I essentially posted the same thing.

                      1 Reply Last reply Reply Quote 1
                      • george1421G
                        george1421 Moderator @george1421
                        last edited by

                        @george1421 I think we need to identify if the HP recovery partition contains a /Windows directory. If so, then the script’s logic test is wrong. We may have to find another check to identify the true 😄 drive from a recovery partition.

                        Right now the script may be fundamentally flawed,

                        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!

                        1 Reply Last reply Reply Quote 0
                        • Jonathan CoolJ
                          Jonathan Cool
                          last edited by

                          Hello,
                          Thank you all for your answer : quick reply :

                          • there is any recovery partition because, when i create a master image, i always delete all partitions. The first partition is the boot partiyon of Windows 7 (called “Partition System Reserved”).

                          • i will try after edit the typo. Thank you, i missed it.

                          I will come back with the resultats.

                          My stuff :
                          Server :
                          FOG Version : Running Version 1.5.9
                          OS : Debian GNU/Linux 10
                          FOG Client Version : 0.12
                          Specifications :
                          > All images are on a Synology NAS storage : mounted with NAS_ip:/images
                          > French user :)
                          > “If everything would work the first time, what would you have learned?”
                          Challenges make knowledge growth … by George1421 ;)

                          1 Reply Last reply Reply Quote 0
                          • Jonathan CoolJ
                            Jonathan Cool
                            last edited by

                            Hi,
                            I’m back with the results … and they are the same …
                            Maybe with the output of SSH, that can help you …

                            [http://txt.do/drvaa](link url)

                            Also, i have an other idea : just for the HP8000, i could hard-coded the good partition directly into the fog.postdownload script ?
                            Like that : “if $model = HP Compaq 8000 Elite USDT PC” (i don’t know if this var really exist, it’s just an example)
                            do
                            umount /ntfs
                            mount /dev/sda2 /ntfs

                            or somethink like that …

                            My stuff :
                            Server :
                            FOG Version : Running Version 1.5.9
                            OS : Debian GNU/Linux 10
                            FOG Client Version : 0.12
                            Specifications :
                            > All images are on a Synology NAS storage : mounted with NAS_ip:/images
                            > French user :)
                            > “If everything would work the first time, what would you have learned?”
                            Challenges make knowledge growth … by George1421 ;)

                            Jonathan CoolJ 1 Reply Last reply Reply Quote 0
                            • Jonathan CoolJ
                              Jonathan Cool @Jonathan Cool
                              last edited by

                              @Jonathan-Cool
                              I wrong, it’s seem to work …
                              I just do few tests to confirm this (test with Opti7010 and HP8000) and i will go back …

                              My stuff :
                              Server :
                              FOG Version : Running Version 1.5.9
                              OS : Debian GNU/Linux 10
                              FOG Client Version : 0.12
                              Specifications :
                              > All images are on a Synology NAS storage : mounted with NAS_ip:/images
                              > French user :)
                              > “If everything would work the first time, what would you have learned?”
                              Challenges make knowledge growth … by George1421 ;)

                              Jonathan CoolJ 1 Reply Last reply Reply Quote 0
                              • Jonathan CoolJ
                                Jonathan Cool @Jonathan Cool
                                last edited by

                                @Jonathan-Cool I’m going crazy … after reboot the computer and retry a debug task, it’s didn’t work at this point …

                                My stuff :
                                Server :
                                FOG Version : Running Version 1.5.9
                                OS : Debian GNU/Linux 10
                                FOG Client Version : 0.12
                                Specifications :
                                > All images are on a Synology NAS storage : mounted with NAS_ip:/images
                                > French user :)
                                > “If everything would work the first time, what would you have learned?”
                                Challenges make knowledge growth … by George1421 ;)

                                1 Reply Last reply Reply Quote 0
                                • Jonathan CoolJ
                                  Jonathan Cool
                                  last edited by Jonathan Cool

                                  It’s working now !
                                  I did a mistake …
                                  This is what I did to find my mistake

                                  • create a debug Task
                                  • at the prompt, add root password
                                  • with SSH, run the fog command
                                  • CTRL+C after “Preparing Drivers”
                                  • run “. /usr/share/fog/lib/funcs.sh”
                                  • cd /images/postdownloadscripts
                                  • sh -x fog.postdownload
                                  • copy / paste the output in a txt file to debug
                                  • analyze the code
                                  • find a mistake with rsync
                                    I copied the ini folder into “/images/Drivers/Win7/HP Compaq 8000 Elite USDT PC/” BUT the good path is “/images/Drivers/Win7/HP Compaq 8000 Elite USDT PC/x64”.
                                    I tried after move the files in the good folder … and it’s works !

                                  Now, i have a little other strange problem with domain on the HP 8000.
                                  i can’t join the domain and fog.log said :

                                  02/05/2017 13:39 Middleware::Authentication ERROR: Could not get security token
                                  02/05/2017 13:39 Middleware::Authentication ERROR: Could not find file 'C:\Program Files (x86)\FOG\token.dat'
                                  

                                  If I go into the folder, i can’t see the token.dat file.

                                  With the same image and with the Optiplex7010, domain jonction works perfectly … strange !

                                  My stuff :
                                  Server :
                                  FOG Version : Running Version 1.5.9
                                  OS : Debian GNU/Linux 10
                                  FOG Client Version : 0.12
                                  Specifications :
                                  > All images are on a Synology NAS storage : mounted with NAS_ip:/images
                                  > French user :)
                                  > “If everything would work the first time, what would you have learned?”
                                  Challenges make knowledge growth … by George1421 ;)

                                  Tom ElliottT george1421G 2 Replies Last reply Reply Quote 0
                                  • Tom ElliottT
                                    Tom Elliott @Jonathan Cool
                                    last edited by

                                    @Jonathan-Cool The token.dat message is a “normal” thing and likely not the problem you’re seeing with domain not joining.

                                    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 1
                                    • george1421G
                                      george1421 Moderator @Jonathan Cool
                                      last edited by

                                      @Jonathan-Cool said in Windows 7 : universal image with Postdownload script : issues:

                                      I tried after move the files in the good folder … and it’s works !

                                      So it WAS the french guys fault…

                                      Good job finding the issue!!

                                      For your domain join, did the network adapter drivers load correctly? I have seen the no network thing cause a problem. This was on an intel nuc where the network drivers where not signed properly and you must accept the unsigned certificate for windows to load the drivers. I’m not saying this is your case now, only one place to check.

                                      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!

                                      1 Reply Last reply Reply Quote 0
                                      • Jonathan CoolJ
                                        Jonathan Cool
                                        last edited by

                                        You right, it’s was me … 😉
                                        But, the script contained a little typo, remember 😉
                                        And now, i understood why the domain fail … simply because i CTRL+C for debug … and after, i rebooted the computer … but, the hostname changer process didin’t run ! And i has a bad hostname …
                                        I just want to thanks all of you for your help.
                                        With this post, i understood many thinks and i improve myself day after day 😉
                                        I’m very happy to learned news features with FOG and new knowledge 😉
                                        It’s solved !

                                        PS : this script works with Windows 10 ?

                                        My stuff :
                                        Server :
                                        FOG Version : Running Version 1.5.9
                                        OS : Debian GNU/Linux 10
                                        FOG Client Version : 0.12
                                        Specifications :
                                        > All images are on a Synology NAS storage : mounted with NAS_ip:/images
                                        > French user :)
                                        > “If everything would work the first time, what would you have learned?”
                                        Challenges make knowledge growth … by George1421 ;)

                                        Tom ElliottT 1 Reply Last reply Reply Quote 3
                                        • Tom ElliottT
                                          Tom Elliott @Jonathan Cool
                                          last edited by

                                          @Jonathan-Cool Ideally yes. But won’t know until it’s tested.

                                          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
                                          • Jonathan CoolJ
                                            Jonathan Cool
                                            last edited by

                                            Hi,
                                            It’s me again …
                                            I just need a precision about drivers : in this case, for Win7x64 and a HP820G3 (seem to be the same problem for Win10x64) : after the deploy and the unique reboot to join the domain, i can see in “Manage Device”, two “other” devices.

                                            IF I right-click on theses devices, update Drivers … and choose the C:\Windows\DRV location, Windows “finish” the installation.
                                            Why Windows can’t do this installation just after the deploy ?
                                            Is it a signature problem with theses devices ? (Wifi and Display Audio Driver).
                                            This problem break my dream of a Golden Full-automated Windows Image 😞

                                            My stuff :
                                            Server :
                                            FOG Version : Running Version 1.5.9
                                            OS : Debian GNU/Linux 10
                                            FOG Client Version : 0.12
                                            Specifications :
                                            > All images are on a Synology NAS storage : mounted with NAS_ip:/images
                                            > French user :)
                                            > “If everything would work the first time, what would you have learned?”
                                            Challenges make knowledge growth … by George1421 ;)

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

                                            151

                                            Online

                                            12.0k

                                            Users

                                            17.3k

                                            Topics

                                            155.2k

                                            Posts
                                            Copyright © 2012-2024 FOG Project