diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2015-08-08 13:49:04 -0700 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2015-08-08 17:38:18 -0700 |
commit | 56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch) | |
tree | 3f91093cdb475e565ae857f1c5a7fd339e2d781e /sys-apps/ifplugd | |
download | gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2 gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip |
proj/gentoo: Initial commit
This commit represents a new era for Gentoo:
Storing the gentoo-x86 tree in Git, as converted from CVS.
This commit is the start of the NEW history.
Any historical data is intended to be grafted onto this point.
Creation process:
1. Take final CVS checkout snapshot
2. Remove ALL ChangeLog* files
3. Transform all Manifests to thin
4. Remove empty Manifests
5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$
5.1. Do not touch files with -kb/-ko keyword flags.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests
X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project
X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration
X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn
X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts
X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration
X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging
X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'sys-apps/ifplugd')
-rw-r--r-- | sys-apps/ifplugd/Manifest | 1 | ||||
-rw-r--r-- | sys-apps/ifplugd/files/ifplugd-0.28-interface.patch | 13 | ||||
-rw-r--r-- | sys-apps/ifplugd/files/ifplugd-0.28-nlapi.diff | 12 | ||||
-rw-r--r-- | sys-apps/ifplugd/files/ifplugd-0.28-noip.patch | 21 | ||||
-rw-r--r-- | sys-apps/ifplugd/files/ifplugd-0.28-strictalias.patch | 63 | ||||
-rw-r--r-- | sys-apps/ifplugd/files/ifplugd.action | 55 | ||||
-rw-r--r-- | sys-apps/ifplugd/ifplugd-0.28-r9.ebuild | 71 | ||||
-rw-r--r-- | sys-apps/ifplugd/metadata.xml | 8 |
8 files changed, 244 insertions, 0 deletions
diff --git a/sys-apps/ifplugd/Manifest b/sys-apps/ifplugd/Manifest new file mode 100644 index 000000000000..6f919e074d41 --- /dev/null +++ b/sys-apps/ifplugd/Manifest @@ -0,0 +1 @@ +DIST ifplugd-0.28.tar.gz 142677 SHA256 474754ac4ab32d738cbf2a4a3e87ee0a2c71b9048a38bdcd7df1e4f9fd6541f0 diff --git a/sys-apps/ifplugd/files/ifplugd-0.28-interface.patch b/sys-apps/ifplugd/files/ifplugd-0.28-interface.patch new file mode 100644 index 000000000000..9c2de464bbde --- /dev/null +++ b/sys-apps/ifplugd/files/ifplugd-0.28-interface.patch @@ -0,0 +1,13 @@ +--- src/interface.c 2004/12/19 00:08:01 114 ++++ src/interface.c 2006/03/07 13:15:11 133 +@@ -22,9 +22,9 @@ + #include <config.h> + #endif + ++#include <sys/types.h> + #include <linux/sockios.h> + #include <linux/if_ether.h> +-#include <sys/types.h> + #include <sys/socket.h> + #include <sys/ioctl.h> + #include <linux/if.h> diff --git a/sys-apps/ifplugd/files/ifplugd-0.28-nlapi.diff b/sys-apps/ifplugd/files/ifplugd-0.28-nlapi.diff new file mode 100644 index 000000000000..b640543eebc9 --- /dev/null +++ b/sys-apps/ifplugd/files/ifplugd-0.28-nlapi.diff @@ -0,0 +1,12 @@ +diff -urN src/nlapi.c src/nlapi.c +--- src/nlapi.c 2004-12-20 08:39:14.682706517 -0500 ++++ src/nlapi.c 2004-12-20 08:39:50.185734092 -0500 +@@ -86,7 +86,7 @@ + for (; bytes > 0; p = NLMSG_NEXT(p, bytes)) { + struct callback_info *c; + +- if (!NLMSG_OK(p, bytes) || (size_t) bytes < sizeof(struct nlmsghdr) || (size_t) bytes < p->nlmsg_len) { ++ if (!NLMSG_OK(p, (size_t) bytes) || (size_t) bytes < sizeof(struct nlmsghdr) || (size_t) bytes < (size_t) p->nlmsg_len) { + daemon_log(LOG_ERR, "NLAPI: Packet too small or truncated!\n"); + return -1; + } diff --git a/sys-apps/ifplugd/files/ifplugd-0.28-noip.patch b/sys-apps/ifplugd/files/ifplugd-0.28-noip.patch new file mode 100644 index 000000000000..5daa4534eb49 --- /dev/null +++ b/sys-apps/ifplugd/files/ifplugd-0.28-noip.patch @@ -0,0 +1,21 @@ +[PATCH] Allow ifplugd to run when no TCP/IP is available + +This simple patch create AF_LOCAL socket instead of AF_INET so if TCP/IP +is not linked into kernel it still works. + +Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> + +--- + +diff -urNp ifplugd-0.28.org/src/ifplugd.c ifplugd-0.28/src/ifplugd.c +--- ifplugd-0.28.org/src/ifplugd.c 2005-06-04 22:21:51.000000000 +0300 ++++ ifplugd-0.28/src/ifplugd.c 2007-10-30 05:22:53.000000000 +0200 +@@ -409,7 +409,7 @@ void work(void) { + break; + } + +- if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { ++ if ((fd = socket(AF_LOCAL, SOCK_DGRAM, 0)) < 0) { + daemon_log(LOG_ERR, "socket(): %s", strerror(errno)); + goto finish; + } diff --git a/sys-apps/ifplugd/files/ifplugd-0.28-strictalias.patch b/sys-apps/ifplugd/files/ifplugd-0.28-strictalias.patch new file mode 100644 index 000000000000..3c5de8a2e731 --- /dev/null +++ b/sys-apps/ifplugd/files/ifplugd-0.28-strictalias.patch @@ -0,0 +1,63 @@ +--- src/interface.c.orig 2007-03-23 13:29:40.000000000 +0000 ++++ src/interface.c 2007-03-23 13:30:05.000000000 +0000 +@@ -89,6 +89,10 @@ + + interface_status_t interface_detect_beat_mii(int fd, char *iface) { + struct ifreq ifr; ++ union { ++ caddr_t *data; ++ unsigned short *usz; ++ } ifd; + + if (interface_auto_up) + interface_up(fd, iface); +@@ -103,7 +107,8 @@ + return IFSTATUS_ERR; + } + +- ((unsigned short*) &ifr.ifr_data)[1] = 1; ++ ifd.data = &ifr.ifr_data; ++ *++ifd.usz = 1; + + if (ioctl(fd, SIOCGMIIREG, &ifr) == -1) { + if (interface_do_message) +@@ -112,12 +117,17 @@ + return IFSTATUS_ERR; + } + +- return (((unsigned short*) &ifr.ifr_data)[3] & 0x0004) ? IFSTATUS_UP : IFSTATUS_DOWN; ++ ifd.usz += 2; ++ return (*ifd.usz & 0x0004) ? IFSTATUS_UP : IFSTATUS_DOWN; + } + + interface_status_t interface_detect_beat_priv(int fd, char *iface) { + struct ifreq ifr; +- ++ union { ++ caddr_t *data; ++ unsigned short *usz; ++ } ifd; ++ + if (interface_auto_up) + interface_up(fd, iface); + +@@ -131,7 +141,8 @@ + return IFSTATUS_ERR; + } + +- ((unsigned short*) &ifr.ifr_data)[1] = 1; ++ ifd.data = &ifr.ifr_data; ++ *++ifd.usz = 1; + + if (ioctl(fd, SIOCDEVPRIVATE+1, &ifr) == -1) { + if (interface_do_message) +@@ -140,7 +151,8 @@ + return IFSTATUS_ERR; + } + +- return (((unsigned short*) &ifr.ifr_data)[3] & 0x0004) ? IFSTATUS_UP : IFSTATUS_DOWN; ++ ifd.usz += 2; ++ return (*ifd.usz & 0x0004) ? IFSTATUS_UP : IFSTATUS_DOWN; + } + + interface_status_t interface_detect_beat_ethtool(int fd, char *iface) { diff --git a/sys-apps/ifplugd/files/ifplugd.action b/sys-apps/ifplugd/files/ifplugd.action new file mode 100644 index 000000000000..ba4cfd7d20b9 --- /dev/null +++ b/sys-apps/ifplugd/files/ifplugd.action @@ -0,0 +1,55 @@ +#!/bin/sh +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# +# Gentoo-specific ifplugd.action +# +# This file gets called by ifplugd when it wants to bring an interface +# up or down. +# + +if grep -q initng /proc/1/cmdline +then + EXEC="/sbin/ngc" + INITNG="yes" +else + EXEC="/etc/init.d/net.$1" + INITNG="no" +fi + +case "$2" in + up) + if [ "${INITNG}" = "yes" ] + then + ARGS="-u net/$1" + else + ARGS="--quiet start" + fi + ;; + down) + if [ "${INITNG}" = "yes" ] + then + ARGS="-d net/$1" + else + ARGS="--quiet stop" + fi + ;; + *) + echo "$0: wrong arguments" >&2 + echo "Call with <interface> <up|down>" >&2 + exit 1 + ;; +esac + +export IN_BACKGROUND=true + +if [ -x "${EXEC}" ] +then + ${EXEC} ${ARGS} + exit 0 +else + logger -t ifplugd.action "Error: Couldn't configure $1, no ${EXEC} !" + exit 1 +fi + +# vim: set ts=4 diff --git a/sys-apps/ifplugd/ifplugd-0.28-r9.ebuild b/sys-apps/ifplugd/ifplugd-0.28-r9.ebuild new file mode 100644 index 000000000000..e1ccd87a3029 --- /dev/null +++ b/sys-apps/ifplugd/ifplugd-0.28-r9.ebuild @@ -0,0 +1,71 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=4 + +inherit eutils + +DESCRIPTION="Brings up/down ethernet ports automatically with cable detection" +HOMEPAGE="http://0pointer.de/lennart/projects/ifplugd/" +SRC_URI="http://0pointer.de/lennart/projects/ifplugd/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~arm amd64 hppa ppc x86" +IUSE="doc selinux" + +DEPEND="virtual/pkgconfig + doc? ( www-client/lynx ) + >=dev-libs/libdaemon-0.5" +RDEPEND=">=dev-libs/libdaemon-0.5 + >=sys-apps/baselayout-1.12 + selinux? ( sec-policy/selinux-ifplugd )" + +src_prepare() { + epatch "${FILESDIR}/${P}-nlapi.diff" + epatch "${FILESDIR}/${P}-interface.patch" + epatch "${FILESDIR}/${P}-strictalias.patch" + epatch "${FILESDIR}/${P}-noip.patch" +} + +src_configure() { + econf \ + $(use_enable doc lynx) \ + --with-initdir=/etc/init.d \ + --disable-xmltoman \ + --disable-subversion +} + +src_install() { + default + + # Remove init.d configuration as we no longer use it + rm -rf "${D}/etc/ifplugd" "${D}/etc/init.d/${PN}" + + exeinto "/etc/${PN}" + newexe "${FILESDIR}/${PN}.action" "${PN}.action" + + cd "${S}/doc" + dodoc README SUPPORTED_DRIVERS + use doc && dohtml *.html *.css +} + +pkg_postinst() { + # Warn about old init script + einfo "baselayout now starts ifplugd automatically on wired interfaces" + einfo "If you do not want this behaviour then add !plug to your modules" + einfo "in /etc/conf.d/net like so" + einfo " modules=( \"!plug\" )" + + if [ -e "${ROOT}/etc/init.d/ifplugd" -o -e "${ROOT}/etc/conf.d/ifplugd" ] ; then + echo + ewarn "You should stop the ifplugd service now and remove its init" + ewarn "script and config file" + if [ "${ROOT}" = "/" ] ; then + ewarn " /etc/init.d/ifplugd stop" + ewarn " rc-update del ifplugd" + ewarn " rm -f /etc/{conf,init}.d/ifplugd" + fi + fi +} diff --git a/sys-apps/ifplugd/metadata.xml b/sys-apps/ifplugd/metadata.xml new file mode 100644 index 000000000000..26ed76b50d8e --- /dev/null +++ b/sys-apps/ifplugd/metadata.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <herd>base-system</herd> + <longdescription lang="en"> + Brings up/down ethernet ports automatically with cable detection + </longdescription> +</pkgmetadata> |