Files
NANOKVM-LicheeRV-Nano-Build…/buildroot/board/cvitek/SG200X/overlay/etc/init.d/S02devicekey
2025-01-14 11:03:07 +08:00

14 lines
372 B
Bash
Executable File

#!/bin/sh
if [ "$1" = "start" ]
then
str_value=$(cat /sys/class/cvi-base/base_uid | awk '{print $2}')
first_uint=$(echo $str_value | cut -d'_' -f1)
second_uint=$(echo $str_value | cut -d'_' -f2)
result="$first_uint$second_uint"
echo $result > /device_key
# for compatibility with previous network mac addr
cat /sys/class/cvi-base/base_uid > /device_key_legacy
fi