From 533a4cab7e24856830e98c812d1b111e51715294 Mon Sep 17 00:00:00 2001 From: "Gerd v. Egidy" Date: Fri, 5 Aug 2022 22:05:02 +0200 Subject: [PATCH] add cow_label and cow_directory options to the global scope of the yaml config file Allows to set to set the persistent backing store options via the yaml config too and not only through boot commandline options. --- airootfs/usr/bin/sysrescue-configuration.lua | 2 ++ patches/archiso-v43-07-yaml-config.patch | 23 +++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/airootfs/usr/bin/sysrescue-configuration.lua b/airootfs/usr/bin/sysrescue-configuration.lua index 255ee9d..2518b1f 100755 --- a/airootfs/usr/bin/sysrescue-configuration.lua +++ b/airootfs/usr/bin/sysrescue-configuration.lua @@ -264,6 +264,8 @@ end cmdline_options = { ['copytoram'] = "global", + ['cow_label'] = "global", + ['cow_directory'] = "global", ['checksum'] = "global", ['loadsrm'] = "global", ['dostartx'] = "global", diff --git a/patches/archiso-v43-07-yaml-config.patch b/patches/archiso-v43-07-yaml-config.patch index e7d9adc..5fe1b4b 100644 --- a/patches/archiso-v43-07-yaml-config.patch +++ b/patches/archiso-v43-07-yaml-config.patch @@ -2,7 +2,7 @@ diff --git a/archiso/initcpio/hooks/archiso b/archiso/initcpio/hooks/archiso index 853652e..53215eb 100644 --- a/archiso/initcpio/hooks/archiso +++ b/archiso/initcpio/hooks/archiso -@@ -197,6 +197,39 @@ archiso_mount_handler() { +@@ -197,6 +197,60 @@ fi fi @@ -39,6 +39,27 @@ index 853652e..53215eb 100644 + fi + done + ++ # read string values set by YAML config, only handle non-empty strings ++ for curentry in "cow_label" "cow_directory" ++ do ++ if value=$(jq --raw-output ".global.${curentry} // empty | tostring" ${jsonconfig} 2>/dev/null) ++ then ++ if [[ -n "${value}" ]] ; then ++ eval "${curentry}='${value}'" ++ fi ++ fi ++ done ++ ++ # redo handling of cow_label, it could have changed due to yaml config ++ if [[ -n "${cow_label}" ]]; then ++ cow_device="/dev/disk/by-label/${cow_label}" ++ [[ -z "${cow_persistent}" ]] && cow_persistent="P" ++ elif [[ -n "${cow_device}" ]]; then ++ [[ -z "${cow_persistent}" ]] && cow_persistent="P" ++ else ++ cow_persistent="N" ++ fi ++ if [[ "${checksum}" == "y" ]]; then if [[ -f "/run/archiso/bootmnt/${archisobasedir}/${arch}/airootfs.sha512" ]]; then msg -n ":: Self-test requested, please wait..."