diff --git a/.bashrc b/.bashrc index 1bbf65dd..4b10822c 100644 --- a/.bashrc +++ b/.bashrc @@ -13,8 +13,11 @@ . setup.env +set -e + if [ -n "$ONL_AUTOBUILD" ]; then make all + exit 0 else echo Ready to build OpenNetworkLinux. fi diff --git a/Makefile b/Makefile index 07e150db..553bb85f 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,7 @@ # ############################################################ ifneq ($(MAKECMDGOALS),docker) +ifneq ($(MAKECMDGOALS),docker-debug) ifndef ONL $(error Please source the setup.env script at the root of the ONL tree) @@ -15,13 +16,22 @@ all: amd64 ppc $(MAKE) -C REPO build-clean onl-amd64 onl-x86 x86 x86_64 amd64: - $(MAKE) -C packages/base ARCHES=amd64,all + $(MAKE) -C packages/base/amd64/kernels + $(MAKE) -C packages/base/amd64/initrds + $(MAKE) -C packages/base/amd64/onlp + $(MAKE) -C packages/base/amd64/onlp-snmpd + $(MAKE) -C packages/base/amd64/faultd $(MAKE) -C builds/amd64/rootfs $(MAKE) -C builds/amd64/swi $(MAKE) -C builds/amd64/installer/legacy onl-ppc ppc: - $(MAKE) -C packages/base ARCHES=powerpc,all + $(MAKE) -C packages/base/powerpc/kernels + $(MAKE) -C packages/base/powerpc/initrds + $(MAKE) -C packages/base/powerpc/onlp + $(MAKE) -C packages/base/powerpc/onlp-snmpd + $(MAKE) -C packages/base/powerpc/faultd + $(MAKE) -C packages/base/powerpc/fit $(MAKE) -C builds/powerpc/rootfs $(MAKE) -C builds/powerpc/swi $(MAKE) -C builds/powerpc/installer/legacy @@ -30,6 +40,7 @@ rpc rebuild: $(ONLPM) --rebuild-pkg-cache endif +endif .PHONY: docker @@ -43,3 +54,7 @@ docker_check: docker: docker_check @docker/tools/onlbuilder -$(VERSION) --isolate --hostname onlbuilder$(VERSION) --pull --autobuild --non-interactive + +# create an interative docker shell, for debugging builds +docker-debug: docker_check + @docker/tools/onlbuilder -$(VERSION) --isolate --hostname onlbuilder$(VERSION) --pull diff --git a/builds/amd64/installer/legacy/builds/Makefile b/builds/amd64/installer/legacy/builds/Makefile index 2425e304..158cbf6c 100644 --- a/builds/amd64/installer/legacy/builds/Makefile +++ b/builds/amd64/installer/legacy/builds/Makefile @@ -1,7 +1,8 @@ include $(ONL)/make/config.amd64.mk KERNELS := $(shell $(ONLPM) --find-file onl-kernel-3.9.6-x86-64-all:amd64 kernel-3.9.6-x86-64-all) \ - $(shell $(ONLPM) --find-file onl-kernel-3.2-deb7-x86-64-all:amd64 kernel-3.2-deb7-x86_64-all) + $(shell $(ONLPM) --find-file onl-kernel-3.2-deb7-x86-64-all:amd64 kernel-3.2-deb7-x86_64-all) \ + $(shell $(ONLPM) --find-file onl-kernel-3.18-x86-64-all:amd64 kernel-3.18-x86_64-all) INITRD := $(shell $(ONLPM) --find-file onl-loader-initrd:amd64 onl-loader-initrd-amd64.cpio.gz) PLATFORMS := $(shell $(ONLPM) --platform-manifest onl-loader-initrd:amd64) diff --git a/builds/any/rootfs/jessie/common/common-packages.yml b/builds/any/rootfs/jessie/common/common-packages.yml index b92a757f..74ef19c4 100644 --- a/builds/any/rootfs/jessie/common/common-packages.yml +++ b/builds/any/rootfs/jessie/common/common-packages.yml @@ -69,4 +69,4 @@ - onl-faultd - onl-loader-initscripts - onlp-snmpd - +- oom-shim diff --git a/builds/any/rootfs/jessie/standard/standard.yml b/builds/any/rootfs/jessie/standard/standard.yml index 82e08834..785a2638 100644 --- a/builds/any/rootfs/jessie/standard/standard.yml +++ b/builds/any/rootfs/jessie/standard/standard.yml @@ -58,6 +58,7 @@ Configure: - 'initdev defaults' - 'onl-platform-baseconf defaults' - 'faultd defaults' + - 'onlpd defaults' - 'snmpd remove' - 'onlp-snmpd remove' - 'ssh defaults' diff --git a/builds/any/rootfs/wheezy/common/common-packages.yml b/builds/any/rootfs/wheezy/common/common-packages.yml index e5803d7f..5857b0f2 100644 --- a/builds/any/rootfs/wheezy/common/common-packages.yml +++ b/builds/any/rootfs/wheezy/common/common-packages.yml @@ -68,5 +68,6 @@ - onl-faultd - onl-loader-initscripts - onlp-snmpd +- oom-shim diff --git a/builds/any/rootfs/wheezy/standard/standard.yml b/builds/any/rootfs/wheezy/standard/standard.yml index e7abdcc4..16567372 100644 --- a/builds/any/rootfs/wheezy/standard/standard.yml +++ b/builds/any/rootfs/wheezy/standard/standard.yml @@ -58,6 +58,7 @@ Configure: - 'initdev defaults' - 'onl-platform-baseconf defaults' - 'faultd defaults' + - 'onlpd defaults' - 'snmpd remove' - 'onlp-snmpd remove' - 'ssh defaults' diff --git a/docker/images/builder7/1.1/Dockerfile b/docker/images/builder7/1.1/Dockerfile new file mode 100644 index 00000000..e3813a49 --- /dev/null +++ b/docker/images/builder7/1.1/Dockerfile @@ -0,0 +1,12 @@ +FROM opennetworklinux/builder7:1.0 +MAINTAINER Rob Sherwood + +RUN apt-get update && apt-get install -y \ + libpcap-dev \ + telnet \ + gdb +# +# Docker shell and other container tools. +# +COPY docker_shell /bin/docker_shell +COPY container-id /bin/container-id diff --git a/docker/images/builder7/1.1/Makefile b/docker/images/builder7/1.1/Makefile new file mode 100644 index 00000000..df7a8449 --- /dev/null +++ b/docker/images/builder7/1.1/Makefile @@ -0,0 +1,20 @@ +VERSION=1.1 +USER=opennetworklinux +REPO=builder7 + +TOOLS=../../../tools/docker_shell ../../../tools/container-id + +build: check_version + cp $(TOOLS) . + docker build -t $(USER)/$(REPO):$(VERSION) . + rm -rf $(notdir $(TOOLS)) + +# +# Todo: Query remote repository to see if the request version already exists to avoid accidental overwrites +# when a new image is built but the VERSION variable is not updated. +# +check_version: + + +push: + docker push $(USER)/$(REPO):$(VERSION) diff --git a/docker/images/builder8/1.0/Dockerfile b/docker/images/builder8/1.0/Dockerfile index b0772495..d1486635 100644 --- a/docker/images/builder8/1.0/Dockerfile +++ b/docker/images/builder8/1.0/Dockerfile @@ -127,8 +127,7 @@ RUN echo 'APT::Get::AllowUnauthenticated "true";\nAPT::Get::Assume-Yes "true";' dpkg -i texinfo_4.13a.dfsg.1-10_amd64.deb && \ wget "http://ftp.us.debian.org/debian/pool/main/e/emdebian-crush/xapt_2.2.19_all.deb" && \ dpkg -i xapt_2.2.19_all.deb && \ - - xapt -a powerpc libedit-dev ncurses-dev libsensors4-dev libwrap0-dev libssl-dev libsnmp-dev + xapt -a powerpc libedit-dev ncurses-dev libsensors4-dev libwrap0-dev libssl-dev libsnmp-dev # update-alternatives --install /usr/bin/powerpc-linux-gnu-gcc powerpc-linux-gnu-gcc 10 && # diff --git a/docker/images/builder8/1.1/Dockerfile b/docker/images/builder8/1.1/Dockerfile new file mode 100644 index 00000000..69fea361 --- /dev/null +++ b/docker/images/builder8/1.1/Dockerfile @@ -0,0 +1,12 @@ +FROM opennetworklinux/builder8:1.0 +MAINTAINER Rob Sherwood + +RUN apt-get update && apt-get install -y \ + libpcap-dev \ + telnet \ + gdb +# +# Docker shell and other container tools. +# +COPY docker_shell /bin/docker_shell +COPY container-id /bin/container-id diff --git a/docker/images/builder8/1.1/Makefile b/docker/images/builder8/1.1/Makefile new file mode 100644 index 00000000..7b0835d2 --- /dev/null +++ b/docker/images/builder8/1.1/Makefile @@ -0,0 +1,19 @@ +VERSION=1.1 +USER=opennetworklinux +REPO=builder8 + +TOOLS=../../../tools/docker_shell ../../../tools/container-id + +build: check_version + cp $(TOOLS) . + docker build -t $(USER)/$(REPO):$(VERSION) . + rm -rf $(notdir $(TOOLS)) + +# +# Todo: Query remote repository to see if the request version already exists to avoid accidental overwrites +# when a new image is built but the VERSION variable is not updated. +# +check_version: + +push: + docker push $(USER)/$(REPO):$(VERSION) diff --git a/docker/tools/PKG.yml b/docker/tools/PKG.yml index 9ad2770d..1c6f35a8 100644 --- a/docker/tools/PKG.yml +++ b/docker/tools/PKG.yml @@ -1,6 +1,6 @@ common: arch: all - version: 1.0.0 + version: 1.1.0 copyright: Copyright 2013, 2014, 2015 Big Switch Networks maintainer: support@bigswitch.com diff --git a/docker/tools/docker_shell b/docker/tools/docker_shell index 9c49883e..6376b7b1 100755 --- a/docker/tools/docker_shell +++ b/docker/tools/docker_shell @@ -154,6 +154,15 @@ for u in ops.addusers: if ops.start_cacher: execute("/etc/init.d/apt-cacher-ng start", "The apt-cacher-ng service could not be started.") +logger.debug("checking if qemu-ppc exists") + +if os.path.isfile("/proc/sys/fs/binfmt_misc/qemu-ppc"): + logger.debug("qemu-ppc already exists") +else: + if not os.path.ismount("/proc/sys/fs/binfmt_misc"): + execute("sudo mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc", "The binfmt_misc system could not be mounted.") + execute("sudo /etc/init.d/binfmt-support start", "The binfmt-support service could not be started.") + # Fixme: change this to os.execvp() c = "/usr/bin/sudo -E -u %s %s" % (g_user.name, " ".join(ops.command)) sys.exit(execute(c)) diff --git a/docker/tools/onlbuilder b/docker/tools/onlbuilder index 04ec4ae4..4f963519 100755 --- a/docker/tools/onlbuilder +++ b/docker/tools/onlbuilder @@ -17,8 +17,8 @@ g_current_user = getpass.getuser() g_current_uid = os.getuid() g_timestamp = datetime.datetime.now().strftime("%Y-%m-%d.%H%M%S") -g_builder7_image_name="opennetworklinux/builder7:1.0" -g_builder8_image_name="opennetworklinux/builder8:1.0" +g_builder7_image_name="opennetworklinux/builder7:1.1" +g_builder8_image_name="opennetworklinux/builder8:1.1" g_default_image_name=g_builder7_image_name g_default_container_name = "%s_%s" % (g_current_user, g_timestamp) @@ -96,6 +96,10 @@ ap.add_argument("--volumes", metavar='DIRECTORY', default=[]) +ap.add_argument("--no-mount-current", + help="Do not mount the current working directory. The default is the current working directory and $HOME", + action='store_true') + ap.add_argument("--autobuild", help="Automatic build in isolation mode.", action='store_true') @@ -159,6 +163,11 @@ if ops.exec_: else: ops.volumes += [ '/lib/modules' ] + + if not ops.no_mount_current: + # Add the current working directory to the volume list. + ops.volumes.append(os.getcwd()) + g_arg_d['volume_options'] = " ".join( [ " -v %s:%s " % (v, v) for v in ops.volumes ] ) g_docker_arguments = "docker run --privileged %(interactive)s -t -e DOCKER_IMAGE=%(image)s --name %(name)s %(ssh_options)s %(volume_options)s " % g_arg_d diff --git a/docs/Building.md b/docs/Building.md index 951dfee3..e66ab7ad 100644 --- a/docs/Building.md +++ b/docs/Building.md @@ -12,29 +12,38 @@ ONL builds with Docker so the only requirements on the build system is: - docker # to grab the build workspace - binfmt-support # kernel support for ppc builds - About 40G of disk free space # to build all images +- At least 4G of ram and 4G of swap # compilation is memory intensive All of the testing is done with Debian, other Linux distributions may work, but we suggest using Debian 8. - # apt-get install lxc-docker binfmt-support + # apt-get install binfmt-support + then follow the instructions at: https://docs.docker.com/engine/installation/debian/ Build ONL Summary ------------------------------------------------------------ -The easiest way to build is to use the autobuild script: +The easiest way to build is to use the make docker command: #> git clone https://github.com/opencomputeproject/OpenNetworkLinux - #> tools/autobuild/build.sh + #> cd OpenNetworkLinux + #> make docker This will build a Debian 7 based ONL from the master branch -To build a Debian 8 based ONL simply run: +To build a Debian 8 based ONL run: - #> tools/autobuild/build.sh -8 + #> git clone https://github.com/opencomputeproject/OpenNetworkLinux + #> cd OpenNetworkLinux + #> export VERSION=8 + #> make docker + If you would like to build by hand you can do the following: #> git clone https://github.com/opencomputeproject/OpenNetworkLinux #> cd OpenNetworkLinux - #> make docker # enter the docker workspace + #> docker/tools/onlbuilder (-8) # enter the docker workspace + #> apt-cacher-ng + #> source setup.env # pull in necessary environment variables #> make amd64 ppc # make onl for $platform (currently amd64 or powerpc) The resulting ONIE installers are in @@ -50,9 +59,6 @@ RELEASE/jessie/amd64/ONL-2.0.0_ONL-OS_2015-12-12.0252-ffce159_AMD64.swi Docker installer oneliner (for reference: see docker.com for details) - # apt-get install -y lxc-docker -or - # wget -qO- https://get.docker.com/ | sh @@ -122,3 +128,86 @@ This installer image can be served to ONIE on Quanta or Accton platforms: #> ls *INSTALLER ONL-2.0.0_ONL-OS_2015-12-12.0252-ffce159_PPC_INSTALLER #> + +Example setup on new Debian 8.2 installation +------------------------------------------------------------ +Install sudo and add yourself to the sudoers: + +As root: + +apt-get install sudo + +vi /etc/sudoers.d/username + +Add the line: + +username ALL=(ALL:ALL) ALL + +Add the docker key: + +sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D + +gpg: key 2C52609D: public key "Docker Release Tool (releasedocker) " imported +gpg: Total number processed: 1 +gpg: imported: 1 (RSA: 1) + +Install necessary items, make, binfmt-support and apt-transport-https (for docker): + +sudo apt-get install apt-transport-https make binfmt-support + +Add the docker repository to your system: + +sudo vi /etc/apt/sources.list.d/docker.list + +Add the following line to the file: + +deb https://apt.dockerproject.org/repo debian-jessie main + +Install Docker: + +sudo apt-get update + +sudo apt-get install docker-engine + +Test Docker: + +sudo docker run hello-world + +Unable to find image 'hello-world:latest' locally +latest: Pulling from library/hello-world +b901d36b6f2f: Pull complete +0a6ba66e537a: Pull complete +Digest: sha256:8be990ef2aeb16dbcb9271ddfe2610fa6658d13f6dfb8bc72074cc1ca36966a7 +Status: Downloaded newer image for hello-world:latest + +Hello from Docker. +This message shows that your installation appears to be working correctly. + +Add yourself to the docker group: + +sudo gpasswd -a snoble docker + +Adding user snoble to group docker + +logout and log back in for the group to take effect: + +Clone the OpenNetworkLinux repository: + +git clone https://github.com/opencomputeproject/OpenNetworkLinux.git + +Cloning into 'OpenNetworkLinux'... +Checking connectivity... done. + +Build OpenNetworkLinux: + + #> cd OpenNetworkLinux/ + #> make docker + #> Pulling opennetworklinux/builder7:1.0… + +Or: + + #> docker/tools/onlbuilder + #> source setup.env + #> apt-cacher-ng + #> make onl-x86 onl-ppc + diff --git a/docs/GettingStarted.md b/docs/GettingStarted.md index a676b3bb..33940d3f 100644 --- a/docs/GettingStarted.md +++ b/docs/GettingStarted.md @@ -109,9 +109,8 @@ Now press RETURN here to jump into ONIE''s manual installer mode. You should se Then simply download the latest ONL installer for the appropriate architecture (powerpc or amd64) from the website and run it. - ONIE:/ # install_url http://opennetlinux.org/binaries/latest-amd64.installer + ONIE:/ # install_url http://opennetlinux.org/binaries/latest-$ARCH.installer - ONIE:/ # install_url http://opennetlinux.org/binaries/latest-powerpc.installer Connecting to opennetlinux.org (107.170.237.53:80) Open Network Installer running under ONIE. Installer Version: Open Network Linux e148b7a (powerpc.all,2014.05.21.18.57,e148b7a90131c07eb8d49f74316baf8f2aae92c6) @@ -123,7 +122,26 @@ architecture (powerpc or amd64) from the website and run it. ... +Note: +1) If there is different OS(other than ONL) running on the switch. +Then halt the booting process at U-boot mode, Then check for the ONIE +details in the environment(=> printenv). Open the ONIE in rescue mode, +while ONIE has many different installation modes, +we recommend the rescue mode for doing a manual (read: via console) +because it disables the automatic ONIE server discovery. +Then run (=> run onie_rescue) command to take you to the ONIE environment. + +2) For development purpose, to load freshly build ONL installer from directly ONIE. +Run a http server from the build machine (example:python -m SimpleHTTPServer 8000) and access it as, + + + example: ONIE:/ # install_url http://buildmachineIPAddress:/path/to/directory/onl-09b7bba-powerpc-all.2016.02.05.05.17.installer # update for specific file/date/build + +Also, you can use install via scp with two steps, + + example: ONIE:/ # scp [username]@buildmachineIPAddress:/path/to/directory/onl-09b7bba-powerpc-all.2016.02.05.05.17.installer ONL.installer # update for specific file/date/build + ONIE:/ # sh ONL.installer ONL NFS Root Directory ------------------------------------------------ diff --git a/docs/GettingStartedWedge.md b/docs/GettingStartedWedge.md index bf608275..fb479df2 100644 --- a/docs/GettingStartedWedge.md +++ b/docs/GettingStartedWedge.md @@ -62,16 +62,19 @@ ONL Manual Install 2) Boot switch and choose "ONIE: Rescue" to go to ONIE''s interactive mode -3) From the ONIE# prompt run "install_url http://opennetlinux.org/binaries/latest-wedge.installer" +3) From the ONIE# prompt run "install_url http://opennetlinux.org/binaries/latest-wedge-2.0.installer" 4) Wait for the install to finish and the system to reboot 5) One the onl login prompt appears login with the username root and the password "onl" -6) You can now change the root password +6) Configure the ma1 interface either via dhcp (dhclient ma1) or manually -7) Configure the ma1 interface either via dhcp (dhclient ma1) or manually +7) Install fboss using the commands + + #> apt-get update + #> apt-get install fboss 8) From the command prompt you can start fboss by using the command "service fboss_wedge_agent start" @@ -126,19 +129,35 @@ Now press RETURN here to jump into ONIE''s manual installer mode. You should se Then simply download the latest ONL wedge installer from the website and run it. - ONIE:/ # install_url http://opennetlinux.org/binaries/latest-wedge.installer + ONIE:/ # install_url http://opennetlinux.org/binaries/latest-wedge-2.0.installer Connecting to opennetlinux.org (107.170.237.53:80) Open Network Installer running under ONIE. - Installer Version: Open Network Linux 019421c (amd64.all,2015.11.17.06.23,019421c116940d87d5a41100d1b8a64cbba50252) - Detected platform: x86-64-accton-wedge-16x-r0 - Installing in standalone mode. - Unpacking Open Network Linux installer files... + Installing Open Network Linux Software Image (ONL-2.0.0_ONL-OS_2016-02-12.2304-b9b7e50_AMD64.swi)... + Installation finished. No error reported. + Install finished. Rebooting to Open Network Linux. ... Connecting tty=ttyS1 with /sbin/pgetty - Open Network Linux 019421c (amd64.all,2015.11.17.06.23,019421c116940d87d5a41100d1b8a64cbba50252) + Debian GNU/Linux 8 localhost ttyS1 - onl-wedge login: + localhost login: root + Password: + Linux localhost 3.2.65-1+deb7u2-OpenNetworkLinux #1 SMP Fri Feb 12 23:10:15 UTC 2016 x86_64 + root@localhost:~# apt-get update + root@localhost:~# apt-get install fboss + WARNING: The following packages cannot be authenticated! + folly wangle fbthrift fboss-py fboss-core fboss + Install these packages without verification? [y/N] y + + root@localhost:~# service fboss_wedge_agent start + [....] Starting Facebook FBOSS agent: fboss_wedge_agent + Error: OpenNSL library not found, attempting to grab from GitHub + Saving to: ‘/usr/local/lib/libopennsl.so.1’ + + OpenNSL library succesfully installed + [ ok --- Loading linux-kernel-bde linux-user-bde linux-bcm-knet ; Creating devices . + root@localhost:~# service fboss_wedge_agent status + [ ok ] fboss_wedge_agent is running. diff --git a/docs/PortingGuide.md b/docs/PortingGuide.md index 5d62a084..f1a65ae5 100644 --- a/docs/PortingGuide.md +++ b/docs/PortingGuide.md @@ -5,9 +5,10 @@ Open Network Linux has a number of internal APIs to simplify porting to new hardware. To support a new switch/device, there are three large software components -that need device-specific drivers: +that need device-specific drivers (information only known by the manufacturer +of the switch/device): -1. The ONL/ONIE installer -- how to actually install and boot ONL using ONIE +1. The ONL/ONIE installer -- how to install and boot ONL using ONIE 2. The ONLP platform drivers -- how to manage hardware once ONL is running 3. Any packet forwarding device specific settings (e.g., front panel port mappings, pre-emphesis settings) @@ -69,7 +70,7 @@ directory structure for the installer driver is as follows: # specific ONL OS abstractions (see below) ./$platform/$release/src/lib/install/$platform.sh # Script called from installer.sh to partition # and install ONL and setup boot params (see below) - ./$platform/src/python/$plaform/__init__.py # Platform specific python library (see below) + ./$platform/src/python/$platform/__init__.py # Platform specific python library (see below) ONL Installer src/boot drivers ------------------------------ diff --git a/docs/SupportedHardware.md b/docs/SupportedHardware.md index 9a4f9752..b399a586 100644 --- a/docs/SupportedHardware.md +++ b/docs/SupportedHardware.md @@ -9,13 +9,12 @@ Quanta - + - - - - - + + + +
Device Ports CPU Forwarding Support Status
Device Ports CPU Forwarding ONL Certified In Lab ORC OF-DPA OpenNSL SAI
QuantaMesh T1048-LB9 48x1G + 4x10G FreeScale P2020 Broadcom BCM56534 (Firebolt3) Supported and Tested
QuantaMesh T1048-LB9A 48x1G + 4x10G FreeScale P2020 Broadcom BCM56534 (Firebolt3) Supported, no ONIE, not regularly tested
QuantaMesh T3048-LY2 48x10G + 4x40G FreeScale P2020 Broadcom BCM56846 (Trident+) Supported and Tested
QuantaMesh T3048-LY8 48x10G + 6x40G Intel Rangely C2758 x86 Broadcom BCM56854 (Trident2) Supported and run in the lab
QuantaMesh T5032-LY6 32x40G Intel Rangely C2758 x86 Broadcom BCM56850 (Trident2) Supported and run in the lab
QuantaMesh T1048-LB9 48x1G + 4x10G FreeScale P2020 Broadcom BCM56534 (Firebolt3) Yes Yes Yes Yes No No
QuantaMesh T3048-LY2 48x10G + 4x40G FreeScale P2020 Broadcom BCM56846 (Trident+) Yes Yes Yes Yes No No
QuantaMesh T3048-LY8 48x10G + 6x40G Intel Rangely C2758 x86 Broadcom BCM56854 (Trident2) Yes* No No No No No
QuantaMesh T5032-LY6 32x40G Intel Rangely C2758 x86 Broadcom BCM56850 (Trident2) Yes* No No No No No
@@ -24,18 +23,20 @@ Accton/Edge-Core - + - - - - - - - - - - + + + + + + + + + + + +
Device Ports CPU Forwarding Support Status
Device Ports CPU Forwarding ONL Certified In Lab ORC OF-DPA OpenNSL SAI
Accton AS4600-54T 48x1G + 4x10G FreeScale P2020 Broadcom BCM56540 (Apollo2) Supported and Tested
Accton AS5600-52X 48x10G + 4x40G FreeScale P2020 Broadcom BCM56846 (Trident+) Supported and Tested
Accton AS5610-52X 48x10G + 4x40G FreeScale P2020 Broadcom BCM56846 (Trident+) Supported and Tested
Accton AS5710-54X 48x10G + 6x40G FreeScale P2041 Broadcom BCM56854 (Trident2) Supported and Tested
Accton AS6700-32X 32x40G FreeScale P2041 Broadcom BCM56850 (Trident2) Supported and Tested
Accton AS5712-54X 48x10G + 6x40G Intel Rangely C2538 x86 Broadcom BCM56854 (Trident2) Supported and Tested
Accton AS6712-32X 32x40G Intel Rangely C2538 x86 Broadcom BCM56850 (Trident2) Supported and Tested
Accton AS5812-54T 48x10G + 6x40G Intel Rangely C2538 x86 Broadcom BCM56864 (Trident2+) Supported
Accton AS5812-54X 48x10G + 6x40G Intel Rangely C2538 x86 Broadcom BCM56864 (Trident2+) Supported
Accton AS6812-32X 32x40G Intel Rangely C2538 x86 Broadcom BCM56864 (Trident2+) Supported
Accton AS4600-54T 48x1G + 4x10G FreeScale P2020 Broadcom BCM56540 (Apollo2) Yes Yes Yes Yes*** Yes*** No
Accton AS5600-52X 48x10G + 4x40G FreeScale P2020 Broadcom BCM56846 (Trident+) Yes Yes Yes No No No
Accton AS5610-52X 48x10G + 4x40G FreeScale P2020 Broadcom BCM56846 (Trident+) Yes Yes Yes No No No
Accton AS5710-54X 48x10G + 6x40G FreeScale P2041 Broadcom BCM56854 (Trident2) Yes Yes Yes Yes*** Yes*** No
Accton AS6700-32X 32x40G FreeScale P2041 Broadcom BCM56850 (Trident2) Yes Yes Yes No No No
Accton AS5712-54X 48x10G + 6x40G Intel Rangely C2538 x86 Broadcom BCM56854 (Trident2) Yes Yes Yes Yes*** Yes*** No
Accton AS6712-32X 32x40G Intel Rangely C2538 x86 Broadcom BCM56850 (Trident2) Yes Yes Yes Yes*** Yes*** No
Accton AS5812-54T 48x10G + 6x40G Intel Rangely C2538 x86 Broadcom BCM56864 (Trident2+) Yes Yes No No No No
Accton AS5812-54X 48x10G + 6x40G Intel Rangely C2538 x86 Broadcom BCM56864 (Trident2+) Yes Yes No No No No
Accton AS6812-32X 32x40G Intel Rangely C2538 x86 Broadcom BCM56864 (Trident2+) Yes Yes No No No No
Accton AS7712-32X 32x100G Intel Rangely C2538 x86 Broadcom BCM56960 (Tomahawk) Yes Yes Yes Yes*** Yes*** No
Accton Wedge-16X 16x40G Intel Rangely C2550 x86 Broadcom BCM56864 (Trident2+) Work In Progress** Yes No No Yes No
DNI/Agema @@ -43,9 +44,9 @@ DNI/Agema - + - +
Device Ports CPU Forwarding Support Status
Device Ports CPU Forwarding ONL Certified In Lab ORC OF-DPA OpenNSL SAI
AG-7448CU 48x10G + 4x40G FreeScale P2020 Broadcom BCM56845 (Trident) Supported and Tested
AG-7448CU 48x10G + 4x40G FreeScale P2020 Broadcom BCM56845 (Trident) Yes Yes Yes No No No
Dell @@ -53,10 +54,35 @@ Dell - + - - - - + + + +
Device Ports CPU Forwarding Support Status
Device Ports CPU Forwarding ONL Certified In Lab ORC OF-DPA OpenNSL SAI
S4810-ON 48x10G + 4x40G FreeScale P2020 Broadcom BCM56845 (Trident) Supported and Tested
S4048-ON 48x10G + 6x40G Intel Atom C2338 Broadcom BCM56854 (Trident2) Supported and Tested
S6000-ON 32x40G Intel Atom S1220 Broadcom BCM56850 (Trident2) Supported and Tested
S4810-ON 48x10G + 4x40G FreeScale P2020 Broadcom BCM56845 (Trident) Yes Yes Yes No No No
S4048-ON 48x10G + 6x40G Intel Atom C2338 Broadcom BCM56854 (Trident2) Yes Yes Yes No No No
S6000-ON 32x40G Intel Atom S1220 Broadcom BCM56850 (Trident2) Yes Yes Yes No No No
Z9100-ON 32x100G Intel Atom C2538 Broadcom BCM56960 (Tomahawk) Yes Yes No No No No
+ +Interface Masters Technologies, Inc. +--- + + + + + + + + + + +
Device Ports CPU Forwarding ONL Certified In Lab ORC OF-DPA OpenNSL SAI
Niagara 2948X12XLm 48x10G + 12x40G Intel/AMD x86 Broadcom BCM56850 (Trident2) Work In Progress** No No Yes*** Yes*** No
Niagara 2960X6XLm 60x10G + 6x40G Intel/AMD x86 Broadcom BCM56850 (Trident2) Work In Progress** No No Yes*** Yes*** No
Niagara 2972Xm 72x10G Intel/AMD x86 Broadcom BCM56850 (Trident2) Work In Progress** Yes No Yes*** Yes*** No
Niagara 2932XL 32x40G Intel/AMD x86 Broadcom BCM56850 (Trident2) Work In Progress** No No Yes*** Yes*** No
Niagara 2948X6XL 48x10G + 6x40G Intel/AMD x86 Broadcom BCM56850 (Trident2) Work In Progress** No No Yes*** Yes No
+ +Notes: +--- + +ONL Certified means that the system runs ONIE, is able to install a generic version of ONL and has the ONL Platform drivers necessary to manage the system. + +\* Systems no longer in the lab cannot be certified post removal + +\** Developing ONL Platform Drivers + +\*** Vendor provided diff --git a/docs/dev.md b/docs/dev.md new file mode 100644 index 00000000..77130458 --- /dev/null +++ b/docs/dev.md @@ -0,0 +1,16 @@ +==== FIXME === +Finish this doc + +== Adding a new package + +* Create most of the files in the 'any' architecture for cross compiling +* Copy the directory structure from an existing package + * APKG.yml goes into the $(ONL)/packages/base/any/foo/ directory + * PKG.yml goes into the $(ONL)/packages/base/$ARCH/foo directory + * Create for each $ARCH you intend to support +* Put code in $(ONL)/packages/base/any/foo/src +* Put package specific Makefiles in $(ONL)/packages/base/any/builds + +* Run `make rebuild` in $(ONL)/packages/base/$ARCH/foo to rebuild the package cache + * particularly if you see an error like: + """ERROR:onlpm:'Package all does not exist.'""" diff --git a/make/config.mk b/make/config.mk index 9f4109a9..4721ddae 100644 --- a/make/config.mk +++ b/make/config.mk @@ -35,3 +35,11 @@ export MODULEMANIFEST := $(shell $(BUILDER)/tools/mmg.py --dirs $(ONL) $(ONLPM_O ONL_MAKE_FLAGS += --no-print-directory -s ONL_MAKE := $(MAKE) $(ONL_MAKE_FLAGS) ONL_V_at := @ + +# +# Some build and autogen tools require these settings. +# +export SUBMODULE_INFRA := $(ONL)/sm/infra +export SUBMODULE_BIGCODE := $(ONL)/sm/bigcode + + diff --git a/packages/base/amd64/initrds/Makefile b/packages/base/amd64/initrds/Makefile new file mode 100644 index 00000000..003238cf --- /dev/null +++ b/packages/base/amd64/initrds/Makefile @@ -0,0 +1 @@ +include $(ONL)/make/pkg.mk \ No newline at end of file diff --git a/packages/base/amd64/kernels/kernel-3.18-x68-64-all/builds/Makefile b/packages/base/amd64/kernels/kernel-3.18-x68-64-all/builds/Makefile index be55d0e3..e0bc3251 100644 --- a/packages/base/amd64/kernels/kernel-3.18-x68-64-all/builds/Makefile +++ b/packages/base/amd64/kernels/kernel-3.18-x68-64-all/builds/Makefile @@ -13,7 +13,7 @@ THIS_DIR := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))) include $(ONL)/make/config.mk kernel: - $(MAKE) -C $(ONL)/packages/base/any/kernels/3.18.25/configs/x86_64-all K_TARGET_DIR=$(THIS_DIR) -j + $(MAKE) -C $(ONL)/packages/base/any/kernels/3.18.25/configs/x86_64-all K_TARGET_DIR=$(THIS_DIR) $(ONL_MAKE_PARALLEL) clean: rm -rf linux-3.18.25 linux-3.18.25-mbuild diff --git a/packages/base/amd64/kernels/kernel-3.2-deb7-x86-64-all/builds/Makefile b/packages/base/amd64/kernels/kernel-3.2-deb7-x86-64-all/builds/Makefile index 2174869e..61fc5d43 100644 --- a/packages/base/amd64/kernels/kernel-3.2-deb7-x86-64-all/builds/Makefile +++ b/packages/base/amd64/kernels/kernel-3.2-deb7-x86-64-all/builds/Makefile @@ -13,7 +13,7 @@ THIS_DIR := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))) include $(ONL)/make/config.mk kernel: - $(MAKE) -C $(ONL)/packages/base/any/kernels/3.2.65-1+deb7u2/configs/x86_64-all K_TARGET_DIR=$(THIS_DIR) -j + $(MAKE) -C $(ONL)/packages/base/any/kernels/3.2.65-1+deb7u2/configs/x86_64-all K_TARGET_DIR=$(THIS_DIR) $(ONL_MAKE_PARALLEL) clean: rm -rf linux-3.2.65-1+deb7u2 linux-3.2.65-1+deb7u2-mbuild diff --git a/packages/base/amd64/oom-shim/Makefile b/packages/base/amd64/oom-shim/Makefile new file mode 100644 index 00000000..dc1e7b86 --- /dev/null +++ b/packages/base/amd64/oom-shim/Makefile @@ -0,0 +1 @@ +include $(ONL)/make/pkg.mk diff --git a/packages/base/amd64/oom-shim/PKG.yml b/packages/base/amd64/oom-shim/PKG.yml new file mode 100644 index 00000000..7f4f460d --- /dev/null +++ b/packages/base/amd64/oom-shim/PKG.yml @@ -0,0 +1,2 @@ +!include $ONL/packages/base/any/oom-shim/APKG.yml ARCH=amd64 TOOLCHAIN=x86_64-linux-gnu + diff --git a/packages/base/amd64/oom-shim/builds/Makefile b/packages/base/amd64/oom-shim/builds/Makefile new file mode 100644 index 00000000..66500cec --- /dev/null +++ b/packages/base/amd64/oom-shim/builds/Makefile @@ -0,0 +1,3 @@ +include $(ONL)/make/config.amd64.mk +include $(ONL)/packages/base/any/oom-shim/builds/Makefile + diff --git a/packages/base/amd64/oom-shim/builds/oom_shim.mk b/packages/base/amd64/oom-shim/builds/oom_shim.mk new file mode 100644 index 00000000..c119b5fc --- /dev/null +++ b/packages/base/amd64/oom-shim/builds/oom_shim.mk @@ -0,0 +1,10 @@ + +############################################################################### +# +# Inclusive Makefile for the oom_shim module. +# +# Autogenerated 2016-02-16 14:17:39.946619 +# +############################################################################### +oom_shim_BASEDIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) + diff --git a/packages/base/any/faultd/builds/Makefile b/packages/base/any/faultd/builds/Makefile index 4f07a942..5f767564 100644 --- a/packages/base/any/faultd/builds/Makefile +++ b/packages/base/any/faultd/builds/Makefile @@ -47,5 +47,5 @@ GLOBAL_CFLAGS += -DFAULTD_CONFIG_INCLUDE_MAIN=1 GLOBAL_CFLAGS += -DFAULTD_CONFIG_INCLUDE_AIM_MAIN=1 GLOBAL_CFLAGS += -g -GLOBAL_LINK_LIBS += -lpthread +GLOBAL_LINK_LIBS += -lpthread -lrt diff --git a/packages/base/any/initrds/buildroot/builds/buildroot.config-powerpc b/packages/base/any/initrds/buildroot/builds/buildroot.config-powerpc index 74334564..3d6f2bd3 100644 --- a/packages/base/any/initrds/buildroot/builds/buildroot.config-powerpc +++ b/packages/base/any/initrds/buildroot/builds/buildroot.config-powerpc @@ -1,6 +1,6 @@ # # Automatically generated make config: don't edit -# Buildroot 2013.02-rc2-dirty Configuration +# Buildroot 2013.02-rc2-g5e1a5c1-dirty Configuration # BR2_HAVE_DOT_CONFIG=y # BR2_arm is not set @@ -85,7 +85,7 @@ BR2_HOST_DIR="$(BASE_DIR)/host" # Mirrors and Download locations # BR2_PRIMARY_SITE="$(BUILDROOTMIRROR)" -BR2_PRIMARY_SITE_ONLY=n +BR2_PRIMARY_SITE_ONLY=y BR2_BACKUP_SITE="https://raw.githubusercontent.com/opennetworklinux/buildroot-download-cache/master/dl" BR2_KERNEL_MIRROR="http://www.kernel.org/pub/" BR2_GNU_MIRROR="http://ftp.gnu.org/pub/gnu" @@ -482,7 +482,11 @@ BR2_PACKAGE_MTD_UBIRMVOL=y BR2_PACKAGE_MTD_UBIUPDATEVOL=y # BR2_PACKAGE_NFS_UTILS is not set # BR2_PACKAGE_NTFS_3G is not set -# BR2_PACKAGE_SQUASHFS is not set +BR2_PACKAGE_SQUASHFS=y +BR2_PACKAGE_SQUASHFS_GZIP=y +# BR2_PACKAGE_SQUASHFS_LZMA is not set +# BR2_PACKAGE_SQUASHFS_LZO is not set +# BR2_PACKAGE_SQUASHFS_XZ is not set # BR2_PACKAGE_SSHFS is not set # BR2_PACKAGE_UNIONFS is not set # BR2_PACKAGE_XFSPROGS is not set diff --git a/packages/base/any/initrds/buildroot/builds/buildroot.config-x86_64 b/packages/base/any/initrds/buildroot/builds/buildroot.config-x86_64 index 0f008093..4cd85df1 100644 --- a/packages/base/any/initrds/buildroot/builds/buildroot.config-x86_64 +++ b/packages/base/any/initrds/buildroot/builds/buildroot.config-x86_64 @@ -1,6 +1,6 @@ # # Automatically generated make config: don't edit -# Buildroot 2013.02-rc2-dirty Configuration +# Buildroot 2013.02-rc2-g5e1a5c1-dirty Configuration # BR2_HAVE_DOT_CONFIG=y BR2_ARCH_IS_64=y @@ -60,7 +60,7 @@ BR2_HOST_DIR="$(BASE_DIR)/host" # Mirrors and Download locations # BR2_PRIMARY_SITE="$(BUILDROOTMIRROR)" -# BR2_PRIMARY_SITE_ONLY is not set +BR2_PRIMARY_SITE_ONLY=y BR2_BACKUP_SITE="https://raw.githubusercontent.com/opennetworklinux/buildroot-download-cache/master/dl" BR2_KERNEL_MIRROR="http://www.kernel.org/pub/" BR2_GNU_MIRROR="http://ftp.gnu.org/pub/gnu" @@ -456,7 +456,11 @@ BR2_PACKAGE_MTD_UBIRMVOL=y BR2_PACKAGE_MTD_UBIUPDATEVOL=y # BR2_PACKAGE_NFS_UTILS is not set # BR2_PACKAGE_NTFS_3G is not set -# BR2_PACKAGE_SQUASHFS is not set +BR2_PACKAGE_SQUASHFS=y +BR2_PACKAGE_SQUASHFS_GZIP=y +# BR2_PACKAGE_SQUASHFS_LZMA is not set +# BR2_PACKAGE_SQUASHFS_LZO is not set +# BR2_PACKAGE_SQUASHFS_XZ is not set # BR2_PACKAGE_SSHFS is not set # BR2_PACKAGE_UNIONFS is not set # BR2_PACKAGE_XFSPROGS is not set diff --git a/packages/base/any/kernels/3.18.25/configs/x86_64-all/x86_64-all.config b/packages/base/any/kernels/3.18.25/configs/x86_64-all/x86_64-all.config index 6a45564b..0f87091b 100644 --- a/packages/base/any/kernels/3.18.25/configs/x86_64-all/x86_64-all.config +++ b/packages/base/any/kernels/3.18.25/configs/x86_64-all/x86_64-all.config @@ -1656,8 +1656,39 @@ CONFIG_USB_NET_DRIVERS=y # CONFIG_USB_PEGASUS is not set # CONFIG_USB_RTL8150 is not set # CONFIG_USB_RTL8152 is not set -# CONFIG_USB_USBNET is not set +CONFIG_USB_USBNET=y +# CONFIG_USB_NET_AX8817X is not set +# CONFIG_USB_NET_AX88179_178A is not set +CONFIG_USB_NET_CDCETHER=y +# CONFIG_USB_NET_CDC_EEM is not set +CONFIG_USB_NET_CDC_NCM=y +# CONFIG_USB_NET_HUAWEI_CDC_NCM is not set +# CONFIG_USB_NET_CDC_MBIM is not set +# CONFIG_USB_NET_DM9601 is not set +# CONFIG_USB_NET_SR9700 is not set +# CONFIG_USB_NET_SR9800 is not set +# CONFIG_USB_NET_SMSC75XX is not set +# CONFIG_USB_NET_SMSC95XX is not set +# CONFIG_USB_NET_GL620A is not set +CONFIG_USB_NET_NET1080=y +# CONFIG_USB_NET_PLUSB is not set +# CONFIG_USB_NET_MCS7830 is not set +# CONFIG_USB_NET_RNDIS_HOST is not set +CONFIG_USB_NET_CDC_SUBSET=y +# CONFIG_USB_ALI_M5632 is not set +# CONFIG_USB_AN2720 is not set +CONFIG_USB_BELKIN=y +# CONFIG_USB_ARMLINUX is not set +# CONFIG_USB_EPSON2888 is not set +# CONFIG_USB_KC2190 is not set +CONFIG_USB_NET_ZAURUS=y +# CONFIG_USB_NET_CX82310_ETH is not set +# CONFIG_USB_NET_KALMIA is not set +# CONFIG_USB_NET_QMI_WWAN is not set +# CONFIG_USB_NET_INT51X1 is not set # CONFIG_USB_IPHETH is not set +# CONFIG_USB_SIERRA_NET is not set +# CONFIG_USB_VL600 is not set # CONFIG_WLAN is not set # diff --git a/packages/base/any/kernels/3.2.65-1+deb7u2/patches/platform-accton-as5812_54t-device-drivers.patch b/packages/base/any/kernels/3.2.65-1+deb7u2/patches/platform-accton-as5812_54t-device-drivers.patch index 5281309c..dfe66f46 100644 --- a/packages/base/any/kernels/3.2.65-1+deb7u2/patches/platform-accton-as5812_54t-device-drivers.patch +++ b/packages/base/any/kernels/3.2.65-1+deb7u2/patches/platform-accton-as5812_54t-device-drivers.patch @@ -1533,7 +1533,7 @@ new file mode 100644 index 0000000..0985c80 --- /dev/null +++ b/drivers/misc/eeprom/accton_as5812_54t_sfp.c -@@ -0,0 +1,332 @@ +@@ -0,0 +1,318 @@ +/* + * An hwmon driver for accton as5812_54t sfp + * @@ -1768,20 +1768,6 @@ index 0000000..0985c80 + return result; +} + -+static int convert_cpld_present_value_in_port_order(int value) -+{ -+ int ret = 0; -+ -+ ret |= (value & BIT_INDEX(0)) << 5; -+ ret |= (value & BIT_INDEX(1)) << 1; -+ ret |= (value & BIT_INDEX(2)) >> 1; -+ ret |= (value & BIT_INDEX(3)) << 1; -+ ret |= (value & BIT_INDEX(4)) >> 4; -+ ret |= (value & BIT_INDEX(5)) >> 2; -+ -+ return ret; -+} -+ +static struct as5812_54t_sfp_data *as5812_54t_sfp_update_device(struct device *dev, int update_eeprom) +{ + struct i2c_client *client = to_i2c_client(dev); @@ -1812,7 +1798,7 @@ index 0000000..0985c80 + dev_dbg(&client->dev, "cpld(0x60) reg(0x22) err %d\n", status); + } + else { -+ data->status = convert_cpld_present_value_in_port_order(status); /* (u32)status */ ++ data->status = status & 0x3F; /* (u32)status */ + } + + if (update_eeprom) { diff --git a/packages/base/any/onlp-snmpd/APKG.yml b/packages/base/any/onlp-snmpd/APKG.yml index 6e70c5f4..d931723e 100644 --- a/packages/base/any/onlp-snmpd/APKG.yml +++ b/packages/base/any/onlp-snmpd/APKG.yml @@ -1,3 +1,6 @@ +prerequisites: + packages: [ "onlp:$ARCH" ] + common: arch: $ARCH version: 1.0.0 diff --git a/packages/base/any/onlp/APKG.yml b/packages/base/any/onlp/APKG.yml index c9e3fbb4..b0d91c6a 100644 --- a/packages/base/any/onlp/APKG.yml +++ b/packages/base/any/onlp/APKG.yml @@ -26,6 +26,8 @@ packages: builds/onlp-platform-defaults/$BUILD_DIR/${TOOLCHAIN}/bin/libonlp-platform-defaults.so : $libdir/ builds/onlpd/$BUILD_DIR/${TOOLCHAIN}/bin/onlpd : $bindir/ + init: $ONL/packages/base/any/onlp/src/onlpd.init + changelog: Change changes changes., diff --git a/packages/base/any/onlp/builds/onlp/Makefile b/packages/base/any/onlp/builds/onlp/Makefile index f2918840..fb0df874 100644 --- a/packages/base/any/onlp/builds/onlp/Makefile +++ b/packages/base/any/onlp/builds/onlp/Makefile @@ -44,6 +44,8 @@ GLOBAL_CFLAGS += -DAIM_CONFIG_INCLUDE_CTOR_DTOR=1 GLOBAL_CFLAGS += -DAIM_CONFIG_INCLUDE_MODULES_INIT=1 GLOBAL_CFLAGS += -DONLP_CONFIG_API_LOCK_GLOBAL_SHARED=1 GLOBAL_CFLAGS += -DONLP_CONFIG_INCLUDE_SHLOCK_GLOBAL_INIT=1 +GLOBAL_CFLAGS += -DAIM_CONFIG_INCLUDE_PVS_SYSLOG=1 +GLOBAL_CFLAGS += -DAIM_CONFIG_INCLUDE_DAEMONIZE=1 GLOBAL_CFLAGS += -fPIC GLOBAL_LINK_LIBS += -lpthread $(LIBONLP_PLATFORM) $(LIBONLP_PLATFORM_DEFAULTS) diff --git a/packages/base/any/onlp/builds/onlpd/Makefile b/packages/base/any/onlp/builds/onlpd/Makefile index 0a3a9d49..258bd9f7 100644 --- a/packages/base/any/onlp/builds/onlpd/Makefile +++ b/packages/base/any/onlp/builds/onlpd/Makefile @@ -40,8 +40,11 @@ LIBONLP_SO := ../onlp/$(BUILD_DIR)/bin/libonlp.so GLOBAL_CFLAGS += -DAIM_CONFIG_AIM_MAIN_FUNCTION=onlpdump_main GLOBAL_CFLAGS += -DAIM_CONFIG_INCLUDE_MODULES_INIT=1 GLOBAL_CFLAGS += -DAIM_CONFIG_INCLUDE_MAIN=1 +GLOBAL_CFLAGS += -DAIM_CONFIG_INCLUDE_DAEMONIZE=1 +GLOBAL_CFLAGS += -DAIM_CONFIG_INCLUDE_PVS_SYSLOG=1 + GLOBAL_LINK_LIBS += $(LIBONLP_SO) -Wl,--unresolved-symbols=ignore-in-shared-libs -GLOBAL_LINK_LIBS += -lpthread -lm +GLOBAL_LINK_LIBS += -lpthread -lm -lrt include $(BUILDER)/targets.mk diff --git a/packages/base/any/onlp/src/onlp/module/inc/onlp/sys.h b/packages/base/any/onlp/src/onlp/module/inc/onlp/sys.h index 1d9029ee..8d12781f 100644 --- a/packages/base/any/onlp/src/onlp/module/inc/onlp/sys.h +++ b/packages/base/any/onlp/src/onlp/module/inc/onlp/sys.h @@ -1,21 +1,21 @@ /************************************************************ * - * - * Copyright 2014, 2015 Big Switch Networks, Inc. - * + * + * Copyright 2014, 2015 Big Switch Networks, Inc. + * * Licensed under the Eclipse Public License, Version 1.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.eclipse.org/legal/epl-v10.html - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific * language governing permissions and limitations under the * License. - * + * * ************************************************************ * @@ -96,12 +96,17 @@ int onlp_sys_vioctl(int code, va_list vargs); /** * @brief Start the platform management thread. */ -int onlp_sys_platform_manage_start(void); +int onlp_sys_platform_manage_start(int block); /** * @brief Stop the platform management thread. */ -int onlp_sys_platform_manage_stop(void); +int onlp_sys_platform_manage_stop(int block); + +/** + * @brief Join the platform management thread. + */ +int onlp_sys_platform_manage_join(void); /** * @brief Perform any pending platform management activities. diff --git a/packages/base/any/onlp/src/onlp/module/src/Makefile b/packages/base/any/onlp/src/onlp/module/src/Makefile index 3033edf5..27348ddb 100644 --- a/packages/base/any/onlp/src/onlp/module/src/Makefile +++ b/packages/base/any/onlp/src/onlp/module/src/Makefile @@ -1,28 +1,28 @@ ############################################################ # -# -# Copyright 2014, 2015 Big Switch Networks, Inc. -# +# +# Copyright 2014, 2015 Big Switch Networks, Inc. +# # Licensed under the Eclipse Public License, Version 1.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at -# +# # http://www.eclipse.org/legal/epl-v10.html -# +# # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, # either express or implied. See the License for the specific # language governing permissions and limitations under the # License. -# +# # ############################################################ # # Local source generation targets. # ############################################################ -include ../../../../init.mk +include $(ONL)/make/config.mk ucli: $(SUBMODULE_BIGCODE)/tools/uclihandlers.py onlp_ucli.c diff --git a/packages/base/any/onlp/src/onlp/module/src/onlp_main.c b/packages/base/any/onlp/src/onlp/module/src/onlp_main.c index f1343487..990d8a54 100644 --- a/packages/base/any/onlp/src/onlp/module/src/onlp_main.c +++ b/packages/base/any/onlp/src/onlp/module/src/onlp_main.c @@ -28,6 +28,10 @@ #include #include #include +#include +#include + +static void platform_manager_daemon__(const char* pidfile); /** * Human-readable SFP inventory. @@ -165,10 +169,12 @@ onlpdump_main(int argc, char* argv[]) int x = 0; int S = 0; int l = 0; + int M = 0; + char* pidfile = NULL; const char* O = NULL; const char* t = NULL; - while( (c = getopt(argc, argv, "srehdojmipxlSt:O:")) != -1) { + while( (c = getopt(argc, argv, "srehdojmM:ipxlSt:O:")) != -1) { switch(c) { case 's': show=1; break; @@ -180,6 +186,7 @@ onlpdump_main(int argc, char* argv[]) case 'o': o=1; break; case 'x': x=1; break; case 'm': m=1; break; + case 'M': M=1; pidfile = optarg; break; case 'i': i=1; break; case 'p': p=1; show=-1; break; case 't': t = optarg; break; @@ -190,6 +197,11 @@ onlpdump_main(int argc, char* argv[]) } } + if(M) { + platform_manager_daemon__(pidfile); + exit(0); + } + if(help) { printf("Usage: %s [OPTIONS]\n", argv[0]); printf(" -d Use dump(). This is the default.\n"); @@ -200,6 +212,7 @@ onlpdump_main(int argc, char* argv[]) printf(" -x Dump Platform Info only.\n"); printf(" -j Dump ONIE data in JSON format.\n"); printf(" -m Run platform manager.\n"); + printf(" -M Run as platform manager daemon.\n"); printf(" -i Iterate OIDs.\n"); printf(" -p Show SFP presence.\n"); printf(" -t Decode TlvInfo data.\n"); @@ -302,10 +315,10 @@ onlpdump_main(int argc, char* argv[]) if(m) { printf("Running the platform manager for 600 seconds...\n"); - onlp_sys_platform_manage_start(); + onlp_sys_platform_manage_start(0); sleep(600); printf("Stopping the platform manager.\n"); - onlp_sys_platform_manage_stop(); + onlp_sys_platform_manage_stop(1); } if(p) { @@ -323,3 +336,75 @@ onlpdump_main(int argc, char* argv[]) return 0; } + +#if AIM_CONFIG_INCLUDE_DAEMONIZE == 1 + +#include +#include +#include +#include + +void +sighandler__(int signal) +{ + onlp_sys_platform_manage_stop(0); +} + +static void +platform_manager_daemon__(const char* pidfile) +{ + aim_pvs_t* aim_pvs_syslog = NULL; + aim_daemon_restart_config_t rconfig; + aim_daemon_config_t config; + + memset(&config, 0, sizeof(config)); + aim_daemon_restart_config_init(&rconfig, 1, 1); + AIM_BITMAP_CLR(&rconfig.signal_restarts, SIGTERM); + AIM_BITMAP_CLR(&rconfig.exit_restarts, 0); + rconfig.maximum_restarts=50; + rconfig.pvs = NULL; + config.wd = "/"; + + aim_daemonize(&config, &rconfig); + aim_log_handler_basic_init_all("onlpd", + "/var/log/onlpd.log", + 1024*1024, + 99); + if(pidfile) { + FILE* fp = fopen(pidfile, "w"); + if(fp == NULL) { + int e = errno; + aim_printf(aim_pvs_syslog, "fatal: open(%s): %s\n", + pidfile, strerror(e)); + aim_printf(&aim_pvs_stderr, "fatal: open(%s): %s\n", + pidfile, strerror(e)); + + /* Don't attempt restart */ + raise(SIGTERM); + } + fprintf(fp, "%d\n", getpid()); + fclose(fp); + } + + /** Signal handler for terminating the platform manager */ + signal(SIGTERM, sighandler__); + + /** Start and block in platform manager. */ + onlp_sys_platform_manage_start(1); + + /** Terminated via signal. Cleanup and exit. */ + onlp_sys_platform_manage_stop(1); + + aim_log_handler_basic_denit_all(); + exit(0); +} + + +#else +static void +platform_manager_daemon__(const char* pidfile) +{ + fprintf(stderr, "Daemon mode not supported in this build."); + exit(1); +} +#endif diff --git a/packages/base/any/onlp/src/onlp/module/src/platform_manager.c b/packages/base/any/onlp/src/onlp/module/src/platform_manager.c index f724e9d6..16684832 100644 --- a/packages/base/any/onlp/src/onlp/module/src/platform_manager.c +++ b/packages/base/any/onlp/src/onlp/module/src/platform_manager.c @@ -228,7 +228,7 @@ onlp_sys_platform_manage_thread__(void* vctrl) } int -onlp_sys_platform_manage_start(void) +onlp_sys_platform_manage_start(int block) { onlp_sys_platform_manage_init(); @@ -250,22 +250,39 @@ onlp_sys_platform_manage_start(void) return -1; } + if(block) { + onlp_sys_platform_manage_join(); + } + return 0; } int -onlp_sys_platform_manage_stop(void) +onlp_sys_platform_manage_stop(int block) { if(control__.eventfd > 0) { uint64_t zero = 1; /* Tell the thread to exit */ write(control__.eventfd, &zero, sizeof(zero)); - /* Wait for the thread to terminate */ - pthread_join(control__.thread, NULL); + + if(block) { + onlp_sys_platform_manage_join(); + } } return 0; } +int +onlp_sys_platform_manage_join(void) +{ + if(control__.eventfd > 0) { + /* Wait for the thread to terminate */ + pthread_join(control__.thread, NULL); + close(control__.eventfd); + control__.eventfd = -1; + } + return 0; +} static int platform_psus_notify__(void) @@ -273,6 +290,7 @@ platform_psus_notify__(void) static onlp_oid_t psu_oid_table[ONLP_OID_TABLE_SIZE] = {0}; static onlp_psu_info_t psu_info_table[ONLP_OID_TABLE_SIZE]; int i = 0; + static int flag[ONLP_OID_TABLE_SIZE] = {0}; if(psu_oid_table[0] == 0) { /* We haven't retreived the system PSU oids yet. */ @@ -302,6 +320,26 @@ platform_psus_notify__(void) continue; } + /* report initial failed state */ + if ( !flag[i] ) { + if ( !(pi.status & 0x1) ) { + AIM_SYSLOG_WARN("PSU is not present.", + "The given PSU is not present.", + "PSU %d is not present.", pid); + } + if ( pi.status & ONLP_PSU_STATUS_FAILED ) { + AIM_SYSLOG_CRIT("PSU has failed.", + "The given PSU has failed.", + "PSU %d has failed.", pid); + } + if ((pi.status & 0x01) && !(pi.status & ONLP_PSU_STATUS_FAILED) && (pi.status & ONLP_PSU_STATUS_UNPLUGGED)) { + AIM_SYSLOG_WARN("PSU power cord not plugged.", + "The given PSU does not have power cord plugged.", + "PSU %d power cord not plugged.", pid); + } + flag[i] = 1; + } + /* * Log any presences or failure transitions. */ @@ -363,6 +401,7 @@ platform_fans_notify__(void) static onlp_oid_t fan_oid_table[ONLP_OID_TABLE_SIZE] = {0}; static onlp_fan_info_t fan_info_table[ONLP_OID_TABLE_SIZE]; int i = 0; + static int flag[ONLP_OID_TABLE_SIZE] = {0}; if(fan_oid_table[0] == 0) { /* We haven't retreived the system FAN oids yet. */ @@ -392,6 +431,21 @@ platform_fans_notify__(void) continue; } + /* report initial failed state */ + if ( !flag[i] ) { + if ( !(fi.status & 0x1) ) { + AIM_SYSLOG_WARN("Fan is not present.", + "The given Fan is not present.", + "Fan %d is not present.", fid); + } + if ( fi.status & ONLP_FAN_STATUS_FAILED ) { + AIM_SYSLOG_CRIT("Fan has failed.", + "The given fan has failed.", + "Fan %d has failed.", fid); + } + flag[i] = 1; + } + /* * Log any presences or failure transitions. */ diff --git a/packages/base/any/onlp/src/onlpd.init b/packages/base/any/onlp/src/onlpd.init new file mode 100644 index 00000000..99165b56 --- /dev/null +++ b/packages/base/any/onlp/src/onlpd.init @@ -0,0 +1,67 @@ +#!/bin/sh + +### BEGIN INIT INFO +# Provides: onlpd +# Required-Start: $syslog +# Required-Stop: $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Start ONLP Platform Agent +# Description: ONLP PLATFORM AGENTX +### END INIT INFO + +PATH=/sbin:/bin:/usr/sbin:/usr/bin + +. /lib/lsb/init-functions + +DAEMON=/bin/onlpd +PIDFILE=/var/run/onlpd.pid +ONLP_SNMPD_OPTS="-M $PIDFILE" +QUIET= + +test -x $DAEMON || exit 5 + +RUNASUSER=root +UGID=$(getent passwd $RUNASUSER | cut -f 3,4 -d:) || true + +case $1 in + start) + log_daemon_msg "Starting ONLP Platform Agent" "onlpd" + if [ -z "$UGID" ]; then + log_failure_msg "user \"$RUNASUSER\" does not exist" + exit 1 + fi + start-stop-daemon --start $QUIET --oknodo --pidfile $PIDFILE --startas $DAEMON -- $ONLP_SNMPD_OPTS $ONLP_SNMPD_EXTRA_OPTS + status=$? + log_end_msg $status + ;; + stop) + log_daemon_msg "Stopping ONLP Platform Agent" "onlpd" + start-stop-daemon --stop $QUIET --oknodo --pidfile $PIDFILE + log_end_msg $? + rm -f $PIDFILE + ;; + restart|force-reload) + $0 stop && sleep 2 && $0 start + ;; + try-restart) + if $0 status >/dev/null; then + $0 restart + else + exit 0 + fi + ;; + reload) + log_daemon_msg "Reloading ONLP Platform Agent" "onlpd" + start-stop-daemon --stop $QUIET --oknodo --pidfile $PIDFILE --signal 1 + status=$? + log_end_msg $status + ;; + status) + status_of_proc $DAEMON "ONLP Platform Agent" + ;; + *) + echo "Usage: $0 {start|stop|restart|try-restart|force-reload|reload|status}" + exit 2 + ;; +esac diff --git a/packages/base/any/oom-shim/APKG.yml b/packages/base/any/oom-shim/APKG.yml new file mode 100644 index 00000000..6a54841f --- /dev/null +++ b/packages/base/any/oom-shim/APKG.yml @@ -0,0 +1,32 @@ +############################################################ +# +# OOM SHIM +# +# Requires: ARCH, TOOLCHAIN +# +############################################################ +variables: + libdir: /lib/${TOOLCHAIN} + +common: + arch: $ARCH + version: 1.0.0 + copyright: Copyright 2016 Big Switch Networks + maintainer: support@bigswitch.com + + + +packages: + - name: oom-shim + version: 1.0.0 + summary: Open Optical Module Wrapper library around ONLP + provides: [ oom_shim ] + + files: + builds/$BUILD_DIR/${TOOLCHAIN}/bin/liboom-south.so : $libdir/ + + changelog: Initial code for 2016 OCP Demo + + + + diff --git a/packages/base/any/oom-shim/builds/Makefile b/packages/base/any/oom-shim/builds/Makefile new file mode 100644 index 00000000..0ccc185a --- /dev/null +++ b/packages/base/any/oom-shim/builds/Makefile @@ -0,0 +1,56 @@ +# -*- Makefile -*- +############################################################ +# +# +# Copyright 2014 BigSwitch Networks, Inc. +# +# Licensed under the Eclipse Public License, Version 1.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.eclipse.org/legal/epl-v10.html +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +# either express or implied. See the License for the specific +# language governing permissions and limitations under the +# License. +# +# +############################################################ +# +# +############################################################ +include $(ONL)/make/any.mk + +MODULE := oom_shim +include $(BUILDER)/standardinit.mk + +DEPENDMODULES := AIM onlplib onlp oom_shim cjson cjson_util sff IOF timer_wheel OS + +#LIBONLP_PLATFORM_DEFAULTS := ../onlp-platform-defaults/$(BUILD_DIR)/bin/libonlp-platform-defaults.so +#LIBONLP_PLATFORM := ../onlp-platform/$(BUILD_DIR)/bin/libonlp-platform.so +LIBONLP := $(shell $(ONLPM) --find-file onlp:$(ARCH) libonlp.so) + +include $(BUILDER)/dependmodules.mk + +SHAREDLIB := liboom-south.so +$(SHAREDLIB)_TARGETS := $(ALL_TARGETS) +include $(BUILDER)/so.mk + +.DEFAULT_GOAL := sharedlibs + +GLOBAL_CFLAGS += -DAIM_CONFIG_INCLUDE_CTOR_DTOR=1 +GLOBAL_CFLAGS += -DAIM_CONFIG_INCLUDE_MODULES_INIT=1 +GLOBAL_CFLAGS += -DONLP_CONFIG_API_LOCK_GLOBAL_SHARED=1 +GLOBAL_CFLAGS += -DONLP_CONFIG_INCLUDE_SHLOCK_GLOBAL_INIT=1 + +GLOBAL_CFLAGS += -fPIC +GLOBAL_LINK_LIBS += -lpthread $(LIBONLP) + +include $(BUILDER)/targets.mk + +.PHONY: deb +deb: + $(MAKE) -C deb diff --git a/packages/base/any/oom-shim/src/Makefile b/packages/base/any/oom-shim/src/Makefile new file mode 100644 index 00000000..ee296946 --- /dev/null +++ b/packages/base/any/oom-shim/src/Makefile @@ -0,0 +1,4 @@ +include $(ONL)/make/config.mk +MODULE := oom_shim +AUTOMODULE := oom_shim +include $(BUILDER)/definemodule.mk diff --git a/packages/base/any/oom-shim/src/module/auto/make.mk b/packages/base/any/oom-shim/src/module/auto/make.mk new file mode 100644 index 00000000..9dac4629 --- /dev/null +++ b/packages/base/any/oom-shim/src/module/auto/make.mk @@ -0,0 +1,28 @@ +############################################################ +# +# +# Copyright 2013, 2014 BigSwitch Networks, Inc. +# +# Licensed under the Eclipse Public License, Version 1.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.eclipse.org/legal/epl-v10.html +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +# either express or implied. See the License for the specific +# language governing permissions and limitations under the +# License. +# +# +############################################################ +# +# faultd Autogeneration +# +############################################################ +oom_shim_AUTO_DEFS := module/auto/oom_shim.yml +oom_shim_AUTO_DIRS := module/inc/oom_shim module/src +include $(BUILDER)/auto.mk + diff --git a/packages/base/any/oom-shim/src/module/auto/oom_shim.yml b/packages/base/any/oom-shim/src/module/auto/oom_shim.yml new file mode 100644 index 00000000..32557d9e --- /dev/null +++ b/packages/base/any/oom-shim/src/module/auto/oom_shim.yml @@ -0,0 +1,86 @@ +############################################################ +# +# +# Copyright 2013, 2014 BigSwitch Networks, Inc. +# +# Licensed under the Eclipse Public License, Version 1.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.eclipse.org/legal/epl-v10.html +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +# either express or implied. See the License for the specific +# language governing permissions and limitations under the +# License. +# +# +############################################################ +# +# faultd Autogeneration Definitions. +# +############################################################ + +cdefs: &cdefs +- OOM_SHIM_CONFIG_INCLUDE_LOGGING: + doc: "Include or exclude logging." + default: 1 +- OOM_SHIM_CONFIG_LOG_OPTIONS_DEFAULT: + doc: "Default enabled log options." + default: AIM_LOG_OPTIONS_DEFAULT +- OOM_SHIM_CONFIG_LOG_BITS_DEFAULT: + doc: "Default enabled log bits." + default: AIM_LOG_BITS_DEFAULT +- OOM_SHIM_CONFIG_LOG_CUSTOM_BITS_DEFAULT: + doc: "Default enabled custom log bits." + default: 0 +- OOM_SHIM_CONFIG_PORTING_STDLIB: + doc: "Default all porting macros to use the C standard libraries." + default: 1 +- OOM_SHIM_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS: + doc: "Include standard library headers for stdlib porting macros." + default: OOM_SHIM_CONFIG_PORTING_STDLIB +- OOM_SHIM_CONFIG_INCLUDE_UCLI: + doc: "Include generic uCli support." + default: 0 +- OOM_SHIM_CONFIG_PIPE_NAME_DEFAULT: + doc: "Default named pipe." + default: "\"/var/run/faultd.pipe\"" +- OOM_SHIM_CONFIG_BINARY_SIZE: + doc: "Maximum binary name size." + default: 255 +- OOM_SHIM_CONFIG_BACKTRACE_SIZE_MAX: + doc: "Maximum backtrace size." + default: 32 +- OOM_SHIM_CONFIG_SERVICE_PIPES_MAX: + doc: "Maximum number of simulatanous service pipes." + default: 8 +- OOM_SHIM_CONFIG_BACKTRACE_SYMBOLS_SIZE: + doc: "Maximum backtrace symbols size" + default: 4096 +- OOM_SHIM_CONFIG_INCLUDE_MAIN: + doc: "Include faultd_main() for standard faultd daemon build." + default: 0 +- OOM_SHIM_CONFIG_INCLUDE_AIM_MAIN: + doc: "Include aim_main() as faultd_main()." + default: OOM_SHIM_CONFIG_INCLUDE_MAIN +- OOM_SHIM_CONFIG_MAIN_PIPENAME: + doc: "Default pipename used by faultd_main() if included." + default: "\"/var/run/faultd.fifo\"" + + +definitions: + cdefs: + OOM_SHIM_CONFIG_HEADER: + defs: *cdefs + basename: faultd_config + + portingmacro: + OOM_SHIM: + macros: + - memset + - memcpy + - strncpy + - strlen diff --git a/packages/base/any/oom-shim/src/module/inc/oom-shim/oom-shim.h b/packages/base/any/oom-shim/src/module/inc/oom-shim/oom-shim.h new file mode 100644 index 00000000..5833c849 --- /dev/null +++ b/packages/base/any/oom-shim/src/module/inc/oom-shim/oom-shim.h @@ -0,0 +1,13 @@ +#define MAXPORTS 512 +#define SFF_A0_BASE 0x0 +#define SFF_A2_BASE 0x100 + +/** + * SFF_EEPROM_DATA_DEBUG + * For printing the eeprom hex data for debugging. + */ + + +#ifndef SFF_EEPROM_DATA_DEBUG +#define SFF_EEPROM_DATA_DEBUG 0 +#endif diff --git a/packages/base/any/oom-shim/src/module/inc/oom-shim/oom_internal.h b/packages/base/any/oom-shim/src/module/inc/oom-shim/oom_internal.h new file mode 100644 index 00000000..67bb0618 --- /dev/null +++ b/packages/base/any/oom-shim/src/module/inc/oom-shim/oom_internal.h @@ -0,0 +1,6 @@ +#ifndef OOM_INTERNAL_H_ +#define OOM_INTERNAL_H_ + +extern void print_block_hex(uint8_t* buf); + +#endif diff --git a/packages/base/any/oom-shim/src/module/inc/oom-shim/oom_south.h b/packages/base/any/oom-shim/src/module/inc/oom-shim/oom_south.h new file mode 100644 index 00000000..fef10e0c --- /dev/null +++ b/packages/base/any/oom-shim/src/module/inc/oom-shim/oom_south.h @@ -0,0 +1,230 @@ +/****************************** +* +* Southbound API definition for +* Open Optical Monitoring (OOM) initiative under the +* umbrella of OCP. +* +* Copyright 2015 Finisar Inc. +* +* LIKELY TO CHANGE, no promises of compatibility with future +* versions is made or implied +* +* Version: 0.4, January 28, 2016 (added oom_get_port(n)) +* Author: Don Bollinger +* +*******************************/ + +#include + +/* Discovery definitions */ + +/* + * list of valid port types + * Values are from SFF-8436 spec (rev 4.8, page 74) + * note OOM_PORT_TYPE_NOT_PRESENT to indicate no + * module is present in this port + */ + +typedef enum oom_port_class_e { + OOM_PORT_CLASS_UNKNOWN = 0x00, + OOM_PORT_CLASS_SFF = 0x01, + OOM_PORT_CLASS_CFP = 0x02, +} oom_port_class_t; + + +/* Define the elements of a port + * Note: seq_num is an implementation defined magic + * number to detect that the module + * on this port has been removed/inserted since this + * port was last accessed + * port_flags is implementation dependent, for use + * by the underlying NOS and switch + * port_flags should NOT be used or modified by the + * decode layer or above + */ +typedef struct oom_port_s { + void *handle; /* opaque handle for this port */ + oom_port_class_t oom_class; /* class is SFF or CFP */ + char name[32]; /* 32 bytes for a human readable name */ +} oom_port_t; + + +/* + * get the list of available ports, as an array + * of oom_port_t structs. 'listsize' indicates the + * number of ports that will fit in the portlist[] array. + * + * If there are listsize or fewer ports, and the portlist[] + * array is new or out of date, then the shim populates + * the portlist structure, and returns 0 (success). + * + * If the portlist structure is already current, then the + * shim does not modify portlist[], and returns 1 (no change). + * This is intended as a way to poll for changes to the ports + * (eg modules added, deleted, replaced, etc) + * + * If there are more than listize ports, the shim + * returns -ENOMEM, to indicate that a larger portlist[] + * array is required. + * + * If called as oom_get_portlist(NULL, 0), then the shim will + * return the number of ports, ie the minimum value of listsize. Note + * that some implementations can dynamically add ports, so the return + * value is a very good hint, but not a guarantee as to the required + * size of the portlist[] structure. + */ +int oom_get_portlist(oom_port_t portlist[], int listsize); + + +/* Read/write control "PINS" function definitions */ + +/* note that these 'control pins' functions are in limbo right + * now, and may not be implemented until later, if at all. + * Developers of "southbound shims" may choose to delay + * implementation of oom_{get, set}_function() + */ + +/* list of functions that can be controlled */ +typedef enum oom_functions_e { + OOM_FUNCTIONS_TX_FAULT, + OOM_FUNCTIONS_TX_DISABLE, + OOM_FUNCTIONS_MODULE_ABSENT, + OOM_FUNCTIONS_RS0, + OOM_FUNCTIONS_RS1, + /* more control functions to be defined here */ + OOM_FUNCTIONS_RXLOSS_OF_SIG, + OOM_FUNCTIONS_LAST = OOM_FUNCTIONS_RXLOSS_OF_SIG, + OOM_FUNCTIONS_COUNT, + OOM_FUNCTIONS_INVALID = -1, +} oom_functions_t; + +/* + * read a function + * rv will be 1 for asserted or enabled, 0 if not + * returns 0 on success, or negative error code + */ +int oom_get_function(oom_port_t* port, oom_functions_t function, int* rv); + +/* + * write a function + * value should be 1 for asserted or enabled, 0 if not + * returns 0 on success, or negative error code + */ +int oom_set_function(oom_port_t* port, oom_functions_t function, int value); + + +/* Read/write EEPROM definitions */ + +/* + * read EEPROM + * address: the 2-wire (i2c) address, per the SFF specs, + * eg A0h, A2h, A8h, etc. (160, 162, 168 respectively.) + * Note that this address points to 256 bytes of data. + * Bytes 0-127 are intrinsic to this address space. + * Bytes 128-255 are the contents of the "page" selected + * in byte 127. (The page select byte will be written by + * the driver as part of this call. DO NOT explicitly + * set byte 127 to select a page.) + * Thus there are 256 pages (based on one + * byte of page select in byte 127). ONE of these pages + * can be accessed in an EEPROM read, and the content + * of that page will be at offset 128-255 of the address + * space. Page contents starts at offset=128. It is NOT + * necessary to read the first 128 bytes of the address + * space to access the page contents in the second 128 + * bytes. See the specs for a further description of + * this access architecture, and the content of each page. + * Note: Bytes 0-127 do not depend on the value of page. + * Reading 256 bytes, starting at offset 0, will read both + * the lower half of the address space, AND the page selected. + * page: page of EEPROM to read from + * offset: byte location within the address space to begin + * transferring data from. Remember, offset 0-127 reference + * the first 128 bytes of "address" range. Their contents + * do not depend on the value of page. Page content begins + * at offset=128. + * len: the number of bytes to be read + * note that (offset + len) must be no more than 256, as + * there are only 256 bytes of data available at A0, A2, etc + * data: receives the memory contents + * returns: the number of bytes read, or a + * negative error code + */ +int oom_get_memory_sff(oom_port_t* port, int address, int page, int offset, int len, uint8_t* data); + + +/* + * write EEPROM + * address: the 2-wire (i2c) address, per the SFF specs, + * eg A0h, A2h, A8h, etc. (160, 162, 168 respectively.) + * Note that this address points to 256 bytes of data. + * Bytes 0-127 are intrinsic to this address space. + * Bytes 128-255 are the contents of the "page" selected + * in byte 127. (The page select byte will be written by + * the driver as part of this call. DO NOT explicitly + * set byte 127 to select a page.) + * Thus there are 256 pages (based on one + * byte of page select in byte 127). ONE of these pages + * can be accessed in an EEPROM write, and data written + * to that page must be written to offset 128-255 of the + * address space. + * Page contents starts at offset=128. It is NOT + * necessary to write the first 128 bytes of the address + * space to access the page contents in the second 128 + * bytes. See the specs for a further description of + * this access architecture, and the content of each page. + * Note: Writes to bytes 0-127 will go to the lower half + * of the address space, and do not depend on the + * value of page. Writing 256 bytes, starting at offset 0, + * will write both the lower half of the address space AND + * the page selected. + * page: page of EEPROM to write to + * offset: byte location within the address space to begin + * transferring data from. Remember, offset 0-127 reference + * the first 128 bytes of "address" range. Their contents + * do not depend on the value of page. Page content begins + * at offset=128. + * len: the number of bytes to be written + * note that (offset + len) must be no more than 256, as + * there are only 256 bytes of address space at A0, A2, etc + * data: data to be written to memory + * returns: the number of bytes written, or a + * negative error code + */ +int oom_set_memory_sff(oom_port_t* port, int address, int page, int offset, int len, uint8_t* data); + +/* + * read 16 bit oriented EEPROM + * CFP modules (for example) do not use 2-wire (i2c) addresses + * nor do they use the page table scheme of SFP, XFP, QSFP, etc + * their EEPROM is addressed in 16 bit words, in a 32K word + * linear address space from 8000hex to FFFFhex + * (0000-7FFF are reserved for IEEE 802.3 use) + * the interface below is for these types of modules + * port: an OOM port structure + * address: address between 0x8000 and 0xFFFF to begin read + * Each consecutive address is a 16 bit "register" + * (not an 8 bit byte) + * len: number of 16 bit "registers" to read + * data: receives the memory contents + * returns the number of words read, or a negative error code + */ +int oom_get_memory_cfp(oom_port_t* port, int address, int len, uint16_t* data); + +/* + * write 16 bit oriented EEPROM + * CFP modules (for example) do not use 2-wire (i2c) addresses + * nor do they use the page table scheme of SFP, XFP, QSFP, etc + * their EEPROM is addressed in 16 bit words, in a 32K word + * linear address space from 8000hex to FFFFhex + * (0000-7FFF are reserved for IEEE 802.3 use) + * the interface below is for these types of modules + * port: an OOM port structure + * address: address between 0x8000 and 0xFFFF to begin write + * Each consecutive address is a 16 bit "register" + * (not an 8 bit byte) + * len: number of 16 bit "registers" to write + * data: data to be written to memory + * returns the number of words written, or a negative error code + */ +int oom_set_memory_cfp(oom_port_t* port, int address, int len, uint16_t* data); diff --git a/packages/base/any/oom-shim/src/module/make.mk b/packages/base/any/oom-shim/src/module/make.mk new file mode 100644 index 00000000..b6ec73a3 --- /dev/null +++ b/packages/base/any/oom-shim/src/module/make.mk @@ -0,0 +1,30 @@ +############################################################ +# +# +# Copyright 2014, 2015 Big Switch Networks, Inc. +# +# Licensed under the Eclipse Public License, Version 1.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.eclipse.org/legal/epl-v10.html +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +# either express or implied. See the License for the specific +# language governing permissions and limitations under the +# License. +# +# +############################################################ +# +# +# +############################################################ + +THIS_DIR := $(dir $(lastword $(MAKEFILE_LIST))) +oom_shim_INCLUDES := -I $(THIS_DIR)inc +oom_shim_INTERNAL_INCLUDES := -I $(THIS_DIR)src +oom_shim_DEPENDMODULE_ENTRIES := init:oom_shim ucli:oom_shim + diff --git a/packages/base/any/oom-shim/src/module/src/Makefile b/packages/base/any/oom-shim/src/module/src/Makefile new file mode 100644 index 00000000..1259eda6 --- /dev/null +++ b/packages/base/any/oom-shim/src/module/src/Makefile @@ -0,0 +1,30 @@ +############################################################ +# +# +# Copyright 2014, 2015 Big Switch Networks, Inc. +# +# Licensed under the Eclipse Public License, Version 1.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.eclipse.org/legal/epl-v10.html +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +# either express or implied. See the License for the specific +# language governing permissions and limitations under the +# License. +# +# +############################################################ +# +# Local source generation targets. +# +############################################################ + +include ../../../../init.mk + +ucli: + $(SUBMODULE_BIGCODE)/tools/uclihandlers.py oom_shim_ucli.c + diff --git a/packages/base/any/oom-shim/src/module/src/make.mk b/packages/base/any/oom-shim/src/module/src/make.mk new file mode 100644 index 00000000..973f1ce3 --- /dev/null +++ b/packages/base/any/oom-shim/src/module/src/make.mk @@ -0,0 +1,29 @@ +############################################################ +# +# +# Copyright 2014, 2015 Big Switch Networks, Inc. +# +# Licensed under the Eclipse Public License, Version 1.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.eclipse.org/legal/epl-v10.html +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +# either express or implied. See the License for the specific +# language governing permissions and limitations under the +# License. +# +# +############################################################ +# +# +# +############################################################ + +LIBRARY := oom_shim +$(LIBRARY)_SUBDIR := $(dir $(lastword $(MAKEFILE_LIST))) +#$(LIBRARY)_LAST := 1 +include $(BUILDER)/lib.mk diff --git a/packages/base/any/oom-shim/src/module/src/oom_internal.c b/packages/base/any/oom-shim/src/module/src/oom_internal.c new file mode 100644 index 00000000..0059479d --- /dev/null +++ b/packages/base/any/oom-shim/src/module/src/oom_internal.c @@ -0,0 +1,28 @@ +/* + * Internal OOM functions + */ + +#include +#include + +void print_block_hex(uint8_t* buf) +{ + int j, k; + uint8_t* bufptr8; + uint32_t tempintchar; + + bufptr8 = buf; + for (j = 0; j < 8; j++) { + printf(" " ); + for (k = 0; k < 19; k++) { + if ((k % 5) == 4) { + printf(" "); + } else { + tempintchar = *bufptr8; + printf("%.2X", tempintchar); + bufptr8++; + } + } + printf("\n"); + } +} diff --git a/packages/base/any/oom-shim/src/module/src/oom_shim.c b/packages/base/any/oom-shim/src/module/src/oom_shim.c new file mode 100644 index 00000000..b2d5be61 --- /dev/null +++ b/packages/base/any/oom-shim/src/module/src/oom_shim.c @@ -0,0 +1,144 @@ +/************************************************************ + * + * + * Copyright 2016 Big Switch Networks, Inc. + * + * Licensed under the Eclipse Public License, Version 1.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.eclipse.org/legal/epl-v10.html + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + * + * + ************************************************************ + * + * + * + ***********************************************************/ +#include +#include +#include +#include +#include +#include + + +/* +* Initializing the SFP and ONLP modules +* compiler calls this function while compiling +*/ + +void __oom_shim_module_init__(void) { + onlp_init(); +} + +/*Gets the portlist of the SFP ports on the switch*/ +int oom_get_portlist(oom_port_t portlist[], int listsize){ + + int port,i=0; + oom_port_t* pptr; + + + onlp_sfp_bitmap_t bitmap; + onlp_sfp_bitmap_t_init(&bitmap); + onlp_sfp_bitmap_get(&bitmap); + + if ((portlist == NULL) && (listsize == 0)){ /* asking # of ports */ + if(AIM_BITMAP_COUNT(&bitmap) == 0){ + return 0; + } + else + return AIM_BITMAP_COUNT(&bitmap); + } + + AIM_BITMAP_ITER(&bitmap, port){ + int rv; + + pptr = &portlist[i]; + pptr->handle = (void *)(uintptr_t)port+1; + pptr->oom_class = OOM_PORT_CLASS_SFF; + sprintf(pptr->name, "port%d", port+1); + i++; + + rv = onlp_sfp_is_present(port); + if(rv == 0){ + /* aim_printf(&aim_pvs_stdout, "module %d is not present\n", port);*/ + pptr->oom_class = OOM_PORT_CLASS_UNKNOWN; + continue; + } + + if(rv < 0){ + aim_printf(&aim_pvs_stdout, "%4d Error %{onlp_status}\n", port, rv); + pptr->oom_class = OOM_PORT_CLASS_UNKNOWN; + continue; + } + } + return 0; +} + + +int oom_get_memory_sff(oom_port_t* port, int address, int page, int offset, int len, uint8_t* data){ + int rv; + unsigned int port_num; + uint8_t* idprom = NULL; + + port_num = (unsigned int)(uintptr_t)port->handle; + port_num -= 1; + + if (offset >= 256) + return -1; /* out of range */ + + /** + * place holder implementation until onlp_sfp_eeprom_read() + * can be improved to handle partial page gets + **/ + + if (address == 0xa0) { + rv = onlp_sfp_eeprom_read(port_num, &idprom); + } else if (address == 0xa2) { + rv = onlp_sfp_dom_read(port_num, &idprom); + } else { + aim_printf(&aim_pvs_stdout, "Error invalid address: 0x%02x\n", address); + return -EINVAL; + } + + if(rv < 0) { + aim_printf(&aim_pvs_stdout, "Error reading eeprom: %{onlp_status}\n"); + return -1; + } + memcpy(data, &idprom[offset], len); + aim_free(idprom); + + return 0; +} + +int oom_get_function(oom_port_t* port, oom_functions_t function, int* rv){ + //not implemented + return -1; +} + +int oom_get_memory_cfp(oom_port_t* port, int address, int len, uint16_t* data){ + //not implemented + return -1; +} + +int oom_set_memory_sff(oom_port_t* port, int address, int page, int offset, int len, uint8_t* data){ + //not implemented + return -1; +} + +int oom_set_function(oom_port_t* port, oom_functions_t function, int value){ + //not implemented + return -1; +} +int oom_set_memory_cfp(oom_port_t* port, int address, int len, uint16_t* data){ + //not implemented + return -1; +} diff --git a/packages/base/any/oom-shim/src/oom_shim.mk b/packages/base/any/oom-shim/src/oom_shim.mk new file mode 100644 index 00000000..106445d0 --- /dev/null +++ b/packages/base/any/oom-shim/src/oom_shim.mk @@ -0,0 +1,14 @@ + +############################################################################### +# +# Inclusive Makefile for the oom_shim module. +# +# Autogenerated 2016-02-16 12:05:28.510482 +# +############################################################################### +oom_shim_BASEDIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) +include $(oom_shim_BASEDIR)/module/make.mk +include $(oom_shim_BASEDIR)/module/auto/make.mk +include $(oom_shim_BASEDIR)/module/src/make.mk +include $(oom_shim_BASEDIR)/utest/_make.mk + diff --git a/packages/base/any/oom-shim/src/utest/_make.mk b/packages/base/any/oom-shim/src/utest/_make.mk new file mode 100644 index 00000000..43139d4c --- /dev/null +++ b/packages/base/any/oom-shim/src/utest/_make.mk @@ -0,0 +1,28 @@ +############################################################ +# +# +# Copyright 2014, 2015 Big Switch Networks, Inc. +# +# Licensed under the Eclipse Public License, Version 1.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.eclipse.org/legal/epl-v10.html +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +# either express or implied. See the License for the specific +# language governing permissions and limitations under the +# License. +# +# +############################################################ +# +# +# +############################################################ + +UMODULE := oom_shim +UMODULE_SUBDIR := $(dir $(lastword $(MAKEFILE_LIST))) +include $(BUILDER)/utest.mk diff --git a/packages/base/any/oom-shim/src/utest/main.c b/packages/base/any/oom-shim/src/utest/main.c new file mode 100644 index 00000000..e7e9e030 --- /dev/null +++ b/packages/base/any/oom-shim/src/utest/main.c @@ -0,0 +1,131 @@ +/************************************************************ + * + * + * Copyright 2014, 2015 Big Switch Networks, Inc. + * + * Licensed under the Eclipse Public License, Version 1.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.eclipse.org/legal/epl-v10.html + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + * + * + ************************************************************ + * + * + * + ***********************************************************/ +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +/** + * Base functionality unit tests. + */ +#define __TRY(_prefix, _expr, _suffix) \ + do { \ + int _rv; \ + fprintf(stderr, "%s%s...%s", _prefix, #_expr, _suffix); \ + fflush(stderr); \ + _rv = _expr ; \ + fprintf(stderr, "%s%s...%d\n", _prefix, #_expr, _rv); \ + fflush(stderr); \ + if(_rv < 0) { \ + AIM_DIE("%s%s: failed: %d", #_expr, _rv); \ + } \ + } while(0) + +#define __TRYNR(_prefix, _expr, _suffix) \ + do { \ + fprintf(stderr, "%s%s...%s", _prefix, #_expr, _suffix); \ + fflush(stderr); \ + _expr ; \ + fprintf(stderr, "%s%s...Done\n", _prefix, #_expr); \ + fflush(stderr); \ + } while(0) + +#define TRY(_expr) __TRY(" ", _expr, "\r") +#define TRYNR(_expr) ___TRYNR(" ", _expr, "\r") +#define TEST(_expr) __TRYNR("", _expr, "\n"); + +/** + * Test Shared Locks + */ +void +shlock_test(void) +{ + onlp_shlock_t* lock = NULL; + + TRY(onlp_shlock_create(0xEEEF, &lock, "utest-lock:%d", 1)); + TRY(onlp_shlock_take(lock)); + TRY(onlp_shlock_give(lock)); + TRY(onlp_shlock_take(lock)); + TRY(onlp_shlock_give(lock)); + TRY(onlp_shlock_global_take()); + TRY(onlp_shlock_global_give()); + TRY(onlp_shlock_global_take()); + TRY(onlp_shlock_global_give()); + if(strcmp("utest-lock:1", onlp_shlock_name(lock))) { + AIM_DIE("lock name does not match (%s)", onlp_shlock_name(lock)); + } +} + +/** + * Test ONIE parsing + */ +void +onie_test(void) +{ + /* TODO */ +} + +int +iter__(onlp_oid_t oid, void* cookie) +{ + onlp_oid_hdr_t hdr; + onlp_oid_hdr_get(oid, &hdr); + printf("OID: 0x%x, D='%s'\n", oid, hdr.description); + return 0; +} + +#include +#include +#include +#include + +int +aim_main(int argc, char* argv[]) +{ + // TEST(shlock_test()); + + /* Example Platform Dump */ + onlp_init(); + onlp_platform_dump(&aim_pvs_stdout, ONLP_OID_DUMP_F_RECURSE); + onlp_oid_iterate(0, 0, iter__, NULL); + onlp_platform_show(&aim_pvs_stdout, ONLP_OID_SHOW_F_RECURSE|ONLP_OID_SHOW_F_EXTENDED); + + if(argv[1] && !strcmp("manage", argv[1])) { + onlp_sys_platform_manage_start(); + printf("Sleeping...\n"); + sleep(10); + printf("Stopping...\n"); + onlp_sys_platform_manage_stop(); + printf("Stopped.\n"); + } + return 0; +} diff --git a/packages/base/powerpc/kernels/kernel-3.2-deb7-powerpc-e500v-all/builds/Makefile b/packages/base/powerpc/kernels/kernel-3.2-deb7-powerpc-e500v-all/builds/Makefile index cf4d94b3..81e28185 100644 --- a/packages/base/powerpc/kernels/kernel-3.2-deb7-powerpc-e500v-all/builds/Makefile +++ b/packages/base/powerpc/kernels/kernel-3.2-deb7-powerpc-e500v-all/builds/Makefile @@ -13,7 +13,7 @@ THIS_DIR := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))) include $(ONL)/make/config.mk kernel: - $(MAKE) -C $(ONL)/packages/base/any/kernels/3.2.65-1+deb7u2/configs/powerpc-e500v-all K_TARGET_DIR=$(THIS_DIR) K_COPY_DST=kernel-3.2-deb7-powerpc-e500v-all.bin.gz + $(MAKE) -C $(ONL)/packages/base/any/kernels/3.2.65-1+deb7u2/configs/powerpc-e500v-all K_TARGET_DIR=$(THIS_DIR) K_COPY_DST=kernel-3.2-deb7-powerpc-e500v-all.bin.gz $(ONL_MAKE_PARALLEL) clean: rm -rf linux-3.2.65-1+deb7u2 linux-3.2.65-1+deb7u2-mbuild linux-3.2.65-1+deb7u2-dtbs diff --git a/packages/base/powerpc/kernels/legacy/kernel-3.8.13-powerpc-e500mc/builds/Makefile b/packages/base/powerpc/kernels/legacy/kernel-3.8.13-powerpc-e500mc/builds/Makefile index 0343af53..007fc38c 100644 --- a/packages/base/powerpc/kernels/legacy/kernel-3.8.13-powerpc-e500mc/builds/Makefile +++ b/packages/base/powerpc/kernels/legacy/kernel-3.8.13-powerpc-e500mc/builds/Makefile @@ -24,7 +24,7 @@ KERNEL_DIR := $(ONL)/packages/base/any/kernels/legacy/linux-3.8.13 $(COMPDIR)/kernel-e500mc: $(KERNEL_DIR)/arch/powerpc/configs/$(DEFCONFIG) mkdir -p $(COMPDIR)/linux-build-e500mc - $(MAKE) -C $(KERNEL_DIR) $(DEFCONFIG) ARCH=powerpc O=$(COMPDIR)/linux-build-e500mc + $(MAKE) -C $(KERNEL_DIR) $(DEFCONFIG) ARCH=powerpc O=$(COMPDIR)/linux-build-e500mc $(ONL_MAKE_PARALLEL) PATH=$$PATH:$(SWITCHLIGHT)/tools $(MAKE) -C $(KERNEL_DIR) uImage ARCH=powerpc O=$(COMPDIR)/linux-build-e500mc powerpc-linux-gnu-strip -o $(COMPDIR)/kernel-e500mc $(COMPDIR)/linux-build-e500mc/vmlinux cp $(COMPDIR)/linux-build-e500mc/vmlinux.bin.gz $(COMPDIR)/kernel-e500mc.bin.gz diff --git a/packages/base/powerpc/kernels/legacy/kernel-3.9.6-powerpc-e500v/builds/Makefile b/packages/base/powerpc/kernels/legacy/kernel-3.9.6-powerpc-e500v/builds/Makefile index 18a8659f..ff57b59c 100644 --- a/packages/base/powerpc/kernels/legacy/kernel-3.9.6-powerpc-e500v/builds/Makefile +++ b/packages/base/powerpc/kernels/legacy/kernel-3.9.6-powerpc-e500v/builds/Makefile @@ -24,7 +24,7 @@ KERNEL_DIR := $(ONL)/packages/base/any/kernels/legacy/linux-3.9.6 $(BUILD_POWERPC_LINUX_85XX)/kernel-85xx: $(KERNEL_DIR)/arch/powerpc/configs/85xx/onl_mpc85xx_defconfig mkdir -p $(BUILD_POWERPC_LINUX_85XX)/linux-build-85xx - $(MAKE) -C $(KERNEL_DIR) 85xx/onl_mpc85xx_defconfig ARCH=powerpc O=$(BUILD_POWERPC_LINUX_85XX)/linux-build-85xx + $(MAKE) -C $(KERNEL_DIR) 85xx/onl_mpc85xx_defconfig ARCH=powerpc O=$(BUILD_POWERPC_LINUX_85XX)/linux-build-85xx $(ONL_MAKE_PARALLEL) PATH=$$PATH:$(SWITCHLIGHT)/tools $(MAKE) -C $(KERNEL_DIR) uImage ARCH=powerpc O=$(BUILD_POWERPC_LINUX_85XX)/linux-build-85xx powerpc-linux-gnu-strip -o $(BUILD_POWERPC_LINUX_85XX)/kernel-85xx $(BUILD_POWERPC_LINUX_85XX)/linux-build-85xx/vmlinux cp $(BUILD_POWERPC_LINUX_85XX)/linux-build-85xx/vmlinux.bin.gz $(BUILD_POWERPC_LINUX_85XX)/kernel-85xx.bin.gz diff --git a/packages/base/powerpc/oom-shim/Makefile b/packages/base/powerpc/oom-shim/Makefile new file mode 100644 index 00000000..dc1e7b86 --- /dev/null +++ b/packages/base/powerpc/oom-shim/Makefile @@ -0,0 +1 @@ +include $(ONL)/make/pkg.mk diff --git a/packages/base/powerpc/oom-shim/PKG.yml b/packages/base/powerpc/oom-shim/PKG.yml new file mode 100644 index 00000000..9fe09577 --- /dev/null +++ b/packages/base/powerpc/oom-shim/PKG.yml @@ -0,0 +1,2 @@ +!include $ONL/packages/base/any/oom-shim/APKG.yml ARCH=powerpc TOOLCHAIN=powerpc-linux-gnu + diff --git a/packages/base/powerpc/oom-shim/builds/Makefile b/packages/base/powerpc/oom-shim/builds/Makefile new file mode 100644 index 00000000..ee3b6e85 --- /dev/null +++ b/packages/base/powerpc/oom-shim/builds/Makefile @@ -0,0 +1,3 @@ +include $(ONL)/make/config.powerpc.mk +include $(ONL)/packages/base/any/oom-shim/builds/Makefile + diff --git a/packages/base/powerpc/oom-shim/builds/oom_shim.mk b/packages/base/powerpc/oom-shim/builds/oom_shim.mk new file mode 100644 index 00000000..04cfe7c1 --- /dev/null +++ b/packages/base/powerpc/oom-shim/builds/oom_shim.mk @@ -0,0 +1,10 @@ + +############################################################################### +# +# Inclusive Makefile for the oom_shim module. +# +# Autogenerated 2016-02-16 14:18:46.799062 +# +############################################################################### +oom_shim_BASEDIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) + diff --git a/packages/platforms-closed b/packages/platforms-closed index 52a6f7f8..ca6abea5 160000 --- a/packages/platforms-closed +++ b/packages/platforms-closed @@ -1 +1 @@ -Subproject commit 52a6f7f8d5357a3ae2e4550b4ffff7cd5a38f3b8 +Subproject commit ca6abea54088ad74ad2fe044a39522224ac90a5d diff --git a/packages/platforms/accton/x86-64/x86-64-accton-as7512-32x/platform-config/r0/src/python/x86_64_accton_as7512_32x_r0/__init__.py b/packages/platforms/accton/x86-64/x86-64-accton-as7512-32x/platform-config/r0/src/python/x86_64_accton_as7512_32x_r0/__init__.py index 3c1e7385..8ff578c9 100644 --- a/packages/platforms/accton/x86-64/x86-64-accton-as7512-32x/platform-config/r0/src/python/x86_64_accton_as7512_32x_r0/__init__.py +++ b/packages/platforms/accton/x86-64/x86-64-accton-as7512-32x/platform-config/r0/src/python/x86_64_accton_as7512_32x_r0/__init__.py @@ -98,7 +98,5 @@ class OnlPlatform_x86_64_accton_as7512_32x_r0(OnlPlatformAccton): self.new_i2c_device('as7512_32x_sfp30', 0x50, 47) self.new_i2c_device('as7512_32x_sfp31', 0x50, 48) self.new_i2c_device('as7512_32x_sfp32', 0x50, 49) - ] - ) return True diff --git a/setup.env b/setup.env index ca010660..57c6aa21 100755 --- a/setup.env +++ b/setup.env @@ -20,7 +20,7 @@ export PATH="$ONL/tools/scripts:$ONL/tools:$PATH" # Parallel Make Jobs # Default parallel build settings -# export MAKEFLAGS="-j64" +export ONL_MAKE_PARALLEL=-j16 # Version files $ONL/tools/make-versions.py --import-file=$ONL/tools/onlvi --class-name=OnlVersionImplementation --output-dir $ONL/make @@ -31,7 +31,7 @@ export ONLPM_OPTION_INCLUDE_ENV_JSON="$ONL/make/version-onl.json" # # buildroot download mirror. We suggest you setup a local repository containing these contents for faster local builds. # -export BUILDROOTMIRROR=${BUILDROOTMIRROR:-"http://buildroot.hw.bigswitch.com/dl"} +export BUILDROOTMIRROR=${BUILDROOTMIRROR:-"https://raw.githubusercontent.com/opennetworklinux/buildroot-download-cache/master/dl"} # These submodules are required for almost everything. $ONL/tools/submodules.py $ONL sm/infra diff --git a/sm/infra b/sm/infra index 810633d3..19f74c74 160000 --- a/sm/infra +++ b/sm/infra @@ -1 +1 @@ -Subproject commit 810633d3fc6b07e6b03428489fc84ef51a160753 +Subproject commit 19f74c743cd8d4c990640d0340fb295da428a0a8 diff --git a/tools/autobuild/build.sh b/tools/autobuild/build.sh index bf999f80..627a6273 100755 --- a/tools/autobuild/build.sh +++ b/tools/autobuild/build.sh @@ -9,7 +9,7 @@ ONL="$(realpath $(dirname $AUTOBUILD_SCRIPT)/../../)" # Default build branch BUILD_BRANCH=master -while getopts ":b:s:d:u:p:vc78" opt; do +while getopts ":b:s:d:u:p:vc78r:" opt; do case $opt in 7) ONLB_OPTIONS=--7 @@ -32,6 +32,9 @@ while getopts ":b:s:d:u:p:vc78" opt; do v) set -x ;; + r) + export BUILDROOTMIRROR=$OPTARG + ;; *) ;; esac diff --git a/tools/onlpm.py b/tools/onlpm.py index d1b5854b..6301a9aa 100755 --- a/tools/onlpm.py +++ b/tools/onlpm.py @@ -506,7 +506,7 @@ class OnlPackageGroup(object): for bp in buildpaths: if os.path.exists(bp): MAKE = os.environ.get('MAKE', "make") - cmd = MAKE + ' -C ' + bp + " " + os.environ.get('ONLPM_MAKE_OPTIONS', "") + target + cmd = MAKE + ' -C ' + bp + " " + os.environ.get('ONLPM_MAKE_OPTIONS', "") + " " + os.environ.get('ONL_MAKE_PARALLEL', "") + " " + target onlu.execute(cmd, ex=OnlPackageError('%s failed.' % operation))