I have an ISO installation of ubuntu 18.04 which has a txt.cfg file in it.
the txt.cfg has 4 options in it, and a preseed file is selected based on the option chosen:
label option1
menu option1
kernel /install/vmlinuz
append file=/cdrom/option1.seed vga=788 initrd=/install/initrd.gz ...
label option2
menu option2
kernel /install/vmlinuz
append file=/cdrom/option2.seed vga=788 initrd=/install/initrd.gz ...
each of the seed files (in this example, option1.seed & option2.seed) sets up the partitions differently using d-i partman-auto/expert_recipe string.
Instead of the user having to choose the suitable partitioning option for him, I wrote a bash script which according to different parameters of the machine (CPU, RAM, etc..) can tell which option is suitable.
How can I run a bash script as part of the .cfg file or somewhere in the .seed file?
I saw usages of d-i preseed/late_command and d-i preseed/early_command but not sure how do use them.