[initcpiocfg] Make using systemd hook optional
This commit is contained in:
parent
741c7b75d8
commit
7fa8fa680c
11
src/modules/initcpiocfg/initcpiocfg.conf
Normal file
11
src/modules/initcpiocfg/initcpiocfg.conf
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# SPDX-FileCopyrightText: no
|
||||||
|
# SPDX-License-Identifier: CC0-1.0
|
||||||
|
#
|
||||||
|
# The initcpiocfg module is responsible for the configuration of mkinitcpio.conf. Typically this
|
||||||
|
# module is used in conjunction with the initcpio module to generate the boot image when using mkinitcpio
|
||||||
|
---
|
||||||
|
#
|
||||||
|
# Determines if the systemd versions of the hooks should be used. This is false by default.mkinitcpio
|
||||||
|
#
|
||||||
|
# Please note that using the systemd hooks result in no access to the emergency recovery shell
|
||||||
|
# useSystemdHook: false
|
11
src/modules/initcpiocfg/initcpiocfg.schema.yaml
Normal file
11
src/modules/initcpiocfg/initcpiocfg.schema.yaml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# SPDX-FileCopyrightText: 2023 Evan James <dalto@fastmail.com>
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
---
|
||||||
|
$schema: https://json-schema.org/schema#
|
||||||
|
$id: https://calamares.io/schemas/initcpiocfg
|
||||||
|
additionalProperties: false
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
useSystemdHook: { type: boolean }
|
||||||
|
|
||||||
|
|
@ -163,9 +163,12 @@ def find_initcpio_features(partitions, root_mount_point):
|
|||||||
"block",
|
"block",
|
||||||
"keyboard",
|
"keyboard",
|
||||||
]
|
]
|
||||||
uses_systemd = target_env_call(["sh", "-c", "which systemd-cat"]) == 0
|
|
||||||
|
|
||||||
if uses_systemd:
|
systemd_hook_allowed = libcalamares.job.configuration.get("useSystemdHook", False)
|
||||||
|
|
||||||
|
use_systemd = systemd_hook_allowed and target_env_call(["sh", "-c", "which systemd-cat"]) == 0
|
||||||
|
|
||||||
|
if use_systemd:
|
||||||
hooks.insert(0, "systemd")
|
hooks.insert(0, "systemd")
|
||||||
hooks.append("sd-vconsole")
|
hooks.append("sd-vconsole")
|
||||||
else:
|
else:
|
||||||
@ -224,7 +227,7 @@ def find_initcpio_features(partitions, root_mount_point):
|
|||||||
hooks.append("usr")
|
hooks.append("usr")
|
||||||
|
|
||||||
if encrypt_hook:
|
if encrypt_hook:
|
||||||
if uses_systemd:
|
if use_systemd:
|
||||||
hooks.append("sd-encrypt")
|
hooks.append("sd-encrypt")
|
||||||
else:
|
else:
|
||||||
hooks.append("encrypt")
|
hooks.append("encrypt")
|
||||||
|
Loading…
Reference in New Issue
Block a user