Score:0

UBUNTU 20.04.2 : Unable to run the scripts post installation as a late command

za flag

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

Score:0
br flag

this worked for me:

- cp /cdrom/script.sh /target/root/
- curtin in-target --target=/target -- chmod +x /root/script.sh
- curtin in-target --target=/target -- bash /root/script.sh
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.