diff --git a/src/modules/initcpiocfg/initcpiocfg.conf b/src/modules/initcpiocfg/initcpiocfg.conf index 281767026..a66039397 100644 --- a/src/modules/initcpiocfg/initcpiocfg.conf +++ b/src/modules/initcpiocfg/initcpiocfg.conf @@ -28,3 +28,11 @@ hooks: prepend: [ bogus ] append: [ bogus ] remove: [ bogus ] + +# +# In some cases, you may want to use a different source +# file than /etc/mkinitcpio.conf , e.g. because the live system +# does not match the target in a useful way. If unset or +# empty, defaults to /etc/mkinitcpio.conf +# +source: "/etc/mkinitcpio.conf" diff --git a/src/modules/initcpiocfg/initcpiocfg.schema.yaml b/src/modules/initcpiocfg/initcpiocfg.schema.yaml index 487da529f..5595b6093 100644 --- a/src/modules/initcpiocfg/initcpiocfg.schema.yaml +++ b/src/modules/initcpiocfg/initcpiocfg.schema.yaml @@ -14,3 +14,4 @@ properties: prepend: { type: array, items: string } append: { type: array, items: string } remove: { type: array, items: string } + source: { type: string } diff --git a/src/modules/initcpiocfg/main.py b/src/modules/initcpiocfg/main.py index bbc403a9c..a70d4ffe9 100644 --- a/src/modules/initcpiocfg/main.py +++ b/src/modules/initcpiocfg/main.py @@ -97,7 +97,7 @@ def get_host_initcpio(): the lines from that file, or an empty list if it does not exist. """ - hostfile = "/etc/mkinitcpio.conf" + hostfile = libcalamares.job.configuration.get("source", None) or "/etc/mkinitcpio.conf" try: with open(hostfile, "r") as mkinitcpio_file: mklins = [x.strip() for x in mkinitcpio_file.readlines()]