0

I have searched the docs and cannot find any mention of what I am trying to achieve. We have a custom Ubuntu installation that contains scripts, these are called in the preseed config file. We are moving to a PXE environment and I need some advice on how to call the scripts, its working from CDROM installs but not PXE.

Preseed file:

call to the script

/cdrom/preseed/wipe_disks.sh

In the Netboot environment how can I call the custom script ? Obviously the /cdrom is not mounted what is the equivalent for a Netboot install ?

The PXE environment uses NFS to get the ISO files. When inside the installer I cannot see this mounted anywhere.

For reference this is the PXE boot arguments (using iPXE)

imgargs vmlinuz initrd=initrd.gz root=/dev/nfs boot=casper netboot=nfs nfsroot=${server}:${nfs_path}/${dir} ip=dhcp url=http://${server}/preseed/ubuntu-server-minimal.seed  

The installation is failing as it can't find our custom scripts in the preseed folder

1 Answers1

0

you can do it by

d-i preseed/late_command string in-target wget -P /tmp/ $server/script.sh; in-target chmod $+x /tmp/script.sh; in-target /tmp/script.sh`

Put this line into a preseed file and you can do everything in your system you are familiar with bash.

You have to replace $server with a webhost or a local ip of course.

or

d-i preseed/run string run.sh

The run.sh file must be stored in the same directory from which the preseed file was downloaded

source: https://askubuntu.com/questions/294338/is-it-possible-to-download-a-bash-script-and-execute-it-from-a-preseed-file

Pat
  • 3,519
  • 2
  • 17
  • 17