]> TLD Linux GIT Repositories - rc-scripts.git/commitdiff
- version 0.5.3 master 0.5.3
authorMarcin Krol <hawk@tld-linux.org>
Wed, 15 May 2024 23:10:40 +0000 (01:10 +0200)
committerMarcin Krol <hawk@tld-linux.org>
Wed, 15 May 2024 23:10:40 +0000 (01:10 +0200)
configure.ac
lib/functions.network
lib/ifdown-bond
lib/ifup
lib/ifup-bond
rc.d/init.d/cryptsetup

index 4a83cf6d1ffb0d759b1c78f7a88515f735cc38a9..61fa78561044f9a8a8c946843710636720c81958 100644 (file)
@@ -1,5 +1,5 @@
 
-AC_INIT([rc-scripts], [0.5.2], [tld-devel@lists.tld-linux.org], [rc-scripts])
+AC_INIT([rc-scripts], [0.5.3], [tld-devel@lists.tld-linux.org], [rc-scripts])
 
 dnl Do not require AUTHORS, ChangeLog, NEWS, and README to exist
 AM_INIT_AUTOMAKE([foreign])
index 862d42b14d6f93f7843695d86dac5b67d99eb4b2..b4ea5d03533d48230516331bc0adba181ef08087 100644 (file)
@@ -226,7 +226,7 @@ setup_ip_param ()
 
        # set handling for bridge
        case "$DEVICETYPE" in
-         br|atm|lec|irda|vlan)
+         bond|br|atm|lec|irda|vlan)
                HANDLING=1
                ;;
        esac
index 80a2cf224bafca00943e19a922447421d52af817..f490bbe69fb645591faa0d18eaa8fc7d3cd3cf69 100755 (executable)
@@ -35,19 +35,19 @@ fi
 setup_ip_param
 
 # forget all addresses
-LC_ALL=C ip addr flush dev ${DEVICE} 2>&1 | grep -v "Nothing to flush"
+LC_ALL=C ip addr flush dev "${DEVICE}" 2>&1 | grep -v "Nothing to flush"
 
 # release slave devices
 for SLAVE_DEV in $(cat /sys/class/net/${DEVICE}/bonding/slaves 2>/dev/null); do
-       echo "-${SLAVE_DEV}" > /sys/class/net/${DEVICE}/bonding/slaves
+       ip link set "${SLAVE_DEV}" nomaster
 done
 
 # bring bonding master down
-ip link set ${DEVICE} down
+ip link set "${DEVICE}" down
 
 # remove bonding master
-if grep -wq "${DEVICE}" /sys/class/net/bonding_masters; then
-       echo "-${DEVICE}" > /sys/class/net/bonding_masters
+if [ -d "/sys/class/net/${DEVICE}" ]; then
+       ip link del "${DEVICE}" type bond
        if [ $? -ne 0 ]; then
                exit 1
        fi
index 5d6fc21ed944b02ddf6ead4236f70edb79252527..b8536af55959af9953e55f6662a8e0e9fff06881 100755 (executable)
--- a/lib/ifup
+++ b/lib/ifup
@@ -125,11 +125,13 @@ if [ -n "$ETHTOOL_OPTS" ] ; then
 fi
 
 if is_yes "$SLAVE" && [ -n "$MASTER" ] ; then
-       if ! grep -wq "${DEVICE}" /sys/class/net/${MASTER}/bonding/slaves 2>/dev/null; then
-               nls "Enslaving %s to %s" "$DEVICE" "$MASTER"
-               ip link set dev ${DEVICE} down
-               echo "+${DEVICE}" > /sys/class/net/${MASTER}/bonding/slaves 2>/dev/null
-       fi
+       # create master if it doesn't exist yet
+       [ ! -d "/sys/class/net/${MASTER}" ] && ip link add "${MASTER}" type bond
+
+       nls "Enslaving %s to %s" "${DEVICE}" "${MASTER}"
+       ip link set "${DEVICE}" master "${MASTER}"
+       ip link set "${DEVICE}" up
+
        exit 0
 fi
 
index 5651839c072d2025d80e39aeb76e7dbfc54ea725..3c1d648098817f452d7b5a455f51a58d32f93df7 100755 (executable)
@@ -35,20 +35,15 @@ fi
 if [ ! -f /sys/class/net/bonding_masters ]; then
        modprobe -s bonding || exit 1
        # delete default bond0
-       echo "-bond0" > /sys/class/net/bonding_masters
+       ip link del bond0 type bond
 fi
 
 # set all major variables
 setup_ip_param
 
 # create bonding master
-if ! grep -wq "${DEVICE}" /sys/class/net/bonding_masters; then
-       echo "+${DEVICE}" > /sys/class/net/bonding_masters
-       if [ $? -eq 0 ]; then
-               ip link set dev ${DEVICE} multicast ${MULTICAST} ${ARP}
-       else
-               exit 1
-       fi
+if [ ! -d "/sys/class/net/${DEVICE}" ]; then
+       ip link add "${DEVICE}" type bond
 fi
 
 # add the bits to setup driver parameters here
index 263a39cb4ed8b71ec1d51d853571bc6995da8be9..d5ac2c315da0fe582c7bb5175f8fdb260d7ba12f 100755 (executable)
@@ -105,7 +105,7 @@ init_crypto() {
                        continue
                fi
 
-               if /sbin/cryptsetup isLuks "$src" 2>/dev/null; then
+               if /sbin/cryptsetup --disable-locks isLuks "$src" 2>/dev/null; then
                        if key_is_random "$key"; then
                                nls "%s: LUKS requires non-random key, skipping" "$dst"
                                ret=1
@@ -114,7 +114,7 @@ init_crypto() {
                        if [ -n "$params" ]; then
                                nls "%s: options are invalid for LUKS partitions, ignoring them" "$dst"
                        fi
-                       /sbin/cryptsetup ${key:+-d $key} luksOpen "$src" "$dst" <&1
+                       /sbin/cryptsetup --disable-locks ${key:+-d $key} luksOpen "$src" "$dst" <&1
                fi
                rc=$?
                if [ $rc -ne 0 ]; then
@@ -144,7 +144,7 @@ halt_crypto() {
        [ -z "$dst" -o "${dst#\#}" != "$dst" ] && continue
         if [ -b "/dev/mapper/$dst" ]; then
             if LC_ALL=C /sbin/dmsetup info "$dst" | grep -q '^Open count: *0$'; then
-                /sbin/cryptsetup remove "$dst"
+                /sbin/cryptsetup --disable-locks remove "$dst"
             else
                 fnval=1
             fi