mirror of
https://github.com/nchevsky/systemrescue-zfs.git
synced 2025-12-06 07:12:01 +01:00
Merge branch 'sysctl-yaml' into 'main'
Add sysctl option to the "sysconfig" scope of YAML config file See merge request systemrescue/systemrescue-sources!236
This commit is contained in:
commit
ae5707d9c3
|
|
@ -321,6 +321,23 @@ if 'sysconfig' in config and 'ca-trust' in config['sysconfig'] and config['sysco
|
|||
with open(firefox_policy_path, "w", encoding='utf-8') as polfile:
|
||||
json.dump(ff_policy, polfile, ensure_ascii=False, indent=2)
|
||||
|
||||
# ==============================================================================
|
||||
# customize sysctl
|
||||
# ==============================================================================
|
||||
|
||||
if 'sysconfig' in config and 'sysctl' in config['sysconfig'] and \
|
||||
config['sysconfig']['sysctl'] and isinstance(config['sysconfig']['sysctl'], dict):
|
||||
print(f"====> Customizing sysctl options ...")
|
||||
sysctllines = ""
|
||||
for key, value in config['sysconfig']['sysctl'].items():
|
||||
sysctllines+=f"{key} = {value}\n"
|
||||
|
||||
# pipe config into sysctl
|
||||
p = subprocess.run(["sysctl", "--load=-"], text=True, input=sysctllines)
|
||||
if p.returncode is not 0:
|
||||
print (f"Some or all sysctl options couldn't be set")
|
||||
errcnt+=1
|
||||
|
||||
# ==============================================================================
|
||||
# late-load a SystemRescueModule (SRM)
|
||||
# ==============================================================================
|
||||
|
|
|
|||
Loading…
Reference in a new issue