[initcpiocfg] Allow alternate source file
This is possibly only interesting for testing purposes.
This commit is contained in:
parent
19b0f28f16
commit
f651fc9bff
@ -28,3 +28,11 @@ hooks:
|
|||||||
prepend: [ bogus ]
|
prepend: [ bogus ]
|
||||||
append: [ bogus ]
|
append: [ bogus ]
|
||||||
remove: [ 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"
|
||||||
|
@ -14,3 +14,4 @@ properties:
|
|||||||
prepend: { type: array, items: string }
|
prepend: { type: array, items: string }
|
||||||
append: { type: array, items: string }
|
append: { type: array, items: string }
|
||||||
remove: { type: array, items: string }
|
remove: { type: array, items: string }
|
||||||
|
source: { type: string }
|
||||||
|
@ -97,7 +97,7 @@ def get_host_initcpio():
|
|||||||
the lines from that file, or an empty list if it does
|
the lines from that file, or an empty list if it does
|
||||||
not exist.
|
not exist.
|
||||||
"""
|
"""
|
||||||
hostfile = "/etc/mkinitcpio.conf"
|
hostfile = libcalamares.job.configuration.get("source", None) or "/etc/mkinitcpio.conf"
|
||||||
try:
|
try:
|
||||||
with open(hostfile, "r") as mkinitcpio_file:
|
with open(hostfile, "r") as mkinitcpio_file:
|
||||||
mklins = [x.strip() for x in mkinitcpio_file.readlines()]
|
mklins = [x.strip() for x in mkinitcpio_file.readlines()]
|
||||||
|
Loading…
Reference in New Issue
Block a user