Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ nokia-7215_plt_setup.sh usr/sbin
7215/service/nokia-7215init.service etc/systemd/system
7215/sonic_platform-1.0-py2-none-any.whl usr/share/sonic/device/armhf-nokia_ixs7215_52x-r0
7215/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/armhf-nokia_ixs7215_52x-r0
entropy.py etc/
inband_mgmt.sh etc/
19 changes: 19 additions & 0 deletions platform/marvell-armhf/sonic-platform-nokia/entropy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/python
import fcntl, struct
import time
from os import path

RNDADDENTROPY=0x40085203

def avail():
with open("/proc/sys/kernel/random/entropy_avail", mode='r') as avail:
return int(avail.read())

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)
28 changes: 28 additions & 0 deletions platform/marvell-armhf/sonic-platform-nokia/inband_mgmt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/sh

#inband_mgmt

inband_mgmt(){
# In this platform, one of the network ports is used as mgmt interface.
# This script periodically monitors inband management port eth0 and
# assigns IP address to eth0 if needed.
if [ ! -f /host/machine.conf ]; then
exit 0
fi
#wait for n/w port init to complete
sleep 60
while :; do
ip -br link show eth0 2> /dev/null
if [ $? -eq 0 ]; then
ip address show eth0 | grep -qw "inet" 2>/dev/null
if [ $? -ne 0 ]; then
ifconfig eth0 down
systemctl restart networking
fi
sleep 120
else
sleep 3
fi
done
}
(inband_mgmt > /dev/null)&
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ main()
{
fw_uboot_env_cfg
echo "Nokia-IXS7215: /dev/mtd0 FW_ENV_DEFAULT"

python /etc/entropy.py &
/bin/sh /etc/inband_mgmt.sh
}

main $@