Skip to content

Commit

Permalink
major update
Browse files Browse the repository at this point in the history
Signed-off-by: Wataru Ishida <[email protected]>
  • Loading branch information
ishidawataru committed Jun 10, 2022
1 parent 5f1281f commit 02419c5
Show file tree
Hide file tree
Showing 456 changed files with 34,793 additions and 637 deletions.
5 changes: 4 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
[submodule "sm/ONL"]
path = sm/ONL
url = https://github.com/microsonic/OpenNetworkLinux.git
url = https://github.com/oopt-goldstone/OpenNetworkLinux.git
[submodule "sm/sonic-buildimage"]
path = sm/sonic-buildimage
url = https://github.com/microsonic/sonic-buildimage.git
[submodule "sm/linux-gft"]
path = sm/linux-gft
url = https://github.com/oopt-goldstone/linux-gft.git
17 changes: 12 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
all: autobuild

ifndef GOLDSTONE_BUILDER_IMAGE
GOLDSTONE_BUILDER_IMAGE = gs-builder
endif
Expand Down Expand Up @@ -51,12 +49,19 @@ BUILDER_OPTS = \
--isolate \
# THIS LINE INTENTIONALLY LEFT BLANK

ARCH = amd64
ALL_ARCHES = arm64 amd64

# Build rule for each architecture.
define build_arch_template
$(1) :
$(MAKE) -C builds/$(1)
endef
$(foreach a,$(ALL_ARCHES),$(eval $(call build_arch_template,$(a))))

all: builder docker

autobuild:
$(MAKE) -C builds/$(ARCH)

autobuild: $(ALL_ARCHES)

docker-check:
@which docker > /dev/null || (echo "*** Docker appears to be missing. Please install docker in order to build Goldstone." && exit 1)
Expand All @@ -67,6 +72,8 @@ docker-debug: docker-check
$(ONL)/docker/tools/onlbuilder $(BUILDER_OPTS) $(VOLUMES_OPTS) -c tools/debug.sh

builder:
docker pull --platform=linux/amd64 python:3-buster
docker tag python:3-buster python:3-buster-amd64
cd docker/images/builder && docker build -t $(GOLDSTONE_BUILDER_IMAGE) .

docker: docker-check
Expand Down
41 changes: 36 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,46 @@
# Goldstone
Goldstone NOS
---

