Skip to content

Platform/cisco-8000 module for sonic-buildimage #8172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Aug 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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_mailbox.c
platform/broadcom/sonic-platform-modules-dell/z9264f/sonic_platform/ipmihelper.py
platform/cisco-8000

# buildinfo
files/build/buildinfo
Expand Down
55 changes: 42 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,27 @@ NOSTRETCH ?= 0
NOBUSTER ?= 0
NOBULLSEYE ?= 1

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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To support azp, please allow the step can be skipped when the repo has already checked out.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To support azp, please allow the step can be skipped when the repo has already checked out.

@xumia would the change in platform/checkout/template.j2 be sufficient to support azp?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This step will automatically be skipped if the $(PLATFORM_PATH) directory already exists in the workspace


%::
@echo "+++ --- Making $@ --- +++"
ifeq ($(NOJESSIE), 0)
Expand Down Expand Up @@ -42,20 +63,28 @@ init:
@echo "+++ Making $@ +++"
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 $@ +++"
ifeq ($(NOJESSIE), 0)
make -f Makefile.work $@
endif
ifeq ($(NOSTRETCH), 0)
BLDENV=stretch make -f Makefile.work $@
endif
ifeq ($(NOBUSTER), 0)
BLDENV=buster make -f Makefile.work $@
endif
ifeq ($(NOBULLSEYE), 0)
BLDENV=bullseye make -f Makefile.work $@
endif
$(if $(BUILD_JESSIE),make -f Makefile.work $@,)
$(if $(BUILD_STRETCH),BLDENV=stretch make -f Makefile.work $@,)
$(if $(BUILD_BUSTER),BLDENV=buster make -f Makefile.work $@,)
$(if $(BUILD_BULLSEYE),BLDENV=bullseye make -f Makefile.work $@,)
endef

.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:
Expand Down
3 changes: 3 additions & 0 deletions platform/checkout/cisco-8000.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[module]
[email protected]:Cisco-8000-sonic/platform-cisco-8000.git
ref=v0.1
11 changes: 11 additions & 0 deletions platform/checkout/template.j2
Original file line number Diff line number Diff line change
@@ -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