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

Adding drivers at the end of an restore.

Scheduled Pinned Locked Moved
FOG Problems
3
4
1.9k
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.
  • T
    Terry Bates
    last edited by Feb 28, 2012, 3:23 AM

    Hey There,

    I have to say this is the third time I have used this project for deployment situations and its fantastic.

    I have an odd request, I would like to add a custom some script to copy driver files from a directory on my fog server to my xp image once its restored to the machine.

    I understand that you can mount the init.gz image and modify it, I am thinking that adding a bit of code to the “fog” script in /bin will do but at what point should I add this? for the most part my images are single partition.

    Also any suggestions on what I should write as well would be great I can write a vb script file but first time with bash script, basically would like to copy a folder full of drivers say /mnt/drivers to ~c:\sysprep\drivers, anything basic will do I’m sure I can modify it to suit 🙂

    There may even be an easier way of doing this but I dont know it 😛

    Cheers

    1 Reply Last reply Reply Quote 0
    • T
      Terry Bates
      last edited by Feb 29, 2012, 3:33 AM

      Had some time today, added this to my fog script

      [CODE] if [ “$type” == “down” ];
      then
      # Windows XP
      if [ “$osid” == “1” ]; then
      echo “”;
      echo " * Copying driver files";
      echo “”;
      ntfs-3g -o force,rw $part /ntfs
      mkdir -p /ntfs/sysprep/drivers
      cp -R -f /images/drivers/* /ntfs/sysprep/drivers
      umount /ntfs;
      fi
      fi[/CODE]

      It seems to work well, will probably expand on this in the future, might even send through page for your wiki with what I’m doing for deploying images.

      1 Reply Last reply Reply Quote 0
      • J
        jdd49
        last edited by Mar 2, 2012, 6:29 PM

        Here is a solution that I currently use. I added an extra host option in the database. Similar to kernel options but called it scripts. Here I can add different scripts to different hosts or groups. That information is then appended to the bootimage in a variable called hostScripts. I created a new nfs share called scripts. In here are all of the different bash or shell scripts that can be ran after a host has imaged and before it checks out. Here is the function I call from my boot image.

        if [ ! “$hostScripts” = “” ]; then
        runScripts
        fi

        function runScripts()
        {
        mkdir /scripts
        mount -o nolock,proto=tcp “$serverIP:/scripts” /scripts 2>/dev/mntscripts
        echo “Running Script(s)”
        sleep 1

        scriptCount=$(grep -o “,” <<<“$hostScripts” | wc -l)
        scriptCount=$(( $scriptCount + 1 ))
        echo “> Found $scriptCount Script(s)”
        sleep 1
        i=1
        while [ $i -le $scriptCount ]
        do
        scriptArray[i]=$(echo $hostScripts | cut -d"," -f$i)
        echo “> Running ${scriptArray[i]}”
        sleep 1
        cd /scripts
        ./${scriptArray[i]} $hd
        i=$(( $i + 1 ))
        sleep 1
        done
        }

        So if hostA had hostScripts=script1,script2,script3 set for it. It would run all 3 scripts that are stored on the server.
        I know this has a lot info missing but this is a general idea of how you could do it.[/i][/i][/i]

        1 Reply Last reply Reply Quote 0
        • D
          De Thegeek
          last edited by Mar 21, 2012, 7:59 AM

          Hi

          I created this page some time ago

          [url]http://www.fogproject.org/wiki/index.php?title=Working_device_drivers_snapins[/url]

          I’m used to deploy device drivers as snapins. most device drivers have a installer able to run silently. However, some drivers need to run when a user is logged on. Some of them (sometimes realtek hdaudio or ac97 depending on the computer, or some ATI video drivers) are a bit ugly and don’t run well silently.

          Have a look, that’s quite nice 🙂

          Now I’m using .cmd files as snapins, and they start my device driver from a SMB share. This is easier to maintain and troubleshoot. No more need to create a sfx with 7z 🙂

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

          124

          Online

          12.1k

          Users

          17.3k

          Topics

          155.4k

          Posts
          Copyright © 2012-2024 FOG Project