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

Easy way to test post installation scripts?

Scheduled Pinned Locked Moved
General Problems
2
2
368
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
    pete
    last edited by Nov 14, 2019, 11:51 PM

    I am new to using scripts and have written a simple one to start experimenting with.
    Now the problem is when I want to test this script I have to deploy a laptop and wait till the end to see if it works.
    Is there any way I can skill the deploy part and go straight to testing the scripts?

    1 Reply Last reply Reply Quote 0
    • G
      george1421 Moderator
      last edited by Nov 15, 2019, 12:48 PM

      Typically a post install script relies on the image being on the computer because the post install script would interact with the image once its downloaded to the disk.

      With that said I can give you some tips to make debugging a bit easier.

      1. Schedule your deployment task, but before you hit the submit button tick the debug checkbox.
      2. PXE boot the target computer. After a few screens of text that needs to be cleared with the enter key you will be dropped to a linux command prompt.
        These next to steps are optional
      3. Get the IP address of the target computer using ip addr show
      4. Set root’s password with passwd give it a simple password like hello. Don’t worry it will be reset the system is rebooted.
      5. Now use putty and connect to the target computer using the information from steps 3 and 4. Using putty you will be able to cut/copy/paste a bit easier than using the FOS Linux console. But these 3 steps are up to you
        The rest of the steps work both from the putty shell as well as the console shell.
      6. Start the deployment process from the command prompt by keying in fog. You will now single step through the imaging process pressing enter at the each debugPause command. You can insert the debugPause command into your post install script to stop the deployment at critical points. Pressing enter will continue the script until the next debugPause breakpoint.

      Hints:

      1. Add liberal echo commands to indicate the start, execution of critical points and exit of your post install script.
      2. If something goes wrong, pressing ctrl-c will exit out of the deployment script at the point where you hit ctrl-c.
      3. If you are linux savvy you can navigate to where the postinstall script is and rerun just that script after you fix what needs fixing. (I don’t know the path off the top of my head, sorry)
      4. You can start the deployment process over again without needing to reboot by just keying in fog again at the command prompt.

      If you are interacting with windows, I have some post install scripts with examplesin the tutorial forum. While they are windows focused they should show you some trick you could implement in your scripts.

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

      117

      Online

      12.1k

      Users

      17.3k

      Topics

      155.3k

      Posts
      Copyright © 2012-2024 FOG Project