diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2012-03-15 13:35:13 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2012-03-15 13:35:13 +0000 |
commit | 9146859d63fb9bc88018664950a7d70086ec51eb (patch) | |
tree | a03c9c4b7b0944b8042d8e9dff63370e1a023548 /testing | |
parent | 36681224a041c8256f2054f62d7b075743c9c1c6 (diff) | |
download | aports-9146859d63fb9bc88018664950a7d70086ec51eb.tar.bz2 aports-9146859d63fb9bc88018664950a7d70086ec51eb.tar.xz |
main/vlan: move from testing
Diffstat (limited to 'testing')
-rw-r--r-- | testing/vlan/APKBUILD | 47 | ||||
-rw-r--r-- | testing/vlan/mvlan.post-down | 14 | ||||
-rw-r--r-- | testing/vlan/mvlan.pre-up | 14 | ||||
-rw-r--r-- | testing/vlan/vlan.post-down | 27 | ||||
-rw-r--r-- | testing/vlan/vlan.pre-up | 57 |
5 files changed, 0 insertions, 159 deletions
diff --git a/testing/vlan/APKBUILD b/testing/vlan/APKBUILD deleted file mode 100644 index 30910bcb4a..0000000000 --- a/testing/vlan/APKBUILD +++ /dev/null @@ -1,47 +0,0 @@ -# Contributor: Natanael Copa <ncopa@alpinelinux.org> -# Maintainer: Natanael Copa <ncopa@alpinelinux.org> -pkgname=vlan -pkgver=1.9 -pkgrel=0 -pkgdesc="Scripts for configuring VLAN network interfaces" -url="http://wiki.alpinelinux.org/wiki/Vlan" -arch="noarch" -license="GPL" -depends="" -makedepends="" -install="" -subpackages="" -source="mvlan.post-down - mvlan.pre-up - vlan.post-down - vlan.pre-up - " - -_builddir= -prepare() { - local i - cd "$_builddir" - for i in $source; do - case $i in - *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; - esac - done -} - -build() { - return 0 -} - -package() { - cd "$srcdir" - for i in vlan mvlan; do - for j in pre-up post-down; do - install -Dm755 $i.$j "$pkgdir"/etc/network/if-$j.d/$i || return 1 - done - done -} - -md5sums="3683be24d1fc1d8565e945c349c41571 mvlan.post-down -5b6232674e83b0dbfc24af523dd5ec03 mvlan.pre-up -cebaa97c933ed0f4cafd92f864ab4bc8 vlan.post-down -c9acef8c17d8af19590767f57eb11b6b vlan.pre-up" diff --git a/testing/vlan/mvlan.post-down b/testing/vlan/mvlan.post-down deleted file mode 100644 index 229fc0e7f5..0000000000 --- a/testing/vlan/mvlan.post-down +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -case "$IFACE" in - *#[0-9]*) - MVLANID="${IFACE##*#}" - IF_MVLAN_RAW_DEVICE="${IFACE%#*}" - ;; - *) - ;; -esac -if [ -n "$IF_MVLAN_RAW_DEVICE" ] -then - # Kernel new style configuration - ip link del link dev "$IFACE" -fi diff --git a/testing/vlan/mvlan.pre-up b/testing/vlan/mvlan.pre-up deleted file mode 100644 index 6713f3115a..0000000000 --- a/testing/vlan/mvlan.pre-up +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -case "$IFACE" in - *#[0-9]*) - MVLANID="${IFACE##*#}" - IF_MVLAN_RAW_DEVICE="${IFACE%#*}" - ;; - *) - ;; -esac -if [ -n "$IF_MVLAN_RAW_DEVICE" ] -then - # Kernel new style configuration - ip link add link $IF_MVLAN_RAW_DEVICE name $IFACE type macvlan -fi diff --git a/testing/vlan/vlan.post-down b/testing/vlan/vlan.post-down deleted file mode 100644 index bf887ef149..0000000000 --- a/testing/vlan/vlan.post-down +++ /dev/null @@ -1,27 +0,0 @@ -#!/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 - *#*) exit 0 ;; - *:*) exit 0 ;; - vlan*.*) exit 0 ;; - vlan*) VLAN_ID="${IFACE#vlan}" NAME1=VLAN;; - *.*) RAW_DEVICE="${IFACE%.*}"; VLAN_ID="${IFACE##*.}" NAME1=DEV;; - *) [ -n "${IF_VLAN_ID}" -o -n "${IF_VLAN_RAW_DEVICE}" ] || exit 0 ;; -esac - -if [ -n "$IF_VLAN_RAW_DEVICE" ]; then - RAW_DEVICE="$IF_VLAN_RAW_DEVICE" -fi - -if [ -n "$IF_VLAN_ID" ]; then - VLAN_ID="$IF_VLAN_ID" -fi - -if [ -n "${RAW_DEVICE}" -o -n "${VLAN_ID}" ] -then - vconfig rem "${IFACE}" -fi diff --git a/testing/vlan/vlan.pre-up b/testing/vlan/vlan.pre-up deleted file mode 100644 index 450e0d3358..0000000000 --- a/testing/vlan/vlan.pre-up +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -do_vlan_config() { - local device="$1" - local id="$2" - local newname="$3" - local nametype="$4" - vconfig set_name_type ${nametype} - vconfig add ${device} ${id} -} - - -# Preferred method: -# Autoguess construction from #520147 -case "$IFACE" in - *#*) exit 0 ;; - *:*) exit 0 ;; - vlan*.*) exit 0 ;; - vlan*) VLAN_ID="${IFACE#vlan}" NAME1=VLAN;; - *.*) RAW_DEVICE="${IFACE%.*}"; VLAN_ID="${IFACE##*.}" NAME1=DEV;; - *) [ -n "${IF_VLAN_ID}" -o -n "${IF_VLAN_RAW_DEVICE}" ] || exit 0 ;; -esac -case "$VLAN_ID" in - [1-9]*) NAME2=VID_NO_PAD;; - 0???) NAME2=VID;; - 0*) NAME2=VID_NO_PAD;; # Failsafe fallback in case of backward compatability -esac -if [ -n "$IF_VLAN_RAW_DEVICE" ]; then - RAW_DEVICE="$IF_VLAN_RAW_DEVICE" -fi - -# Strip leading 0s -VLAN_ID="${VLAN_ID#0}" -VLAN_ID="${VLAN_ID#0}" -VLAN_ID="${VLAN_ID#0}" -VLAN_ID="${VLAN_ID#0}" -VLAN_ID="$(($VLAN_ID))" -if [ -n "$IF_VLAN_ID" ]; then - VLAN_ID="$IF_VLAN_ID" -fi - -if [ -z "$VLAN_ID" -o -z "$RAW_DEVICE" ]; then - exit 1 -fi - -if [ -n "$RAW_DEVICE" ] && [ -n "$VLAN_ID" ]; then - if ! ip link show dev "$RAW_DEVICE" > /dev/null; then - echo "$RAW_DEVICE does not exist, unable to create $IFACE" - exit 1 - fi - ip link set up dev "$RAW_DEVICE" - do_vlan_config "$RAW_DEVICE" "$VLAN_ID" "$IFACE" "${NAME1}_PLUS_${NAME2}" - if ! ip link show dev "$IFACE" > /dev/null; then - echo "Failed to create vlan device $IFACE on device $RAW_DEVICE with tag $VLAN_ID" - exit 1 - fi -fi - |