I have a lot of installs to manage, so I wrote some python that generates my USER-DATA. At the beginning of my early and late commands, I create a log dir. I have a list of scripts for early and late install from a template that, similar to the script you posted, writes it's output to the log files and can better handle errors, etc. Each of these scripts are base64 encoded by my python script then written as a set of commands to USER-DATA something like:
I have a lot of installs to manage, so I wrote some python that generates my USER-DATA. At the beginning of my early and late commands, I create a log dir. I have a list of scripts for early and late install from a template that, similar to the script you posted, writes it's output to the log files and can better handle errors, etc. Each of these scripts are base64 encoded by my python script then written as a set of commands to USER-DATA something like:
``` var/log/ installer/ custom /installer /target/installer gKClNDUklQVD0iJ ChiYXNlbmFtZSAi JHswfSIpIgpMT0d fRElSPScvdmFyL2 xvZy9pbnN0YWxlc i9jdXN0b20nCkxP Rz0iJHtMT0dfREl SfS8ke1NDUklQVH 0iCgpmdW5jdGlvb iBsb2coKSB7CiAg cHJpbnRmICclcyA lczogJXNcbicgIi RTQ1JJUFQiICIkK GRhdGUgJyslWSVt JWQgJUglTSVTJyk iICIkMSIgPiAiJE xPRyIKfQoKZG9fc 29tZXRoaW5nIDI+ JjEgfCB3aGlsZSB yZWFkIGxpbmU7IG RvIGxvZyAiJGxpb mUiOyBkb25lCg= =' > /installer/ test.sh. b64 test.sh. b64 > /target/ installer/ test.sh
late-commands:
- mkdir -p /target/
- echo Running test.sh
- printf 'IyEvYmluL2Jhc2
- base64 -d < /installer/
- curtin in-target --target /target -- /installer/test.sh
```