mirror of
https://github.com/nchevsky/systemrescue-zfs.git
synced 2026-03-14 08:33:51 +01:00
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.
This commit is contained in:
parent
b85260c377
commit
533a4cab7e
|
|
@ -264,6 +264,8 @@ end
|
|||
|
||||
cmdline_options = {
|
||||
['copytoram'] = "global",
|
||||
['cow_label'] = "global",
|
||||
['cow_directory'] = "global",
|
||||
['checksum'] = "global",
|
||||
['loadsrm'] = "global",
|
||||
['dostartx'] = "global",
|
||||
|
|
|
|||
|
|
@ -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..."
|
||||
|
|
|
|||
Loading…
Reference in a new issue