Comment 4 for bug 1905731

Revision history for this message
Ryan Harper (raharper) wrote :

@eoli3n

The late_commands run by curtin can support multi-line shell code. It's easiest to use yaml anchors to construct the script and then curtin in-target[1] command and expand the anchor.

A simple example:

_example:
  - &shellcmd |
    set -x
    command1
    command2

late_commands:
  01_run_shellcmd: ['curtin', 'in-target', '--', 'sh', '-c', *shellcmd]

A bigger example here:
https://git.launchpad.net/curtin/tree/examples/tests/apt_config_command.yaml

1. https://git.launchpad.net/curtin/tree/curtin/commands/in_target.py