The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Ubuntu Preseed not found Curtor Shell Programming and Scripting 4 09-12-2008 11:29 AM
Running from Shell Vs running from RC script vickylife SUN Solaris 2 07-31-2008 06:01 AM
Install script potro Shell Programming and Scripting 2 06-20-2008 04:46 AM
Script to install jdk eamani_sun Shell Programming and Scripting 5 05-12-2008 06:26 PM
Help with an install script dhs23 Shell Programming and Scripting 1 02-28-2008 03:01 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 09-16-2008
Registered User
 

Join Date: Feb 2008
Location: Ontario, Canada
Posts: 6
Running Script after Preseed Install

Hello there,

If you don't want to here the long version, but still want to answer my question, please skip down to THE BOTTOM!

You can probably tell what I want to do already from the title, so I'll sum up what I have already done real quick:

First off, for those that don't know, a preseed file is a script which auto answers all the questions in the install process for you, so you can start it, walk away, and come back with a full system without having to babysit the install and answer all the questions. Here is a handy page if you are interested yourself:
https://help.ubuntu.com/7.04/install...eed-using.html

1) Tried installing from CD and specifying to look on a thumb drive for the preseed file through a boot parameter. Could not get it to find the file, not sure where it would look or how it would mount the dive.
2) Made a boot thumb drive, and placed preseed file on there. Worked fine, but didn't find file until it looked for it while looking for iso on the thumb drive.
3) Improved number of questions I had to answer by placing file right in the initrd file. This is tricky, if you are curious about it, you can ask. This should, in theory, also work if you edited the initrd on an iso and burned it.

Now, at the end of the install, I want to run a script that does some further set up aside from the installation. Here is a section of the default provided preseed file:
Code:
Code:
# d-i preseeding is inherently not secure. Nothing in the installer checks
# for attempts at buffer overflows or other exploits of the values of a
# preconfiguration file like this one. Only use preconfiguration files from
# trusted locations! To drive that home, and because it's generally useful,
# here's a way to run any shell command you'd like inside the installer,
# automatically.

# This first command is run as early as possible, just after
# preseeding is read.
#d-i preseed/early_command string anna-install some-udeb

# This command is run just before the install finishes, but when there is
# still a usable /target directory. You can chroot to /target and use it
# directly, or use the apt-install and in-target commands to easily install
# packages and run commands in the target system.
#d-i preseed/late_command string apt-install zsh; in-target chsh -s /bin/zsh
Now, using this new information, I want to run a script. Trouble is, that when I do this, using
d-i preseed/late_command string sh testscript.sh
I get an error that the file cannot be found. My theory is that during the final stages of the install, it is running from the hard drive and not the installation device. If this is wrong, or you have a different solution than the answer to the question at the bottom, please feel free to voice it.

// THE BOTTOM \\

Therefore, during installation, I want to try to place a file from the boot device onto the hard drive. How would I go about doing this, what/where on the .iso do I edit?

// Temporary solution \\

Copy the file from an in house mirror:

d-i preseed/late_command string \
in-target chsh -s /bin/bash ; \
in-target wget http://[some_IP]/testscript.sh ; \
in-target sh testscript.sh ;
in-target rm testscript.sh ;

Last edited by Curtor; 09-18-2008 at 07:30 AM. Reason: Fixed link and added a solution
Reply With Quote
Forum Sponsor
  #2  
Old 09-17-2008
era era is offline
Herder of Useless Cats
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,650
My speculation would be that the device is okay but you need an explicit path to the script.

As a workaround, make it install a dummy package with a preinst script which does what you want.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 03:33 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0