mwhudson / livefs-editor

GNU General Public License v3.0
68 stars 31 forks source link

Allow to set the initrd-path using an environment variable #63

Closed ogayot closed 1 month ago

ogayot commented 1 month ago

When injecting a snap on an ISO that has multiple initrds (which define multiple layerfs-paths), having a way to select the initrd to use is convenient.

On Ubuntu 22.04 Server ISOs, we have a boot entry for "Ubuntu Server" and a second boot entry for "Ubuntu Server with HWE kernel". The entries respectively map to /casper/initrd and /casper/hwe-initrd.

Unconditionally injecting the snap using the layerfs-path from /casper/initrd makes it difficult to run ISO testing with the HWE kernel.

By making livefs-editor look for the presence of the INITRD_PATH variable (which we would set to /casper/hwe-initrd in our scenario), we have the opportunity to choose which boot entry is affected by the snap injection.

ogayot commented 1 month ago

I think ideally, we'd need a way to inject the snap in both layers ; which we can't do in a single livefs-editor invocation with this implementation. But I guess it's an improvement.