Platform/cisco-8000 module for sonic-buildimage (#8172)
Why I did it Update Makefile, so it does the following: For a given platform, verify if platform/checkout/.ini exists and hence run the platform/checkout/template.j2. This allows platform code to be checked out during the 'make configure' stage. How I did it git clone git@github.com:Azure/sonic-buildimage.git mkdir platform/cisco-8000 make init make configure PLATFORM=cisco-8000 make all
This commit is contained in:
parent
402b0732ff
commit
8093ab2024
1
.gitignore
vendored
1
.gitignore
vendored
@ -74,6 +74,7 @@ platform/broadcom/sonic-platform-modules-dell/s6100/modules/dell_s6100_lpc.c
|
|||||||
platform/broadcom/sonic-platform-modules-dell/z9100/modules/dell_ich.c
|
platform/broadcom/sonic-platform-modules-dell/z9100/modules/dell_ich.c
|
||||||
platform/broadcom/sonic-platform-modules-dell/z9100/modules/dell_mailbox.c
|
platform/broadcom/sonic-platform-modules-dell/z9100/modules/dell_mailbox.c
|
||||||
platform/broadcom/sonic-platform-modules-dell/z9264f/sonic_platform/ipmihelper.py
|
platform/broadcom/sonic-platform-modules-dell/z9264f/sonic_platform/ipmihelper.py
|
||||||
|
platform/cisco-8000
|
||||||
|
|
||||||
# buildinfo
|
# buildinfo
|
||||||
files/build/buildinfo
|
files/build/buildinfo
|
||||||
|
50
Makefile
50
Makefile
@ -3,6 +3,27 @@
|
|||||||
NOJESSIE ?= 1
|
NOJESSIE ?= 1
|
||||||
NOSTRETCH ?= 0
|
NOSTRETCH ?= 0
|
||||||
|
|
||||||
|
ifeq ($(NOJESSIE),0)
|
||||||
|
BUILD_JESSIE=1
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(NOSTRETCH),0)
|
||||||
|
BUILD_STRETCH=1
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(NOBUSTER),0)
|
||||||
|
BUILD_BUSTER=1
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(NOBULLSEYE),0)
|
||||||
|
BUILD_BULLSEYE=1
|
||||||
|
endif
|
||||||
|
|
||||||
|
PLATFORM_PATH := platform/$(if $(PLATFORM),$(PLATFORM),$(CONFIGURED_PLATFORM))
|
||||||
|
PLATFORM_CHECKOUT := platform/checkout
|
||||||
|
PLATFORM_CHECKOUT_FILE := $(PLATFORM_CHECKOUT)/$(PLATFORM).ini
|
||||||
|
PLATFORM_CHECKOUT_CMD := $(shell if [ -f $(PLATFORM_CHECKOUT_FILE) ]; then PLATFORM_PATH=$(PLATFORM_PATH) j2 $(PLATFORM_CHECKOUT)/template.j2 $(PLATFORM_CHECKOUT_FILE); fi)
|
||||||
|
|
||||||
%::
|
%::
|
||||||
@echo "+++ --- Making $@ --- +++"
|
@echo "+++ --- Making $@ --- +++"
|
||||||
ifeq ($(NOJESSIE), 0)
|
ifeq ($(NOJESSIE), 0)
|
||||||
@ -29,15 +50,28 @@ init:
|
|||||||
@echo "+++ Making $@ +++"
|
@echo "+++ Making $@ +++"
|
||||||
make -f Makefile.work $@
|
make -f Makefile.work $@
|
||||||
|
|
||||||
clean configure reset showtag sonic-slave-build sonic-slave-bash :
|
#
|
||||||
|
# Function to invoke target $@ in Makefile.work with proper BLDENV
|
||||||
|
#
|
||||||
|
define make_work
|
||||||
@echo "+++ Making $@ +++"
|
@echo "+++ Making $@ +++"
|
||||||
ifeq ($(NOJESSIE), 0)
|
$(if $(BUILD_JESSIE),make -f Makefile.work $@,)
|
||||||
make -f Makefile.work $@
|
$(if $(BUILD_STRETCH),BLDENV=stretch make -f Makefile.work $@,)
|
||||||
endif
|
$(if $(BUILD_BUSTER),BLDENV=buster make -f Makefile.work $@,)
|
||||||
ifeq ($(NOSTRETCH), 0)
|
$(if $(BUILD_BULLSEYE),BLDENV=bullseye make -f Makefile.work $@,)
|
||||||
BLDENV=stretch make -f Makefile.work $@
|
endef
|
||||||
endif
|
|
||||||
BLDENV=buster make -f Makefile.work $@
|
.PHONY: $(PLATFORM_PATH)
|
||||||
|
|
||||||
|
$(PLATFORM_PATH):
|
||||||
|
@echo "+++ Cheking $@ +++"
|
||||||
|
$(PLATFORM_CHECKOUT_CMD)
|
||||||
|
|
||||||
|
configure : $(PLATFORM_PATH)
|
||||||
|
$(call make_work, $@)
|
||||||
|
|
||||||
|
clean reset showtag sonic-slave-build sonic-slave-bash :
|
||||||
|
$(call make_work, $@)
|
||||||
|
|
||||||
# Freeze the versions, see more detail options: scripts/versions_manager.py freeze -h
|
# Freeze the versions, see more detail options: scripts/versions_manager.py freeze -h
|
||||||
freeze:
|
freeze:
|
||||||
|
3
platform/checkout/cisco-8000.ini
Normal file
3
platform/checkout/cisco-8000.ini
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[module]
|
||||||
|
repo=git@github.com:Cisco-8000-sonic/platform-cisco-8000.git
|
||||||
|
ref=v0.1
|
11
platform/checkout/template.j2
Normal file
11
platform/checkout/template.j2
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{% set path = env('PLATFORM_PATH') %}
|
||||||
|
if [ ! -d {{ path }} ]; then git clone {{ module.repo }} {{ path }}; fi;
|
||||||
|
if [ -d {{ path }}/.git ]; then cd {{ path }} &&
|
||||||
|
|
||||||
|
{% if module.ref is defined %}
|
||||||
|
git checkout {{ module.ref }} && git submodule update --init --recursive;
|
||||||
|
{% else %}
|
||||||
|
git submodule update --init --recursive;
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
else echo "{{ path }}/.git not found"; exit 1; fi
|
Loading…
Reference in New Issue
Block a user