Goldstone is an open source network OS for TIP OOPT networking hardware
Goldstone NOS is an open source network OS for [TIP OOPT](https://telecominfraproject.com/oopt/) networking hardware

### Supported Hardware

- Wistron WTP-01-02-00 (Galileo 1)
- Wistron WTP-01-C1-00 (Galileo FlexT)
- Edgecore AS7716-24SC/XC (Cassini)

### How to build

- prerequisite: Docker ( version >= 18.09 )
#### Prerequisite

- Git
- Docker ( version >= 18.09, enable [buildkit](https://docs.docker.com/develop/develop-images/build_enhancements/) )
- Python2
- make

```
$ git clone https://github.com/Telecominfraproject/goldstone.git
$ cd goldstone
$ docker run --rm --privileged multiarch/qemu-user-static --reset -p yes # https://github.com/multiarch/qemu-user-static
$ git clone https://github.com/oopt-goldstone/goldstone-buildimage.git
$ cd goldstone-buildimage
$ git submodule update --init
$ make builder
$ make docker
```

This will build [ONIE](https://opencomputeproject.github.io/onie/) installers that can be installed on the supported hardware under `RELEASE` directory.

```
$ find RELEASE
RELEASE
RELEASE/buster
RELEASE/buster/arm64
RELEASE/buster/arm64/goldstone-ea520b9_ONL-OS10_2022-06-08.2311-ea520b9_ARM64.swi.md5sum
RELEASE/buster/arm64/goldstone-ea520b9_ONL-OS_2022-06-08.2311-ea520b9_ARM64_INSTALLER
RELEASE/buster/arm64/goldstone-ea520b9_ONL-OS_2022-06-08.2311-ea520b9_ARM64_INSTALLER.md5sum
RELEASE/buster/arm64/goldstone-ea520b9_ONL-OS10_2022-06-08.2311-ea520b9_ARM64.swi
RELEASE/buster/amd64
RELEASE/buster/amd64/goldstone-ea520b9_ONL-OS10_2022-06-08.2311-ea520b9_AMD64.swi.md5sum
RELEASE/buster/amd64/goldstone-ea520b9_ONL-OS_2022-06-08.2311-ea520b9_AMD64_INSTALLER
RELEASE/buster/amd64/goldstone-ea520b9_ONL-OS_2022-06-08.2311-ea520b9_AMD64_INSTALLER.md5sum
RELEASE/buster/amd64/goldstone-ea520b9_ONL-OS10_2022-06-08.2311-ea520b9_AMD64.swi
```
1 change: 0 additions & 1 deletion builds/amd64/installer/swi/PKG.yml

This file was deleted.

3 changes: 0 additions & 3 deletions builds/amd64/installer/swi/builds/Makefile

This file was deleted.

32 changes: 32 additions & 0 deletions builds/amd64/rootfs/arch-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
- apt-transport-https
- ca-certificates
- dmidecode
- parted
- grub2
- efibootmgr
- gdisk
- ipmitool
- iptables
- x1-upgrade
- onl-kernel-5.4-lts-x86-64-all-modules
- x1-saibcm-kernel-5.4-lts-x86-64-all:amd64
- gs-usonic:amd64
- gs-tai:amd64
- k3s:amd64
- stern:amd64
- gs-mgmt:amd64
- cfp2piu-kernel-5.4-lts-x86-64-all:amd64
- libyang1:amd64
- sysrepo:amd64
- gscli:amd64
- onlp-py3:amd64
- gssystem:amd64
- libtac2:amd64
- libtac2-bin:amd64
- libpam-tacplus:amd64
- libnss-tacplus:amd64
- gsyang:all
- netopeer2:amd64
- gs-snmp:amd64
- gs-xlate-oc:amd64
- python3.10:amd64
4 changes: 0 additions & 4 deletions builds/amd64/rootfs/builds/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ ifndef RFS_DIR
RFS_DIR := $(RFS_WORKDIR)/rootfs-$(ARCH).d
endif

ifndef RFS_CPIO
RFS_CPIO := $(RFS_WORKDIR)/rootfs-$(ARCH).cpio.gz
endif

ifndef RFS_SQUASH
RFS_SQUASH := $(RFS_WORKDIR)/rootfs-$(ARCH).sqsh
endif
Expand Down
4 changes: 4 additions & 0 deletions builds/amd64/rootfs/overlay/etc/network/interfaces
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source-directory /etc/network/interfaces.d

auto eth0
iface eth0 inet dhcp
2 changes: 1 addition & 1 deletion builds/amd64/swi/builds/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
ROOTFS_PACKAGE := x1-rootfs
ROOTFS_PACKAGE := goldstone-rootfs
include $(X1)/make/config.amd64.mk
include $(ONL)/make/swi.mk
9 changes: 3 additions & 6 deletions builds/any/installer/APKG.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,14 @@ variables:

prerequisites:
broken: true
packages: [ "x1-swi:$ARCH" ]
packages: [ "goldstone-swi:$ARCH" ]

packages:
- name: x1-installer-$BOOTMODE
- name: goldstone-installer-$BOOTMODE
summary: Goldstone Network OS $ARCH Installer
arch: $ARCH
version: 0.$FNAME_RELEASE_ID
copyright: Copyright 2018 Big Switch Networks
maintainer: [email protected]
changelog: Initial
support: [email protected]
maintainer: [email protected]

files:
builds/*INSTALLER : $$PKG_INSTALL/
Expand Down
8 changes: 4 additions & 4 deletions builds/any/installer/builds/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ ifndef ARCH
$(error $$ARCH not set)
endif

ifndef BOOTMODE
$(error $$BOOTMODE not set)
ifneq ($(BOOTMODE), INSTALLED)
$(error $$BOOTMODE is not INSTALLED but $BOOTMOT)
endif

# Hardcoded to match ONL File naming conventions.
include $(X1)/make/versions/version-goldstone.mk
INSTALLER_NAME=$(FNAME_PRODUCT_VERSION)_ONL-OS_$(FNAME_BUILD_ID)_$(UARCH)_$(BOOTMODE)_INSTALLER
INSTALLER_NAME=$(FNAME_PRODUCT_VERSION)_$(FNAME_BUILD_ID)_$(UARCH)_INSTALLER

MKINSTALLER_OPTS := \
--arch $(ARCH) \
--boot-config boot-config \
--swi x1-swi:$(ARCH) \
--swi goldstone-swi:$(ARCH) \
--add-file zerotouch.json \
--onl-version "$(VERSION_STRING)" \
# THIS LINE INTENTIONALLY LEFT BLANK
Expand Down
8 changes: 2 additions & 6 deletions builds/any/rootfs/APKG.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@ variables:
!include $X1/make/versions/version-goldstone.yml

packages:
- name: x1-rootfs
- name: goldstone-rootfs
summary: Goldstone Network OS Root Filesystem
arch: $ARCH
version: 0.$FNAME_RELEASE_ID
copyright: Copyright 2018 Big Switch Networks
maintainer: [email protected]
changelog: Initial
support: [email protected]
maintainer: [email protected]

files:
builds/$ONL_DEBIAN_SUITE/rootfs-$ARCH.cpio.gz : $$PKG_INSTALL/
builds/$ONL_DEBIAN_SUITE/rootfs-$ARCH.sqsh : $$PKG_INSTALL/
builds/$ONL_DEBIAN_SUITE/manifest.json : $$PKG_INSTALL/
1 change: 1 addition & 0 deletions builds/any/rootfs/all-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@
- watchdog
- gs-config
- python-parted
- jq
13 changes: 11 additions & 2 deletions builds/any/rootfs/rfs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Packages: &Packages
- !script $ONL/tools/onl-platform-pkgs.py ${PLATFORM_LIST}
- !script $X1/tools/goldstone-platform-pkgs.py ${PLATFORM_LIST}
- !include $X1/builds/any/rootfs/all-packages.yml
- !include $X1/builds/any/rootfs/${ARCH}-packages.yml
- !include $X1/builds/$ARCH/rootfs/arch-packages.yml

Multistrap:
General:
Expand Down Expand Up @@ -45,6 +45,7 @@ Configure:
- $ONL/builds/any/rootfs/${ONL_DEBIAN_SUITE}/common/overlay
- $ONL/builds/any/rootfs/${ONL_DEBIAN_SUITE}/${INIT}/overlay
- $X1/builds/any/rootfs/overlay
- $X1/builds/${ARCH}/rootfs/overlay

update-rc.d:
- 'onlpd defaults'
Expand All @@ -69,12 +70,18 @@ Configure:
console: True
PermitRootLogin: 'yes'

groups:
gsmgmt:
force: true

users:
root:
password: x1
admin:
password: admin
shell: /usr/bin/gscli
shell: /usr/local/bin/gscli
groups:
- gsmgmt

manifests:
'/etc/onl/rootfs/manifest.json' :
Expand Down Expand Up @@ -103,3 +110,5 @@ Configure:
- 'sudo mkdir -p __rfs__/var/tmp'
- 'sudo mkdir -p __rfs__/host/warmboot'
- 'sudo mkdir -p __rfs__/var/log/swss'
- 'sudo chroot __rfs__ update-alternatives --set iptables /usr/sbin/iptables-legacy'
- 'if [ ${ARCH} = amd64 ]; then sudo chroot __rfs__ systemctl enable ipmievd.service; fi'
9 changes: 3 additions & 6 deletions builds/any/swi/APKG.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,14 @@ variables:

prerequisites:
broken: true
packages: [ "x1-rootfs:$ARCH" ]
packages: [ "goldstone-rootfs:$ARCH" ]

packages:
- name: x1-swi
- name: goldstone-swi
summary: Goldstone Network OS Switch Image (All $ARCH) Platforms)
arch: $ARCH
version: 0.$FNAME_RELEASE_ID
copyright: Copyright 2018 Big Switch Networks
maintainer: [email protected]
changelog: Initial
support: [email protected]
maintainer: [email protected]

files:
builds/$ONL_DEBIAN_SUITE/*.swi : $$PKG_INSTALL/
Expand Down
1 change: 1 addition & 0 deletions builds/arm64/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include $(ONL)/make/arch-build.mk
File renamed without changes.
1 change: 1 addition & 0 deletions builds/arm64/installer/installed/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include $(ONL)/make/pkg.mk
1 change: 1 addition & 0 deletions builds/arm64/installer/installed/PKG.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!include $X1/builds/any/installer/APKG.yml ARCH=arm64 BOOTMODE=installed
3 changes: 3 additions & 0 deletions builds/arm64/installer/installed/builds/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
BOOTMODE=INSTALLED
include $(X1)/make/config.arm64.mk
include $(X1)/builds/any/installer/builds/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
NETDEV=eth0
BOOTMODE=SWI
BOOTMODE=INSTALLED
SWI=images::latest
1 change: 1 addition & 0 deletions builds/arm64/rootfs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.d/
1 change: 1 addition & 0 deletions builds/arm64/rootfs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include $(ONL)/make/pkg.mk
1 change: 1 addition & 0 deletions builds/arm64/rootfs/PKG.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!include $X1/builds/any/rootfs/APKG.yml ARCH=arm64
29 changes: 29 additions & 0 deletions builds/arm64/rootfs/arch-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
- apt-transport-https
- ca-certificates
- dmidecode
- parted
- gdisk
- iptables
- u-boot-tools
- libatomic1
- goldstone-kernel-5.4-lts-arm64-all-modules
- k3s:arm64
- stern:arm64
- gs-tai:arm64
- gs-tai-gearbox:arm64
- gs-tai-dpll:arm64
- gs-mgmt:arm64
- libyang1:arm64
- sysrepo:arm64
- gscli:arm64
- onlp-py3:arm64
- gssystem:arm64
- libtac2:arm64
- libtac2-bin:arm64
- libpam-tacplus:arm64
- libnss-tacplus:arm64
- gsyang:all
- netopeer2:arm64
- gs-snmp:arm64
- gs-xlate-oc:arm64
- python3.10:arm64
1 change: 1 addition & 0 deletions builds/arm64/rootfs/builds/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
manifest.json
53 changes: 53 additions & 0 deletions builds/arm64/rootfs/builds/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
include $(X1)/make/config.arm64.mk

ifndef PLATFORM_LIST
export PLATFORM_LIST=$(shell onlpm --list-platforms --arch arm64 --csv )
endif

RFS_CONFIG := $(X1)/builds/any/rootfs/rfs.yml

ifndef ARCH
$(error $$ARCH must be specified)
endif

ifndef RFS_CONFIG
$(error $$RFS_CONFIG must be set to the RFS yaml configuration file)
endif

ifndef RFS_WORKDIR
RFS_WORKDIR := $(ONL_DEBIAN_SUITE)
endif

ifndef RFS_DIR
RFS_DIR := $(RFS_WORKDIR)/rootfs-$(ARCH).d
endif

ifndef RFS_SQUASH
RFS_SQUASH := $(RFS_WORKDIR)/rootfs-$(ARCH).sqsh
endif

RFS_COMMAND := $(ONL)/tools/onlrfs.py --config $(RFS_CONFIG) --arch $(ARCH) --dir $(RFS_DIR)

ifdef RFS_CPIO
RFS_COMMAND += --cpio $(RFS_CPIO)
endif

ifdef RFS_SQUASH
RFS_COMMAND += --squash $(RFS_SQUASH)
endif

ifndef RFS_MANIFEST
RFS_MANIFEST := etc/goldstone/rootfs/manifest.json
endif

LOCAL_MANIFEST := $(RFS_WORKDIR)/manifest.json

RFS: clean
$(ONL_V_at) $(RFS_COMMAND)
$(ONL_V_at) [ -f $(RFS_DIR)/$(RFS_MANIFEST) ] && sudo cp $(RFS_DIR)/$(RFS_MANIFEST) $(LOCAL_MANIFEST)

clean:
$(ONL_V_at) sudo rm -rf $(RFS_WORKDIR)

show-packages:
$(ONL_V_at) $(RFS_COMMAND) --show-packages
Loading

0 comments on commit 02419c5

Please sign in to comment.