From c636f8653fcbc2d4848460a68f59c1a008f21e49 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Tue, 8 Dec 2009 17:19:26 +0100 Subject: [PATCH] kernel-libc-headers: add ifenslave subpkg! --HG-- extra : convert_revision : 29928bf7543fe59cedc6d1872fb18177b7cb6dfb --- srcpkgs/ifenslave | 1 + srcpkgs/kernel-libc-headers/files/ifenslave.8 | 69 +++++++++++++++++++ .../kernel-libc-headers/ifenslave.template | 25 +++++++ srcpkgs/kernel-libc-headers/template | 2 + 4 files changed, 97 insertions(+) create mode 120000 srcpkgs/ifenslave create mode 100644 srcpkgs/kernel-libc-headers/files/ifenslave.8 create mode 100644 srcpkgs/kernel-libc-headers/ifenslave.template diff --git a/srcpkgs/ifenslave b/srcpkgs/ifenslave new file mode 120000 index 00000000000..265b26799d8 --- /dev/null +++ b/srcpkgs/ifenslave @@ -0,0 +1 @@ +kernel-libc-headers \ No newline at end of file diff --git a/srcpkgs/kernel-libc-headers/files/ifenslave.8 b/srcpkgs/kernel-libc-headers/files/ifenslave.8 new file mode 100644 index 00000000000..61673385cce --- /dev/null +++ b/srcpkgs/kernel-libc-headers/files/ifenslave.8 @@ -0,0 +1,69 @@ +.Dd 2004-04-09 +.Dt IFENSLAVE 8 +.Os "Debian GNU/Linux" +.\" Manual page created by Guus Sliepen +.Sh NAME +.Nm ifenslave +.Nd Attach and detach slave network devices to a bonding device. +.Sh SYNOPSIS +.Nm +.Op Fl acdfhuvV +.Op Fl -all-interfaces +.Op Fl -change-active +.Op Fl -detach +.Op Fl -force +.Op Fl -help +.Op Fl -usage +.Op Fl -verbose +.Op Fl -version +.Ar master +.Ar slave +.No ... +.Sh DESCRIPTION +.Nm +is a tool to attach and detach slave network devices to a bonding device. +A bonding device will act like a normal Ethernet network device to the kernel, +but will send out the packets via the slave devices using a simple round-robin scheduler. +This allows for simple load-balancing, +identical to "channel bonding" or "trunking" techniques used in switches. +.Pp +The kernel must have support for bonding devices for +.Nm +to be useful. +.Sh OPTIONS +.Bl -tag -width indent +.It Fl a, -all-interfaces +Show information about all interfaces. +.It Fl c, -change-active +Change active slave. +.It Fl d, -detach +Removes slave interfaces from the bonding device. +.It Fl f, -force +Force actions to be taken if one of the specified interfaces appears not to belong to an Ethernet device. +.It Fl h, -help +Display a help message and exit. +.It Fl u, -usage +Show usage information and exit. +.It Fl v, -verbose +Print warning and debug messages. +.It Fl V, -version +Show version information and exit. +.El +If not options are given, the default action will be to enslave interfaces. +.Sh EXAMPLE +The following example shows how to setup a bonding device and +enslave two real Ethernet devices to it: +.Bd -literal +# modprobe bonding +# ifconfig bond0 192.168.0.1 netmask 255.255.0.0 +# ifenslave bond0 eth0 eth1 +.Ed +.Sh AUTHOR +.Nm +was originally written by +.An Donald Becker Aq becker@cesdis.gsfc.nasa.gov , +and has since been updated by various kernel developers. +.Pp +This manual page was written by +.An Guus Sliepen Aq guus@debian.org +for the Debian GNU/Linux system. diff --git a/srcpkgs/kernel-libc-headers/ifenslave.template b/srcpkgs/kernel-libc-headers/ifenslave.template new file mode 100644 index 00000000000..ab0a5958423 --- /dev/null +++ b/srcpkgs/kernel-libc-headers/ifenslave.template @@ -0,0 +1,25 @@ +# Template file for 'ifenslave'. +# +short_desc="Attach and detach slave interfaces to a bonding device" +long_desc=" + This is a tool to attach and detach slave network interfaces to a bonding + device. A bonding device will act like a normal Ethernet network device to + the kernel, but will send out the packets via the slave devices using a + simple round-robin scheduler. This allows for simple load-balancing, + identical to channel bonding or trunking techniques used in switches. + + The kernel must have support for bonding devices for ifenslave to be useful. + This package supports 2.6.x kernels and the most recent 2.4.x kernels." + +version=1.1.0 +Add_dependency run glibc + +do_install() +{ + cd ${wrksrc}/Documentation/networking || return 1 + gcc -Wall -Wstrict-prototypes -O -I${wrksrc}/include \ + ifenslave.c -o ifenslave || return 1 + install -D -m755 ifenslave ${DESTDIR}/sbin/ifenslave + install -D -m644 ${FILESDIR}/ifenslave.8 \ + ${DESTDIR}/usr/share/man/man8/ifenslave.8 || return 1 +} diff --git a/srcpkgs/kernel-libc-headers/template b/srcpkgs/kernel-libc-headers/template index 2d9c1776e59..6b0d3e48c23 100644 --- a/srcpkgs/kernel-libc-headers/template +++ b/srcpkgs/kernel-libc-headers/template @@ -18,6 +18,8 @@ long_desc=" base_chroot=yes nostrip=yes +# Ugly but so we can always use official code :-) +subpackages="ifenslave" post_install() {