summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile4
-rwxr-xr-xifenslave64
-rwxr-xr-xinit.d/modutils6
-rw-r--r--sysctl.conf1
4 files changed, 67 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 561d407..eb9fd62 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-VERSION=1.3.2
+VERSION=1.4.1
PV =alpine-baselayout-$(VERSION)
TARBALL =$(PV).tar.gz
@@ -10,7 +10,7 @@ ETC_FILES =$(GENERATED_FILES) group fstab inittab nsswitch.conf \
crontab sysctl.conf modprobe.conf
CONFD_FILES = $(addprefix conf.d/, cron localinit rdate tuntap vlan watchdog)
SBIN_FILES =runscript-alpine.sh functions.sh rc_add rc_delete rc_status\
- modules-update
+ modules-update ifenslave
RC_SH_FILES =rc-services.sh
UDHCPC_FILES =default.script
LIB_MDEV_FILES =ide_links sd_links subdir_dev usbdev
diff --git a/ifenslave b/ifenslave
new file mode 100755
index 0000000..21244cb
--- /dev/null
+++ b/ifenslave
@@ -0,0 +1,64 @@
+#!/bin/sh
+
+PROGRAM=$(basename $0)
+
+die() {
+ echo $* >&2
+ exit 1
+}
+
+usage() {
+ echo "Usage: $PROGRAM [-d] <master-if> <slave-if> ...
+
+Options:
+ -d Detach slaves
+
+"
+ exit 1
+}
+
+
+OPER='+'
+while getopts "dh" opt ; do
+ case $opt in
+ d) OPER="-";;
+ h) usage;;
+ esac
+done
+
+shift $(( $OPTIND - 1 ))
+
+[ $# -lt 2 ] && usage
+
+bondif=$1
+shift
+
+#check if $bondif is a bonding master
+unset found
+for i in $(cat /sys/class/net/bonding_masters) ; do
+ [ "$i" = "$bondif" ] && found=1
+done
+[ "$found" != 1 ] && die "$bondif is not a bonding master. Aborting"
+
+# check that $bondif is up
+if [ "$(cat /sys/class/net/$bondif/operstate)" != "up" ] ; then
+ die "The specified master interface '$bondif' is not up"
+fi
+
+while [ $# -gt 0 ] ; do
+ if [ "$OPER" = "+" ] && [ -d /sys/class/net/$1/master ] ; then
+ echo "Interface '$1' is already a slave. Skipping" >&2
+ elif [ -d /sys/class/net/$1 ]; then
+ # flush ip adresses and set link down before adding
+ if [ "$OPER" = '+' ]; then
+ ip addr flush dev $1 >/dev/null 2>&1
+ ip link set dev $1 down #linux will bring link up
+ fi
+ ( echo "${OPER}${1}" > /sys/class/net/$bondif/bonding/slaves ) >/dev/null \
+ || echo "Slave '$1' failed. Skipping" >&2
+ else
+ echo "Slave '$1' is not a network interface. Skipping" >&2
+ fi
+ shift
+done
+
diff --git a/init.d/modutils b/init.d/modutils
index 0a6c8c5..bfa1683 100755
--- a/init.d/modutils
+++ b/init.d/modutils
@@ -3,11 +3,7 @@
PATH="/sbin:/bin:/usr/bin:/usr/bin"
start() {
-#[ -e /sbin/depmod ] || exit 0
-#echo -n "Calculating module dependencies... "
-#depmod -a > /dev/null
-#echo "done."
-
+ modules-update
if [ -f /etc/modules ] ; then
sed 's/\#.*//g' < /etc/modules |
while read module args
diff --git a/sysctl.conf b/sysctl.conf
index 881da1f..e4ed179 100644
--- a/sysctl.conf
+++ b/sysctl.conf
@@ -3,4 +3,3 @@ net.ipv4.tcp_syncookies = 1
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.all.rp_filter = 1
-kernel.grsecurity.rand_pids = 1