diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2005-11-15 19:27:35 +0000 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2005-11-15 19:27:35 +0000 |
commit | 656f71a7921d0c501cc55504b8fcd6249ce17e73 (patch) | |
tree | ecd29d4af8bc8fea83f6ec5109eba15b15ce6f81 /app-admin | |
parent | Stable on x86 wrt bug #112442. (diff) | |
download | gentoo-2-656f71a7921d0c501cc55504b8fcd6249ce17e73.tar.gz gentoo-2-656f71a7921d0c501cc55504b8fcd6249ce17e73.tar.bz2 gentoo-2-656f71a7921d0c501cc55504b8fcd6249ce17e73.zip |
Add netconsole source init.d scripts.
(Portage version: 2.0.53_rc7)
Diffstat (limited to 'app-admin')
-rw-r--r-- | app-admin/cancd/ChangeLog | 9 | ||||
-rw-r--r-- | app-admin/cancd/Manifest | 6 | ||||
-rw-r--r-- | app-admin/cancd/cancd-0.1.0-r1.ebuild | 40 | ||||
-rw-r--r-- | app-admin/cancd/files/digest-cancd-0.1.0-r1 | 1 | ||||
-rw-r--r-- | app-admin/cancd/files/netconsole-conf.d | 26 | ||||
-rw-r--r-- | app-admin/cancd/files/netconsole-init.d | 77 |
6 files changed, 157 insertions, 2 deletions
diff --git a/app-admin/cancd/ChangeLog b/app-admin/cancd/ChangeLog index ebca0163ce7e..453c67eb8c57 100644 --- a/app-admin/cancd/ChangeLog +++ b/app-admin/cancd/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for app-admin/cancd # Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-admin/cancd/ChangeLog,v 1.1 2005/11/14 21:15:54 robbat2 Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-admin/cancd/ChangeLog,v 1.2 2005/11/15 19:27:35 robbat2 Exp $ + +*cancd-0.1.0-r1 (15 Nov 2005) + + 15 Nov 2005; Robin H. Johnson <robbat2@gentoo.org> + +files/netconsole-conf.d, +files/netconsole-init.d, + +cancd-0.1.0-r1.ebuild: + Add netconsole source init.d scripts. *cancd-0.1.0 (14 Nov 2005) diff --git a/app-admin/cancd/Manifest b/app-admin/cancd/Manifest index 84abf8bd87c0..f71a5362a246 100644 --- a/app-admin/cancd/Manifest +++ b/app-admin/cancd/Manifest @@ -1,6 +1,10 @@ -MD5 f1f95eb22b1599cd54f8f220a89c7303 ChangeLog 418 +MD5 986b40631fbeb821fde52c2172fb270f ChangeLog 623 +MD5 f5d2c06d00de2f8813daca7848b6acb4 cancd-0.1.0-r1.ebuild 1064 MD5 4ca7e3df59e4817fd53a9b61f33f681a cancd-0.1.0.ebuild 962 MD5 3b01d1817d6513beed0e000105ae17f7 files/cancd-conf.d 605 MD5 c442ca1294fd06f4b84e8ba23180507f files/cancd-init.d 624 MD5 2519af6cc0a0ad63ed00fff3929ed7ad files/digest-cancd-0.1.0 61 +MD5 2519af6cc0a0ad63ed00fff3929ed7ad files/digest-cancd-0.1.0-r1 61 +MD5 38da345afd63db02458809dcca54c916 files/netconsole-conf.d 696 +MD5 7a75a6e2bcef8160625f166e83a14d90 files/netconsole-init.d 1949 MD5 b0d485ea1a51fb83c70daedef2599272 metadata.xml 279 diff --git a/app-admin/cancd/cancd-0.1.0-r1.ebuild b/app-admin/cancd/cancd-0.1.0-r1.ebuild new file mode 100644 index 000000000000..17570b703c92 --- /dev/null +++ b/app-admin/cancd/cancd-0.1.0-r1.ebuild @@ -0,0 +1,40 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-admin/cancd/cancd-0.1.0-r1.ebuild,v 1.1 2005/11/15 19:27:35 robbat2 Exp $ + +DESCRIPTION="This is the CA NetConsole Daemon, a daemon to receive 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="" +DEPEND="virtual/libc" +RDEPEND="${DEPEND}" + +src_unpack() { + unpack ${A} + # slight makefile cleanup + sed -i.orig \ + -e '/^CFLAGS/s,-g,,' \ + -e '/^CFLAGS/s,-O2,,' \ + -e '/rm cancd cancd.o/s,rm,rm -f,' \ + ${S}/Makefile +} + +src_compile() { + emake cancd +} + +src_install() { + into /usr + 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/digest-cancd-0.1.0-r1 b/app-admin/cancd/files/digest-cancd-0.1.0-r1 new file mode 100644 index 000000000000..919c488ecc49 --- /dev/null +++ b/app-admin/cancd/files/digest-cancd-0.1.0-r1 @@ -0,0 +1 @@ +MD5 3eb4a75cfa4d1a860ea547fdc76c6d4d cancd-0.1.0.tar.gz 7634 diff --git a/app-admin/cancd/files/netconsole-conf.d b/app-admin/cancd/files/netconsole-conf.d new file mode 100644 index 000000000000..5a17a9107ca4 --- /dev/null +++ b/app-admin/cancd/files/netconsole-conf.d @@ -0,0 +1,26 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-admin/cancd/files/netconsole-conf.d,v 1.1 2005/11/15 19:27:35 robbat2 Exp $ + +# required! +TGT_IP='' + +DEVICE=eth0 + +SRC_IP='' # will default to first address on $DEVICE +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..af0335f87579 --- /dev/null +++ b/app-admin/cancd/files/netconsole-init.d @@ -0,0 +1,77 @@ +#!/sbin/runscript +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-admin/cancd/files/netconsole-init.d,v 1.1 2005/11/15 19:27:35 robbat2 Exp $ + +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 /sbin/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 +} + +# netconsole=[src-port]@[src-ip]/[dev],[tgt-port]@<tgt-ip>/[tgt-macaddr] +# src-port source for UDP packets (defaults to 6665) +# src-ip source IP to use (interface address) +# dev network interface (eth0) +# tgt-port port for logging agent (6666) +# tgt-ip IP address for logging agent +# tgt-macaddr ethernet MAC address for logging agent (broadcast) + +# vim: ts=4 sw=4 sts=4: |