[platform]: remove sku from build parameter (#350)
different sku will be contained in a single one sonic image. no longer need to specify sku at the build time
This commit is contained in:
parent
903499000f
commit
0ed9b3ce28
2
.gitignore
vendored
2
.gitignore
vendored
@ -6,6 +6,8 @@
|
||||
fsroot/
|
||||
fs.*
|
||||
target/
|
||||
*.deb
|
||||
*.changes
|
||||
|
||||
# Subdirectories in src
|
||||
src/hiredis/*
|
||||
|
1
Makefile
1
Makefile
@ -36,7 +36,6 @@ DOCKER_BUILD = docker build --no-cache \
|
||||
-C sonic \
|
||||
-f slave.mk \
|
||||
PLATFORM=$(PLATFORM) \
|
||||
SKU=$(SKU) \
|
||||
DEBUG_BUILD=$(DEBUG_BUILD) \
|
||||
ENABLE_DHCP_GRAPH_SERVICE=$(ENABLE_DHCP_GRAPH_SERVICE) \
|
||||
$@
|
||||
|
10
README.md
10
README.md
@ -32,15 +32,15 @@ You also need to change all git paths to relative path as we build all submodule
|
||||
|
||||
To build NOS installer image and docker images, run the following commands:
|
||||
|
||||
make configure PLATFORM=[ASIC_VENDOR] SKU=[HW_SKU]
|
||||
make configure PLATFORM=[ASIC_VENDOR]
|
||||
make
|
||||
|
||||
**NOTE**: We recommend reserving 50G free space to build one platform.
|
||||
|
||||
Supported PLATFORM and SKU are:
|
||||
- PLATFORM=broadcom SKU=Force10-S6000
|
||||
- PLATFORM=mellanox SKU=ACS-MSN2700
|
||||
- PLATFORM=cavium SKU=AS7512
|
||||
Supported PLATFORM are:
|
||||
- PLATFORM=broadcom
|
||||
- PLATFORM=mellanox
|
||||
- PLATFORM=cavium
|
||||
- PLATFORM=p4
|
||||
|
||||
You may find the rules/config file useful. It contains configuration options for the build process, like adding more verbosity or showing dependencies, username and password for base image etc.
|
||||
|
1049
device/arista/x86_64-arista_7050_qx32/minigraph.xml
Normal file
1049
device/arista/x86_64-arista_7050_qx32/minigraph.xml
Normal file
File diff suppressed because it is too large
Load Diff
@ -55,9 +55,6 @@ sudo cp $IMAGE_CONFIGS/environment/motd $FILESYSTEM_ROOT/etc/
|
||||
sudo mkdir -p $FILESYSTEM_ROOT/etc/sonic/
|
||||
sudo mkdir -p $FILESYSTEM_ROOT/usr/share/sonic/templates/
|
||||
|
||||
# Copy default minigraph
|
||||
sudo cp $IMAGE_CONFIGS/minigraph/minigraph_{{sonic_hwsku}}.xml $FILESYSTEM_ROOT/etc/sonic/minigraph.xml
|
||||
|
||||
# Install dependencies for SONiC config engine
|
||||
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install \
|
||||
python-lxml \
|
||||
@ -118,7 +115,6 @@ sudo cp $IMAGE_CONFIGS/snmp/snmp.yml $FILESYSTEM_ROOT/etc/sonic/
|
||||
|
||||
# Generate build version file
|
||||
export git_revision=$(git rev-parse --short HEAD)
|
||||
export sonic_hwsku={{sonic_hwsku}}
|
||||
export debian_version=`cat $FILESYSTEM_ROOT/etc/debian_version`
|
||||
export kernel_version={{kversion}}
|
||||
j2 $BUILD_TEMPLATES/sonic_version.yml.j2 > sonic_version.yml
|
||||
|
@ -1,4 +1,3 @@
|
||||
build_version: {{git_revision}}
|
||||
build_hwsku: {{sonic_hwsku}}
|
||||
debian_version: {{debian_version}}
|
||||
kernel_version: {{kernel_version}}
|
||||
|
@ -4,17 +4,18 @@ Requires=database.service
|
||||
After=database.service
|
||||
|
||||
[Service]
|
||||
User=root
|
||||
# Wait for redis server start before database clean
|
||||
ExecStartPre=/bin/bash -c "while true; do if [ \"$(/usr/bin/docker exec database redis-cli ping)\" == \"PONG\" ]; then break; fi; sleep 1; done"
|
||||
ExecStartPre=/usr/bin/docker exec database redis-cli -n 0 FLUSHDB
|
||||
ExecStartPre=/usr/bin/docker exec database redis-cli -n 1 FLUSHDB
|
||||
ExecStartPre=/usr/bin/docker exec database redis-cli -n 2 FLUSHDB
|
||||
|
||||
{% if sonic_hwsku == 'ACS-MSN2700' %}
|
||||
{% if sonic_asic_platform == 'mellanox' %}
|
||||
ExecStartPre=/etc/init.d/sxdkernel start
|
||||
ExecStartPre=/usr/bin/mst start
|
||||
ExecStartPre=/etc/mlnx/msn2700 start
|
||||
{% elif sonic_hwsku == 'AS7512' %}
|
||||
{% elif sonic_asic_platform == 'cavium' %}
|
||||
ExecStartPre=-/etc/init.d/xpnet.sh stop
|
||||
ExecStartPre=/etc/init.d/xpnet.sh start
|
||||
{% endif %}
|
||||
@ -26,11 +27,11 @@ ExecStart=/bin/bash -c "/usr/bin/{{docker_container_name}}.sh start & /usr/bin/s
|
||||
ExecStop=/usr/bin/{{docker_container_name}}.sh stop
|
||||
ExecStopPost=/usr/bin/syncd.sh stop
|
||||
|
||||
{% if sonic_hwsku == 'ACS-MSN2700' %}
|
||||
{% if sonic_asic_platform == 'mellanox' %}
|
||||
ExecStopPost=/etc/mlnx/msn2700 stop
|
||||
ExecStopPost=/etc/init.d/sxdkernel stop
|
||||
ExecStopPost=/usr/bin/mst stop
|
||||
{% elif sonic_hwsku == 'AS7512' %}
|
||||
{% elif sonic_asic_platform == 'cavium' %}
|
||||
ExecStopPost=/etc/init.d/xpnet.sh stop
|
||||
ExecStopPost=/etc/init.d/xpnet.sh start
|
||||
{% endif %}
|
||||
|
@ -16,9 +16,23 @@
|
||||
echo "install platform dependent packages at the first boot time"
|
||||
|
||||
if [ -f /host/platform/firsttime ]; then
|
||||
if [ -d /host/platform/$onie_platform ]; then
|
||||
dpkg -i /host/platform/$onie_platform/*.deb
|
||||
|
||||
if [ -n $aboot_platform ]; then
|
||||
platform=$aboot_platform
|
||||
elif [ -n $onie_platform ]; then
|
||||
platform=$onie_platform
|
||||
else
|
||||
echo "Unknown sonic platform"
|
||||
rm /host/platform/firsttime
|
||||
exit 0
|
||||
fi
|
||||
|
||||
cp /usr/share/sonic/device/$platform/minigraph.xml /etc/sonic/
|
||||
|
||||
if [ -d /host/platform/$platform ]; then
|
||||
dpkg -i /host/platform/$platform/*.deb
|
||||
fi
|
||||
|
||||
rm /host/platform/firsttime
|
||||
fi
|
||||
|
||||
|
4
slave.mk
4
slave.mk
@ -25,7 +25,6 @@ PYTHON_WHEELS_PATH = $(TARGET_PATH)/python-wheels
|
||||
PROJECT_ROOT = $(shell pwd)
|
||||
|
||||
CONFIGURED_PLATFORM := $(shell [ -f .platform ] && cat .platform || echo generic)
|
||||
CONFIGURED_SKU := $(shell [ -f .sku ] && cat .sku || echo undefined)
|
||||
PLATFORM_PATH = platform/$(CONFIGURED_PLATFORM)
|
||||
|
||||
###############################################################################
|
||||
@ -49,7 +48,6 @@ configure :
|
||||
@mkdir -p target/debs
|
||||
@mkdir -p target/python-wheels
|
||||
@echo $(PLATFORM) > .platform
|
||||
@echo $(SKU) > .sku
|
||||
|
||||
distclean : .platform .sku clean
|
||||
@rm -f .platform .sku
|
||||
@ -65,7 +63,6 @@ include $(RULES_PATH)/*.mk
|
||||
ifneq ($(CONFIGURED_PLATFORM), undefined)
|
||||
include $(PLATFORM_PATH)/rules.mk
|
||||
endif
|
||||
export CONFIGURED_SKU
|
||||
|
||||
MAKEFLAGS += -j $(SONIC_CONFIG_BUILD_JOBS)
|
||||
|
||||
@ -312,7 +309,6 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : .platform
|
||||
export config_engine="$(addprefix $(DEBS_PATH)/,$(SONIC_CONFIG_ENGINE))"
|
||||
export image_type="$($*_IMAGE_TYPE)"
|
||||
export sonicadmin_user="$(USERNAME)"
|
||||
export sonic_hwsku="$(CONFIGURED_SKU)"
|
||||
export sonic_asic_platform="$(CONFIGURED_PLATFORM)"
|
||||
export enable_dhcp_graph_service="$(ENABLE_DHCP_GRAPH_SERVICE)"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user