netson / ubuntu-unattended

Script to create unattended Ubuntu ISO
MIT License
370 stars 185 forks source link

Unable to execute custom hostname-changing script as part of install process. #44

Closed douglas-carmichael closed 5 years ago

douglas-carmichael commented 5 years ago

I'm trying to use your script to create an ISO that would automatically run a script upon installation (pick up the hostname from ESXi after SaltStack creates the VM and alter /etc/hosts with the new hostname).

I've been able to successfully move the script from the /preseed directory of the ISO into /root on the target system, but so far I haven't been able to have the script execute as part of the installation process. (I even tried adding "chroot /target /root/ncc-hostname.sh" on the end of late_command, but that failed.)

Would that be at all possible with Ubuntu 18.04, or would that have to be done as part of the first boot? I've attached my patches to your script and seed file as well as the custom script I want to execute as part of the installation process.

Thanks in advance!

ncc-set-hostname.sh.txt

create-unattended-iso_ncc.patch.txt

ncc.seed.patch.txt

douglas-carmichael commented 5 years ago

Fixed the underlying hostname-changing script.