diff options
author | Dave Cobbley <david.j.cobbley@linux.intel.com> | 2018-08-14 20:05:37 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-08-23 04:26:31 +0300 |
commit | eb8dc40360f0cfef56fb6947cc817a547d6d9bc6 (patch) | |
tree | de291a73dc37168da6370e2cf16c347d1eba9df8 /meta-openembedded/meta-networking/recipes-daemons/vblade/files | |
parent | 9c3cf826d853102535ead04cebc2d6023eff3032 (diff) | |
download | openbmc-eb8dc40360f0cfef56fb6947cc817a547d6d9bc6.tar.xz |
[Subtree] Removing import-layers directory
As part of the move to subtrees, need to bring all the import layers
content to the top level.
Change-Id: I4a163d10898cbc6e11c27f776f60e1a470049d8f
Signed-off-by: Dave Cobbley <david.j.cobbley@linux.intel.com>
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'meta-openembedded/meta-networking/recipes-daemons/vblade/files')
6 files changed, 242 insertions, 0 deletions
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vblade/files/cross.patch b/meta-openembedded/meta-networking/recipes-daemons/vblade/files/cross.patch new file mode 100644 index 000000000..d2eb15614 --- /dev/null +++ b/meta-openembedded/meta-networking/recipes-daemons/vblade/files/cross.patch @@ -0,0 +1,16 @@ +Remove CC and CFLAGS values, we set these ourselves + +Upstream-Status: Inappropriate [config] + +diff -urN vblade-19.old//makefile vblade-19//makefile +--- vblade-19.old//makefile 2008-10-08 22:07:40.000000000 +0100 ++++ vblade-19//makefile 2008-11-18 19:07:51.700365029 +0000 +@@ -9,8 +9,6 @@ + mandir = ${sharedir}/man + + O=aoe.o bpf.o ${PLATFORM}.o ata.o +-CFLAGS += -Wall -g -O2 +-CC = gcc + + vblade: $O + ${CC} -o vblade $O diff --git a/meta-openembedded/meta-networking/recipes-daemons/vblade/files/makefile-add-ldflags.patch b/meta-openembedded/meta-networking/recipes-daemons/vblade/files/makefile-add-ldflags.patch new file mode 100644 index 000000000..a74452db6 --- /dev/null +++ b/meta-openembedded/meta-networking/recipes-daemons/vblade/files/makefile-add-ldflags.patch @@ -0,0 +1,19 @@ +Add LDFLAGS variable to Makefile, make sure the extra linker flags can be passed. + +Upstream-Status: Pending + +Signed-off-by: Yi Zhao <yi.zhao@windriver.com> + +diff --git a/makefile b/makefile +index 98008da..c328ba7 100644 +--- a/makefile ++++ b/makefile +@@ -11,7 +11,7 @@ mandir = ${sharedir}/man + O=aoe.o bpf.o ${PLATFORM}.o ata.o + + vblade: $O +- ${CC} -o vblade $O ++ ${CC} ${LDFLAGS} -o vblade $O + + aoe.o : aoe.c config.h dat.h fns.h makefile + ${CC} ${CFLAGS} -c $< diff --git a/meta-openembedded/meta-networking/recipes-daemons/vblade/files/vblade.conf b/meta-openembedded/meta-networking/recipes-daemons/vblade/files/vblade.conf new file mode 100644 index 000000000..e8b93ec37 --- /dev/null +++ b/meta-openembedded/meta-networking/recipes-daemons/vblade/files/vblade.conf @@ -0,0 +1,2 @@ +# network_device shelf slot file/disk/partition mac[,mac[,mac]] +#eth0 0 0 /dev/sdb 00:11:22:33:44:55 diff --git a/meta-openembedded/meta-networking/recipes-daemons/vblade/files/vblade.init b/meta-openembedded/meta-networking/recipes-daemons/vblade/files/vblade.init new file mode 100644 index 000000000..0298c8001 --- /dev/null +++ b/meta-openembedded/meta-networking/recipes-daemons/vblade/files/vblade.init @@ -0,0 +1,193 @@ +#!/bin/sh +# +# Init script for vblade (ATA over Ethernet daemon) +# +# chkconfig: - 30 70 +# description: vblade AoE daemon +# +# processname: vblade +# config: /etc/vblade.conf +# +# Shamelessly hacked together from other init scripts (sshd, mostly) +# integrate vblade.init from Fedora's vblade-14-6.fc12.src.rpm +# + +RETVAL=0 +prog=vblade + +spawn_vblade() { + ALLOWMACS="" + [ -n "$5" ] && ALLOWMACS="-m $5" + ID="$1-e$2.$3" + if [ ! -d "/var/run/$prog" ]; then + mkdir /var/run/$prog + fi + PID_FILE=/var/run/$prog/${ID}.pid + $prog $ALLOWMACS $2 $3 $1 $4 >> /var/log/$prog.log 2>&1 & + pid=$! + RETVAL=$? + echo $pid > $PID_FILE + echo -n $"$4 (e$2.$3@$1) [pid $pid]" + [ "$RETVAL" = 0 ] && echo "success" || echo "failure" + echo +} + +start() { + local ret + + echo $"Starting up $prog: " + + #/var/lock/subsys/$prog exists? + status $prog 2>&1 > /dev/null + ret=$? + + if [ "$ret" = "2" ]; then + echo "$prog dead but subsys locked" + echo + return 2 + else + if [ "$ret" = "0" ]; then + #is running + echo "already running" + return 0 + fi + fi + + if [ 0 -ne `grep -vc '^#\|^$' /etc/$prog.conf` ] + then + grep -v '^#' /etc/$prog.conf | sed -e 's/ / /g' -e 's/ / /g' | while read line + do + spawn_vblade $line + done + touch /var/lock/subsys/$prog + else + echo -n "empty $prog.conf?" + echo " passed" + echo + fi +} + +stop() { + echo -n $"Shutting down $prog: " + for pidfile in `ls /var/run/$prog/*.pid 2>/dev/null` + do + kill -TERM `cat $pidfile` + rm -f $pidfile + done + echo "success" + echo + rm -f /var/lock/subsys/$prog +} + +__pids_var_run() { + local base=${1##*/} + local pid_file=${2:-/var/run/$base.pid} + + pid= + if [ -f "$pid_file" ] ; then + local line p + + while : ; do + read line + [ -z "$line" ] && break + for p in $line ; do + [ -z "${p//[0-9]/}" -a -d "/proc/$p" ] && pid="$pid $p" + done + done < "$pid_file" + + if [ -n "$pid" ]; then + return 0 + fi + return 1 # "Program is dead and /var/run pid file exists" + fi + return 3 # "Program is not running" +} + +__pids_pidof() { + pidof "$1" || pidof "${1##*/}" +} + +status() { + local base pid lock_file= pid_file= + + # Test syntax. + if [ "$#" = 0 ] ; then + echo $"Usage: status [-p pidfile] {program}" + return 1 + fi + if [ "$1" = "-p" ]; then + pid_file=$2 + shift 2 + fi + if [ "$1" = "-l" ]; then + lock_file=$2 + shift 2 + fi + base=${1##*/} + + # First try "pidof" + __pids_var_run "$1" "$pid_file" + RC=$? + if [ -z "$pid_file" -a -z "$pid" ]; then + pid="$(__pids_pidof "$1")" + fi + if [ -n "$pid" ]; then + echo $"${base} (pid $pid) is running..." + return 0 + fi + + case "$RC" in + 0) + echo $"${base} (pid $pid) is running..." + return 0 + ;; + 1) + echo $"${base} dead but pid file exists" + return 1 + ;; + esac + if [ -z "${lock_file}" ]; then + lock_file=${base} + fi + # See if /var/lock/subsys/${lock_file} exists + if [ -f /var/lock/subsys/${lock_file} ]; then + echo $"${base} dead but subsys locked" + return 2 + fi + echo $"${base} is stopped" + return 3 +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + stop + start + ;; + reload) + # yes, this sucks, but the vblade processes die on SIGHUP + stop + start + ;; + condrestart) + if [ -f /var/lock/subsys/$prog ]; then + stop + # avoid race + sleep 3 + start + fi + ;; + status) + status $prog + RETVAL=$? + ;; + *) + echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}" + RETVAL=1 +esac +exit $RETVAL diff --git a/meta-openembedded/meta-networking/recipes-daemons/vblade/files/vblade.service b/meta-openembedded/meta-networking/recipes-daemons/vblade/files/vblade.service new file mode 100644 index 000000000..83a4d5dcb --- /dev/null +++ b/meta-openembedded/meta-networking/recipes-daemons/vblade/files/vblade.service @@ -0,0 +1,11 @@ +[Unit] +Description=Virtual EtherDrive blade AoE target +After=syslog.target network.target + +[Service] +Type=forking +ExecStart=@BINDIR@/vblade.init start +ExecStop=@BINDIR@/vblade.init stop + +[Install] +WantedBy=multi-user.target diff --git a/meta-openembedded/meta-networking/recipes-daemons/vblade/files/volatiles.99_vblade b/meta-openembedded/meta-networking/recipes-daemons/vblade/files/volatiles.99_vblade new file mode 100644 index 000000000..64a5881c0 --- /dev/null +++ b/meta-openembedded/meta-networking/recipes-daemons/vblade/files/volatiles.99_vblade @@ -0,0 +1 @@ +d root root 0755 /var/run/vblade none |