浏览代码

base-files: fix vlan support for busybox vconfig

The busybox symlinks reside in /bin, so the check fails. Curiously,
there is no vconfig package, so vlan support must have been broken since
the beginning of time (for OpenADK). :)

This patch also adds some error messages when the basic checks fail,
useful helpers when debugging what's going wrong. Also, there was some
whitespace fuckup in two lines.
Phil Sutter 15 年之前
父节点
当前提交
fbd8958d37
共有 1 个文件被更改,包括 10 次插入4 次删除
  1. 10 4
      package/base-files/src/etc/network/if-pre-up.d/02-vlan

+ 10 - 4
package/base-files/src/etc/network/if-pre-up.d/02-vlan

@@ -1,12 +1,18 @@
 #!/bin/sh
 
-[ -x /sbin/vconfig ] || exit 0
-[ -d /proc/net/vlan ] || exit 0
+which vconfig || {
+	echo "vconfig executable not found, aborting"
+	exit 0
+}
+[ -d /proc/net/vlan ] || {
+	echo "no kernel support for 802.1q found, aborting"
+	exit 0
+}
 
 case "$IFACE" in
         vlan*)
-               	vconfig set_name_type VLAN_PLUS_VID_NO_PAD
-               	VLANID=`echo $IFACE|sed "s/vlan*//"`
+		vconfig set_name_type VLAN_PLUS_VID_NO_PAD
+		VLANID=`echo $IFACE|sed "s/vlan*//"`
 		;;
 	eth*.*)
 		vconfig set_name_type DEV_PLUS_VID_NO_PAD