2017-05-08 17:43:31 -05:00
|
|
|
#!/usr/bin/env bash
|
2022-03-10 00:11:38 -06:00
|
|
|
HWSKU_DIR=/usr/share/sonic/hwsku
|
2016-10-27 20:02:32 -05:00
|
|
|
|
|
|
|
start_bcm()
|
|
|
|
{
|
|
|
|
[ -e /dev/linux-bcm-knet ] || mknod /dev/linux-bcm-knet c 122 0
|
|
|
|
[ -e /dev/linux-user-bde ] || mknod /dev/linux-user-bde c 126 0
|
|
|
|
[ -e /dev/linux-kernel-bde ] || mknod /dev/linux-kernel-bde c 127 0
|
|
|
|
}
|
|
|
|
|
2022-03-10 00:11:38 -06:00
|
|
|
generate_profile()
|
|
|
|
{
|
|
|
|
# There are two ways to specify the contents of the SAI_INIT_CONFIG_FILE and they are mutually exclusive
|
|
|
|
# via current method (sai.profile.j2) or new method (config.bcm.j2)
|
|
|
|
# If delta is large, use sai.profile.j2 which basically require the user to select which config file to use
|
|
|
|
# If delta is small, use config.bcm.j2 where additional SAI INIT config properties are added
|
|
|
|
# based on specific device metadata requirement
|
|
|
|
# in this case sai.profile should have been modified to use the path /etc/sai.d/config.bcm
|
|
|
|
# There is also a possibility that both sai.profile.j2 and config.bcm.j2 are absent. in that cacse just copy
|
|
|
|
# sai.profile to the new /etc/said directory.
|
|
|
|
|
|
|
|
# Create/Copy the sai.profile to /etc/sai.d/sai.profile
|
|
|
|
mkdir -p /etc/sai.d/
|
|
|
|
|
|
|
|
if [ -f $HWSKU_DIR/sai.profile.j2 ]; then
|
|
|
|
sonic-cfggen -d -t $HWSKU_DIR/sai.profile.j2 > /etc/sai.d/sai.profile
|
|
|
|
else
|
|
|
|
if [ -f $HWSKU_DIR/config.bcm.j2 ]; then
|
|
|
|
sonic-cfggen -d -t $HWSKU_DIR/config.bcm.j2 > /etc/sai.d/config.bcm
|
|
|
|
fi
|
|
|
|
if [ -f $HWSKU_DIR/sai.profile ]; then
|
|
|
|
cp $HWSKU_DIR/sai.profile /etc/sai.d/sai.profile
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
2016-10-27 20:02:32 -05:00
|
|
|
|
2017-03-29 20:07:25 -05:00
|
|
|
rm -f /var/run/rsyslogd.pid
|
2017-05-08 17:43:31 -05:00
|
|
|
|
|
|
|
supervisorctl start rsyslogd
|
2016-10-27 20:02:32 -05:00
|
|
|
|
2022-03-10 00:11:38 -06:00
|
|
|
generate_profile
|
2016-10-27 20:02:32 -05:00
|
|
|
start_bcm
|
|
|
|
|
2017-05-08 17:43:31 -05:00
|
|
|
supervisorctl start saiserver
|