diff --git a/.gitmodules b/.gitmodules index 1d345d4f..20df3fba 100644 --- a/.gitmodules +++ b/.gitmodules @@ -16,3 +16,6 @@ [submodule "packages/platforms-closed"] path = packages/platforms-closed url = git@github.com:opennetworklinux/platforms-closed +[submodule "sm/build-artifacts"] + path = sm/build-artifacts + url = git@github.com:opennetworklinux/build-artifacts diff --git a/Makefile b/Makefile index b9a2b57a..c183f82e 100644 --- a/Makefile +++ b/Makefile @@ -26,6 +26,7 @@ $(foreach a,$(ALL_ARCHES),$(eval $(call build_arch_template,$(a)))) # Available build architectures based on the current suite BUILD_ARCHES_wheezy := amd64 powerpc BUILD_ARCHES_jessie := $(ALL_ARCHES) +BUILD_ARCHES_stretch := amd64 # Build available architectures by default. .DEFAULT_GOAL := all diff --git a/REPO/stretch/Makefile b/REPO/stretch/Makefile new file mode 100644 index 00000000..bfbd6a4b --- /dev/null +++ b/REPO/stretch/Makefile @@ -0,0 +1 @@ +include $(ONL)/make/repo-suite.mk diff --git a/REPO/stretch/packages/binary-all/Makefile b/REPO/stretch/packages/binary-all/Makefile new file mode 100644 index 00000000..6283cc30 --- /dev/null +++ b/REPO/stretch/packages/binary-all/Makefile @@ -0,0 +1 @@ +include $(ONL)/make/repo.mk diff --git a/REPO/stretch/packages/binary-amd64/Makefile b/REPO/stretch/packages/binary-amd64/Makefile new file mode 100644 index 00000000..6283cc30 --- /dev/null +++ b/REPO/stretch/packages/binary-amd64/Makefile @@ -0,0 +1 @@ +include $(ONL)/make/repo.mk diff --git a/REPO/stretch/packages/binary-arm64/Makefile b/REPO/stretch/packages/binary-arm64/Makefile new file mode 100644 index 00000000..6283cc30 --- /dev/null +++ b/REPO/stretch/packages/binary-arm64/Makefile @@ -0,0 +1 @@ +include $(ONL)/make/repo.mk diff --git a/REPO/stretch/packages/binary-armel/Makefile b/REPO/stretch/packages/binary-armel/Makefile new file mode 100644 index 00000000..6283cc30 --- /dev/null +++ b/REPO/stretch/packages/binary-armel/Makefile @@ -0,0 +1 @@ +include $(ONL)/make/repo.mk diff --git a/REPO/stretch/packages/binary-powerpc/Makefile b/REPO/stretch/packages/binary-powerpc/Makefile new file mode 100644 index 00000000..6283cc30 --- /dev/null +++ b/REPO/stretch/packages/binary-powerpc/Makefile @@ -0,0 +1 @@ +include $(ONL)/make/repo.mk diff --git a/builds/any/rootfs/stretch/common/all-base-packages.yml b/builds/any/rootfs/stretch/common/all-base-packages.yml new file mode 100644 index 00000000..e6ef6a3a --- /dev/null +++ b/builds/any/rootfs/stretch/common/all-base-packages.yml @@ -0,0 +1,79 @@ +############################################################ +# +# Common Release Packages for all systems. +# +############################################################ +- base-files +- sysvinit-core +- locales +- python +- apt +- apt-utils +- procps +- net-tools +- iputils-ping +- less +- sudo +- openssh-server +- iproute +- resolvconf +- vim-tiny +- zile +- nano +- lsof +- mingetty +- traceroute +- realpath +- rsyslog +- nfs-common +- netbase +- bsdmainutils +- ifupdown +- psmisc +- make +- python-cherrypy3 +- python-tz +- scapy +- python-pypcap +- snmpd +- snmp +- pciutils +- usbutils +- mtd-utils +- i2c-tools +- isc-dhcp-client +- ntp +- wget +- ethtool +- localepurge +- telnetd +- python-pyinotify +- cpio +- util-linux +- dosfstools +- rssh +- u-boot-tools +- ntpdate +- onlp +- parted +- watchdog +- netplug +- binutils +- file +- smartmontools +- realpath +- iptables +- onl-faultd +- onlp-snmpd +- oom-shim +- python-parted +- python-yaml +- bzip2 +- xz-utils +- unzip +- onl-mibs +- openssl +- gdb +- tcpdump +- strace +- sysstat diff --git a/builds/any/rootfs/stretch/common/amd64-base-packages.yml b/builds/any/rootfs/stretch/common/amd64-base-packages.yml new file mode 100644 index 00000000..a07863f3 --- /dev/null +++ b/builds/any/rootfs/stretch/common/amd64-base-packages.yml @@ -0,0 +1,13 @@ +############################################################ +# +# Common packages for all amd64 systems. +# +############################################################ +- dmidecode +- parted +- smartmontools +- grub2 +- onl-upgrade +- hw-management +- sx-kernel +- onl-kernel-3.16-lts-x86-64-all-modules diff --git a/builds/any/rootfs/stretch/common/amd64-onl-packages.yml b/builds/any/rootfs/stretch/common/amd64-onl-packages.yml new file mode 100644 index 00000000..984f2fc3 --- /dev/null +++ b/builds/any/rootfs/stretch/common/amd64-onl-packages.yml @@ -0,0 +1,11 @@ +############################################################ +# +# These packages are specific to the ONL root filesystem build. +# +############################################################ +- onl-upgrade + + + + + diff --git a/builds/any/rootfs/stretch/common/arm64-base-packages.yml b/builds/any/rootfs/stretch/common/arm64-base-packages.yml new file mode 100644 index 00000000..71c41a67 --- /dev/null +++ b/builds/any/rootfs/stretch/common/arm64-base-packages.yml @@ -0,0 +1 @@ +- u-boot-tools diff --git a/builds/any/rootfs/stretch/common/arm64-onl-packages.yml b/builds/any/rootfs/stretch/common/arm64-onl-packages.yml new file mode 100644 index 00000000..e58df638 --- /dev/null +++ b/builds/any/rootfs/stretch/common/arm64-onl-packages.yml @@ -0,0 +1,9 @@ +############################################################ +# +# These packages are specific to the ONL root filesystem build. +# +############################################################ +- onl-loader-fit + + + diff --git a/builds/any/rootfs/stretch/common/armel-base-packages.yml b/builds/any/rootfs/stretch/common/armel-base-packages.yml new file mode 100644 index 00000000..71c41a67 --- /dev/null +++ b/builds/any/rootfs/stretch/common/armel-base-packages.yml @@ -0,0 +1 @@ +- u-boot-tools diff --git a/builds/any/rootfs/stretch/common/armel-onl-packages.yml b/builds/any/rootfs/stretch/common/armel-onl-packages.yml new file mode 100644 index 00000000..e58df638 --- /dev/null +++ b/builds/any/rootfs/stretch/common/armel-onl-packages.yml @@ -0,0 +1,9 @@ +############################################################ +# +# These packages are specific to the ONL root filesystem build. +# +############################################################ +- onl-loader-fit + + + diff --git a/builds/any/rootfs/stretch/common/overlay/etc/adjtime b/builds/any/rootfs/stretch/common/overlay/etc/adjtime new file mode 100644 index 00000000..7481b115 --- /dev/null +++ b/builds/any/rootfs/stretch/common/overlay/etc/adjtime @@ -0,0 +1 @@ +0.0 0 0.0 diff --git a/builds/any/rootfs/stretch/common/overlay/etc/filesystems b/builds/any/rootfs/stretch/common/overlay/etc/filesystems new file mode 100644 index 00000000..01350bea --- /dev/null +++ b/builds/any/rootfs/stretch/common/overlay/etc/filesystems @@ -0,0 +1,6 @@ +jffs2 +ubifs +vfat +ext4 +ext3 +ext2 diff --git a/builds/any/rootfs/stretch/common/overlay/etc/inetd.conf b/builds/any/rootfs/stretch/common/overlay/etc/inetd.conf new file mode 100644 index 00000000..367f8d08 --- /dev/null +++ b/builds/any/rootfs/stretch/common/overlay/etc/inetd.conf @@ -0,0 +1,3 @@ +telnet stream tcp nowait telnetd /usr/sbin/tcpd /usr/sbin/in.telnetd +qotd stream tcp nowait telnetd /usr/sbin/tcpd /sbin/versiond + diff --git a/builds/any/rootfs/stretch/common/overlay/etc/inittab b/builds/any/rootfs/stretch/common/overlay/etc/inittab new file mode 100644 index 00000000..e242bf0a --- /dev/null +++ b/builds/any/rootfs/stretch/common/overlay/etc/inittab @@ -0,0 +1,67 @@ +# The default runlevel. +id:2:initdefault: + +# Boot-time system configuration/initialization script. +# This is run first except when booting in emergency (-b) mode. +si0::sysinit:/etc/boot.d/boot +si1::sysinit:/etc/init.d/rcS + +# What to do in single-user mode. +~~:S:wait:/sbin/sulogin + +# /etc/init.d executes the S and K scripts upon change +# of runlevel. +# +# Runlevel 0 is halt. +# Runlevel 1 is single-user. +# Runlevels 2-5 are multi-user. +# Runlevel 6 is reboot. + +l0:0:wait:/etc/init.d/rc 0 +l1:1:wait:/etc/init.d/rc 1 +l2:2:wait:/etc/init.d/rc 2 +l3:3:wait:/etc/init.d/rc 3 +l4:4:wait:/etc/init.d/rc 4 +l5:5:wait:/etc/init.d/rc 5 +l6:6:wait:/etc/init.d/rc 6 +# Normally not reached, but fallthrough in case of emergency. +z6:6:respawn:/sbin/sulogin + +# What to do when CTRL-ALT-DEL is pressed. +ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now + +# Action on special keypress (ALT-UpArrow). +#kb::kbrequest:/bin/echo "Keyboard Request--edit /etc/inittab to let this work." + +# What to do when the power fails/returns. +pf::powerwait:/etc/init.d/powerfail start +pn::powerfailnow:/etc/init.d/powerfail now +po::powerokwait:/etc/init.d/powerfail stop + +# /sbin/getty invocations for the runlevels. +# +# The "id" field MUST be the same as the last +# characters of the device (after "tty"). +# +# Format: +# ::: +# +# Note that on most Debian systems tty7 is used by the X Window System, +# so if you want to add more getty's go ahead but skip tty7 if you run X. +# +1:2345:respawn:/sbin/getty 38400 tty1 +2:23:respawn:/sbin/getty 38400 tty2 +3:23:respawn:/sbin/getty 38400 tty3 +4:23:respawn:/sbin/getty 38400 tty4 +5:23:respawn:/sbin/getty 38400 tty5 +6:23:respawn:/sbin/getty 38400 tty6 + +# Example how to put a getty on a serial line (for a terminal) +# +#T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100 +#T1:23:respawn:/sbin/getty -L ttyS1 9600 vt100 + +# Example how to put a getty on a modem line. +# +#T3:23:respawn:/sbin/mgetty -x0 -s 57600 ttyS3 + diff --git a/builds/any/rootfs/stretch/common/overlay/etc/mtab.yml b/builds/any/rootfs/stretch/common/overlay/etc/mtab.yml new file mode 100644 index 00000000..598e4c69 --- /dev/null +++ b/builds/any/rootfs/stretch/common/overlay/etc/mtab.yml @@ -0,0 +1,19 @@ +mounts: + ONL-IMAGES: + mount: ro + dir: /mnt/onl/images + fsck: true + + ONL-DATA: + mount: rw + dir: /mnt/onl/data + + ONL-CONFIG: + mount: ro + dir: /mnt/onl/config + fsck: true + + ONL-BOOT: + mount: ro + dir: /mnt/onl/boot + fsck: false diff --git a/builds/any/rootfs/stretch/common/overlay/etc/profile.d/onl-platform-current.sh b/builds/any/rootfs/stretch/common/overlay/etc/profile.d/onl-platform-current.sh new file mode 100644 index 00000000..5237bbb8 --- /dev/null +++ b/builds/any/rootfs/stretch/common/overlay/etc/profile.d/onl-platform-current.sh @@ -0,0 +1,7 @@ +############################################################ +# +# Add platform specific directories to path. +# +############################################################ +dir=/lib/platform-config/current/onl +export PATH="$PATH:$dir/bin:$dir/sbin:$dir/lib/bin:$dir/lib/sbin" diff --git a/builds/any/rootfs/stretch/common/overlay/etc/rssh.conf b/builds/any/rootfs/stretch/common/overlay/etc/rssh.conf new file mode 100644 index 00000000..33975b18 --- /dev/null +++ b/builds/any/rootfs/stretch/common/overlay/etc/rssh.conf @@ -0,0 +1,4 @@ +logfacility = LOG_USER +allowsftp +allowscp +umask = 022 diff --git a/builds/any/rootfs/stretch/common/overlay/etc/snmp/snmpd.conf b/builds/any/rootfs/stretch/common/overlay/etc/snmp/snmpd.conf new file mode 100644 index 00000000..13eb88f7 --- /dev/null +++ b/builds/any/rootfs/stretch/common/overlay/etc/snmp/snmpd.conf @@ -0,0 +1,195 @@ +############################################################################### +# +# EXAMPLE.conf: +# An example configuration file for configuring the Net-SNMP agent ('snmpd') +# See the 'snmpd.conf(5)' man page for details +# +# Some entries are deliberately commented out, and will need to be explicitly activated +# +############################################################################### +# +# AGENT BEHAVIOUR +# + +# Listen for connections from the local system only +# agentAddress udp:127.0.0.1:161 +# Listen for connections on all interfaces (both IPv4 *and* IPv6) +agentAddress udp:161,udp6:[::1]:161 + + + +############################################################################### +# +# SNMPv3 AUTHENTICATION +# +# Note that these particular settings don't actually belong here. +# They should be copied to the file /var/lib/snmp/snmpd.conf +# and the passwords changed, before being uncommented in that file *only*. +# Then restart the agent + +# createUser authOnlyUser MD5 "remember to change this password" +# createUser authPrivUser SHA "remember to change this one too" DES +# createUser internalUser MD5 "this is only ever used internally, but still change the password" + +# If you also change the usernames (which might be sensible), +# then remember to update the other occurances in this example config file to match. + + + +############################################################################### +# +# ACCESS CONTROL +# + + # system + hrSystem groups only +view systemonly included .1.3.6.1.2.1.1 +view systemonly included .1.3.6.1.2.1.25.1 +view systemonly included .1.3.6.1.4.1.42623 + # Full access from the local host +rocommunity public localhost + # Default access to basic system info + rocommunity public default -V systemonly + # rocommunity6 is for IPv6 + rocommunity6 public default -V systemonly + + # Full access from an example network + # Adjust this network address to match your local + # settings, change the community string, + # and check the 'agentAddress' setting above +#rocommunity secret 10.0.0.0/16 + + # Full read-only access for SNMPv3 + rouser authOnlyUser + # Full write access for encrypted requests + # Remember to activate the 'createUser' lines above +#rwuser authPrivUser priv + +# It's no longer typically necessary to use the full 'com2sec/group/access' configuration +# r[ow]user and r[ow]community, together with suitable views, should cover most requirements + + + +############################################################################### +# +# SYSTEM INFORMATION +# + +# Note that setting these values here, results in the corresponding MIB objects being 'read-only' +# See snmpd.conf(5) for more details +sysLocation Sitting on the Dock of the Bay +sysContact Me + # Application + End-to-End layers +sysServices 72 + + +# +# Process Monitoring +# + # At least one 'mountd' process +proc mountd + # No more than 4 'ntalkd' processes - 0 is OK +proc ntalkd 4 + # At least one 'sendmail' process, but no more than 10 +proc sendmail 10 1 + +# Walk the UCD-SNMP-MIB::prTable to see the resulting output +# Note that this table will be empty if there are no "proc" entries in the snmpd.conf file + + +# +# Disk Monitoring +# + # 10MBs required on root disk, 5% free on /var, 10% free on all other disks +disk / 10000 +disk /var 5% +includeAllDisks 10% + +# Walk the UCD-SNMP-MIB::dskTable to see the resulting output +# Note that this table will be empty if there are no "disk" entries in the snmpd.conf file + + +# +# System Load +# + # Unacceptable 1-, 5-, and 15-minute load averages +load 12 10 5 + +# Walk the UCD-SNMP-MIB::laTable to see the resulting output +# Note that this table *will* be populated, even without a "load" entry in the snmpd.conf file + + + +############################################################################### +# +# ACTIVE MONITORING +# + + # send SNMPv1 traps + trapsink localhost public + # send SNMPv2c traps +#trap2sink localhost public + # send SNMPv2c INFORMs +#informsink localhost public + +# Note that you typically only want *one* of these three lines +# Uncommenting two (or all three) will result in multiple copies of each notification. + + +# +# Event MIB - automatically generate alerts +# + # Remember to activate the 'createUser' lines above +iquerySecName internalUser +rouser internalUser + # generate traps on UCD error conditions +defaultMonitors yes + # generate traps on linkUp/Down +linkUpDownNotifications yes + + + +############################################################################### +# +# EXTENDING THE AGENT +# + +# +# Arbitrary extension commands +# + extend test1 /bin/echo Hello, world! + extend-sh test2 echo Hello, world! ; echo Hi there ; exit 35 +#extend-sh test3 /bin/sh /tmp/shtest + +# Note that this last entry requires the script '/tmp/shtest' to be created first, +# containing the same three shell commands, before the line is uncommented + +# Walk the NET-SNMP-EXTEND-MIB tables (nsExtendConfigTable, nsExtendOutput1Table +# and nsExtendOutput2Table) to see the resulting output + +# Note that the "extend" directive supercedes the previous "exec" and "sh" directives +# However, walking the UCD-SNMP-MIB::extTable should still returns the same output, +# as well as the fuller results in the above tables. + + +# +# "Pass-through" MIB extension command +# +#pass .1.3.6.1.4.1.8072.2.255 /bin/sh PREFIX/local/passtest +#pass .1.3.6.1.4.1.8072.2.255 /usr/bin/perl PREFIX/local/passtest.pl + +# Note that this requires one of the two 'passtest' scripts to be installed first, +# before the appropriate line is uncommented. +# These scripts can be found in the 'local' directory of the source distribution, +# and are not installed automatically. + +# Walk the NET-SNMP-PASS-MIB::netSnmpPassExamples subtree to see the resulting output + + +# +# AgentX Sub-agents +# + # Run as an AgentX master agent + master agentx + # Listen for network connections (from localhost) + # rather than the default named socket /var/agentx/master +#agentXSocket tcp:localhost:705 diff --git a/builds/any/rootfs/stretch/common/overlay/etc/udev/rules.d/60-block.rules b/builds/any/rootfs/stretch/common/overlay/etc/udev/rules.d/60-block.rules new file mode 100644 index 00000000..f2345a37 --- /dev/null +++ b/builds/any/rootfs/stretch/common/overlay/etc/udev/rules.d/60-block.rules @@ -0,0 +1 @@ +SUBSYSTEM=="block", RUN+="/sbin/initblockdev $kernel $env{ACTION}" diff --git a/builds/any/rootfs/stretch/common/overlay/etc/udev/rules.d/60-net.rules b/builds/any/rootfs/stretch/common/overlay/etc/udev/rules.d/60-net.rules new file mode 100644 index 00000000..627e65e4 --- /dev/null +++ b/builds/any/rootfs/stretch/common/overlay/etc/udev/rules.d/60-net.rules @@ -0,0 +1 @@ +SUBSYSTEM=="net", RUN+="/sbin/initnetdev $kernel $env{ACTION}" diff --git a/builds/any/rootfs/stretch/common/overlay/sbin/pgetty b/builds/any/rootfs/stretch/common/overlay/sbin/pgetty new file mode 100755 index 00000000..01ed10dc --- /dev/null +++ b/builds/any/rootfs/stretch/common/overlay/sbin/pgetty @@ -0,0 +1,23 @@ +#!/bin/sh + +t=/dev/$1 +# if $1 is not set, use linux cmdline console as default tty +[ -z "$1" ] && { + tty=$(/bin/sed 's/.*console=\([^,]*\).*/\1/' /proc/cmdline) + t=/dev/$tty +} + +# Reset the console tty to standard settings +/bin/stty -F $t sane pass8 -ixon -cstopb clocal + +# Kill any processes with the console tty open before starting a new +# login session (login tries to do this, but vhangup() spares processes +# that ignore SIGHUP) +#/usr/bin/lsof -p ^$$ -t $t 0<&- 1>&- 2>&- | /usr/bin/xargs -r /bin/kill -9 + +# Flush tty input and output queues +#/sbin/flushtty <$t + +# We use mingetty instead of agetty, as the latter messes up the tty +# settings if it receives junk characters at the wrong speed +exec /sbin/mingetty --noclear $t diff --git a/builds/any/rootfs/stretch/common/overlay/sbin/watchdir b/builds/any/rootfs/stretch/common/overlay/sbin/watchdir new file mode 100755 index 00000000..3ff32aa7 --- /dev/null +++ b/builds/any/rootfs/stretch/common/overlay/sbin/watchdir @@ -0,0 +1,71 @@ +#!/usr/bin/python +############################################################ +# +# +# Copyright 2013, 2014 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. +# +# +############################################################ +# +# watchdir +# +############################################################ +import optparse, os.path, sys +import pyinotify + +#pyinotify.log.setLevel(pyinotify.logging.DEBUG) + +op = optparse.OptionParser( usage="%prog [OPTIONS] command") +op.add_option("-w", "--watchdir", action="append", + help="monitor watchdir for changes (may be used multiple times)") +op.add_option("--period", action="store", type="float", + help="run command at most every period sec (default=%default)") +op.add_option("-d", "--daemon", action="store_true", + help="run in background") +op.add_option("--logfile", action="store", + help="send output to logfile when running in background") +op.add_option("--pidfile", action="store", + help="write pid to pidfile when running in background") +op.set_defaults(period=0, logfile="/dev/stdout", pidfile=False) +opts, args = op.parse_args() + +if not opts.watchdir: + op.error("need at least one watchdir") + +os.close(0) +os.open("/dev/null", os.O_RDONLY) + +wm = pyinotify.WatchManager() +n = pyinotify.Notifier(wm, read_freq=opts.period) +def handle(event): + dir = None + for d in opts.watchdir: + if os.path.commonprefix([d, event.pathname]) == d: + dir = d + sys.stdout.write("%s: %s %s\n" % (dir, event.pathname, event)) + sys.stdout.flush() + if args: + os.spawnvp(os.P_WAIT, args[0], + args + [dir, event.pathname, event.maskname]) +wm.add_watch( + opts.watchdir, + pyinotify.IN_ATTRIB | pyinotify.IN_CREATE | pyinotify.IN_DELETE | + pyinotify.IN_MODIFY | pyinotify.IN_MOVED_FROM | pyinotify.IN_MOVED_TO, + handle, + rec=True, + auto_add=True) +n.loop(daemonize=opts.daemon, stdout=opts.logfile, stderr=opts.logfile, + pid_file=opts.pidfile) diff --git a/builds/any/rootfs/stretch/common/powerpc-base-packages.yml b/builds/any/rootfs/stretch/common/powerpc-base-packages.yml new file mode 100644 index 00000000..e876f6bd --- /dev/null +++ b/builds/any/rootfs/stretch/common/powerpc-base-packages.yml @@ -0,0 +1,11 @@ +############################################################ +# +# Common packages for all PowerPC systems. +# +############################################################ +- u-boot-tools + + + + + diff --git a/builds/any/rootfs/stretch/common/powerpc-onl-packages.yml b/builds/any/rootfs/stretch/common/powerpc-onl-packages.yml new file mode 100644 index 00000000..e58df638 --- /dev/null +++ b/builds/any/rootfs/stretch/common/powerpc-onl-packages.yml @@ -0,0 +1,9 @@ +############################################################ +# +# These packages are specific to the ONL root filesystem build. +# +############################################################ +- onl-loader-fit + + + diff --git a/builds/any/rootfs/stretch/standard/standard.yml b/builds/any/rootfs/stretch/standard/standard.yml new file mode 100644 index 00000000..48969cbe --- /dev/null +++ b/builds/any/rootfs/stretch/standard/standard.yml @@ -0,0 +1,105 @@ +############################################################ +# +# Standard ONL Debian 9 Root Filesystem Configuration. +# +# Requires: +# ARCH, PLATFORM_LIST +# +# +############################################################ +variables: + !include $ONL/make/versions/version-onl.yml + +Packages: &Packages + - !include $ONL/builds/any/rootfs/$ONL_DEBIAN_SUITE/common/all-base-packages.yml + - !include $ONL/builds/any/rootfs/$ONL_DEBIAN_SUITE/common/${ARCH}-base-packages.yml + - !include $ONL/builds/any/rootfs/$ONL_DEBIAN_SUITE/common/${ARCH}-onl-packages.yml + - !script $ONL/tools/onl-platform-pkgs.py ${PLATFORM_LIST} + +Multistrap: + General: + arch: ${ARCH} + cleanup: true + noauth: true + explicitsuite: false + unpack: true + debootstrap: Debian-Local Local-All Local-Arch ONL + aptsources: Debian ONL + + Debian: + packages: *Packages + source: http://${DEBIAN_MIRROR} + suite: ${ONL_DEBIAN_SUITE} + keyring: debian-archive-keyring + omitdebsrc: true + + Debian-Local: + packages: *Packages + source: http://${APT_CACHE}${DEBIAN_MIRROR} + suite: ${ONL_DEBIAN_SUITE} + keyring: debian-archive-keyring + omitdebsrc: true + + ONL: + packages: *Packages + source: http://apt.opennetlinux.org/debian + suite: unstable + omitdebsrc: true + + Local-All: + source: ${ONLPM_OPTION_REPO}/${ONL_DEBIAN_SUITE}/packages/binary-all + omitdebsrc: true + + Local-Arch: + source: ${ONLPM_OPTION_REPO}/${ONL_DEBIAN_SUITE}/packages/binary-${ARCH} + omitdebsrc: true + +Configure: + overlays: + - ${ONL}/builds/any/rootfs/${ONL_DEBIAN_SUITE}/common/overlay + + update-rc.d: + - 'faultd defaults' + - 'onlpd defaults' + - 'snmpd defaults' + - 'onlp-snmpd defaults' + - 'ssh defaults' + - 'openbsd-inetd remove' + - 'ntp remove' + - 'nfs-common remove' + - 'rpcbind remove' + - 'motd remove' + - 'mountall-bootclean.sh remove' + - 'mountall.sh remove' + - 'checkfs.sh remove' + - 'mtab.sh remove' + - 'checkroot-bootclean.sh remove' + - 'checkroot.sh remove' + - 'mountnfs-bootclean.sh remove' + - 'mountnfs.sh remove' + - 'lm-sensors remove' + - 'netplug defaults' + - 'watchdog defaults' + - 'wd_keepalive remove' + + options: + clean: True + securetty: False + ttys: False + console: True + PermitRootLogin: 'yes' + + users: + root: + password: onl + + manifests: + '/etc/onl/rootfs/manifest.json' : + version : $ONL/make/versions/version-onl.json + platforms : $PLATFORM_LIST + + issue: $VERSION_STRING + + files: + remove: + - /etc/motd diff --git a/docker/images/builder9/1.0/Dockerfile b/docker/images/builder9/1.0/Dockerfile new file mode 100644 index 00000000..cd109362 --- /dev/null +++ b/docker/images/builder9/1.0/Dockerfile @@ -0,0 +1,137 @@ +FROM debian:9.1 +MAINTAINER Jeff Townsend + +# First round of dependences +RUN apt-get update && apt-get install -y \ + apt \ + apt-cacher-ng \ + apt-file \ + apt-utils \ + autoconf \ + automake \ + autotools-dev \ + bash-completion \ + bc \ + bind9-host \ + binfmt-support \ + binfmt-support \ + bison \ + bsdmainutils \ + build-essential \ + ccache \ + cdbs \ + cpio \ + cryptsetup-bin \ + debhelper \ + debhelper \ + debhelper \ + device-tree-compiler \ + devscripts \ + devscripts \ + dialog \ + dosfstools \ + doxygen \ + dpkg-sig \ + emacs \ + file \ + flex \ + gawk \ + gcc \ + gdb \ + genisoimage \ + git \ + gperf \ + ifupdown \ + iproute \ + iputils-ping \ + isolinux \ + kmod \ + less \ + libc6-dev \ + libcurl4-nss-dev \ + libdouble-conversion-dev \ + libedit-dev \ + libevent-dev \ + libexpat1-dev \ + libgoogle-glog-dev \ + libi2c-dev \ + libkrb5-dev \ + libnuma-dev \ + libsasl2-dev \ + libsnappy-dev \ + libpam-dev \ + libpcap-dev \ + libsnmp-dev \ + libssl-dev \ + libtool \ + libtool-bin \ + locales \ + lsof \ + make \ + mingetty \ + mtd-utils \ + mtools \ + multistrap \ + nano \ + ncurses-dev \ + netbase \ + net-tools \ + nfs-common \ + openssh-server \ + pkg-config \ + pkg-config \ + procps \ + psmisc \ + python \ + python-debian \ + python-dnspython \ + python-yaml \ + qemu \ + qemu-user-static \ + realpath \ + realpath \ + rsyslog \ + ruby \ + ruby-dev \ + rubygems \ + screen \ + squashfs-tools \ + sshpass \ + stgit \ + sudo \ + syslinux-utils \ + telnet \ + texinfo \ + traceroute \ + u-boot-tools \ + vim-tiny \ + wget \ + xorriso \ + zile \ + zip + +RUN apt-get install -y \ +chrpath devscripts dh-autoreconf dh-systemd flex \ +libcap-dev libc-ares-dev libjson-c-dev libpam0g-dev libpcre3-dev \ +libreadline-dev libsystemd-dev pkg-config \ +texlive-generic-recommended texinfo texlive-latex-base + +RUN gem install --version 1.3.3 fpm + +# +# The i2c-dev.h user/kernel header conflict is a nightmare. +# +# The ONLP implementation expects a new file called to be in place which contains the correct user-space driver definitions. +# This should be manually populated here after the toolchains have been installed. +# +RUN cp /usr/include/linux/i2c-dev.h /usr/include/linux/i2c-devices.h + +RUN rm /etc/apt/apt.conf.d/docker-* && \ + wget "https://launchpad.net/ubuntu/+source/qemu/1.4.0+dfsg-1expubuntu3/+build/4336762/+files/qemu-user-static_1.4.0%2Bdfsg-1expubuntu3_amd64.deb" && \ + dpkg -i qemu-user-static_1.4.0+dfsg-1expubuntu3_amd64.deb + +# +# Copy the docker shell init script to /bin +# +COPY docker_shell /bin/docker_shell +COPY container-id /bin/container-id diff --git a/docker/images/builder9/1.0/Makefile b/docker/images/builder9/1.0/Makefile new file mode 100644 index 00000000..7b594b45 --- /dev/null +++ b/docker/images/builder9/1.0/Makefile @@ -0,0 +1,19 @@ +VERSION=1.0 +USER=opennetworklinux +REPO=builder9 + +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/onlbuilder b/docker/tools/onlbuilder index f99746ff..48f20edf 100755 --- a/docker/tools/onlbuilder +++ b/docker/tools/onlbuilder @@ -19,6 +19,7 @@ g_timestamp = datetime.datetime.now().strftime("%Y-%m-%d.%H%M%S") g_builder7_image_name="opennetworklinux/builder7:1.2" g_builder8_image_name="opennetworklinux/builder8:1.7" +g_builder9_image_name="opennetworklinux/builder9:1.0" g_default_image_name=g_builder8_image_name g_default_container_name = "%s_%s" % (g_current_user, g_timestamp) @@ -26,6 +27,9 @@ g_default_user="%s:%s" % (g_current_user, g_current_uid) ap = argparse.ArgumentParser("ONL Docker Build") +ap.add_argument('--9', '-9', + help="Run the Debian 9 version.", + action='store_true', dest='debian9') ap.add_argument('--8', '-8', help="Run the Debian 8 version.", action='store_true', dest='debian8') @@ -117,6 +121,8 @@ if ops.debian7: if ops.debian8: ops.image = g_builder8_image_name +if ops.debian9: + ops.image = g_builder9_image_name if ops.verbose or ops.dry: logger.setLevel(logging.DEBUG) diff --git a/packages/base/all/initrds/loader-initrd-files/src/bin/ifup b/packages/base/all/initrds/loader-initrd-files/src/bin/ifup index 8ea35729..453a55c9 100644 --- a/packages/base/all/initrds/loader-initrd-files/src/bin/ifup +++ b/packages/base/all/initrds/loader-initrd-files/src/bin/ifup @@ -141,4 +141,7 @@ wait_link_up() return 1 } -wait_link_up $NETDEV 100 +if [ -n "${NETAUTO}" ]; then + wait_link_up $NETDEV 100 +fi +return 0 diff --git a/packages/base/amd64/upgrade/PKG.yml b/packages/base/amd64/upgrade/PKG.yml index ae40b753..3717282f 100644 --- a/packages/base/amd64/upgrade/PKG.yml +++ b/packages/base/amd64/upgrade/PKG.yml @@ -1,6 +1,5 @@ prerequisites: packages: - - onl-kernel-3.2-lts-x86-64-all:amd64 - onl-kernel-3.16-lts-x86-64-all:amd64 - onl-kernel-4.9-lts-x86-64-all:amd64 - onl-loader-initrd:amd64 diff --git a/packages/base/amd64/upgrade/builds/Makefile b/packages/base/amd64/upgrade/builds/Makefile index ef428d0f..3a7d529c 100644 --- a/packages/base/amd64/upgrade/builds/Makefile +++ b/packages/base/amd64/upgrade/builds/Makefile @@ -1,8 +1,7 @@ include $(ONL)/make/config.amd64.mk # All amd64 kernels -KERNELS := $(shell $(ONLPM) --find-file onl-kernel-3.2-lts-x86-64-all:amd64 kernel-3.2-lts-x86_64-all) \ - $(shell $(ONLPM) --find-file onl-kernel-3.16-lts-x86-64-all:amd64 kernel-3.16-lts-x86_64-all) \ +KERNELS := $(shell $(ONLPM) --find-file onl-kernel-3.16-lts-x86-64-all:amd64 kernel-3.16-lts-x86_64-all) \ $(shell $(ONLPM) --find-file onl-kernel-4.9-lts-x86-64-all:amd64 kernel-4.9-lts-x86_64-all) diff --git a/packages/base/any/faultd/src/module/src/faultd_handler.c b/packages/base/any/faultd/src/module/src/faultd_handler.c index 7c01ebf1..183b93c8 100644 --- a/packages/base/any/faultd/src/module/src/faultd_handler.c +++ b/packages/base/any/faultd/src/module/src/faultd_handler.c @@ -1,21 +1,21 @@ /**************************************************************************//** * - * - * Copyright 2013, 2014 BigSwitch Networks, Inc. - * + * + * 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. - * + * * *****************************************************************************/ #include @@ -46,157 +46,151 @@ static pthread_spinlock_t thread_lock__; -static faultd_client_t* faultd_client__ = NULL; +static faultd_client_t* faultd_client__ = NULL; static faultd_info_t faultd_info__; -static int localfd__ = -1; +static int localfd__ = -1; -inline int signal_backtrace__(void** buffer, int size, ucontext_t* context, +int signal_backtrace__(void** buffer, int size, ucontext_t* context, int distance) { #define IP_STACK_FRAME_NUMBER 3 - - int rv; + + int rv; rv = backtrace(buffer, size); - - if(context) { - distance += IP_STACK_FRAME_NUMBER; - + + if(context) { + distance += IP_STACK_FRAME_NUMBER; + #ifdef __i386__ - buffer[distance] = (void*)(context->uc_mcontext.gregs[REG_EIP]); + buffer[distance] = (void*)(context->uc_mcontext.gregs[REG_EIP]); #endif #ifdef __PPC__ - buffer[distance] = (void*)(context->uc_mcontext.regs->nip); + buffer[distance] = (void*)(context->uc_mcontext.regs->nip); #endif /* Note -- 64bit does not require require modifications */ - } - return rv; -} - #include -static void + } + return rv; +} + #include +static void faultd_signal_handler__(int signal, siginfo_t* siginfo, void* context) { - int rv; + int rv; /* * Make sure we syncronize properly with other threads that * may *also* be faulting */ - rv = pthread_spin_trylock(&thread_lock__); + rv = pthread_spin_trylock(&thread_lock__); - if (rv == EBUSY) { - sigset_t mask; - sigemptyset(&mask); - pselect(0, NULL, NULL, NULL, NULL, &mask); + if (rv == EBUSY) { + sigset_t mask; + sigemptyset(&mask); + pselect(0, NULL, NULL, NULL, NULL, &mask); } - + /* - * Generate our fault information. - */ - faultd_info__.pid = getpid(); - faultd_info__.tid = 0; - faultd_info__.signal = signal; - faultd_info__.signal_code = siginfo->si_code; - faultd_info__.fault_address = siginfo->si_addr; - faultd_info__.last_errno = errno; + * Generate our fault information. + */ + faultd_info__.pid = getpid(); + faultd_info__.tid = 0; + faultd_info__.signal = signal; + faultd_info__.signal_code = siginfo->si_code; + faultd_info__.fault_address = siginfo->si_addr; + faultd_info__.last_errno = errno; - faultd_info__.backtrace_size = signal_backtrace__(faultd_info__.backtrace, + faultd_info__.backtrace_size = signal_backtrace__(faultd_info__.backtrace, AIM_ARRAYSIZE(faultd_info__.backtrace), - context, 0); - faultd_info__.backtrace_symbols = (void*)1; - if(faultd_client__) { - faultd_client_write(faultd_client__, &faultd_info__); + context, 0); + faultd_info__.backtrace_symbols = (void*)1; + if(faultd_client__) { + faultd_client_write(faultd_client__, &faultd_info__); } - if(localfd__ >= 0) { - char* signame = strsignal(faultd_info__.signal); - char* nl = "\n"; - write(localfd__, signame, strlen(signame)+1); - write(localfd__, nl, 2); - backtrace_symbols_fd(faultd_info__.backtrace, - faultd_info__.backtrace_size, - localfd__); + if(localfd__ >= 0) { + char* signame = strsignal(faultd_info__.signal); + char* nl = "\n"; + write(localfd__, signame, strlen(signame)+1); + write(localfd__, nl, 2); + backtrace_symbols_fd(faultd_info__.backtrace, + faultd_info__.backtrace_size, + localfd__); } - /* + /* * Unlock spinlock, in case this signal wasn't fatal */ - pthread_spin_unlock(&thread_lock__); + pthread_spin_unlock(&thread_lock__); } int -faultd_handler_register(int localfd, - const char* pipename, +faultd_handler_register(int localfd, + const char* pipename, const char* binaryname) { - int rv; - struct sigaction saction; - void* dummy_backtrace[1]; - int dummy_backtrace_size; - int fd; + int rv; + struct sigaction saction; + void* dummy_backtrace[1]; + int dummy_backtrace_size; + int fd; - if ( (rv = pthread_spin_init(&thread_lock__, 0)) ) { - return rv; + if ( (rv = pthread_spin_init(&thread_lock__, 0)) ) { + return rv; } - /* - * These calls to backtrace are to assure that - * backtrace() and backtrace_symbols_fd() have actually - * been loaded into our process -- its possible they + /* + * These calls to backtrace are to assure that + * backtrace() and backtrace_symbols_fd() have actually + * been loaded into our process -- its possible they * come from a dynamic library, and we don't want them * to get loaded at fault-time. */ - dummy_backtrace_size = backtrace(dummy_backtrace, 1); - - /** Note - we could just pass an invalid descriptor here, but it - * it flags errors in valgrind. + dummy_backtrace_size = backtrace(dummy_backtrace, 1); + + /** Note - we could just pass an invalid descriptor here, but it + * it flags errors in valgrind. */ - fd = open("/dev/null", O_WRONLY); - backtrace_symbols_fd(dummy_backtrace, dummy_backtrace_size, fd); - close(fd); + fd = open("/dev/null", O_WRONLY); + backtrace_symbols_fd(dummy_backtrace, dummy_backtrace_size, fd); + close(fd); - AIM_MEMSET(&faultd_info__, 0, sizeof(faultd_info__)); - if(!binaryname) { - binaryname = "Not specified."; + AIM_MEMSET(&faultd_info__, 0, sizeof(faultd_info__)); + if(!binaryname) { + binaryname = "Not specified."; } - aim_strlcpy(faultd_info__.binary, binaryname, sizeof(faultd_info__.binary)); - + aim_strlcpy(faultd_info__.binary, binaryname, sizeof(faultd_info__.binary)); - if(pipename) { - faultd_client_create(&faultd_client__, pipename); + + if(pipename) { + faultd_client_create(&faultd_client__, pipename); } - AIM_MEMSET(&saction, 0, sizeof(saction)); - saction.sa_sigaction = faultd_signal_handler__; + AIM_MEMSET(&saction, 0, sizeof(saction)); + saction.sa_sigaction = faultd_signal_handler__; - sigfillset(&saction.sa_mask); - saction.sa_flags = SA_SIGINFO | SA_RESETHAND; - - rv = sigaction (SIGSEGV, &saction, NULL); + sigfillset(&saction.sa_mask); + saction.sa_flags = SA_SIGINFO | SA_RESETHAND; + + rv = sigaction (SIGSEGV, &saction, NULL); rv |= sigaction (SIGILL, &saction, NULL); - rv |= sigaction (SIGFPE, &saction, NULL); + rv |= sigaction (SIGFPE, &saction, NULL); rv |= sigaction (SIGBUS, &saction, NULL); rv |= sigaction (SIGQUIT, &saction, NULL); rv |= sigaction (SIGALRM, &saction, NULL); /* - * SIGUSR2 can be used to request a backtrace explicitly. - * In this case, we don't want to reset the handler. + * SIGUSR2 can be used to request a backtrace explicitly. + * In this case, we don't want to reset the handler. */ - saction.sa_flags = SA_SIGINFO; - rv |= sigaction (SIGUSR2, &saction, NULL); + saction.sa_flags = SA_SIGINFO; + rv |= sigaction (SIGUSR2, &saction, NULL); /* * The local fault handler will attempt to write a subset of - * the fault information (signal type and backtrace) - * to the localfd descriptor if specified. + * the fault information (signal type and backtrace) + * to the localfd descriptor if specified. */ - localfd__ = localfd; + localfd__ = localfd; return rv; } - - - - - - diff --git a/packages/base/any/kernels/3.16-lts/patches/gcc-no-pie.patch b/packages/base/any/kernels/3.16-lts/patches/gcc-no-pie.patch new file mode 100644 index 00000000..c682275b --- /dev/null +++ b/packages/base/any/kernels/3.16-lts/patches/gcc-no-pie.patch @@ -0,0 +1,16 @@ +diff -urpN a/Makefile b/Makefile +--- a/Makefile 2017-08-22 17:42:57.037875653 +0000 ++++ b/Makefile 2017-08-22 17:43:53.089875539 +0000 +@@ -616,6 +616,12 @@ include $(srctree)/arch/$(SRCARCH)/Makef + + KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,) + ++# Required for GCC-5/6 ++KBUILD_CFLAGS += $(call cc-option, -fno-pie) ++KBUILD_CFLAGS += $(call cc-option, -no-pie) ++KBUILD_AFLAGS += $(call cc-option, -fno-pie) ++KBUILD_CPPFLAGS += $(call cc-option, -fno-pie) ++ + ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE + KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,) + else diff --git a/packages/base/any/kernels/3.16-lts/patches/series b/packages/base/any/kernels/3.16-lts/patches/series index 8c9db7bd..e6a083f7 100644 --- a/packages/base/any/kernels/3.16-lts/patches/series +++ b/packages/base/any/kernels/3.16-lts/patches/series @@ -26,3 +26,4 @@ platform-powerpc-dni-7448-r0.patch platform-powerpc-quanta-lb9-r0.patch driver-support-intel-igb-bcm50210-phy.patch driver-igb-netberg-aurora.patch +gcc-no-pie.patch diff --git a/packages/base/any/onlp/src/sff/module/auto/sff.yml b/packages/base/any/onlp/src/sff/module/auto/sff.yml index 07b931ea..8977bcad 100644 --- a/packages/base/any/onlp/src/sff/module/auto/sff.yml +++ b/packages/base/any/onlp/src/sff/module/auto/sff.yml @@ -69,6 +69,8 @@ sff_module_types: &sff_module_types desc: "40GBASE-SR2" - 40G_BASE_SM4: desc: "40GBASE-SM4" +- 40G_BASE_ER4: + desc: "40GBASE-ER4" - 25G_BASE_CR: desc: "25GBASE-CR" - 10G_BASE_SR: diff --git a/packages/base/any/onlp/src/sff/module/inc/sff/8436.h b/packages/base/any/onlp/src/sff/module/inc/sff/8436.h index 6383eddf..ee6640ab 100644 --- a/packages/base/any/onlp/src/sff/module/inc/sff/8436.h +++ b/packages/base/any/onlp/src/sff/module/inc/sff/8436.h @@ -115,7 +115,7 @@ ((idprom[131] & SFF8436_CC131_40GE_ACTIVE) != 0) #define SFF8436_MEDIA_NONE(idprom) \ - (idprom[131] == 0) + ((idprom[131] & 0x7F) == 0) #define SFF8436_CC132_40G_OTN 0x08 #define SFF8436_CC132_OC48_LONG SFF8472_CC4_OC48_LONG @@ -291,6 +291,23 @@ _sff8436_qsfp_40g_sm4(const uint8_t* idprom) return 1; } +static inline int +_sff8436_qsfp_40g_er4(const uint8_t* idprom) +{ + if(!SFF8436_MODULE_QSFP_PLUS_V2(idprom)) { + return 0; + } + + if (idprom[130] != SFF8436_CONN_LC) return 0; + if (!SFF8436_MEDIA_NONE(idprom)) return 0; + + /* 40 kilometer SMF */ + if (idprom[142] != 40) { + return 0; + } + return 1; +} + static inline int _sff8436_bitrate(const uint8_t *idprom) { diff --git a/packages/base/any/onlp/src/sff/module/inc/sff/sff.h b/packages/base/any/onlp/src/sff/module/inc/sff/sff.h index ec9e9c0a..367b6c0e 100644 --- a/packages/base/any/onlp/src/sff/module/inc/sff/sff.h +++ b/packages/base/any/onlp/src/sff/module/inc/sff/sff.h @@ -110,6 +110,7 @@ typedef enum sff_module_type_e { SFF_MODULE_TYPE_40G_BASE_CR, SFF_MODULE_TYPE_40G_BASE_SR2, SFF_MODULE_TYPE_40G_BASE_SM4, + SFF_MODULE_TYPE_40G_BASE_ER4, SFF_MODULE_TYPE_25G_BASE_CR, SFF_MODULE_TYPE_10G_BASE_SR, SFF_MODULE_TYPE_10G_BASE_LR, @@ -148,6 +149,7 @@ typedef enum sff_module_type_e { "40G_BASE_CR", \ "40G_BASE_SR2", \ "40G_BASE_SM4", \ + "40G_BASE_ER4", \ "25G_BASE_CR", \ "10G_BASE_SR", \ "10G_BASE_LR", \ diff --git a/packages/base/any/onlp/src/sff/module/inc/sff/sff.x b/packages/base/any/onlp/src/sff/module/inc/sff/sff.x index ed354ef1..1efe7884 100644 --- a/packages/base/any/onlp/src/sff/module/inc/sff/sff.x +++ b/packages/base/any/onlp/src/sff/module/inc/sff/sff.x @@ -20,6 +20,7 @@ SFF_MEDIA_TYPE_ENTRY(40G_BASE_ACTIVE, 40GBASE-ACTIVE) SFF_MEDIA_TYPE_ENTRY(40G_BASE_CR, 40GBASE-CR) SFF_MEDIA_TYPE_ENTRY(40G_BASE_SR2, 40GBASE-SR2) SFF_MEDIA_TYPE_ENTRY(40G_BASE_SM4, 40GBASE-SM4) +SFF_MEDIA_TYPE_ENTRY(40G_BASE_ER4, 40GBASE-ER4) SFF_MEDIA_TYPE_ENTRY(25G_BASE_CR, 25GBASE-CR) SFF_MEDIA_TYPE_ENTRY(10G_BASE_SR, 10GBASE-SR) SFF_MEDIA_TYPE_ENTRY(10G_BASE_LR, 10GBASE-LR) @@ -64,6 +65,7 @@ SFF_MODULE_TYPE_ENTRY(40G_BASE_ACTIVE, 40GBASE-ACTIVE) SFF_MODULE_TYPE_ENTRY(40G_BASE_CR, 40GBASE-CR) SFF_MODULE_TYPE_ENTRY(40G_BASE_SR2, 40GBASE-SR2) SFF_MODULE_TYPE_ENTRY(40G_BASE_SM4, 40GBASE-SM4) +SFF_MODULE_TYPE_ENTRY(40G_BASE_ER4, 40GBASE-ER4) SFF_MODULE_TYPE_ENTRY(25G_BASE_CR, 25GBASE-CR) SFF_MODULE_TYPE_ENTRY(10G_BASE_SR, 10GBASE-SR) SFF_MODULE_TYPE_ENTRY(10G_BASE_LR, 10GBASE-LR) diff --git a/packages/base/any/onlp/src/sff/module/src/sff.c b/packages/base/any/onlp/src/sff/module/src/sff.c index eec75130..34a554a0 100644 --- a/packages/base/any/onlp/src/sff/module/src/sff.c +++ b/packages/base/any/onlp/src/sff/module/src/sff.c @@ -132,6 +132,11 @@ sff_module_type_get(const uint8_t* eeprom) return SFF_MODULE_TYPE_40G_BASE_SM4; } + if (SFF8436_MODULE_QSFP_PLUS_V2(eeprom) + && _sff8436_qsfp_40g_er4(eeprom)) { + return SFF_MODULE_TYPE_40G_BASE_ER4; + } + if (SFF8472_MODULE_SFP(eeprom) && SFF8472_MEDIA_XGE_SR(eeprom) && !_sff8472_media_gbe_sx_fc_hack(eeprom)) @@ -242,6 +247,7 @@ sff_media_type_get(sff_module_type_t mt) case SFF_MODULE_TYPE_40G_BASE_ACTIVE: case SFF_MODULE_TYPE_40G_BASE_SR2: case SFF_MODULE_TYPE_40G_BASE_SM4: + case SFF_MODULE_TYPE_40G_BASE_ER4: case SFF_MODULE_TYPE_10G_BASE_SR: case SFF_MODULE_TYPE_10G_BASE_LR: case SFF_MODULE_TYPE_10G_BASE_LRM: @@ -291,6 +297,7 @@ sff_module_caps_get(sff_module_type_t mt, uint32_t *caps) case SFF_MODULE_TYPE_40G_BASE_CR: case SFF_MODULE_TYPE_40G_BASE_SR2: case SFF_MODULE_TYPE_40G_BASE_SM4: + case SFF_MODULE_TYPE_40G_BASE_ER4: *caps |= SFF_MODULE_CAPS_F_40G; return 0; @@ -687,6 +694,7 @@ sff_info_init(sff_info_t* info, sff_module_type_t mt, case SFF_MODULE_TYPE_40G_BASE_ACTIVE: case SFF_MODULE_TYPE_40G_BASE_SR2: case SFF_MODULE_TYPE_40G_BASE_SM4: + case SFF_MODULE_TYPE_40G_BASE_ER4: case SFF_MODULE_TYPE_4X_MUX: info->sfp_type = SFF_SFP_TYPE_QSFP_PLUS; info->media_type = SFF_MEDIA_TYPE_FIBER; diff --git a/packages/base/any/onlp/src/sff/module/src/sff_enums.c b/packages/base/any/onlp/src/sff/module/src/sff_enums.c index 7f4d2b17..b2ce8fc3 100644 --- a/packages/base/any/onlp/src/sff/module/src/sff_enums.c +++ b/packages/base/any/onlp/src/sff/module/src/sff_enums.c @@ -144,6 +144,7 @@ aim_map_si_t sff_module_type_map[] = { "40G_BASE_CR", SFF_MODULE_TYPE_40G_BASE_CR }, { "40G_BASE_SR2", SFF_MODULE_TYPE_40G_BASE_SR2 }, { "40G_BASE_SM4", SFF_MODULE_TYPE_40G_BASE_SM4 }, + { "40G_BASE_ER4", SFF_MODULE_TYPE_40G_BASE_ER4 }, { "25G_BASE_CR", SFF_MODULE_TYPE_25G_BASE_CR }, { "10G_BASE_SR", SFF_MODULE_TYPE_10G_BASE_SR }, { "10G_BASE_LR", SFF_MODULE_TYPE_10G_BASE_LR }, @@ -179,6 +180,7 @@ aim_map_si_t sff_module_type_desc_map[] = { "40GBASE-CR", SFF_MODULE_TYPE_40G_BASE_CR }, { "40GBASE-SR2", SFF_MODULE_TYPE_40G_BASE_SR2 }, { "40GBASE-SM4", SFF_MODULE_TYPE_40G_BASE_SM4 }, + { "40GBASE-ER4", SFF_MODULE_TYPE_40G_BASE_ER4 }, { "25GBASE-CR", SFF_MODULE_TYPE_25G_BASE_CR }, { "10GBASE-SR", SFF_MODULE_TYPE_10G_BASE_SR }, { "10GBASE-LR", SFF_MODULE_TYPE_10G_BASE_LR }, diff --git a/packages/base/any/onlp/src/sff/sff.mk b/packages/base/any/onlp/src/sff/sff.mk index 8becb2c5..e982638c 100644 --- a/packages/base/any/onlp/src/sff/sff.mk +++ b/packages/base/any/onlp/src/sff/sff.mk @@ -3,12 +3,12 @@ # # Inclusive Makefile for the sff module. # -# Autogenerated 2017-05-22 21:57:32.679978 +# Autogenerated 2017-08-22 22:14:08.507022 # ############################################################################### sff_BASEDIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) include $(sff_BASEDIR)module/make.mk -include $(sff_BASEDIR)module/auto/make.mk include $(sff_BASEDIR)module/src/make.mk +include $(sff_BASEDIR)module/auto/make.mk include $(sff_BASEDIR)utest/_make.mk diff --git a/packages/platforms-closed b/packages/platforms-closed index c42683c1..194d6cef 160000 --- a/packages/platforms-closed +++ b/packages/platforms-closed @@ -1 +1 @@ -Subproject commit c42683c1317cf662331a34a2a84b5879144f8a56 +Subproject commit 194d6cef67bc5f67eecad95456c5085cd5ba47c3 diff --git a/packages/platforms/celestica/x86-64/x86-64-cel-redstone-xp/onlp/builds/src/module/src/i2c_chips.c b/packages/platforms/celestica/x86-64/x86-64-cel-redstone-xp/onlp/builds/src/module/src/i2c_chips.c index 84b1cfc6..cfdeeb9e 100644 --- a/packages/platforms/celestica/x86-64/x86-64-cel-redstone-xp/onlp/builds/src/module/src/i2c_chips.c +++ b/packages/platforms/celestica/x86-64/x86-64-cel-redstone-xp/onlp/builds/src/module/src/i2c_chips.c @@ -458,7 +458,7 @@ int getCtrlOfBus(void) return getCtrlOfBus_9541(); } -static const struct fan_cpld_reg fan_cpld_reg[FAN_NUM] = { +const struct fan_cpld_reg fan_cpld_reg[FAN_NUM] = { {0x180, 0x181}, {0x182, 0x183}, {0x184, 0x185}, @@ -1952,5 +1952,3 @@ int fanSpeedSet(int id, unsigned short speed) } return ret; } - - diff --git a/packages/platforms/delta/x86-64/x86-64-delta-ag5648/.gitignore b/packages/platforms/delta/x86-64/x86-64-delta-ag5648/.gitignore index 76483140..269535f7 100644 --- a/packages/platforms/delta/x86-64/x86-64-delta-ag5648/.gitignore +++ b/packages/platforms/delta/x86-64/x86-64-delta-ag5648/.gitignore @@ -1,3 +1,2 @@ -*x86*64*delta_agc7648a*.mk +*x86*64*delta*ag5648*.mk onlpdump.mk - diff --git a/packages/platforms/delta/x86-64/x86-64-delta-ag5648/onlp/builds/src/module/src/ledi.c b/packages/platforms/delta/x86-64/x86-64-delta-ag5648/onlp/builds/src/module/src/ledi.c index e697dce4..4400b2cc 100755 --- a/packages/platforms/delta/x86-64/x86-64-delta-ag5648/onlp/builds/src/module/src/ledi.c +++ b/packages/platforms/delta/x86-64/x86-64-delta-ag5648/onlp/builds/src/module/src/ledi.c @@ -2,7 +2,7 @@ * * * Copyright 2014 Big Switch Networks, Inc. - * Copyright (C) 2017 Delta Networks, Inc. + * Copyright (C) 2017 Delta Networks, Inc. * * Licensed under the Eclipse Public License, Version 1.0 (the * "License"); you may not use this file except in compliance @@ -43,44 +43,44 @@ * Get the information for the given LED OID. */ static onlp_led_info_t linfo[] = -{ - { }, /* Not used */ { - { ONLP_LED_ID_CREATE(LED_FRONT_FAN), "FRONT LED (FAN LED)", 0 }, - ONLP_LED_STATUS_PRESENT, - ONLP_LED_CAPS_ON_OFF | ONLP_LED_CAPS_GREEN | ONLP_LED_CAPS_ORANGE | ONLP_LED_CAPS_ORANGE_BLINKING | ONLP_LED_CAPS_AUTO, - }, - { - { ONLP_LED_ID_CREATE(LED_FRONT_SYS), "FRONT LED (SYS LED)", 0 }, - ONLP_LED_STATUS_PRESENT, - ONLP_LED_CAPS_ON_OFF | ONLP_LED_CAPS_GREEN | ONLP_LED_CAPS_ORANGE | ONLP_LED_CAPS_GREEN_BLINKING | ONLP_LED_CAPS_AUTO, - }, - { - { ONLP_LED_ID_CREATE(LED_FRONT_PWR), "FRONT LED (PWR LED)", 0 }, - ONLP_LED_STATUS_PRESENT, - ONLP_LED_CAPS_ON_OFF | ONLP_LED_CAPS_GREEN | ONLP_LED_CAPS_ORANGE | ONLP_LED_CAPS_ORANGE_BLINKING, - }, - { - { ONLP_LED_ID_CREATE(LED_REAR_FAN_TRAY_1), "FAN TRAY 1 LED", 0 }, - ONLP_LED_STATUS_PRESENT, - ONLP_LED_CAPS_ON_OFF | ONLP_LED_CAPS_RED | ONLP_LED_CAPS_GREEN | ONLP_LED_CAPS_AUTO, - }, - { - { ONLP_LED_ID_CREATE(LED_REAR_FAN_TRAY_2), "FAN TRAY 2 LED", 0 }, - ONLP_LED_STATUS_PRESENT, - ONLP_LED_CAPS_ON_OFF | ONLP_LED_CAPS_RED | ONLP_LED_CAPS_GREEN | ONLP_LED_CAPS_AUTO, - }, - { - { ONLP_LED_ID_CREATE(LED_REAR_FAN_TRAY_3), "FAN TRAY 3 LED", 0 }, - ONLP_LED_STATUS_PRESENT, - ONLP_LED_CAPS_ON_OFF | ONLP_LED_CAPS_RED | ONLP_LED_CAPS_GREEN | ONLP_LED_CAPS_AUTO, - }, - { - { ONLP_LED_ID_CREATE(LED_REAR_FAN_TRAY_4), "FAN TRAY 4 LED", 0 }, - ONLP_LED_STATUS_PRESENT, - ONLP_LED_CAPS_ON_OFF | ONLP_LED_CAPS_RED | ONLP_LED_CAPS_GREEN | ONLP_LED_CAPS_AUTO, - }, -}; + { }, /* Not used */ + { + { ONLP_LED_ID_CREATE(LED_FRONT_FAN), "FRONT LED (FAN LED)", 0 }, + ONLP_LED_STATUS_PRESENT, + ONLP_LED_CAPS_ON_OFF | ONLP_LED_CAPS_GREEN | ONLP_LED_CAPS_ORANGE | ONLP_LED_CAPS_ORANGE_BLINKING | ONLP_LED_CAPS_AUTO, + }, + { + { ONLP_LED_ID_CREATE(LED_FRONT_SYS), "FRONT LED (SYS LED)", 0 }, + ONLP_LED_STATUS_PRESENT, + ONLP_LED_CAPS_ON_OFF | ONLP_LED_CAPS_GREEN | ONLP_LED_CAPS_ORANGE | ONLP_LED_CAPS_GREEN_BLINKING | ONLP_LED_CAPS_AUTO, + }, + { + { ONLP_LED_ID_CREATE(LED_FRONT_PWR), "FRONT LED (PWR LED)", 0 }, + ONLP_LED_STATUS_PRESENT, + ONLP_LED_CAPS_ON_OFF | ONLP_LED_CAPS_GREEN | ONLP_LED_CAPS_ORANGE | ONLP_LED_CAPS_ORANGE_BLINKING, + }, + { + { ONLP_LED_ID_CREATE(LED_REAR_FAN_TRAY_1), "FAN TRAY 1 LED", 0 }, + ONLP_LED_STATUS_PRESENT, + ONLP_LED_CAPS_ON_OFF | ONLP_LED_CAPS_RED | ONLP_LED_CAPS_GREEN | ONLP_LED_CAPS_AUTO, + }, + { + { ONLP_LED_ID_CREATE(LED_REAR_FAN_TRAY_2), "FAN TRAY 2 LED", 0 }, + ONLP_LED_STATUS_PRESENT, + ONLP_LED_CAPS_ON_OFF | ONLP_LED_CAPS_RED | ONLP_LED_CAPS_GREEN | ONLP_LED_CAPS_AUTO, + }, + { + { ONLP_LED_ID_CREATE(LED_REAR_FAN_TRAY_3), "FAN TRAY 3 LED", 0 }, + ONLP_LED_STATUS_PRESENT, + ONLP_LED_CAPS_ON_OFF | ONLP_LED_CAPS_RED | ONLP_LED_CAPS_GREEN | ONLP_LED_CAPS_AUTO, + }, + { + { ONLP_LED_ID_CREATE(LED_REAR_FAN_TRAY_4), "FAN TRAY 4 LED", 0 }, + ONLP_LED_STATUS_PRESENT, + ONLP_LED_CAPS_ON_OFF | ONLP_LED_CAPS_RED | ONLP_LED_CAPS_GREEN | ONLP_LED_CAPS_AUTO, + }, + }; /* * This function will be called prior to any other onlp_ledi_* functions. */ @@ -104,10 +104,10 @@ onlp_ledi_info_get(onlp_oid_t id, onlp_led_info_t* info) dev_info.flags = DEFAULT_FLAG; /* Set front panel's mode of leds */ - r_data = dni_lock_cpld_read_attribute(SLAVE_CPLD_PATH,LED_REG); + r_data = dni_lock_cpld_read_attribute(SLAVE_CPLD_PATH,LED_REG); int local_id = ONLP_OID_ID_GET(id); switch(local_id) - { + { case LED_FRONT_FAN: if((r_data & 0xc0) == 0x80) info->mode = ONLP_LED_MODE_GREEN; @@ -120,11 +120,11 @@ onlp_ledi_info_get(onlp_oid_t id, onlp_led_info_t* info) break; case LED_FRONT_SYS: if((r_data & 0x30) == 0x10) - info->mode = ONLP_LED_MODE_GREEN; + info->mode = ONLP_LED_MODE_GREEN; else if((r_data & 0x30) == 0x20) - info->mode = ONLP_LED_MODE_ORANGE; + info->mode = ONLP_LED_MODE_ORANGE; else if((r_data & 0x30) == 0x00) - info->mode = ONLP_LED_MODE_GREEN_BLINKING; + info->mode = ONLP_LED_MODE_GREEN_BLINKING; else return ONLP_STATUS_E_INTERNAL; break; @@ -143,12 +143,12 @@ onlp_ledi_info_get(onlp_oid_t id, onlp_led_info_t* info) r_data = dni_lock_cpld_read_attribute(SLAVE_CPLD_PATH,FAN_TRAY_LED_REG); fantray_present = dni_i2c_lock_read(NULL, &dev_info); if(fantray_present >= 0) - { - if((r_data & 0x01) == 0x01) - info->mode = ONLP_LED_MODE_GREEN; - else - info->mode = ONLP_LED_MODE_ORANGE; - } + { + if((r_data & 0x01) == 0x01) + info->mode = ONLP_LED_MODE_GREEN; + else + info->mode = ONLP_LED_MODE_ORANGE; + } else info->mode = ONLP_LED_MODE_OFF; break; @@ -157,12 +157,12 @@ onlp_ledi_info_get(onlp_oid_t id, onlp_led_info_t* info) r_data = dni_lock_cpld_read_attribute(SLAVE_CPLD_PATH,FAN_TRAY_LED_REG); fantray_present = dni_i2c_lock_read(NULL, &dev_info); if(fantray_present >= 0) - { - if((r_data & 0x04) == 0x04) - info->mode = ONLP_LED_MODE_GREEN; - else - info->mode = ONLP_LED_MODE_ORANGE; - } + { + if((r_data & 0x04) == 0x04) + info->mode = ONLP_LED_MODE_GREEN; + else + info->mode = ONLP_LED_MODE_ORANGE; + } else info->mode = ONLP_LED_MODE_OFF; break; @@ -171,12 +171,12 @@ onlp_ledi_info_get(onlp_oid_t id, onlp_led_info_t* info) r_data = dni_lock_cpld_read_attribute(SLAVE_CPLD_PATH,FAN_TRAY_LED_REG); fantray_present = dni_i2c_lock_read(NULL, &dev_info); if(fantray_present >= 0) - { - if((r_data & 0x10) == 0x10) - info->mode = ONLP_LED_MODE_GREEN; - else - info->mode = ONLP_LED_MODE_ORANGE; - } + { + if((r_data & 0x10) == 0x10) + info->mode = ONLP_LED_MODE_GREEN; + else + info->mode = ONLP_LED_MODE_ORANGE; + } else info->mode = ONLP_LED_MODE_OFF; break; @@ -185,20 +185,20 @@ onlp_ledi_info_get(onlp_oid_t id, onlp_led_info_t* info) r_data = dni_lock_cpld_read_attribute(SLAVE_CPLD_PATH,FAN_TRAY_LED_REG); fantray_present = dni_i2c_lock_read(NULL, &dev_info); if(fantray_present >= 0) - { - if((r_data & 0x40) == 0x40) - info->mode = ONLP_LED_MODE_GREEN; - else - info->mode = ONLP_LED_MODE_ORANGE; - } + { + if((r_data & 0x40) == 0x40) + info->mode = ONLP_LED_MODE_GREEN; + else + info->mode = ONLP_LED_MODE_ORANGE; + } else info->mode = ONLP_LED_MODE_OFF; break; default: break; - } + } /* Set the on/off status */ - if (info->mode == ONLP_LED_MODE_OFF) + if (info->mode == ONLP_LED_MODE_OFF) info->status |= ONLP_LED_STATUS_FAILED; else info->status |=ONLP_LED_STATUS_PRESENT; @@ -250,40 +250,40 @@ onlp_ledi_mode_set(onlp_oid_t id, onlp_led_mode_t mode) fan_led_status_value = dni_lock_cpld_read_attribute(SLAVE_CPLD_PATH,FAN_STAT1_REG); fan_tray_pres_value = dni_lock_cpld_read_attribute(SLAVE_CPLD_PATH,FAN_STAT2_REG); alarm_reg_value = dni_lock_cpld_read_attribute(SLAVE_CPLD_PATH,ALARM_REG); - - switch(local_id) - { - case LED_FRONT_FAN: + + switch(local_id) + { + case LED_FRONT_FAN: /* Clean the bit 7,6 */ front_panel_led_value &= ~0xC0; fan_board_not_present_count = 0; - /* Read cpld fan status to check present. Fan tray 1-4 */ + /* Read cpld fan status to check present. Fan tray 1-4 */ for(i = 0; i < 4; i++) - { - fan_stat2_reg_mask = 0x01 << i; - fan_stat1_reg_mask = 0x01 << (i * 2); - if((fan_tray_pres_value & fan_stat2_reg_mask) == fan_stat2_reg_mask) - fan_board_not_present_count++; - else if((fan_led_status_value & fan_stat1_reg_mask) == fan_stat1_reg_mask) - count++; - } + { + fan_stat2_reg_mask = 0x01 << i; + fan_stat1_reg_mask = 0x01 << (i * 2); + if((fan_tray_pres_value & fan_stat2_reg_mask) == fan_stat2_reg_mask) + fan_board_not_present_count++; + else if((fan_led_status_value & fan_stat1_reg_mask) == fan_stat1_reg_mask) + count++; + } /* Set front light of FAN */ if(count == ALL_FAN_TRAY_EXIST) - { - front_panel_led_value |= 0x80;/*Solid green, FAN operates normally.*/ - dni_lock_cpld_write_attribute(SLAVE_CPLD_PATH,LED_REG, front_panel_led_value); - } + { + front_panel_led_value |= 0x80;/*Solid green, FAN operates normally.*/ + dni_lock_cpld_write_attribute(SLAVE_CPLD_PATH,LED_REG, front_panel_led_value); + } else if (fan_board_not_present_count > 0) - { - front_panel_led_value |= 0xc0;/*Blinking Yellow , FAN is failed */ - dni_lock_cpld_write_attribute(SLAVE_CPLD_PATH,LED_REG, front_panel_led_value); - } + { + front_panel_led_value |= 0xc0;/*Blinking Yellow , FAN is failed */ + dni_lock_cpld_write_attribute(SLAVE_CPLD_PATH,LED_REG, front_panel_led_value); + } else - { - front_panel_led_value |= 0x40;/*Solid Amber FAN operating is NOT present */ - dni_lock_cpld_write_attribute(SLAVE_CPLD_PATH,LED_REG, front_panel_led_value); - } - + { + front_panel_led_value |= 0x40;/*Solid Amber FAN operating is NOT present */ + dni_lock_cpld_write_attribute(SLAVE_CPLD_PATH,LED_REG, front_panel_led_value); + } + break; case LED_FRONT_PWR: @@ -298,52 +298,52 @@ onlp_ledi_mode_set(onlp_oid_t id, onlp_led_mode_t mode) psu2_state = dni_i2c_lock_read(NULL, &dev_info); if(psu1_state == 1 && psu2_state == 1) - { - power_state = dni_lock_cpld_read_attribute(MASTER_CPLD_PATH,PSU_STAT_REG); - - if((power_state & 0x40) == 0x40 || (power_state & 0x04) == 0x04) { - front_panel_led_value |= 0x06; /*Blinking Amber*/ - dni_lock_cpld_write_attribute(SLAVE_CPLD_PATH,LED_REG, front_panel_led_value); + power_state = dni_lock_cpld_read_attribute(MASTER_CPLD_PATH,PSU_STAT_REG); + + if((power_state & 0x40) == 0x40 || (power_state & 0x04) == 0x04) + { + front_panel_led_value |= 0x06; /*Blinking Amber*/ + dni_lock_cpld_write_attribute(SLAVE_CPLD_PATH,LED_REG, front_panel_led_value); + } + else + { + front_panel_led_value |= 0x04; /*Solid Green*/ + dni_lock_cpld_write_attribute(SLAVE_CPLD_PATH,LED_REG, front_panel_led_value); + } } - else - { - front_panel_led_value |= 0x04; /*Solid Green*/ - dni_lock_cpld_write_attribute(SLAVE_CPLD_PATH,LED_REG, front_panel_led_value); - } - } else front_panel_led_value |= 0x02; /*Solid Amber*/ - dni_lock_cpld_write_attribute(SLAVE_CPLD_PATH,LED_REG, front_panel_led_value); + dni_lock_cpld_write_attribute(SLAVE_CPLD_PATH,LED_REG, front_panel_led_value); break; - + case LED_FRONT_SYS: /* Clean bit 4,5 */ front_panel_led_value &= ~0x30; - fan_board_not_present_count = 0; + fan_board_not_present_count = 0; /* Read fan eeprom to check present */ for(i = 0;i < 4; i++) - { - fan_stat2_reg_mask = 0x01 << i; - if((fan_tray_pres_value & fan_stat2_reg_mask) == fan_stat2_reg_mask) - fan_board_not_present_count++; - } - if(fan_board_not_present_count > 0 || (alarm_reg_value & 0xff) == 0xff) - { - fan_tray_interface_detected_value = dni_lock_cpld_read_attribute(SLAVE_CPLD_PATH,INTERRUPT_REG); - if(fan_tray_interface_detected_value == 0xfe || (alarm_reg_value & 0xff) == 0xff) { - front_panel_led_value |= 0x20; + fan_stat2_reg_mask = 0x01 << i; + if((fan_tray_pres_value & fan_stat2_reg_mask) == fan_stat2_reg_mask) + fan_board_not_present_count++; + } + if(fan_board_not_present_count > 0 || (alarm_reg_value & 0xff) == 0xff) + { + fan_tray_interface_detected_value = dni_lock_cpld_read_attribute(SLAVE_CPLD_PATH,INTERRUPT_REG); + if(fan_tray_interface_detected_value == 0xfe || (alarm_reg_value & 0xff) == 0xff) + { + front_panel_led_value |= 0x20; + dni_lock_cpld_write_attribute(SLAVE_CPLD_PATH, LED_REG, front_panel_led_value); + } + } + else + { + front_panel_led_value |= 0x10; dni_lock_cpld_write_attribute(SLAVE_CPLD_PATH, LED_REG, front_panel_led_value); } - } - else - { - front_panel_led_value |= 0x10; - dni_lock_cpld_write_attribute(SLAVE_CPLD_PATH, LED_REG, front_panel_led_value); - } break; - + case LED_REAR_FAN_TRAY_1: dev_info.addr = FAN_TRAY_1; fantray_present = dni_i2c_lock_read(NULL, &dev_info); @@ -351,15 +351,15 @@ onlp_ledi_mode_set(onlp_oid_t id, onlp_led_mode_t mode) rpm1 = dni_i2c_lock_read_attribute(NULL, FAN1_REAR); fan_tray_led_reg_value &= ~0x03; if(fantray_present >= 0 && rpm != FAN_ZERO_RPM && rpm != 0 && rpm1 != FAN_ZERO_RPM && rpm1 != 0 ) - { - fan_tray_led_reg_value |= 0x01;/*Solid Green*/ - dni_lock_cpld_write_attribute(SLAVE_CPLD_PATH,FAN_TRAY_LED_REG, fan_tray_led_reg_value); - } + { + fan_tray_led_reg_value |= 0x01;/*Solid Green*/ + dni_lock_cpld_write_attribute(SLAVE_CPLD_PATH,FAN_TRAY_LED_REG, fan_tray_led_reg_value); + } else - { - fan_tray_led_reg_value |= 0x02;/*Solid Amber*/ - dni_lock_cpld_write_attribute(SLAVE_CPLD_PATH,FAN_TRAY_LED_REG, fan_tray_led_reg_value); - } + { + fan_tray_led_reg_value |= 0x02;/*Solid Amber*/ + dni_lock_cpld_write_attribute(SLAVE_CPLD_PATH,FAN_TRAY_LED_REG, fan_tray_led_reg_value); + } break; case LED_REAR_FAN_TRAY_2: @@ -368,17 +368,17 @@ onlp_ledi_mode_set(onlp_oid_t id, onlp_led_mode_t mode) rpm = dni_i2c_lock_read_attribute(NULL, FAN2_FRONT); rpm1 = dni_i2c_lock_read_attribute(NULL, FAN2_REAR); fan_tray_led_reg_value &= ~0x0c; - + if(fantray_present >= 0 && rpm != FAN_ZERO_RPM && rpm != 0 && rpm1 != FAN_ZERO_RPM && rpm1 != 0 ) - { - fan_tray_led_reg_value |= 0x04;/*Solid Green*/ - dni_lock_cpld_write_attribute(SLAVE_CPLD_PATH,FAN_TRAY_LED_REG, fan_tray_led_reg_value); - } + { + fan_tray_led_reg_value |= 0x04;/*Solid Green*/ + dni_lock_cpld_write_attribute(SLAVE_CPLD_PATH,FAN_TRAY_LED_REG, fan_tray_led_reg_value); + } else - { - fan_tray_led_reg_value |= 0x08;/*Solid Amber*/ - dni_lock_cpld_write_attribute(SLAVE_CPLD_PATH,FAN_TRAY_LED_REG, fan_tray_led_reg_value); - } + { + fan_tray_led_reg_value |= 0x08;/*Solid Amber*/ + dni_lock_cpld_write_attribute(SLAVE_CPLD_PATH,FAN_TRAY_LED_REG, fan_tray_led_reg_value); + } break; case LED_REAR_FAN_TRAY_3: @@ -388,15 +388,15 @@ onlp_ledi_mode_set(onlp_oid_t id, onlp_led_mode_t mode) rpm = dni_i2c_lock_read_attribute(NULL, FAN3_FRONT); rpm1 = dni_i2c_lock_read_attribute(NULL, FAN3_REAR); if(fantray_present >= 0 && rpm != FAN_ZERO_RPM && rpm != 0 && rpm1 != FAN_ZERO_RPM && rpm1 != 0 ) - { - fan_tray_led_reg_value |= 0x10;/*Solid Green*/ - dni_lock_cpld_write_attribute(SLAVE_CPLD_PATH,FAN_TRAY_LED_REG, fan_tray_led_reg_value); - } + { + fan_tray_led_reg_value |= 0x10;/*Solid Green*/ + dni_lock_cpld_write_attribute(SLAVE_CPLD_PATH,FAN_TRAY_LED_REG, fan_tray_led_reg_value); + } else - { - fan_tray_led_reg_value |= 0x20;/*Solid Amber*/ - dni_lock_cpld_write_attribute(SLAVE_CPLD_PATH,FAN_TRAY_LED_REG, fan_tray_led_reg_value); - } + { + fan_tray_led_reg_value |= 0x20;/*Solid Amber*/ + dni_lock_cpld_write_attribute(SLAVE_CPLD_PATH,FAN_TRAY_LED_REG, fan_tray_led_reg_value); + } break; case LED_REAR_FAN_TRAY_4: @@ -406,16 +406,16 @@ onlp_ledi_mode_set(onlp_oid_t id, onlp_led_mode_t mode) rpm = dni_i2c_lock_read_attribute(NULL, FAN4_FRONT); rpm1 = dni_i2c_lock_read_attribute(NULL, FAN4_REAR); if(fantray_present >= 0 && rpm != FAN_ZERO_RPM && rpm !=0 && rpm1 != FAN_ZERO_RPM && rpm1 != 0 ) - { - fan_tray_led_reg_value |= 0x40; /*Solid Green*/ - dni_lock_cpld_write_attribute(SLAVE_CPLD_PATH,FAN_TRAY_LED_REG, fan_tray_led_reg_value); - } + { + fan_tray_led_reg_value |= 0x40; /*Solid Green*/ + dni_lock_cpld_write_attribute(SLAVE_CPLD_PATH,FAN_TRAY_LED_REG, fan_tray_led_reg_value); + } else - { - fan_tray_led_reg_value |= 0x80;/*Solid Amber*/ - dni_lock_cpld_write_attribute(SLAVE_CPLD_PATH,FAN_TRAY_LED_REG, fan_tray_led_reg_value); - } - } + { + fan_tray_led_reg_value |= 0x80;/*Solid Amber*/ + dni_lock_cpld_write_attribute(SLAVE_CPLD_PATH,FAN_TRAY_LED_REG, fan_tray_led_reg_value); + } + } return ONLP_STATUS_OK; } diff --git a/packages/platforms/delta/x86-64/x86-64-delta-ag7648/onlp/builds/src/module/src/psui.c b/packages/platforms/delta/x86-64/x86-64-delta-ag7648/onlp/builds/src/module/src/psui.c index 3802b3e0..cdde1a5e 100755 --- a/packages/platforms/delta/x86-64/x86-64-delta-ag7648/onlp/builds/src/module/src/psui.c +++ b/packages/platforms/delta/x86-64/x86-64-delta-ag7648/onlp/builds/src/module/src/psui.c @@ -57,7 +57,7 @@ } while(0) static long psu_data_convert(unsigned int d, int mult) { - long X, Y, N, n; + long X, Y, N, n; Y = d & 0x07FF; N = (d >> 11) & 0x0f; @@ -73,116 +73,116 @@ static long psu_data_convert(unsigned int d, int mult) static long psu_data_convert_16(unsigned int d, int mult) { - long X; - X = (d * mult) / (1 << 9); - return X; + long X; + X = (d * mult) / (1 << 9); + return X; } - -static int + +static int psu_status_info_get(int id, char *node) { int ret; - char r_data; - ret=i2c_devname_read_byte(CPLD_PSU_NAME,PSU_STATUS_REG); - - if(ret<0) - return -1; - - if (PSU1_ID == id) { - if(!strcmp("present",node)) - r_data=!((ret& PSU_STATUS_PRESENT_BIT(id))>> PSU_STATUS_PRESENT_OFFSET(id)); - else if(!strcmp("good",node)) - r_data=((ret& PSU_STATUS_GOOD_BIT(id))>> PSU_STATUS_GOOD_OFFSET(id)); - else - r_data=-1; - + char r_data; + ret=i2c_devname_read_byte(CPLD_PSU_NAME,PSU_STATUS_REG); + + if(ret<0) + return -1; + + if (PSU1_ID == id) { + if(!strcmp("present",node)) + r_data=!((ret& PSU_STATUS_PRESENT_BIT(id))>> PSU_STATUS_PRESENT_OFFSET(id)); + else if(!strcmp("good",node)) + r_data=((ret& PSU_STATUS_GOOD_BIT(id))>> PSU_STATUS_GOOD_OFFSET(id)); + else + r_data=-1; + } else if (PSU2_ID == id) { - + if(!strcmp("present",node)) - r_data=!((ret& PSU_STATUS_PRESENT_BIT(id))>> PSU_STATUS_PRESENT_OFFSET(id)); - else if(!strcmp("good",node)) - r_data=((ret& PSU_STATUS_GOOD_BIT(id))>> PSU_STATUS_GOOD_OFFSET(id)); - else - r_data=-1; - } + r_data=!((ret& PSU_STATUS_PRESENT_BIT(id))>> PSU_STATUS_PRESENT_OFFSET(id)); + else if(!strcmp("good",node)) + r_data=((ret& PSU_STATUS_GOOD_BIT(id))>> PSU_STATUS_GOOD_OFFSET(id)); + else + r_data=-1; + } else{ - r_data=-1; - } - - return r_data; + r_data=-1; + } + + return r_data; } -static int +static int psu_value_info_get(int id, char *type) { int ret; - char *dev_name; - int reg_offset; - + char *dev_name; + int reg_offset; + if(PSU1_ID == id) dev_name="PSU1_PMBUS"; else dev_name="PSU2_PMBUS"; - - if(!strcmp(type,"vin")) - reg_offset=PSU_PNBUS_VIN_REG; - else if(!strcmp(type,"iin")) - reg_offset=PSU_PNBUS_IIN_REG; - else if(!strcmp(type,"pin")) - reg_offset=PSU_PNBUS_PIN_REG; - else if(!strcmp(type,"vout")) - reg_offset=PSU_PNBUS_VOUT_REG; - else if(!strcmp(type,"iout")) - reg_offset=PSU_PNBUS_IOUT_REG; - else - reg_offset=PSU_PNBUS_POUT_REG; - - ret=i2c_devname_read_word(dev_name,reg_offset); - - if(ret<0) - return -1; - - return ret; + + if(!strcmp(type,"vin")) + reg_offset=PSU_PNBUS_VIN_REG; + else if(!strcmp(type,"iin")) + reg_offset=PSU_PNBUS_IIN_REG; + else if(!strcmp(type,"pin")) + reg_offset=PSU_PNBUS_PIN_REG; + else if(!strcmp(type,"vout")) + reg_offset=PSU_PNBUS_VOUT_REG; + else if(!strcmp(type,"iout")) + reg_offset=PSU_PNBUS_IOUT_REG; + else + reg_offset=PSU_PNBUS_POUT_REG; + + ret=i2c_devname_read_word(dev_name,reg_offset); + + if(ret<0) + return -1; + + return ret; } -static int +static int psu_serial_model_info_get(int id,char *type,char*data,int data_len) { int i,r_data,re_cnt; - char *dev_name; - int reg_offset; - + char *dev_name; + int reg_offset; + if(PSU1_ID == id) dev_name="PSU1_EEPROM"; else dev_name="PSU2_EEPROM"; - - if(!strcmp(type,"serial")) - reg_offset=PSU_PNBUS_SERIAL_REG; - else - reg_offset=PSU_PNBUS_MODEL_REG; - for(i=0;istatus &= ~ONLP_PSU_STATUS_PRESENT; return ONLP_STATUS_OK; } info->status |= ONLP_PSU_STATUS_PRESENT; /* Get power good status */ - val=psu_status_info_get(index,"good"); - - if (val<0) { - AIM_LOG_INFO("Unable to read PSU %d good value)\r\n", index); - return ONLP_STATUS_E_INVALID; + val=psu_status_info_get(index,"good"); + + if (val<0) { + AIM_LOG_INFO("Unable to read PSU %d good value)\r\n", index); + return ONLP_STATUS_E_INVALID; } if (val != PSU_STATUS_POWER_GOOD) { info->status |= ONLP_PSU_STATUS_FAILED; } - + /* Get PSU type */ psu_type = get_psu_type(index, info->model, sizeof(info->model)); switch (psu_type) { - case PSU_TYPE_AC_F2B: - case PSU_TYPE_AC_B2F: - info->caps = ONLP_PSU_CAPS_AC; - ret = ONLP_STATUS_OK; - break; - case PSU_TYPE_UNKNOWN: /* User insert a unknown PSU or unplugged.*/ - info->status |= ONLP_PSU_STATUS_UNPLUGGED; - info->status &= ~ONLP_PSU_STATUS_FAILED; - ret = ONLP_STATUS_OK; - break; - default: - ret = ONLP_STATUS_E_UNSUPPORTED; - break; + case PSU_TYPE_AC_F2B: + case PSU_TYPE_AC_B2F: + info->caps = ONLP_PSU_CAPS_AC; + ret = ONLP_STATUS_OK; + break; + case PSU_TYPE_UNKNOWN: /* User insert a unknown PSU or unplugged.*/ + info->status |= ONLP_PSU_STATUS_UNPLUGGED; + info->status &= ~ONLP_PSU_STATUS_FAILED; + ret = ONLP_STATUS_OK; + break; + default: + ret = ONLP_STATUS_E_UNSUPPORTED; + break; } - /* Get PSU vin,vout*/ - - r_data=psu_value_info_get(index,"vin"); - + /* Get PSU vin,vout*/ + + r_data=psu_value_info_get(index,"vin"); + if (r_data<0) { - AIM_LOG_INFO("Unable to read PSU %d Vin value)\r\n", index); - return ONLP_STATUS_E_INVALID; + AIM_LOG_INFO("Unable to read PSU %d Vin value)\r\n", index); + return ONLP_STATUS_E_INVALID; } - - info->mvin=psu_data_convert(r_data,1000); - - r_data=psu_value_info_get(index,"vout"); - + + info->mvin=psu_data_convert(r_data,1000); + + r_data=psu_value_info_get(index,"vout"); + if (r_data<0) { - AIM_LOG_INFO("Unable to read PSU %d Vout value)\r\n", index); - return ONLP_STATUS_E_INVALID; + AIM_LOG_INFO("Unable to read PSU %d Vout value)\r\n", index); + return ONLP_STATUS_E_INVALID; } - - info->mvout=psu_data_convert_16(r_data,1000); - /* Get PSU iin, iout + + info->mvout=psu_data_convert_16(r_data,1000); + /* Get PSU iin, iout */ - r_data=psu_value_info_get(index,"iin"); - + r_data=psu_value_info_get(index,"iin"); + if (r_data<0) { - AIM_LOG_INFO("Unable to read PSU %d Iin value)\r\n", index); - return ONLP_STATUS_E_INVALID; + AIM_LOG_INFO("Unable to read PSU %d Iin value)\r\n", index); + return ONLP_STATUS_E_INVALID; } - - info->miin=psu_data_convert(r_data,1000); - - r_data=psu_value_info_get(index,"iout"); - + + info->miin=psu_data_convert(r_data,1000); + + r_data=psu_value_info_get(index,"iout"); + if (r_data<0) { - AIM_LOG_INFO("Unable to read PSU %d Iout value)\r\n", index); - return ONLP_STATUS_E_INVALID; + AIM_LOG_INFO("Unable to read PSU %d Iout value)\r\n", index); + return ONLP_STATUS_E_INVALID; } - - info->miout=psu_data_convert(r_data,1000); - - /* Get PSU pin, pout + + info->miout=psu_data_convert(r_data,1000); + + /* Get PSU pin, pout */ - r_data=psu_value_info_get(index,"pin"); - + r_data=psu_value_info_get(index,"pin"); + if (r_data<0) { - AIM_LOG_INFO("Unable to read PSU %d Pin value)\r\n", index); - return ONLP_STATUS_E_INVALID; + AIM_LOG_INFO("Unable to read PSU %d Pin value)\r\n", index); + return ONLP_STATUS_E_INVALID; } - - info->mpin=psu_data_convert(r_data,1000); - - r_data=psu_value_info_get(index,"pout"); - + + info->mpin=psu_data_convert(r_data,1000); + + r_data=psu_value_info_get(index,"pout"); + if (r_data<0) { - AIM_LOG_INFO("Unable to read PSU %d Pout value)\r\n", index); - return ONLP_STATUS_E_INVALID; + AIM_LOG_INFO("Unable to read PSU %d Pout value)\r\n", index); + return ONLP_STATUS_E_INVALID; } - - info->mpout=psu_data_convert(r_data,1000); - /* Get PSU serial + + info->mpout=psu_data_convert(r_data,1000); + /* Get PSU serial */ - ret=psu_serial_model_info_get(index,"serial",sn_data,14); - if (ret!=ONLP_STATUS_OK) { - AIM_LOG_INFO("Unable to read PSU %d SN value)\r\n", index); - return ONLP_STATUS_E_INVALID; + ret=psu_serial_model_info_get(index,"serial",sn_data,14); + if (ret!=ONLP_STATUS_OK) { + AIM_LOG_INFO("Unable to read PSU %d SN value)\r\n", index); + return ONLP_STATUS_E_INVALID; } - - strcpy(info->serial,sn_data); - - /* Get PSU model + + strcpy(info->serial,sn_data); + + /* Get PSU model */ - ret=psu_serial_model_info_get(index,"model",model_data,16); - if (ret!=ONLP_STATUS_OK) { - AIM_LOG_INFO("Unable to read PSU %d model value)\r\n", index); - return ONLP_STATUS_E_INVALID; + ret=psu_serial_model_info_get(index,"model",model_data,16); + if (ret!=ONLP_STATUS_OK) { + AIM_LOG_INFO("Unable to read PSU %d model value)\r\n", index); + return ONLP_STATUS_E_INVALID; } - - strcpy(info->model,model_data); + + strcpy(info->model,model_data); return ONLP_STATUS_OK; } @@ -354,4 +354,3 @@ onlp_psui_ioctl(onlp_oid_t pid, va_list vargs) { return ONLP_STATUS_E_UNSUPPORTED; } - diff --git a/packages/platforms/quanta/x86-64/x86-64-quanta-ly4r/.gitignore b/packages/platforms/quanta/x86-64/x86-64-quanta-ly4r/.gitignore index 64d7ff10..651bf060 100755 --- a/packages/platforms/quanta/x86-64/x86-64-quanta-ly4r/.gitignore +++ b/packages/platforms/quanta/x86-64/x86-64-quanta-ly4r/.gitignore @@ -1,2 +1,2 @@ -*x86*64*quanta*ly4r*rangeley.mk +*x86*64*quanta*ly4r*.mk onlpdump.mk diff --git a/setup.env b/setup.env index 7e6f7f33..667ba08f 100755 --- a/setup.env +++ b/setup.env @@ -36,6 +36,10 @@ export BUILDROOTMIRROR=${BUILDROOTMIRROR:-"http://buildroot.opennetlinux.org/dl" # These submodules are required for almost everything. $ONL/tools/submodules.py $ONL sm/infra $ONL/tools/submodules.py $ONL sm/bigcode +$ONL/tools/submodules.py $ONL sm/build-artifacts + +# Prepopulate local REPO with build-artifacts. +cp -R $ONL/sm/build-artifacts/REPO/* $ONL/REPO # Export the current debian suite export ONL_DEBIAN_SUITE=$(lsb_release -c -s) @@ -46,4 +50,4 @@ if [ ! -f $ONL/.git/hooks/post-merge ] && [ -d $ONL/.git ]; then fi # submodule post update scripts. -export ONL_SUBMODULE_UPDATED_SCRIPTS="$ONL/tools/scripts/submodule-updated.sh" \ No newline at end of file +export ONL_SUBMODULE_UPDATED_SCRIPTS="$ONL/tools/scripts/submodule-updated.sh" diff --git a/sm/bigcode b/sm/bigcode index ad064c4d..a77f6c6b 160000 --- a/sm/bigcode +++ b/sm/bigcode @@ -1 +1 @@ -Subproject commit ad064c4d73903528633954d12fb2f66b9901b331 +Subproject commit a77f6c6b1ca1c895f954fdbf37991af49c7496d8 diff --git a/sm/build-artifacts b/sm/build-artifacts new file mode 160000 index 00000000..54005ad5 --- /dev/null +++ b/sm/build-artifacts @@ -0,0 +1 @@ +Subproject commit 54005ad5e9e03fe9235cf17378d53a30544dd155 diff --git a/sm/infra b/sm/infra index b23f2577..fd74bf9c 160000 --- a/sm/infra +++ b/sm/infra @@ -1 +1 @@ -Subproject commit b23f2577cb4ab505eb8bdfdd5d599e49da38c142 +Subproject commit fd74bf9c3fa31901ef3570a1b02e5a9621232fbe diff --git a/tools/autobuild/build.sh b/tools/autobuild/build.sh index 80b88dc0..a3b6aff0 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:vc78r:" opt; do +while getopts ":b:s:d:u:p:vc789r:" opt; do case $opt in 7) ONLB_OPTIONS=--7 @@ -23,6 +23,12 @@ while getopts ":b:s:d:u:p:vc78r:" opt; do echo "Selecting Debian 8 build..." fi ;; + 9) + ONLB_OPTIONS=--9 + if [ -z "$DOCKER_IMAGE" ]; then + echo "Selecting Debian 9 build..." + fi + ;; c) cd $ONL && git submodule update --init --recursive packages/platforms-closed ;; @@ -41,9 +47,9 @@ while getopts ":b:s:d:u:p:vc78r:" opt; do done if [ -z "$ONLB_OPTIONS" ]; then - # Build both suites - $AUTOBUILD_SCRIPT --7 $@ + # Build both 8 and 9 $AUTOBUILD_SCRIPT --8 $@ + $AUTOBUILD_SCRIPT --9 $@ exit $? fi