VMware Cloud Community
kgottleib
Enthusiast
Enthusiast

scripted installation question pertaining to %post section of the kickstart script

Attention Gurus - I am scripting the installation and configuration of our ESX environment at our DR site and have been stuck on this one simple problem - I need to copy files from the install media to the server in the %post section and can't seem to make it happen.. there is no network up - or at least any servers up on the wire - at the time I will be building the ESX environment so I need to be able to leverage the %post section to copy files to the /mnt/sysimage directory structure.. I have tried so many ways to make this happen but have been unsuccessful and can't find any solid documentation on this. Yes, I am using the '--nochroot' parameter after the %post....

I have copied the ks.cfg file to both floppy and CDROM and have installed ESX using both 'esx ks=floppy' and 'esx ks=cdrom:\KS.cfg ksdevice=cdrom' and both work fine - however - when I add files to the media, whether to the floppy or the CD, I can't get them copied into the /mnt/sysimage/tmp directory where they can be executed later during the post config script. Here is what I have tried:

%post --nochroot

cp /script_filename /mnt/sysimage/tmp/script_filename

When the above didn't work I tried this:

%post --nochroot

mount /dev/fd0 /mnt/sysimage/tmp

cp /mnt/sysimage/tmp/script_filename /mnt/sysimage/tmp/script_filename

This didn't work either - Smiley Sad

What command do I use during the %post section to represent the floppy or CDROM devices so I can copy the files i need to /mnt/sysimage/tmp???

Thanks in advance!!!!

Gman

0 Kudos
1 Reply
kgottleib
Enthusiast
Enthusiast

OK, since nobody answered - I tried a completely different approach and simply created the script I needed to run with

cat> /path to script <<EOF

in the script were all commands needed to configure my environment

EOF

then I did this last piece in my ks.cfg:

cp -f /etc/rc.d/rc.local /etc/rc.d/rc.local.bak

cat >> /etc/rc.d/rc.local <<EOF

chmod 751 /tmp/scriptname

cd /tmp

./scriptname

mv -f /etc/rc.d/rc.local.bak /etc/rc.d/rc.local

EOF

If anyone wants some info on this let me know, it worked killer! Installed ESX via ks.cfg and the script configured my environment completely unattended after initial reboot..

0 Kudos