mirror of
https://github.com/sipeed/LicheeRV-Nano-Build.git
synced 2026-09-11 05:09:56 -05:00
* fix cvi_base deadlock2
This commit is contained in:
@@ -2,6 +2,11 @@
|
||||
|
||||
if [ "$1" = "start" ]
|
||||
then
|
||||
# Cache uid to prevent deadlock during cvi_base operation
|
||||
if [ ! -e /boot/cvi_base_uid ]; then
|
||||
$(cat /sys/class/cvi-base/base_uid > /boot/cvi_base_uid)
|
||||
fi
|
||||
|
||||
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)
|
||||
|
||||
@@ -19,7 +19,11 @@ then
|
||||
prefix=$(cat /boot/hostname.prefix)
|
||||
fi
|
||||
old_hostname=$(cat /etc/hostname)
|
||||
new_hostname=${prefix}-$(sha512sum /sys/class/cvi-base/base_uid | head -c 4)
|
||||
if [ -e /boot/cvi_base_uid ]; then
|
||||
new_hostname=${prefix}-$(sha512sum /boot/cvi_base_uid | head -c 4)
|
||||
else
|
||||
new_hostname=${prefix}-$(sha512sum /sys/class/cvi-base/base_uid | head -c 4)
|
||||
fi
|
||||
|
||||
if [ -e /boot/hostname ]
|
||||
then
|
||||
@@ -38,7 +42,11 @@ then
|
||||
then
|
||||
new_ethmac=$(cat /boot/ethmac)
|
||||
else
|
||||
new_ethmac=$(hex2mac 48da356f$(sha512sum /sys/class/cvi-base/base_uid | head -c 4))
|
||||
if [ -e /boot/cvi_base_uid ]; then
|
||||
new_ethmac=$(hex2mac 48da356f$(sha512sum /boot/cvi_base_uid | head -c 4))
|
||||
else
|
||||
new_ethmac=$(hex2mac 48da356f$(sha512sum /sys/class/cvi-base/base_uid | head -c 4))
|
||||
fi
|
||||
fi
|
||||
|
||||
ifconfig eth0 down
|
||||
|
||||
Reference in New Issue
Block a user