diff options
author | Maxim Devaev <[email protected]> | 2024-09-08 01:35:11 +0300 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2024-09-08 01:35:11 +0300 |
commit | aa1ca3b32953498a427f6e0c36f2f46014394324 (patch) | |
tree | b0088281cece9e0c054d2988479f60b01f72b1b6 /scripts/kvmd-bootconfig | |
parent | 508d5fe606977d0447bd6bc1dc2048191b7f242f (diff) |
Serial number to uppercase, more info in Avahi
Diffstat (limited to 'scripts/kvmd-bootconfig')
-rwxr-xr-x | scripts/kvmd-bootconfig | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/scripts/kvmd-bootconfig b/scripts/kvmd-bootconfig index 06f41dbb..c2fc5c6f 100755 --- a/scripts/kvmd-bootconfig +++ b/scripts/kvmd-bootconfig @@ -50,16 +50,21 @@ fi # shellcheck disable=SC1090 source <(dos2unix < /boot/pikvm.txt) +# shellcheck disable=SC1091 +source /usr/share/kvmd/platform || true + rw # ========== First boot and/or Avahi configuration ========== make_avahi_service() { + local _base local _serial - _serial=$(tr -d '\0' < /proc/device-tree/serial-number || echo "0000000000000000") - local _model - _model=$(tr -d '\0' < /proc/device-tree/model || echo "Unknown model") + local _platform + _base=$(tr -d '\0' < /proc/device-tree/model || echo "Unknown base") + _serial=$( (cat /proc/device-tree/serial-number || echo "0000000000000000") | tr -d '\0' | tr '[:lower:]' '[:upper:]') + _platform="$PIKVM_MODEL-$PIKVM_VIDEO-$PIKVM_BOARD" mkdir -p /etc/avahi/services cat <<end_of_file > /etc/avahi/services/pikvm.service <?xml version="1.0" standalone='no'?> @@ -72,8 +77,12 @@ make_avahi_service() { <txt-record>path=/</txt-record> <txt-record>protocol=https</txt-record> <txt-record>description=PiKVM Web Server</txt-record> + <txt-record>model=$PIKVM_MODEL</txt-record> + <txt-record>video=$PIKVM_VIDEO</txt-record> + <txt-record>board=$PIKVM_BOARD</txt-record> + <txt-record>base=$_base</txt-record> <txt-record>serial=$_serial</txt-record> - <txt-record>model=$_model</txt-record> + <txt-record>platform=$_platform</txt-record> </service> <service> <type>_https._tcp</type> @@ -81,8 +90,12 @@ make_avahi_service() { <txt-record>path=/</txt-record> <txt-record>protocol=https</txt-record> <txt-record>description=PiKVM Web Server</txt-record> + <txt-record>model=$PIKVM_MODEL</txt-record> + <txt-record>video=$PIKVM_VIDEO</txt-record> + <txt-record>board=$PIKVM_BOARD</txt-record> + <txt-record>base=$_base</txt-record> <txt-record>serial=$_serial</txt-record> - <txt-record>model=$_model</txt-record> + <txt-record>model=$_platform</txt-record> </service> </service-group> end_of_file |