DESTDIR=
-SUBDIRS = aplinfo PVE bin www services configs
+SUBDIRS = aplinfo PVE bin www services configs network-hooks
ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
GITVERSION:=$(shell git rev-parse HEAD)
tar cf - ${DEB} | ssh -X repoman@repo.proxmox.com upload --product pve --dist stretch
.PHONY: install
-install: vzdump-hook-script.pl mtu bridgevlan bridgevlanport vlan vlan-down
+install: vzdump-hook-script.pl
install -d -m 0700 -o www-data -g www-data ${DESTDIR}/var/log/pveproxy
install -d ${DESTDIR}/usr/share/${PACKAGE}
install -d ${DESTDIR}/usr/share/man/man1
install -d ${DESTDIR}/var/lib/vz/template/cache
install -d ${DESTDIR}/var/lib/vz/template/iso
install -d ${DESTDIR}/var/lib/vz/template/qemu
- install -D -m 0755 mtu ${DESTDIR}/etc/network/if-up.d/mtu
- install -D -m 0755 bridgevlan ${DESTDIR}/etc/network/if-up.d/bridgevlan
- install -D -m 0755 bridgevlanport ${DESTDIR}/etc/network/if-up.d/bridgevlanport
- install -D -m 0755 vlan ${DESTDIR}/etc/network/if-pre-up.d/vlan
- install -D -m 0755 vlan-down ${DESTDIR}/etc/network/if-post-down.d/vlan
-
install -m 0644 vzdump-hook-script.pl ${DOCDIR}/examples/vzdump-hook-script.pl
install -m 0644 spice-example-sh ${DOCDIR}/examples/spice-example-sh
-
set -e && for i in ${SUBDIRS}; do ${MAKE} -C $$i $@; done
.PHONY: distclean
+++ /dev/null
-#!/bin/sh
-
-if [ ! -x /sbin/bridge ] && [ ! -f /sys/class/net/$IFACE/bridge/vlan_filtering ]
-then
- exit 0
-fi
-
-# Enabling vlan filtering feature
-if [ "$MODE" = "start" ] ; then
-
- if [ -n "$IF_BRIDGE_VLAN_AWARE" ]
- then
- echo 1 > /sys/class/net/$IFACE/bridge/vlan_filtering
- else
- exit 0
- fi
-
-fi
-
-. /lib/bridge-utils/bridge-utils.sh
-
-case "$IF_BRIDGE_PORTS" in
- "")
- exit 0
- ;;
- none)
- INTERFACES=""
- ;;
- *)
- INTERFACES="$IF_BRIDGE_PORTS"
- ;;
-esac
-
-all_interfaces= &&
-unset all_interfaces &&
-bridge_parse_ports $INTERFACES | while read i
-do
- for port in $i
- do
- if [ "$MODE" = "start" ] && [ -d /sys/class/net/$IFACE/brif/$port ]; then
- # we allow vlan to pass through attached interface
- if [ -n "$IF_BRIDGE_VIDS" ]
- then
- bridge vlan add dev $port vid $IF_BRIDGE_VIDS
- else
- bridge vlan add dev $port vid 2-4094
- fi
- fi
- done
-done
-
+++ /dev/null
-#!/bin/sh
-
-if [ ! -x /sbin/bridge ]
-then
- exit 0
-fi
-
-if [ "$MODE" = "start" ] ; then
- case "$IFACE" in
- *.[0-9]*)
- VLANID="${IFACE##*.}"
- IF_VLAN_RAW_DEVICE="${IFACE%.*}"
- ;;
- esac
-
- if [ -n "$IF_VLAN_RAW_DEVICE" ]; then
- if [ -e "/sys/class/net/$IF_VLAN_RAW_DEVICE/bridge/vlan_filtering" ]; then
- bridge vlan add dev $IF_VLAN_RAW_DEVICE vid $VLANID self
- fi
- fi
-fi
-
-
+++ /dev/null
-#!/bin/sh
-
-case "$IFACE" in
- # Ignore any alias (#272891) which uses <interface>:<alabel>
- *:*)
- exit 0
- ;;
-esac
-
-if [ "$METHOD" != manual ]; then
- exit 0
-fi
-
-if [ -n "$IF_MTU" ]; then
- ip link set $IFACE mtu $IF_MTU
-fi
--- /dev/null
+include ../defines.mk
+
+all:
+
+.PHONY: install
+install: mtu bridgevlan bridgevlanport vlan vlan-down
+ install -D -m 0755 mtu ${DESTDIR}/etc/network/if-up.d/mtu
+ install -D -m 0755 bridgevlan ${DESTDIR}/etc/network/if-up.d/bridgevlan
+ install -D -m 0755 bridgevlanport ${DESTDIR}/etc/network/if-up.d/bridgevlanport
+ install -D -m 0755 vlan ${DESTDIR}/etc/network/if-pre-up.d/vlan
+ install -D -m 0755 vlan-down ${DESTDIR}/etc/network/if-post-down.d/vlan
+
+clean:
--- /dev/null
+#!/bin/sh
+
+if [ ! -x /sbin/bridge ] && [ ! -f /sys/class/net/$IFACE/bridge/vlan_filtering ]
+then
+ exit 0
+fi
+
+# Enabling vlan filtering feature
+if [ "$MODE" = "start" ] ; then
+
+ if [ -n "$IF_BRIDGE_VLAN_AWARE" ]
+ then
+ echo 1 > /sys/class/net/$IFACE/bridge/vlan_filtering
+ else
+ exit 0
+ fi
+
+fi
+
+. /lib/bridge-utils/bridge-utils.sh
+
+case "$IF_BRIDGE_PORTS" in
+ "")
+ exit 0
+ ;;
+ none)
+ INTERFACES=""
+ ;;
+ *)
+ INTERFACES="$IF_BRIDGE_PORTS"
+ ;;
+esac
+
+all_interfaces= &&
+unset all_interfaces &&
+bridge_parse_ports $INTERFACES | while read i
+do
+ for port in $i
+ do
+ if [ "$MODE" = "start" ] && [ -d /sys/class/net/$IFACE/brif/$port ]; then
+ # we allow vlan to pass through attached interface
+ if [ -n "$IF_BRIDGE_VIDS" ]
+ then
+ bridge vlan add dev $port vid $IF_BRIDGE_VIDS
+ else
+ bridge vlan add dev $port vid 2-4094
+ fi
+ fi
+ done
+done
+
--- /dev/null
+#!/bin/sh
+
+if [ ! -x /sbin/bridge ]
+then
+ exit 0
+fi
+
+if [ "$MODE" = "start" ] ; then
+ case "$IFACE" in
+ *.[0-9]*)
+ VLANID="${IFACE##*.}"
+ IF_VLAN_RAW_DEVICE="${IFACE%.*}"
+ ;;
+ esac
+
+ if [ -n "$IF_VLAN_RAW_DEVICE" ]; then
+ if [ -e "/sys/class/net/$IF_VLAN_RAW_DEVICE/bridge/vlan_filtering" ]; then
+ bridge vlan add dev $IF_VLAN_RAW_DEVICE vid $VLANID self
+ fi
+ fi
+fi
+
+
--- /dev/null
+#!/bin/sh
+
+case "$IFACE" in
+ # Ignore any alias (#272891) which uses <interface>:<alabel>
+ *:*)
+ exit 0
+ ;;
+esac
+
+if [ "$METHOD" != manual ]; then
+ exit 0
+fi
+
+if [ -n "$IF_MTU" ]; then
+ ip link set $IFACE mtu $IF_MTU
+fi
--- /dev/null
+#!/bin/sh
+
+# Most of this stuff is to enable vlans, it's really only needed by bridge_utils
+case "$IFACE" in
+ # Ignore any alias (#272891) which uses <interface>:<alabel>
+ *:*)
+ exit 0
+ ;;
+ vlan[0-9]*)
+ VLANID=`echo $IFACE|sed "s/vlan*//"`
+ ;;
+ *.[0-9]*)
+ # Silently ignore interfaces which ifupdown handles on its own
+ # If IF_BRIDGE_PORTS is set, probably we're called by bridge-utils
+ [ -z "$IF_VLAN_RAW_DEVICE" -a -z "$IF_BRIDGE_PORTS" ] && exit 0
+ VLANID=`echo $IFACE|sed "s/[a-zA-Z0-9]*\.//g"`
+ IF_VLAN_RAW_DEVICE=`echo $IFACE|sed "s/\([a-zA-Z0-9]*\)\..*/\1/"`
+ ;;
+
+ *)
+ exit 0
+ ;;
+esac
+
+if [ -n "$IF_VLAN_RAW_DEVICE" ]; then
+ if ! ip link show dev "$IF_VLAN_RAW_DEVICE" > /dev/null; then
+ echo "$IF_VLAN_RAW_DEVICE does not exist, unable to create $IFACE"
+ exit 1
+ fi
+ if [ ! -e "/sys/class/net/$IFACE" ]; then
+ ip link set up dev $IF_VLAN_RAW_DEVICE
+ ip link add link $IF_VLAN_RAW_DEVICE name $IFACE type vlan id $VLANID
+ fi
+
+fi
+
+# This is not vlan specific, and should actually go somewhere else.
+if [ -n "$IF_HW_MAC_ADDRESS" ]; then
+ ip link set $IFACE address $IF_HW_MAC_ADDRESS
+fi
--- /dev/null
+#!/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
+ ;;
+ *.[0-9]*)
+ # Silently ignore interfaces which ifupdown handles on its own
+ # If IF_BRIDGE_PORTS is set, probably we're called by bridge-utils
+ [ -z "$IF_VLAN_RAW_DEVICE" -a -z "$IF_BRIDGE_PORTS" ] && exit 0
+ IF_VLAN_RAW_DEVICE=`echo $IFACE|sed "s/\([A-Za-z0-9]*\)\..*/\1/"`
+ ;;
+ # Test for vlan raw device (#196890, #292648)
+ *)
+ [ -z "$IF_VLAN_RAW_DEVICE" ] && exit 0
+ ;;
+esac
+
+if [ -e "/sys/class/net/$IFACE" ]; then
+ ip link delete $IFACE
+fi
+++ /dev/null
-#!/bin/sh
-
-# Most of this stuff is to enable vlans, it's really only needed by bridge_utils
-case "$IFACE" in
- # Ignore any alias (#272891) which uses <interface>:<alabel>
- *:*)
- exit 0
- ;;
- vlan[0-9]*)
- VLANID=`echo $IFACE|sed "s/vlan*//"`
- ;;
- *.[0-9]*)
- # Silently ignore interfaces which ifupdown handles on its own
- # If IF_BRIDGE_PORTS is set, probably we're called by bridge-utils
- [ -z "$IF_VLAN_RAW_DEVICE" -a -z "$IF_BRIDGE_PORTS" ] && exit 0
- VLANID=`echo $IFACE|sed "s/[a-zA-Z0-9]*\.//g"`
- IF_VLAN_RAW_DEVICE=`echo $IFACE|sed "s/\([a-zA-Z0-9]*\)\..*/\1/"`
- ;;
-
- *)
- exit 0
- ;;
-esac
-
-if [ -n "$IF_VLAN_RAW_DEVICE" ]; then
- if ! ip link show dev "$IF_VLAN_RAW_DEVICE" > /dev/null; then
- echo "$IF_VLAN_RAW_DEVICE does not exist, unable to create $IFACE"
- exit 1
- fi
- if [ ! -e "/sys/class/net/$IFACE" ]; then
- ip link set up dev $IF_VLAN_RAW_DEVICE
- ip link add link $IF_VLAN_RAW_DEVICE name $IFACE type vlan id $VLANID
- fi
-
-fi
-
-# This is not vlan specific, and should actually go somewhere else.
-if [ -n "$IF_HW_MAC_ADDRESS" ]; then
- ip link set $IFACE address $IF_HW_MAC_ADDRESS
-fi
+++ /dev/null
-#!/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
- ;;
- *.[0-9]*)
- # Silently ignore interfaces which ifupdown handles on its own
- # If IF_BRIDGE_PORTS is set, probably we're called by bridge-utils
- [ -z "$IF_VLAN_RAW_DEVICE" -a -z "$IF_BRIDGE_PORTS" ] && exit 0
- IF_VLAN_RAW_DEVICE=`echo $IFACE|sed "s/\([A-Za-z0-9]*\)\..*/\1/"`
- ;;
- # Test for vlan raw device (#196890, #292648)
- *)
- [ -z "$IF_VLAN_RAW_DEVICE" ] && exit 0
- ;;
-esac
-
-if [ -e "/sys/class/net/$IFACE" ]; then
- ip link delete $IFACE
-fi