summaryrefslogtreecommitdiff
path: root/app-admin/cancd
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /app-admin/cancd
reinit the tree, so we can have metadata
Diffstat (limited to 'app-admin/cancd')
-rw-r--r--app-admin/cancd/Manifest11
-rw-r--r--app-admin/cancd/cancd-0.1.0-r3.ebuild37
-rw-r--r--app-admin/cancd/files/cancd-0.1.0-build.patch14
-rw-r--r--app-admin/cancd/files/cancd-0.1.0-c-cleanup.patch65
-rw-r--r--app-admin/cancd/files/cancd-conf.d19
-rw-r--r--app-admin/cancd/files/cancd-init.d22
-rw-r--r--app-admin/cancd/files/netconsole-conf.d27
-rw-r--r--app-admin/cancd/files/netconsole-init.d67
-rw-r--r--app-admin/cancd/metadata.xml8
9 files changed, 270 insertions, 0 deletions
diff --git a/app-admin/cancd/Manifest b/app-admin/cancd/Manifest
new file mode 100644
index 000000000000..5f39fed35cd2
--- /dev/null
+++ b/app-admin/cancd/Manifest
@@ -0,0 +1,11 @@
+AUX cancd-0.1.0-build.patch 262 SHA256 10be31f427940224cecd5b90de94dfd9b0a76368c57a8354b44f4c3905c8d192 SHA512 cbc3d0bfcdb2abae08268a408d2d7f7bc5898bd07c744878a6d8996dea5ea4f9f308078f9fe05566ee8cd06b3a5e083163f50d69f6795b31952934a88d69c481 WHIRLPOOL a8cdce4f61d03d7a683065bd43422d25723685b75008abfd2c745b5d5bb56257007af26992276c829fa47336a959f75e0f628d3f0e91f8e556dc3c3ade135a6a
+AUX cancd-0.1.0-c-cleanup.patch 1648 SHA256 55628aa8e2fabd3aa26bc0023d46562a238047b2f7ad5c8485b88794655f93d7 SHA512 16350363f8f8f7e3843000e3128216d302ea7112608d61ae8d74ca79688588f3b028e1eedf187df06c78f8aaa2c987cdfdf33761adb9e597d4ca617f34b1072e WHIRLPOOL fb55e5d1ab1a9971a8423d6dadadcaacfc24dc6a2f300e7c1b28173d5beccf04309f511299af5f64ea06f9f497ee35548cfd6744459afd7ef54ccfe1e5c1b7ca
+AUX cancd-conf.d 496 SHA256 45c9bc3267b5526435267786885ab77cd50ffc610866ec4bbceaf5c2795691f7 SHA512 95d7fdeec35b2b544b9c30ca3c45197195ae8180624971af1c876ad19bedc0e9045edbb8d5bb393ff8d4f2f96dd7258cdeeb30ba58f31326ebff14f21a9efae9 WHIRLPOOL 3d6a991b2519d2a4280edb4b48050c32e32a6df09854562295c8a9980af20fa7a142c6c31e2a2121197ecc0d489844233397cf0c48ba2edf88aa2970c8787ce4
+AUX cancd-init.d 514 SHA256 268e508d1e9267abfdc58fdead0b0ae7cb09d18962bb2615867d6478f5fc5e5f SHA512 27f46006a90814c41849bf03d45b100361ce49ac83d498e2244db13827620a254140aefee14059a722b08446c62124d25fb029080cc246aea34287a838b31c64 WHIRLPOOL bdce93c36111269ef2937fead25aa54edb92669a9f6dae374c4099874ba1e6d2018d77fbfad63e25183fbfa324fa16348732bfa6d96ce625305db2d220173dfc
+AUX netconsole-conf.d 751 SHA256 8b3fd9af2d20cb17de51a1c6a116bb74bc44a0faceb9b24b41d03ef8b203848a SHA512 7095ec6b8595865fc084b39f027efa0818c1348b8bfc8bfbea8d7d05c767f57a8357ae2eb07f13f073143911451e0fa005e1623ec9865076e4350f442cb8648b WHIRLPOOL c83bc58afc721a12a425d99e2c71216581ce80ce49deddbd52b39ad150854b6a581edd7b174e5cb88b89c639b23ee9ae8b18eef3d81ea3101c4fb9e91c2cebd9
+AUX netconsole-init.d 1503 SHA256 67f9d006099ef571f7b61a0bd8d041483a95965e247d2f0383438e79c59562e7 SHA512 33005e692fce59d567e399fca58b81b740cb381ce897f689af7e33785ccd1991506be1af2c09de8f96b6eb3996c5be16c212daee03d304b1fff7095b2ae1491d WHIRLPOOL bb5765788b9399a2ecfc0adb0a22a06d847f1e2892ec8511e629ad6658d1a279acc3c3359e60334c1252ec28351516999fb5be1866798063868c05884e55652f
+DIST cancd-0.1.0.tar.gz 7634 SHA256 aea21e3eadee64d2b76591d272dcd03c566215b2320d7fef5cfe0937c3ef0315 SHA512 9b01ed3ea1e27276799d657572645a7b40da9cf80910a73e2de9d733e8f3cfa374e29764b1e5853d7fb5a6835edda3103a1a6d31fd699010f98318631e62c5fb WHIRLPOOL 84e1b6461bc5ae40b01c71112fed9999e590a7cbed54da6850131bd475eafb6ab7830a418a6fc46bf217645ed73aec080af6d4117a9ea97f1b48dad92cc93caf
+EBUILD cancd-0.1.0-r3.ebuild 1197 SHA256 5677dbce1d6e471db4f6b150e4f67155f8107d8a64ae61d48bdb18583f57ed6d SHA512 4258be990c471d8d5a3df2c735b19c3333bd17be8d878bde92839216df8350220b463f97e5b92753ef9af866e40ed0b6d53df3f0e8c30e52bb71721ec72add1c WHIRLPOOL 799d658cfd6ef8392c5d05b76b503f672b36963112608bba9159558bc8ce9c717250502340fb7abd05d85144d6707a9b4a3330d4b0c8c984743ccf5b9843f432
+MISC ChangeLog 2519 SHA256 0b8906428250ea05427d8218592b464abdb091eed69834dc7b8d3837dabaa3a8 SHA512 8c076932082c239d7cd534f59f4bdc2f4cd9a7cae18363de884ee329c0983ce59e023de1be147da251d65e5fd78a875ca52435d8be36771aebc155d53ff072cb WHIRLPOOL 9c029c72a286d62a244b94214152fce462d55908eacd8b41342c34dda5bf78f0aaa14bd38ad322e9ef1432e22d9fe34ee0ed1dc13bafa64ecfebc7b951487cc2
+MISC ChangeLog-2015 2061 SHA256 1b848e877c78beb772ecb284002d0f3c2b36948363e81f5fba443ab849f75339 SHA512 3da179ae869f61ada233d301ee3f28dc48224abc4d4150127032f6da6151b023404fd95d2bfc6eb8173087a56ed58845513e2abc80c6ab6af2bc4d481996062f WHIRLPOOL 708712fd64d55b771efcc3ab8311f7d8ee0d83b78febe1f8af86677c06c6586caab6732864262d0756fc27dcbbd3663971da127e4a49b8743834469d3e6f5567
+MISC metadata.xml 268 SHA256 972faf76e6638f2159ef3c7dafdcfef26d582070e6f0064d9136d1c6b2bee905 SHA512 ffda1db3fd6ac952f41a970e2e496c6a9fd0b12ed11cdf363fd269c3b00f627c6e70421fd545aad61d69594af2e5f43d8ebc197232a39b596d012818fe758850 WHIRLPOOL 759c32dcdde671d2fda0269ee9326f6d0f0e44966f767ac7becc40e6efb5429237b683cb23867d76a8d13dde79fe257e090ef890761b20f9792172a90369296d
diff --git a/app-admin/cancd/cancd-0.1.0-r3.ebuild b/app-admin/cancd/cancd-0.1.0-r3.ebuild
new file mode 100644
index 000000000000..6ad37a6163ff
--- /dev/null
+++ b/app-admin/cancd/cancd-0.1.0-r3.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils
+
+DESCRIPTION="the CA NetConsole Daemon receives output from the Linux netconsole driver"
+HOMEPAGE="http://oss.oracle.com/projects/cancd/"
+SRC_URI="http://oss.oracle.com/projects/cancd/dist/files/source/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-build.patch #246734
+ epatch "${FILESDIR}"/${P}-c-cleanup.patch
+ # slight makefile cleanup
+ sed -i \
+ -e '/^CFLAGS/s,-g,,' \
+ -e '/^CFLAGS/s,-O2,-Wall -W -Wextra -Wundef -Wendif-labels -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wsign-compare -Waggregate-return -Wstrict-prototypes -Wredundant-decls -Wunreachable-code -Wlong-long,' \
+ -e '/rm cancd cancd.o/s,rm,rm -f,' \
+ Makefile || die
+}
+
+src_install() {
+ dosbin cancd
+ newinitd "${FILESDIR}"/cancd-init.d cancd
+ newconfd "${FILESDIR}"/cancd-conf.d cancd
+ newinitd "${FILESDIR}"/netconsole-init.d netconsole
+ newconfd "${FILESDIR}"/netconsole-conf.d netconsole
+ keepdir /var/crash
+ fowners adm:nobody /var/crash
+ fperms 700 /var/crash
+}
diff --git a/app-admin/cancd/files/cancd-0.1.0-build.patch b/app-admin/cancd/files/cancd-0.1.0-build.patch
new file mode 100644
index 000000000000..b1c99b1cd565
--- /dev/null
+++ b/app-admin/cancd/files/cancd-0.1.0-build.patch
@@ -0,0 +1,14 @@
+fix building with newer glibc
+
+http://bugs.gentoo.org/246734
+
+--- cancd.c
++++ cancd.c
+@@ -36,6 +36,7 @@
+ #include <libgen.h>
+ #include <getopt.h>
+ #include <stdarg.h>
++#include <limits.h>
+ #include <sys/socket.h>
+ #include <arpa/inet.h>
+ #include <netinet/in.h>
diff --git a/app-admin/cancd/files/cancd-0.1.0-c-cleanup.patch b/app-admin/cancd/files/cancd-0.1.0-c-cleanup.patch
new file mode 100644
index 000000000000..47defb3e43b2
--- /dev/null
+++ b/app-admin/cancd/files/cancd-0.1.0-c-cleanup.patch
@@ -0,0 +1,65 @@
+diff -Nuar --exclude '*~' --exclude '*.orig' --exclude Makefile cancd-0.1.0/cancd.c cancd-0.1.0.new/cancd.c
+--- cancd-0.1.0/cancd.c 2005-08-18 11:47:48.000000000 -0700
++++ cancd-0.1.0.new/cancd.c 2006-03-17 17:09:46.402025517 -0800
+@@ -199,7 +199,7 @@
+ char *path;
+ };
+
+-static int make_tree(const char *path, int mode)
++static int make_tree(const char *path, mode_t mode)
+ {
+ struct stat stat_buf;
+ char *ptr, *tmp;
+@@ -319,7 +319,7 @@
+ static int open_socket()
+ {
+ int rc;
+- struct sockaddr_in servaddr = {0, };
++ struct sockaddr_in servaddr;
+
+ sock_fd = socket(PF_INET, SOCK_DGRAM, 0);
+ if (sock_fd < 0)
+@@ -438,7 +438,7 @@
+ int rc;
+ static int block = 1;
+
+- rc = recvfrom(sock_fd, buf, bufsize, 0,
++ rc = recvfrom(fd, buf, bufsize, 0,
+ (struct sockaddr *)from, fromlen);
+ if (rc < 0)
+ {
+@@ -569,7 +569,7 @@
+
+ static int valid_format()
+ {
+- struct in_addr addr = {0, };
++ struct in_addr addr;
+ char *name;
+ int rc;
+
+@@ -599,9 +599,11 @@
+ exit(rc);
+ }
+
++/*
+ extern char *optarg;
+ extern int optopt;
+ extern int opterr;
++*/
+ static int parse_options(int argc, char *argv[])
+ {
+ int c;
+@@ -641,11 +643,11 @@
+ optarg);
+ print_usage(-EINVAL);
+ }
+- log_prefix = optarg;
++ log_prefix = strdup(optarg);
+ break;
+
+ case 'o':
+- log_format = optarg;
++ log_format = strdup(optarg);
+ if (!log_format || !*log_format || !valid_format())
+ {
+ fprintf(stderr,
diff --git a/app-admin/cancd/files/cancd-conf.d b/app-admin/cancd/files/cancd-conf.d
new file mode 100644
index 000000000000..7b4dd27383c0
--- /dev/null
+++ b/app-admin/cancd/files/cancd-conf.d
@@ -0,0 +1,19 @@
+#!/sbin/openrc-run
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# user to run as, root strongly discouraged
+# user should have /bin/false for a shell
+# but file access into /var
+CHUID='adm:nobody'
+
+# port to listen on
+CANCD_PORT=6667
+
+# directory to output to
+CRASH_DIR=/var/crash
+
+# one file per minute, one dir per host/date
+#CRASH_FORMAT="%Q/%Y-%m-%d/%H:%M.log"
+# one file per day, one dir per host
+CRASH_FORMAT="%Q/%Y-%m-%d.log"
diff --git a/app-admin/cancd/files/cancd-init.d b/app-admin/cancd/files/cancd-init.d
new file mode 100644
index 000000000000..eb0d34e1a2ee
--- /dev/null
+++ b/app-admin/cancd/files/cancd-init.d
@@ -0,0 +1,22 @@
+#!/sbin/openrc-run
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ need net
+}
+
+start() {
+ mkdir -p ${CRASH_DIR}
+ chown ${CHUID} ${CRASH_DIR}
+ chmod 700 ${CRASH_DIR}
+ ebegin "Starting cancd"
+ start-stop-daemon --start --quiet --user ${CHUID} --exec /usr/sbin/cancd -- -p ${CANCD_PORT} -l "${CRASH_DIR}" -o "${CRASH_FORMAT}"
+ eend ${?}
+}
+
+stop() {
+ ebegin "Stopping cancd"
+ start-stop-daemon --stop --quiet --exec /usr/sbin/cancd
+ eend ${?}
+}
diff --git a/app-admin/cancd/files/netconsole-conf.d b/app-admin/cancd/files/netconsole-conf.d
new file mode 100644
index 000000000000..aad2fc797172
--- /dev/null
+++ b/app-admin/cancd/files/netconsole-conf.d
@@ -0,0 +1,27 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# required!
+TGT_IP=''
+
+DEVICE=eth0
+
+SRC_IP=''
+# will default to first address on $DEVICE
+# must be specified if the device does not have an IP at init time
+SRC_PORT=6665 # default
+
+# note that cancd daemon uses 6667 as default
+# but netconsole.txt says 6666 is the default
+TGT_PORT=6667
+
+# if you want to broadcast, specify 'broadcast' here.
+# it's a security hole on an untrusted network.
+TGT_MAC=''
+
+LOGLEVEL='1'
+# LOGLEVEL are the kernel console logging levels
+# [0..7] = EMERG,ALERT,CRIT,ERR,WARNING,NOTICE,INFO,DEBUG
+# 1 means only kernel panics are reported (default)
+# this affects all console logging
+# see syslog(2) for more info
diff --git a/app-admin/cancd/files/netconsole-init.d b/app-admin/cancd/files/netconsole-init.d
new file mode 100644
index 000000000000..dfb28eb9eac0
--- /dev/null
+++ b/app-admin/cancd/files/netconsole-init.d
@@ -0,0 +1,67 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ need net
+}
+
+start() {
+ checkconfig || return 1
+ if [ -z "${TGT_MAC}" ]; then
+ LC_ALL=C /bin/ping -nq -c 3 "${TGT_IP}" -I "${DEVICE}" 1>/dev/null 2>/dev/null
+ ret=$?
+ # ping worked, try arp
+ if [ $ret -eq 0 ]; then
+ TGT_MAC="$(LC_ALL=C arp -an -i ${DEVICE} ${TGT_IP} |egrep -v 'incomplete|no match' | awk '{print $4}')"
+ fi
+ elif [ "${TGT_MAC}" = "broadcast" ]; then
+ TGT_MAC=''
+ fi
+ ebegin "Starting netconsole ${SRC_IP}:${SRC_PORT}(${DEVICE}) -> ${TGT_IP}:${TGT_PORT} ${TGT_MAC}"
+ # else we use the MAC that we are given
+ modprobe netconsole netconsole=${SRC_PORT}@${SRC_IP}/${DEVICE},${TGT_PORT}@${TGT_IP}/${TGT_MAC}
+ ret=$?
+ [ $ret -eq 0 ] && dmesg -n ${LOGLEVEL}
+ eend $ret
+}
+
+stop() {
+ ebegin "Stopping netconsole"
+ modprobe -r netconsole
+ eend $?
+}
+
+checkconfig() {
+ # kernel uses 15 internally
+ if [ "$LOGLEVEL" -lt 0 -o "${LOGLEVEL}" -gt 15 ]; then
+ eerror "Invalid kernel console loglevel."
+ return 1
+ fi
+
+ if [ "$SRC_PORT" -le 0 ]; then
+ eerror "Invalid source port."
+ return 1
+ fi
+
+ LC_ALL=C ifconfig "${DEVICE}" 1>/dev/null 2>/dev/null
+ ret=$?
+
+ if [ -z "${DEVICE}" -o "${ret}" -gt 0 ]; then
+ eerror "Source device invalid."
+ return 1
+ fi
+
+ if [ "$TGT_PORT" -le 0 ]; then
+ eerror "Invalid target port."
+ return 1
+ fi
+
+ if [ -z "$TGT_IP" ]; then
+ eerror "Unspecified target address."
+ return 1
+ fi
+
+ return 0
+}
+# vim: ts=4 sw=4 sts=4:
diff --git a/app-admin/cancd/metadata.xml b/app-admin/cancd/metadata.xml
new file mode 100644
index 000000000000..a4e0d354f696
--- /dev/null
+++ b/app-admin/cancd/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>robbat2@gentoo.org</email>
+ <name>Robin H. Johnson</name>
+ </maintainer>
+</pkgmetadata>