diff --git a/platform/marvell-armhf/sonic-platform-et6448m/entropy.py b/platform/marvell-armhf/sonic-platform-et6448m/entropy.py index debc8f2db..338e2ad9b 100644 --- a/platform/marvell-armhf/sonic-platform-et6448m/entropy.py +++ b/platform/marvell-armhf/sonic-platform-et6448m/entropy.py @@ -1,6 +1,7 @@ #!/usr/bin/python import fcntl, struct import time +from os import path RNDADDENTROPY=0x40085203 @@ -8,10 +9,11 @@ def avail(): with open("/proc/sys/kernel/random/entropy_avail", mode='r') as avail: return int(avail.read()) -while 1: - while avail() < 2048: - with open('/dev/urandom', 'rb') as urnd, open("/dev/random", mode='wb') as rnd: - d = urnd.read(512) - t = struct.pack('ii', 4 * len(d), len(d)) + d - fcntl.ioctl(rnd, RNDADDENTROPY, t) - time.sleep(30) +if path.exists("/proc/sys/kernel/random/entropy_avail"): + while 1: + while avail() < 2048: + with open('/dev/urandom', 'rb') as urnd, open("/dev/random", mode='wb') as rnd: + d = urnd.read(512) + t = struct.pack('ii', 4 * len(d), len(d)) + d + fcntl.ioctl(rnd, RNDADDENTROPY, t) + time.sleep(30) diff --git a/platform/marvell-armhf/sonic-platform-et6448m/inband_mgmt.sh b/platform/marvell-armhf/sonic-platform-et6448m/inband_mgmt.sh index 1295c52a0..3d3d77abe 100644 --- a/platform/marvell-armhf/sonic-platform-et6448m/inband_mgmt.sh +++ b/platform/marvell-armhf/sonic-platform-et6448m/inband_mgmt.sh @@ -10,6 +10,9 @@ inband_mgmt(){ # order. # NOTE: In the nokia platform the following sequence is performed by the Nokia # platform service init script and thus should not be performed here + if [ ! -f /host/machine.conf ]; then + exit 0 + fi grep ^onie_platform /host/machine.conf 2>/dev/null | grep nokia >/dev/null if [ $? != 0 ]; then rmmod i2c-dev