vlan: Add vlan recipe
PATCH 1/1 vlan: Add vlan recipe
From: Lei Yang <[email protected]>
A 802.1q vlan support program,which can be used by virt-test
--- meta-networking/recipes-support/vlan/files/ip | 21 +++++++ .../recipes-support/vlan/files/vlan-post-down | 28 +++++++++ .../recipes-support/vlan/files/vlan-pre-up | 61 ++++++++++++++++++++ meta-networking/recipes-support/vlan/vlan_1.9.bb | 38 ++++++++++++ 4 files changed, 148 insertions(+), 0 deletions(-) create mode 100755 meta-networking/recipes-support/vlan/files/ip create mode 100755 meta-networking/recipes-support/vlan/files/vlan-post-down create mode 100755 meta-networking/recipes-support/vlan/files/vlan-pre-up create mode 100755 meta-networking/recipes-support/vlan/vlan_1.9.bb
meta-networking/recipes-support/vlan/files/ip new file +21 -0
@@ -0,0 +1,21 @@ +#!/bin/sh +# This should probably go into ifupdown +# But usually only those with lots of interfaces (vlans) need these +if [ -d "/proc/sys/net/ipv4/conf/$IFACE" ] +then + if [ -n "$IF_IP_PROXY_ARP" ]; then + if [ "$IF_IP_PROXY_ARP" -eq "1" ]; then + echo 1 > "/proc/sys/net/ipv4/conf/$IFACE/proxy_arp" + else + echo 0 > "/proc/sys/net/ipv4/conf/$IFACE/proxy_arp" + fi + fi + if [ -n "$IF_IP_RP_FILTER" ]; then + if [ "$IF_IP_RP_FILTER" -eq "0" ]; then + echo 0 > "/proc/sys/net/ipv4/conf/$IFACE/rp_filter" + else + echo 1 > "/proc/sys/net/ipv4/conf/$IFACE/rp_filter" + fi + fi +fi +
meta-networking/recipes-support/vlan/files/vlan-post-down new file +28 -0
@@ -0,0 +1,28 @@ +#!/bin/sh + +# If IFACE is an automagic vlan interface (without the vlan-raw-device +# parameter) then let's try to discover the magic here.. Another way would be +# to just probe for the right device name in /proc/net/vlan + +case "$IFACE" in + # Ignore any alias (#272891) + *:*) + exit 0 + ;; + eth*.0*|bond*.0*|wlan*.0*) + IF_VLAN_RAW_DEVICE=`echo $IFACE|sed "s/\(eth[0-9][0-9]*\)\..*/\1/;s/\(bond[0-9][0-9]*\)\..*/\1/;s/\(wlan[0-9][0-9]*\)\..*/\1/"` + ;; + eth*.*|bond*.*|wlan*.*) + IF_VLAN_RAW_DEVICE=`echo $IFACE|sed "s/\(eth[0-9][0-9]*\)\..*/\1/;s/\(bond[0-9][0-9]*\)\..*/\1/;s/\(wlan[0-9][0-9]*\)\..*/\1/"` + ;; + # Test for vlan raw device (#196890, #292648) + *) + [ -z "$IF_VLAN_RAW_DEVICE" ] && exit 0 + ;; +esac + +if [ ! -x /sbin/vconfig ]; then + exit 0 +fi + +vconfig rem $IFACE
meta-networking/recipes-support/vlan/files/vlan-pre-up new file +61 -0
61 lines not on this page · raw message
meta-networking/recipes-support/vlan/vlan_1.9.bb new file +38 -0
@@ -0,0 +1,38 @@ +DESCRIPTION = "802.1q vlan support program" +HOMEPAGE = "http://www.candelatech.com/~greear/" +LICENSE = "GPLv2" +SECTION = "console/network" + +S = "${WORKDIR}/vlan/" + +SRC_URI = " \ + http://www.candelatech.com/~greear/vlan/vlan.${PV}.tar.gz \ + file://ip \ + file://vlan-pre-up \ + file://vlan-post-down \ + " + +CCFLAGS = "-g -D_GNU_SOURCE -Wall -I${STAGING_INCDIR}" +LDLIBS = "" + +do_compile() { + ${CC} ${CCFLAGS} -c vconfig.c + ${CC} ${CCFLAGS} ${LDFLAGS} -o vconfig vconfig.o ${LDLIBS} +} + +do_install() { + install -d "${D}${sbindir}" + install -m 755 "${S}/vconfig" "${D}${sbindir}/vconfig" + install -d ${D}/${sysconfdir}/network/if-pre-up.d + install -d ${D}/${sysconfdir}/network/if-post-down.d + install -d ${D}/${sysconfdir}/network/if-up.d + install -m 0755 ${WORKDIR}/ip ${D}/${sysconfdir}/network/if-up.d/ + install -m 0755 ${WORKDIR}/vlan-pre-up ${D}/${sysconfdir}/network/if-pre-up.d/vlan + install -m 0755 ${WORKDIR}/vlan-post-down ${D}/${sysconfdir}/network/if-post-down.d/vlan +} + + +SRC_URI[md5sum] = "5f0c6060b33956fb16e11a15467dd394" +SRC_URI[sha256sum] = "3b8f0a1bf0d3642764e5f646e1f3bbc8b1eeec474a77392d9aeb4868842b4cca" +LIC_FILES_CHKSUM = "file://macvlan_config.c;beginline=4;endline=62;md5=dc0660d77e4313e8ccdf256fbe436a63" +
Signature · 1 line
1.7.1
Hi Lei,
Some style feedback below.
meta-networking/recipes-support/vlan/vlan_1.9.bb line 1
Quoted 7 lines · On Thursday 30 May 2013 11:42:08 [email protected] wrote:
(quoted diff) +0
-0b/meta-networking/recipes-support/vlan/vlan_1.9.bb new file mode 100755 index 0000000..464150c
meta-networking/recipes-support/vlan/vlan_1.9.bb new file +1
-0@@ -0,0 +1,38 @@ +DESCRIPTION = "802.1q vlan support program"
Please set SUMMARY instead of DESCRIPTION if you're only setting a short description.
meta-networking/recipes-support/vlan/vlan_1.9.bb line 2
Quoted 1 line
meta-networking/recipes-support/vlan/vlan_1.9.bb new file +1
-0+HOMEPAGE = "http://www.candelatech.com/~greear/"
By the looks of it this should be:
http://www.candelatech.com/~greear/vlan.html
Quoted 35 lines
meta-networking/recipes-support/vlan/vlan_1.9.bb new file +28
-0+LICENSE = "GPLv2" +SECTION = "console/network" + +S = "${WORKDIR}/vlan/" + +SRC_URI = " \ + http://www.candelatech.com/~greear/vlan/vlan.${PV}.tar.gz \ + file://ip \ + file://vlan-pre-up \ + file://vlan-post-down \ + " + +CCFLAGS = "-g -D_GNU_SOURCE -Wall -I${STAGING_INCDIR}" +LDLIBS = "" + +do_compile() { + ${CC} ${CCFLAGS} -c vconfig.c + ${CC} ${CCFLAGS} ${LDFLAGS} -o vconfig vconfig.o ${LDLIBS} +} + +do_install() { + install -d "${D}${sbindir}" + install -m 755 "${S}/vconfig" "${D}${sbindir}/vconfig" + install -d ${D}/${sysconfdir}/network/if-pre-up.d + install -d ${D}/${sysconfdir}/network/if-post-down.d + install -d ${D}/${sysconfdir}/network/if-up.d + install -m 0755 ${WORKDIR}/ip ${D}/${sysconfdir}/network/if-up.d/ + install -m 0755 ${WORKDIR}/vlan-pre-up${D}/${sysconfdir}/network/if-pre-up.d/vlan + install -m 0755
${WORKDIR}/vlan-post-down ${D}/${sysconfdir}/network/if-post-down.d/vlanmeta-networking/recipes-support/vlan/vlan_1.9.bb new file +5
-0+} + + +SRC_URI[md5sum] = "5f0c6060b33956fb16e11a15467dd394" +SRC_URI[sha256sum] =
Quoted 1 line
"
3b8f0a1bf0d3642764e5f646e1f3bbc8b1eeec474a77392d9aeb4868842b4cca"
Please move these just after SRC_URI.
Quoted 3 lines
+LIC_FILES_CHKSUM = "file://macvlan_config.c;beginline=4;endline=62;md5=dc0660d77e4313e8ccdf256
fbe436a63" +
Please move this towards the top (usually after the first block which includes LICENSE).
Cheers,
Paul
Signature · 2 lines
Paul Eggleton Intel Open Source Technology Centre