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

post-installation script

Scheduled Pinned Locked Moved Unsolved
FOG Problems
2
2
172
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.
  • P
    professorb24
    last edited by george1421 Feb 5, 2024, 5:42 PM Feb 5, 2024, 11:34 PM

    Is there a way for the fog server to run a post-installation script? For example, I need to inject the HP and Lenovo drivers into the image, and I already downloaded the drivers. Everything that I’ve tried post-installation script hasn’t worked.

    #!/bin/bash
    
    # Path to Windows image file
    WINDOWS_IMAGE="/path/to/windows_image.wim"
    
    # Mount directory for Windows image
    MOUNT_DIR="/mnt/windows_image"
    
    # Path to HP drivers directory
    HP_DRIVER_DIR="/path/to/hp_drivers"
    
    # Path to Lenovo drivers directory
    LENOVO_DRIVER_DIR="/path/to/lenovo_drivers"
    
    # Mount the Windows image
    mkdir -p $MOUNT_DIR
    sudo mount -o loop $WINDOWS_IMAGE $MOUNT_DIR
    
    # Inject HP drivers
    sudo dism /Image:$MOUNT_DIR /Add-Driver /Driver:$HP_DRIVER_DIR /Recurse
    
    # Inject Lenovo drivers
    sudo dism /Image:$MOUNT_DIR /Add-Driver /Driver:$LENOVO_DRIVER_DIR /Recurse
    
    # Unmount the Windows image
    sudo umount $MOUNT_DIR
    rmdir $MOUNT_DIR
    
    echo "Driver injection complete."
    

    mod note: fixed the code for readability

    G 1 Reply Last reply Feb 5, 2024, 11:46 PM Reply Quote 0
    • G
      george1421 Moderator @professorb24
      last edited by george1421 Feb 5, 2024, 5:47 PM Feb 5, 2024, 11:46 PM

      @professorb24 I have a tutorial on how to do this with Dell computers, but the concept is almost the same for other vendors. The key is to have the driver files in inf format so pnputil.exe can install them. Lenovo use to have drivers in .exe format and not .inf format. That made things a bit harder when I was trying to setup lenovo computers.

      Looking at the script and it doesn’t appear to do anything. other than mount a wim image, but also be aware that the post install script runs withing a linux environment so it can’t directly interact with windows or the .wim file.

      Your post install script should copy the drivers over to the target computer after the image is placed on the target computer. All that FOG can do is leave files behind for windows to find them during OOBE/WinSetup.

      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
      • 1 / 1
      1 / 1
      • First post
        2/2
        Last post

      194

      Online

      12.1k

      Users

      17.3k

      Topics

      155.2k

      Posts
      Copyright © 2012-2024 FOG Project