[hwsku-init] Introduce mechanism to run HWSKU specific initialization code (#2072)

When there is HWSKU specific initialization needs to be performed, please
add hwsku-init script under device folder, it will be invoked by swss
before any subsequent initializations.

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
This commit is contained in:
Ying Xie 2018-09-24 14:56:37 -07:00 committed by Guohan Lu
parent 9b2a5943bd
commit 542b4332c8

View File

@ -6,6 +6,11 @@ sonic-cfggen -d -t /usr/share/sonic/templates/switch.json.j2 > /etc/swss/config.
sonic-cfggen -d -t /usr/share/sonic/templates/ipinip.json.j2 > /etc/swss/config.d/ipinip.json
sonic-cfggen -d -t /usr/share/sonic/templates/ports.json.j2 > /etc/swss/config.d/ports.json
# Executed HWSKU specific initialization tasks.
if [ -x /usr/share/sonic/hwsku/hwsku-init ]; then
/usr/share/sonic/hwsku/hwsku-init
fi
export platform=`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`
rm -f /var/run/rsyslogd.pid