From 28d383e39c38077bff551e5c2605ad0f63872358 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Thu, 15 Mar 2012 21:20:29 +0000 Subject: remove init.d scripts an udhcpcd script Those are provided by busybox-initscripts --- Makefile | 12 +++---- conf.d/tuntap | 3 -- conf.d/vlan | 28 --------------- default.script | 108 -------------------------------------------------------- init.d/Makefile | 20 ----------- init.d/bridge | 38 -------------------- init.d/rc.local | 14 -------- init.d/rcK | 3 -- init.d/rcL | 4 --- init.d/rcS | 1 - init.d/tuntap | 46 ------------------------ init.d/vlan | 65 ---------------------------------- 12 files changed, 4 insertions(+), 338 deletions(-) delete mode 100644 conf.d/tuntap delete mode 100644 conf.d/vlan delete mode 100644 default.script delete mode 100644 init.d/Makefile delete mode 100755 init.d/bridge delete mode 100755 init.d/rc.local delete mode 100755 init.d/rcK delete mode 100644 init.d/rcL delete mode 100644 init.d/rcS delete mode 100755 init.d/tuntap delete mode 100755 init.d/vlan diff --git a/Makefile b/Makefile index a3e04a7..769e917 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ VERSION=2.1.1 PV =$(PACKAGE)-$(VERSION) TARBALL =$(PV).tar.bz2 -SUBDIRS =src init.d +SUBDIRS =src GENERATED_FILES := shadow @@ -22,12 +22,10 @@ ETC_FILES = TZ \ shells \ sysctl.conf \ -CONFD_FILES = $(addprefix conf.d/, tuntap vlan) -UDHCPC_FILES =default.script MODPROBED_FILES =aliases.conf blacklist.conf i386.conf kms.conf PROFILED_FILES =color_prompt CRONTABS =crontab -DISTFILES =$(ETC_FILES) $(UDHCPC_FILES) $(MODPROBED_FILES) Makefile +DISTFILES =$(ETC_FILES) $(MODPROBED_FILES) Makefile all: $(GENERATED_FILES) for i in $(SUBDIRS) ; do \ @@ -57,6 +55,7 @@ install: $(GENERATED_FILES) etc/apk \ etc/conf.d \ etc/crontabs \ + etc/init.d \ etc/modprobe.d \ etc/profile.d \ etc/network/if-down.d \ @@ -83,7 +82,7 @@ install: $(GENERATED_FILES) usr/local/bin \ usr/local/lib \ usr/local/share \ - usr/share/udhcpc \ + usr/share \ var/cache/misc \ var/lib/misc \ var/lock/subsys \ @@ -99,8 +98,6 @@ install: $(GENERATED_FILES) done install -m 0644 $(ETC_FILES) $(GENERATED_FILES) $(DESTDIR)/etc chmod 600 $(DESTDIR)/etc/shadow - install -m 0644 $(CONFD_FILES) $(DESTDIR)/etc/conf.d - install -m 0755 $(UDHCPC_FILES) $(DESTDIR)/usr/share/udhcpc install -m 0755 $(MODPROBED_FILES) $(DESTDIR)/etc/modprobe.d install -m 0755 $(PROFILED_FILES) $(DESTDIR)/etc/profile.d mv $(DESTDIR)/etc/crontab $(DESTDIR)/etc/crontabs/root @@ -118,7 +115,6 @@ $(TARBALL): $(DISTFILES) $(SUBDIRS) done cp $(DISTFILES) $(PV) mkdir $(PV)/conf.d - cp $(CONFD_FILES) $(PV)/conf.d/ rsync -Cr $(SUBDIRS) $(PV) tar -cjf $@ $(PV) rm -r $(PV) diff --git a/conf.d/tuntap b/conf.d/tuntap deleted file mode 100644 index 8491396..0000000 --- a/conf.d/tuntap +++ /dev/null @@ -1,3 +0,0 @@ -# Specify all tap devices -#DEVICES="tap0 tap1" - diff --git a/conf.d/vlan b/conf.d/vlan deleted file mode 100644 index 9635939..0000000 --- a/conf.d/vlan +++ /dev/null @@ -1,28 +0,0 @@ -# vlan configuration - -# NAME_TYPE (set_name_type) can be on of: -# VLAN_PLUS_VID (vlan0005), VLAN_PLUS_VID_NO_PAD (vlan5), -# DEV_PLUS_VID (eth0.0005), DEV_PLUS_VID_NO_PAD (eth0.5) -# -NAME_TYPE="DEV_PLUS_VID_NO_PAD" - -# specify VLANS as: interface-name.vlan-id -# for example: eth0.1 eth1.4 -# -#VLANS="eth0.1 eth1.4" -VLANS="" - -# Set the egress and ingress maps (set_egress_map, set_ingress_map) in -# the following format: -# vlan-name=skb_priority[:vlan_qos] -# -# EGRESS_MAP="vlan1=2:3 vlan2=3:4" -# -EGRESS_MAP="" -INGRESS_MAP="" - -# Reorder the ethernet header on specified vlans. (set_flag 1) -# REORDER_HDR="vlan1 vlan2" - -REORDER_HDR="" - diff --git a/default.script b/default.script deleted file mode 100644 index c6cfbc5..0000000 --- a/default.script +++ /dev/null @@ -1,108 +0,0 @@ -#!/bin/sh - -# script for udhcpc -# Copyright (c) 2008 Natanael Copa - -UDHCPC="/etc/udhcpc" -UDHCPC_CONF="$UDHCPC/udhcpc.conf" - -RESOLV_CONF="/etc/resolv.conf" -[ -f $UDHCPC_CONF ] && . $UDHCPC_CONF - -export broadcast -export dns -export domain -export interface -export ip -export mask -export metric -export router -export subnet - -export PATH=/usr/bin:/bin:/usr/sbin:/sbin - -run_scripts() { - local dir=$1 - if [ -d $dir ]; then - for i in $dir/*; do - [ -f $i ] && $i - done - fi -} - -deconfig() { - ip addr flush dev $interface -} - -routes() { - [ -z "$router" ] && return - local gw metric - while ip route del default via dev $interface 2>/dev/null; do - : - done - metric=0 - for gw in $router; do - route add default gw $gw dev $interface metric $metric - metric=$(( $metric + 1 )) - done -} - -resolvconf() { - local i - if [ "$RESOLV_CONF" = "no" ] || [ "$RESOLV_CONF" = "NO" ] \ - || [ -z "$RESOLV_CONF" ]; then - return - fi - echo -n > "$RESOLV_CONF" - [ -n "$domain" ] && echo "search $domain" >> "$RESOLV_CONF" - for i in $dns; do - echo "nameserver $i" >> "$RESOLV_CONF" - done -} - -bound() { - ip addr add $ip/$mask dev $interface - ip link set dev $interface up - routes - resolvconf -} - -renew() { - if ! ip addr show dev $interface | grep $ip/$mask; then - ip addr flush dev $interface - ip addr add $ip/$mask dev $interface - fi - - local i - for i in $router; do - if ! ip route show | grep ^default | grep $i; then - routes - break - fi - done - - if ! grep "^search $domain"; then - resolvconf - return - fi - for i in $dns; do - if ! grep "^nameserver $i"; then - resolvconf - return - fi - done -} - -case "$1" in - deconfig|renew|bound) - run_scripts $UDHCPC/pre-$1 - $1 - run_scripts $UDHCPC/post-$1 - ;; - *) - echo "Error: this script should be called from udhcpc" >&2 - exit 1 - ;; -esac -exit 0 - diff --git a/init.d/Makefile b/init.d/Makefile deleted file mode 100644 index 01b3534..0000000 --- a/init.d/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -SCRIPTS = rcL \ - rcK \ - rcS \ - tuntap \ - vlan - -all: - -install: $(SCRIPTS) - install -m 0755 -d $(DESTDIR)/etc - install -m 0755 -d $(DESTDIR)/etc/init.d - - for i in $(SCRIPTS) ; do \ - install -m 755 -D $$i $(DESTDIR)/etc/init.d/$$i ;\ - done - -clean: - rm -f *~ - -.PHONY: all clean diff --git a/init.d/bridge b/init.d/bridge deleted file mode 100755 index bfbf057..0000000 --- a/init.d/bridge +++ /dev/null @@ -1,38 +0,0 @@ -#!/sbin/runscript - -BRCTL=`which brctl 2>/dev/null` - -start() { - # abort if brctl does not exist - for brspec in $BRIDGES; do - retcode=0 - br=`echo $brspec | cut -d= -f1` - ebegin "Setting up bridge $br" - if [ -z "$BRCTL" ] ; then - eerror "Need bridge-utils to be able to set up $br" - retcode=1 - else - brctl addbr $br || retcode=1 - bridge_ifs=`echo "$BRIDGES" | sed 's/.*=//; s/\+/ /g'` - for iface in $bridge_ifs ; do - # set if in promisc mode - ifconfig $iface 0.0.0.0 promisc up || retcode=1 - brctl addif $br $iface || retcode=1 - done - fi - eend $retcode - done - -} - -stop() { - which brctl > /dev/null 2>&1 || return 1 - for brspec in $BRIDGES; do - br=`echo $brspec | cut -d= -f1` - ebegin "Shutting down bridge $br" - brctl delbr $br - eend $? - done - - -} diff --git a/init.d/rc.local b/init.d/rc.local deleted file mode 100755 index ff36d17..0000000 --- a/init.d/rc.local +++ /dev/null @@ -1,14 +0,0 @@ -#!/sbin/runscript - -start() { - if [ -f /etc/rc.local ] ; then - ebegin "Running local boot script /etc/rc.local" - /etc/rc.local - eend $? - fi -} - -stop() { - return 0 -} - diff --git a/init.d/rcK b/init.d/rcK deleted file mode 100755 index a8e18d3..0000000 --- a/init.d/rcK +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -/sbin/rc shutdown diff --git a/init.d/rcL b/init.d/rcL deleted file mode 100644 index 9fd5cdf..0000000 --- a/init.d/rcL +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -/sbin/rc sysinit || exit 1 -/sbin/rc default -exit 0 diff --git a/init.d/rcS b/init.d/rcS deleted file mode 100644 index 1a24852..0000000 --- a/init.d/rcS +++ /dev/null @@ -1 +0,0 @@ -#!/bin/sh diff --git a/init.d/tuntap b/init.d/tuntap deleted file mode 100755 index 667acb9..0000000 --- a/init.d/tuntap +++ /dev/null @@ -1,46 +0,0 @@ -#!/sbin/runscript - -OPENVPN=`which openvpn 2>/dev/null` -TUNCTL=`which tunctl 2>/dev/null` - -if [ -x "$OPENVPN" ] ; then - CREATETAP="$OPENVPN --mktun --dev" -else - CREATETAP="$TUNCTL -t" -fi - - -start() { - # verify tun/tap support in kernel - if ! [ -e /dev/net/tun ] ; then - modprobe tun 2>&1 >/dev/null && sleep 1 - if ! [ -e /dev/net/tun ] ; then - eerror "Tun/Tap support is not present in kernel" - return 1 - fi - fi - - # verify if openvpn is present - if [ -x "$OPENVPN" ] ; then - MKTUNTAP="$OPENVPN --mktun --dev" - elif [ -x "$TUNCTL" ] ; then - MKTUNTAP="$TUNCTL -t" - else - eerror "Needs openvpn or tunctl to create Tun/Tap devices" - return 1 - fi - - # create devices - for iface in $DEVICES ; do - ebegin "Creating Tun/Tap interface $iface" - $MKTUNTAP $iface >/dev/null - eend $? - done -} - -stop() { - ebegin "Destroying Tun/Tap interfaces" - rmmod tun 2>/dev/null - eend $? -} - diff --git a/init.d/vlan b/init.d/vlan deleted file mode 100755 index 0c7b1cb..0000000 --- a/init.d/vlan +++ /dev/null @@ -1,65 +0,0 @@ -#!/sbin/runscript - -VCONF=`which vconfig 2>/dev/null` || exit - -# set egress_map or ingress_map. -# $1 = egress | ingress -# $2 ... = vlan params -set_map() { - local i type=$1 - shift - for i in $* ; do - local dev param skb qos - dev=${i%=*} - param=${i#*=} - skb_prio=${param%:*} - qos=${param#$skb_prio} - qos=${qos#:} - $VCONF set_${type}_map $dev $skb_prio $qos >/dev/null - done -} - -start() { - modprobe 8021q 2>/dev/null - - # set nametype before creating the vlan's - [ x$NAME_TYPE != x ] && $VCONF set_name_type "$NAME_TYPE" >/dev/null - - # create the vlans - for vlan in $VLANS; do - retcode=0 - iface=${vlan%.*} - vlan_id=${vlan#*.} - ebegin "Setting up vlan $vlan" - if [ -z "$VCONF" ] ; then - eerror "Need vconfig to be able to set up $vlan" - retcode=1 - else - ip link set $iface up - $VCONF add $iface $vlan_id >/dev/null - retcode=$? - fi - eend $retcode - done - - # set the egress_map and ingress_map - set_map "egress" $EGRESS_MAP - set_map "ingress" $INGRESS_MAP - - # set the reorder header - for vlan in $REORDER_HDR ; do - $VCONF set_flag $vlan 1 >/dev/null - done -} - -stop() { - # remove all vlans - local vlan - for vlan in `awk '{ print $1 }' /proc/net/vlan/config`; do - if [ -f /proc/net/vlan/$vlan ] ; then - ebegin "Removing vlan $vlan" - $VCONF rem $vlan >/dev/null - eend $? - fi - done -} -- cgit v1.2.3