diff options
author | ncopa <ncopa@f176ef85-8d20-0410-844a-e957b5a1c371> | 2007-06-14 14:58:52 +0000 |
---|---|---|
committer | ncopa <ncopa@f176ef85-8d20-0410-844a-e957b5a1c371> | 2007-06-14 14:58:52 +0000 |
commit | b024e55f1322f49a32b693f7d064a8aa985f3053 (patch) | |
tree | 6976871d651271476c0c82d961bd29b17b70be30 | |
parent | a6931d2ac989ccd191e940ecdf816830a5876c7e (diff) | |
download | alpine-baselayout-b024e55f1322f49a32b693f7d064a8aa985f3053.tar.bz2 alpine-baselayout-b024e55f1322f49a32b693f7d064a8aa985f3053.tar.xz |
init.d/modutils:
run modules-udate
removed dead code
sysctl.conf:
dont set kernel.grsecurity.rand_pids since its gone from kernel
Makefile:
version 1.4.1
added ifenslave
ifenslave:
micro version of ifenslave
-rw-r--r-- | Makefile | 4 | ||||
-rwxr-xr-x | ifenslave | 64 | ||||
-rwxr-xr-x | init.d/modutils | 6 | ||||
-rw-r--r-- | sysctl.conf | 1 |
4 files changed, 67 insertions, 8 deletions
@@ -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 |