Jessie support.

This commit is contained in:
Jeffrey Townsend
2015-12-15 12:10:54 -08:00
parent c682e90064
commit 9239a4ea34
15 changed files with 390 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
############################################################
#
# Common packages for all amd64 systems.
#
############################################################
- dmidecode
- parted
- smartmontools
- grub2

View File

@@ -0,0 +1,70 @@
############################################################
#
# 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
- lm-sensors
- fancontrol
- pciutils
- usbutils
- mtd-utils
- kexec-tools
- i2c-tools
- module-init-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
- onl-loader-initscripts

View File

@@ -0,0 +1 @@
0.0 0 0.0

View File

@@ -0,0 +1,6 @@
jffs2
ubifs
vfat
ext4
ext3
ext2

View File

@@ -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

View File

@@ -0,0 +1,26 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: initdev
# Required-Start:
# Required-Stop:
# Default-Start: S
# Default-Stop:
# Short-Description: Set up block and net devices
### END INIT INFO
. /lib/lsb/init-functions
log_action_begin_msg "Setting up block and net devices"
ln -snf /proc/mounts /etc/mtab
( cd /sys/class/block; for d in *; do /sbin/initblockdev $d add; done )
if [ -d /sys/class/ubi ]; then
( cd /sys/class/ubi; for d in *; do /sbin/initblockdev $d add; done )
fi
( cd /sys/class/net; for d in *; do /sbin/initnetdev $d add; done )
initmounts
log_action_end_msg 0

View File

@@ -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"

View File

@@ -0,0 +1,3 @@
logfacility = LOG_USER
allowsftp
umask = 022

View File

@@ -0,0 +1 @@
SUBSYSTEM=="block", RUN+="/sbin/initblockdev $kernel $env{ACTION}"

View File

@@ -0,0 +1 @@
SUBSYSTEM=="net", RUN+="/sbin/initnetdev $kernel $env{ACTION}"

View File

@@ -0,0 +1,62 @@
#!/bin/bash
set -e
exec 9<$0
flock -x 9
case $2 in
add)
eval $(echo $1 | sed "s#^\(mmcblk[0-9]*\|ubi[0-9]*_[0-9]*\|mtdblock[0-9]*\|[a-z]*\)\(p[0-9]*\|[0-9]*\).*#dev='\1' part='\2'#")
if [ -e /etc/onl/recover ]; then
recover=$(cat /etc/onl/recover)
fi
devid=
if [ -e /sys/class/ubi/${dev}/device ]; then
eval $(realpath /sys/class/ubi/${dev}/device | sed "s#/sys/devices/\(.*\)#devid='\1'#")
fi
if [ -e /sys/class/block/${dev}/device ]; then
eval $(realpath /sys/class/block/${dev}/device | sed "s#/sys/devices/\(.*\)#devid='\1'#")
fi
while read i n; do
expr match "$i" "#" >/dev/null && continue || :
[ -n "${devid}" ] && expr match "${devid}" "$i" >/dev/null && mount=/mnt/$n && break || :
expr match "@${dev}" "$i" >/dev/null && mount=/mnt/$n && break || :
done </etc/onl/block
[ -n "${mount}" ]
if [ "$(dd if=/dev/${dev}${part} bs=1 count=6 2>/dev/null)" = "070701" ]; then
mount=${mount}-recover
else
mkdir -p ${mount}
[ $(stat -c %D ${mount}) = $(stat -c %D /mnt) ]
if [ "$(dd if=/dev/${dev}${part} bs=1 skip=82 count=5 2>/dev/null)" = "FAT32" ] \
|| [ "$(dd if=/dev/${dev}${part} bs=1 skip=54 count=5 2>/dev/null)" = "FAT16" ]; then
if [ ! -e /etc/onl/kdump ]; then
if [ "$recover" = "fsck" ]; then
# Try to repair FAT filesystem automatically to prevent further
# damage (but skip it in kdump to save time and memory)
if dosfsck -a /dev/${dev}${part} >/dev/null 2>&1; then
:
else
dosfsck -n /dev/${dev}${part} >/dev/null 2>&1
fi
else
dosfsck -n /dev/${dev}${part} >/dev/null 2>&1
fi
fi
mount -o flush,dirsync,noatime,umask=0007 /dev/${dev}${part} ${mount} 2>/dev/null
else
mount -o noatime /dev/${dev}${part} ${mount} 2>/dev/null
fi
fi
echo -e "devid='${devid}'\ndev='${dev}'\npart='${part}'" >${mount}.conf
;;
remove)
mtab=$(mktemp /tmp/tmp.XXXXXX)
cp /proc/mounts ${mtab}
while read dev mount x; do
if [ /dev/$1 = "${dev}" ]; then
rm -f ${mount}.conf
umount -l ${mount} 2>/dev/null || :
fi
done <${mtab}
rm -f ${mtab}
;;
esac

View File

@@ -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

View File

@@ -0,0 +1,71 @@
#!/usr/bin/python
############################################################
# <bsn.cl fy=2013 v=onl>
#
# 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.
#
# </bsn.cl>
############################################################
#
# 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)

View File

@@ -0,0 +1,10 @@
############################################################
#
# Common packages for all PowerPC systems.
#
############################################################
- u-boot-tools

View File

@@ -0,0 +1,93 @@
############################################################
#
# Standard ONL Debian 8 Root Filesystem Configuration.
#
# Requires:
# ARCH, PLATFORM_LIST
#
#
############################################################
Packages: &Packages
- !include $ONL/builds/any/rootfs/$ONL_DEBIAN_SUITE/common/common-packages.yml
- !include $ONL/builds/any/rootfs/$ONL_DEBIAN_SUITE/common/${ARCH}-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: ${ONL}/REPO/${ONL_DEBIAN_SUITE}/packages/all
omitdebsrc: true
Local-Arch:
source: ${ONL}/REPO/${ONL_DEBIAN_SUITE}/packages/${ARCH}
omitdebsrc: true
Configure:
overlays:
- ${ONL}/builds/any/rootfs/${ONL_DEBIAN_SUITE}/common/overlay
update-rc.d:
- 'initdev defaults'
- 'onl-platform-baseconf defaults'
- 'faultd defaults'
- 'snmpd remove'
- '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
users:
root:
password: onl
manifest:
version: $ONL/make/version-onl.json
platforms: $PLATFORM_LIST