elemental-toolkit icon indicating copy to clipboard operation
elemental-toolkit copied to clipboard

What is the execution order of substeps?

Open jjqq2013 opened this issue 6 months ago • 3 comments

There seems no documentation about the execution order of substeps such as files, commands.

I have done some experiments, turns out that there are some rules existing in the internal implementation, I hope we can add the rules to the documentation.

==> /oem/91_custom.yml <==
name: "====test====1"
stages:
  initramfs:
   - name: "test step1"
     files:
       - path: /etc/file1
         permissions: 644
         owner: 0
         group: 0
         content: "file1"
     commands:
       - ls /etc/file1 2>&1 > /etc/cmd1.out

==> /oem/92_custom.yml <==
name: "====test====2"
stages:
  initramfs:
   - name: "test step1 of test2"
     commands:
       - ls /etc/file2 2>&1 > /etc/cmd2.out
     files:
       - path: /etc/file2
         permissions: 644
         owner: 0
         group: 0
         content: "file2"

==> /etc/cmd1.out <==
/etc/file1

==> /etc/cmd2.out <==
/etc/file2

Regardless of the order of files and commands, the files is always executed before commands.

So I am wondering, what is the rule?

jjqq2013 avatar Jul 08 '25 03:07 jjqq2013