Move template files to /usr/share/sonic/templates (#305)
This commit is contained in:
parent
81d7119c57
commit
073c28bf15
@ -13,7 +13,7 @@ RUN apt-get -y install isc-dhcp-relay
|
||||
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y
|
||||
RUN rm -rf /debs
|
||||
|
||||
COPY ["isc-dhcp-relay.j2", "/usr/share/dhcp-relay/"]
|
||||
COPY ["isc-dhcp-relay.j2", "/usr/share/sonic/templates/"]
|
||||
COPY ["config.sh", "/usr/bin/"]
|
||||
|
||||
ENTRYPOINT /usr/bin/config.sh \
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
sonic-cfggen -m /etc/sonic/minigraph.xml -y /etc/sonic/dhcp_relay.yml -t /usr/share/dhcp-relay/isc-dhcp-relay.j2 > /etc/default/isc-dhcp-relay
|
||||
sonic-cfggen -m /etc/sonic/minigraph.xml -y /etc/sonic/dhcp_relay.yml -t /usr/share/sonic/templates/isc-dhcp-relay.j2 > /etc/default/isc-dhcp-relay
|
||||
|
||||
|
@ -22,7 +22,7 @@ debs/{{ deb }}{{' '}}
|
||||
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y
|
||||
RUN rm -rf /debs
|
||||
|
||||
COPY ["*.j2", "/etc/swss/bgp/"]
|
||||
COPY ["*.j2", "/usr/share/sonic/templates/"]
|
||||
COPY ["start.sh", "config.sh", "/usr/bin/"]
|
||||
COPY ["daemons", "/etc/quagga/"]
|
||||
|
||||
|
@ -1,14 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
mkdir -p /etc/quagga
|
||||
sonic-cfggen -m /etc/sonic/minigraph.xml -t /etc/swss/bgp/bgpd.conf.j2 >/etc/quagga/bgpd.conf
|
||||
sonic-cfggen -m /etc/sonic/minigraph.xml -t /etc/swss/bgp/zebra.conf.j2 >/etc/quagga/zebra.conf
|
||||
sonic-cfggen -m /etc/sonic/minigraph.xml -t /usr/share/sonic/templates/bgpd.conf.j2 >/etc/quagga/bgpd.conf
|
||||
sonic-cfggen -m /etc/sonic/minigraph.xml -t /usr/share/sonic/templates/zebra.conf.j2 >/etc/quagga/zebra.conf
|
||||
|
||||
sonic-cfggen -m /etc/sonic/minigraph.xml -t /etc/swss/bgp/isolate.j2 >/usr/sbin/bgp-isolate
|
||||
sonic-cfggen -m /etc/sonic/minigraph.xml -t /usr/share/sonic/templates/isolate.j2 >/usr/sbin/bgp-isolate
|
||||
chown root:root /usr/sbin/bgp-isolate
|
||||
chmod 0755 /usr/sbin/bgp-isolate
|
||||
|
||||
sonic-cfggen -m /etc/sonic/minigraph.xml -t /etc/swss/bgp/unisolate.j2 >/usr/sbin/bgp-unisolate
|
||||
sonic-cfggen -m /etc/sonic/minigraph.xml -t /usr/share/sonic/templates/unisolate.j2 >/usr/sbin/bgp-unisolate
|
||||
chown root:root /usr/sbin/bgp-unisolate
|
||||
chmod 0755 /usr/sbin/bgp-unisolate
|
||||
|
||||
|
@ -31,7 +31,7 @@ RUN pip install /python-wheels/sswsdk-2.0.1-py2-none-any.whl && \
|
||||
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||
COPY reconfigure.sh /opt/reconfigure.sh
|
||||
COPY ["config.sh", "/usr/bin/"]
|
||||
COPY ["lldpd.conf.j2", "/etc/swss/lldp/"]
|
||||
COPY ["lldpd.conf.j2", "/usr/share/sonic/templates/"]
|
||||
COPY ["lldpd", "/etc/default/"]
|
||||
|
||||
ENTRYPOINT /usr/bin/config.sh && /usr/bin/supervisord
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
sonic-cfggen -m /etc/sonic/minigraph.xml -t /etc/swss/lldp/lldpd.conf.j2 >/etc/lldpd.conf
|
||||
sonic-cfggen -m /etc/sonic/minigraph.xml -t /usr/share/sonic/templates/lldpd.conf.j2 >/etc/lldpd.conf
|
||||
|
||||
mkdir -p /var/sonic
|
||||
echo "# Config files managed by sonic-config-engine" >/var/sonic/config_status
|
||||
|
@ -41,7 +41,7 @@ RUN apt-get update && apt-get install -y supervisor \
|
||||
rm -rf ~/.cache
|
||||
|
||||
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||
COPY ["*.j2", "/etc/swss/snmp/"]
|
||||
COPY ["*.j2", "/usr/share/sonic/templates/"]
|
||||
COPY ["config.sh", "/usr/bin/"]
|
||||
|
||||
## Although exposing ports is not need for host net mode, keep it for possible bridge mode
|
||||
|
@ -2,11 +2,11 @@
|
||||
|
||||
mkdir -p /etc/ssw
|
||||
|
||||
sonic-cfggen -m /etc/sonic/minigraph.xml -y /etc/sonic/sonic_version.yml -t /etc/swss/snmp/sysDescription.j2 >/etc/ssw/sysDescription
|
||||
sonic-cfggen -m /etc/sonic/minigraph.xml -y /etc/sonic/sonic_version.yml -t /usr/share/sonic/templates/sysDescription.j2 >/etc/ssw/sysDescription
|
||||
|
||||
mkdir -p /etc/snmp
|
||||
|
||||
sonic-cfggen -m /etc/sonic/minigraph.xml -y /etc/sonic/snmp.yml -t /etc/swss/snmp/snmpd.conf.j2 >/etc/snmp/snmpd.conf
|
||||
sonic-cfggen -m /etc/sonic/minigraph.xml -y /etc/sonic/snmp.yml -t /usr/share/sonic/templates/snmpd.conf.j2 >/etc/snmp/snmpd.conf
|
||||
|
||||
hwsku=`sonic-cfggen -m /etc/sonic/minigraph.xml -v minigraph_hwsku`
|
||||
/bin/cp -rf /usr/share/sonic/$hwsku/alias_map.json /etc/snmp/
|
||||
|
@ -14,7 +14,7 @@ debs/{{ deb }}{{' '}}
|
||||
{%- endfor %}
|
||||
|
||||
COPY ["start.sh", "config.sh", "/usr/bin/"]
|
||||
COPY ["teamd.j2", "/etc/swss/teamd/"]
|
||||
COPY ["teamd.j2", "/usr/share/sonic/templates"]
|
||||
|
||||
## Make apt-get non-interactive
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
@ -3,7 +3,7 @@
|
||||
mkdir -p /etc/teamd
|
||||
|
||||
for pc in `sonic-cfggen -m /etc/sonic/minigraph.xml --var-keys minigraph_portchannel_interfaces`; do
|
||||
sonic-cfggen -m /etc/sonic/minigraph.xml -a '{"pc":"'$pc'"}' -t /etc/swss/teamd/teamd.j2 >/etc/teamd/$pc.conf
|
||||
sonic-cfggen -m /etc/sonic/minigraph.xml -a '{"pc":"'$pc'"}' -t /usr/share/sonic/templates/teamd.j2 >/etc/teamd/$pc.conf
|
||||
done
|
||||
|
||||
mkdir -p /var/sonic
|
||||
|
@ -59,7 +59,7 @@ sudo dpkg --root=$FILESYSTEM_ROOT -i target/debs/sonic-utilities_*.deb || \
|
||||
|
||||
# Create all needed directories
|
||||
sudo mkdir -p $FILESYSTEM_ROOT/etc/sonic/
|
||||
sudo mkdir -p $FILESYSTEM_ROOT/etc/sonic/templates/
|
||||
sudo mkdir -p $FILESYSTEM_ROOT/usr/share/sonic/templates/
|
||||
|
||||
# Apply apt configuration files
|
||||
sudo cp $IMAGE_CONFIGS/apt/sources.list $FILESYSTEM_ROOT/etc/apt/
|
||||
@ -77,14 +77,14 @@ sudo cp $IMAGE_CONFIGS/minigraph/minigraph_{{sonic_hwsku}}.xml $FILESYSTEM_ROOT/
|
||||
sudo cp $IMAGE_CONFIGS/ntp/ntp-config.service $FILESYSTEM_ROOT/etc/systemd/system/
|
||||
sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable ntp-config.service
|
||||
sudo cp $IMAGE_CONFIGS/ntp/ntp-config.sh $FILESYSTEM_ROOT/usr/bin/
|
||||
sudo cp $IMAGE_CONFIGS/ntp/ntp.conf.j2 $FILESYSTEM_ROOT/etc/sonic/templates/
|
||||
sudo cp $IMAGE_CONFIGS/ntp/ntp.conf.j2 $FILESYSTEM_ROOT/usr/share/sonic/templates/
|
||||
sudo cp $IMAGE_CONFIGS/ntp/ntp.yml $FILESYSTEM_ROOT/etc/sonic/
|
||||
|
||||
# Copy rsyslog configuration files and templates
|
||||
sudo cp $IMAGE_CONFIGS/rsyslog/rsyslog-config.service $FILESYSTEM_ROOT/etc/systemd/system/
|
||||
sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable rsyslog-config.service
|
||||
sudo cp $IMAGE_CONFIGS/rsyslog/rsyslog-config.sh $FILESYSTEM_ROOT/usr/bin/
|
||||
sudo cp $IMAGE_CONFIGS/rsyslog/rsyslog.conf.j2 $FILESYSTEM_ROOT/etc/sonic/templates/
|
||||
sudo cp $IMAGE_CONFIGS/rsyslog/rsyslog.conf.j2 $FILESYSTEM_ROOT/usr/share/sonic/templates/
|
||||
sudo cp $IMAGE_CONFIGS/rsyslog/rsyslog.yml $FILESYSTEM_ROOT/etc/sonic/
|
||||
sudo cp $IMAGE_CONFIGS/rsyslog/rsyslog.d/* $FILESYSTEM_ROOT/etc/rsyslog.d/
|
||||
|
||||
@ -92,7 +92,7 @@ sudo cp $IMAGE_CONFIGS/rsyslog/rsyslog.d/* $FILESYSTEM_ROOT/etc/rsyslog.d/
|
||||
sudo cp $IMAGE_CONFIGS/interfaces/interfaces-config.service $FILESYSTEM_ROOT/etc/systemd/system/
|
||||
sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable interfaces-config.service
|
||||
sudo cp $IMAGE_CONFIGS/interfaces/interfaces-config.sh $FILESYSTEM_ROOT/usr/bin/
|
||||
sudo cp $IMAGE_CONFIGS/interfaces/*.j2 $FILESYSTEM_ROOT/etc/sonic/templates/
|
||||
sudo cp $IMAGE_CONFIGS/interfaces/*.j2 $FILESYSTEM_ROOT/usr/share/sonic/templates/
|
||||
|
||||
# Copy initial interfaces configuration file, will be overwritten on first boot
|
||||
sudo cp $IMAGE_CONFIGS/interfaces/init_interfaces $FILESYSTEM_ROOT/etc/network
|
||||
|
@ -1,8 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
sonic-cfggen -m /etc/sonic/minigraph.xml -t /etc/sonic/templates/interfaces.j2 >/etc/network/interfaces
|
||||
sonic-cfggen -m /etc/sonic/minigraph.xml -t /etc/sonic/templates/vlan_interfaces.j2 >/etc/network/interfaces.d/vlan_interfaces
|
||||
sonic-cfggen -m /etc/sonic/minigraph.xml -t /etc/sonic/templates/lag_interfaces.j2 >/etc/network/interfaces.d/lag_interfaces
|
||||
sonic-cfggen -m /etc/sonic/minigraph.xml -t /usr/share/sonic/templates/interfaces.j2 >/etc/network/interfaces
|
||||
sonic-cfggen -m /etc/sonic/minigraph.xml -t /usr/share/sonic/templates/vlan_interfaces.j2 >/etc/network/interfaces.d/vlan_interfaces
|
||||
sonic-cfggen -m /etc/sonic/minigraph.xml -t /usr/share/sonic/templates/lag_interfaces.j2 >/etc/network/interfaces.d/lag_interfaces
|
||||
ifdown eth0 && ifup eth0
|
||||
ifdown lo && ifup lo
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
sonic-cfggen -m /etc/sonic/minigraph.xml -y /etc/sonic/ntp.yml -t /etc/sonic/templates/ntp.conf.j2 >/etc/ntp.conf
|
||||
sonic-cfggen -m /etc/sonic/minigraph.xml -y /etc/sonic/ntp.yml -t /usr/share/sonic/templates/ntp.conf.j2 >/etc/ntp.conf
|
||||
|
@ -1,3 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
sonic-cfggen -m /etc/sonic/minigraph.xml -y /etc/sonic/rsyslog.yml -t /etc/sonic/templates/rsyslog.conf.j2 >/etc/rsyslog.conf
|
||||
sonic-cfggen -m /etc/sonic/minigraph.xml -y /etc/sonic/rsyslog.yml -t /usr/share/sonic/templates/rsyslog.conf.j2 >/etc/rsyslog.conf
|
||||
|
Loading…
Reference in New Issue
Block a user