I have been trying to run the script (setup-proxy.sh
) using late-commands. I have tried various methods to make it run but unable to run the script. It fails with the exit status 1
.
My late-commands section:
late-commands:
- curtin in-target --target=/target -- touch /media/userkun.txt
- curtin in-target --target=/target -- echo "$(whoami)" >> /media/userkun.txt
- curtin in-target --target=/target -- cp /cdrom/setup-proxy.sh /media
- curtin in-target --target=/target -- cp /cdrom/setup-certs.sh /media
- curtin in-target --target=/target -- chmod 777 /media/setup-proxy.sh
- curtin in-target --target=/target -- chmod 777 /media/setup-certs.sh
- sed -i 's/sudo//g' /target/media/setup-proxy.sh
- sed -i 's/sudo//g' /target/media/setup-certs.sh
- /target/media/setup-proxy.sh
I have also tried (but no progress) the last step of the late-commands section with:
curtin in-target --target=/target -- /bin/bash -c '/media/setup-proxy.sh'
curtin in-target --target=/target -- bash -c '/media/setup-proxy.sh'
curtin in-target --target=/target -- bash /media/setup-proxy.sh
The script setup-proxy.sh
uses sudo
calls for running the lines inside it. I thought error was due to the sudo
calls and tried removing all instances of sudo
in the setup-proxy.sh
. But it was the same regardless. The scripts which I am copying does get copied to the target
machine as mentioned after installation.
Kindly help. I am desperate to make this script run as a late-command at this point. Thank you for your time.
The output looks like