mirror of
https://github.com/nchevsky/systemrescue-zfs.git
synced 2026-03-04 12:03:52 +01:00
allow the same values for booleans during initramfs as in the python scripts
True values are 'y', 'yes', 't', 'true', 'on', '1', '1.0'; false values are 'n', 'no', 'f', 'false', 'off', '0', '0.0'.
This commit is contained in:
parent
e8cf327452
commit
b21ff875a7
|
|
@ -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,35 @@ archiso_mount_handler() {
|
||||
@@ -197,6 +197,39 @@ archiso_mount_handler() {
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
@ -21,12 +21,16 @@ index 853652e..53215eb 100644
|
|||
+ msg ":: Define early boot options based on the configuration ..."
|
||||
+ for curentry in "copytoram" "checksum" "loadsrm"
|
||||
+ do
|
||||
+ if value=$(jq --raw-output ".global.${curentry}" ${jsonconfig} 2>/dev/null)
|
||||
+ if value=$(jq --raw-output ".global.${curentry} | tostring | ascii_downcase" ${jsonconfig} 2>/dev/null)
|
||||
+ then
|
||||
+ if [[ "${value}" == 'true' ]]; then
|
||||
+ if [[ "${value}" == 'y' ]] || [[ "${value}" == 'yes' ]] || [[ "${value}" == 't' ]] || \
|
||||
+ [[ "${value}" == 'true' ]] || [[ "${value}" == 'on' ]] || [[ "${value}" == '1' ]] || \
|
||||
+ [[ "${value}" == '1.0' ]] ; then
|
||||
+ echo "Entry '.global.${curentry}' enabled in config: value='${value}'"
|
||||
+ eval "${curentry}='y'"
|
||||
+ elif [[ "${value}" == 'false' ]] || [[ "${value}" == 'null' ]]; then
|
||||
+ elif [[ "${value}" == 'n' ]] || [[ "${value}" == 'no' ]] || [[ "${value}" == 'f' ]] || \
|
||||
+ [[ "${value}" == 'false' ]] || [[ "${value}" == 'off' ]] || [[ "${value}" == '0' ]] || \
|
||||
+ [[ "${value}" == '0.0' ]] || [[ "${value}" == 'null' ]] ; then
|
||||
+ echo "Entry '.global.${curentry}' disabled in config: value='${value}'"
|
||||
+ else
|
||||
+ echo "ERROR: Found invalid value for '.global.${curentry}': value='${value}'"
|
||||
|
|
|
|||
Loading…
Reference in a new issue