diff --git a/utils/persistent-vars-storage-bcm2711/files/sbin/persistent_vars_storage.sh b/utils/persistent-vars-storage-bcm2711/files/sbin/persistent_vars_storage.sh index 8fbf55a..92dc25f 100755 --- a/utils/persistent-vars-storage-bcm2711/files/sbin/persistent_vars_storage.sh +++ b/utils/persistent-vars-storage-bcm2711/files/sbin/persistent_vars_storage.sh @@ -20,10 +20,12 @@ get_key_from_persistent_storage() print_usage() { - echo "persistent_vars_storage.sh OPERATION(READ|WRITE|ERASE) KEY [VALUE]" 1>&2; + echo "persistent_vars_storage.sh OPERATION(READ|READALL|WRITE|ERASE) KEY [VALUE]" 1>&2; } - +all_keys="device_password default_wifi_key dpp_priv_key mm_region + mm_virtual_wire mm_mode dropbear_authorized_keys dropbear_ed25519_host_key + dropbear_rsa_host_key" case "$operation" in READ) @@ -38,6 +40,12 @@ case "$operation" in fi ;; + READALL) + for key in $all_keys; do + printf '%s=%s\n' "$key" "$($0 READ "$key")" + done + ;; + WRITE|ERASE) echo "Writing to persistent memory isn't implemented on bcm2711, yet." 1>&2; exit 1 @@ -49,5 +57,3 @@ case "$operation" in ;; esac - - diff --git a/utils/persistent-vars-storage-ubootenv/files/sbin/persistent_vars_storage.sh b/utils/persistent-vars-storage-ubootenv/files/sbin/persistent_vars_storage.sh index fe1b955..58ad436 100755 --- a/utils/persistent-vars-storage-ubootenv/files/sbin/persistent_vars_storage.sh +++ b/utils/persistent-vars-storage-ubootenv/files/sbin/persistent_vars_storage.sh @@ -9,7 +9,7 @@ trap exit_handler EXIT exit_handler() { if [ "$?" -ne 0 ]; then - echo "Usage: $0 OPERATION(READ|WRITE|ERASE) KEY [VALUE]" 1>&2 + echo "Usage: $0 OPERATION(READ|READALL|WRITE|ERASE) KEY [VALUE]" 1>&2 exit 1 fi } @@ -82,6 +82,10 @@ fi operation="$1" key="$2" +all_keys="device_password default_wifi_key dpp_priv_key mm_region + mm_virtual_wire mm_mode dropbear_authorized_keys dropbear_ed25519_host_key + dropbear_rsa_host_key" + case "$operation" in READ) if ! fw_printenv -n -c "$conffile" "$key" 2> /dev/null; then @@ -91,6 +95,12 @@ case "$operation" in fi ;; + READALL) + for key in $all_keys; do + printf '%s=%s\n' "$key" "$($0 READ "$key")" + done + ;; + WRITE) value="$3" fw_setenv -c "$conffile" "$key" "$value"