Changeset 2653

Show
Ignore:
Timestamp:
05/24/07 12:23:28 (2 years ago)
Author:
tg
Message:

• base-files/files/etc/init.d/rcK, base-files/files/etc/init.d/rcS:

do correct shebang processing, like the BSD kernel and mksh: get
first line of script to run if it begins with "#!", strip that and
any leading space/tab off, then get shell name (terminates with
space/tab/end of string) and shell argument quoting according to
unix common proceedings; use /bin/sh as interpreter if none could
be found

• mk/package.mk: ensure all init scripts are 0755 by default
• busybox: flesh out inetd init script, so that all init scripts in

FreeWRT either can be found with -path \*/init.d/\* or -name \*.init

• other packages: add #!/bin/sh shebang line to init scripts¹, bump dashver

¹) change this to /bin/ash if you use ash-specific features that mksh

can also do; never use ash-specific features that mksh cannot do (are
there any?), change to /bin/mksh if you use mksh-specific features
and add a run-time dependency on mksh in that case

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/freewrt/mk/package.mk

    r2611 r2653  
    107107$$(IPKG_$(1)): $$(IDIR_$(1))/CONTROL/control $${_FAKE_COOKIE} 
    108108        $${RSTRIP} $${IDIR_$(1)} 
     109        cd $${IDIR_$(1)}; for script in etc/init.d/*; do \ 
     110                [[ -e $$$$script ]] || break; \ 
     111                chmod 0755 "$$$$script"; \ 
     112        done 
    109113        @mkdir -p $${PACKAGE_DIR} '$${STAGING_PARENT}/pkg' \ 
    110114            '$${STAGING_DIR}/scripts' 
  • trunk/freewrt/package/aiccu/Makefile

    r2642 r2653  
    99PKG_NAME:=              aiccu 
    1010PKG_VERSION:=           20070115 
    11 PKG_RELEASE:=           4 
     11PKG_RELEASE:=           5 
    1212PKG_MD5SUM:=            c9bcc83644ed788e22a7c3f3d4021350 
    1313 
  • trunk/freewrt/package/aiccu/files/aiccu.init

    r2642 r2653  
     1#!/bin/sh 
    12#FWINIT 60 
    23. /etc/rc.conf 
  • trunk/freewrt/package/asterisk-12/Makefile

    r2642 r2653  
    99PKG_NAME:=              asterisk 
    1010PKG_VERSION:=           1.2.18 
    11 PKG_RELEASE:=           2 
     11PKG_RELEASE:=           3 
    1212PKG_MD5SUM:=            84d16eb0a94a3da883cb9bd6cb8a3fca 
    1313PKG_SOURCE_URL:=        http://ftp.digium.com/pub/asterisk/old-releases \ 
  • trunk/freewrt/package/asterisk-12/files/asterisk.init

    r2642 r2653  
     1#!/bin/sh 
    12#FWINIT 60 
    23. /etc/rc.conf 
  • trunk/freewrt/package/asterisk/Makefile

    r2642 r2653  
    99PKG_NAME:=              asterisk 
    1010PKG_VERSION:=           1.4.0 
    11 PKG_RELEASE:=           4 
     11PKG_RELEASE:=           5 
    1212PKG_MD5SUM:=            b4586be9bf00d438d6a53d408ba247d4 
    1313PKG_SOURCE_URL:=        http://ftp.digium.com/pub/asterisk/ \ 
  • trunk/freewrt/package/asterisk/files/asterisk.init

    r2642 r2653  
     1#!/bin/sh 
    12#FWINIT 60 
    23. /etc/rc.conf 
  • trunk/freewrt/package/avahi/Makefile

    r2642 r2653  
    99PKG_NAME:=              avahi 
    1010PKG_VERSION:=           0.6.16 
    11 PKG_RELEASE:=           4 
     11PKG_RELEASE:=           5 
    1212PKG_MD5SUM:=            3cbc460bbd55bae35f7b57443c063640 
    1313PKG_SOURCE_URL:=        http://avahi.org/download 
  • trunk/freewrt/package/avahi/files/avahi-daemon.init

    r2642 r2653  
     1#!/bin/sh 
    12#FWINIT 75 
    2 #!/bin/sh 
    33 
    44. /etc/rc.conf 
  • trunk/freewrt/package/axtls/Makefile

    r2642 r2653  
    99PKG_NAME:=              axtls 
    1010PKG_VERSION:=           1.1.0 
    11 PKG_RELEASE:=           5 
     11PKG_RELEASE:=           6 
    1212PKG_MD5SUM:=            4a834edc93f46fdca4f9c93ec665376e 
    1313PKG_SOURCE:=            axTLS-${PKG_VERSION}.tar.gz 
  • trunk/freewrt/package/axtls/files/axhttpd.init

    r2642 r2653  
     1#!/bin/sh 
    12#FWINIT 80 
    23. /etc/rc.conf 
  • trunk/freewrt/package/base-files-arch/Makefile

    r2518 r2653  
    1010PKG_NAME:=              base-files-arch 
    1111PKG_VERSION:=           1.0 
    12 PKG_RELEASE:=           6 
     12PKG_RELEASE:=           7 
    1313NO_DISTFILES:=          1 
    1414PKG_ID=                 ${BOARD}-${KERNEL}-${DEVICE}-${FS} 
  • trunk/freewrt/package/base-files/Makefile

    r2648 r2653  
    1010PKG_NAME:=              base-files 
    1111PKG_VERSION:=           1.0 
    12 PKG_RELEASE:=           28 
     12PKG_RELEASE:=           29 
    1313WRKDIST=                ${WRKDIR}/base-files 
    1414NO_DISTFILES:=          1 
  • trunk/freewrt/package/base-files/files/etc/init.d/boot

    r2485 r2653  
     1#!/bin/sh 
    12#FWINIT 10 
    23. /etc/functions.sh 
  • trunk/freewrt/package/base-files/files/etc/init.d/done

    r2485 r2653  
     1#!/bin/sh 
    12#FWINIT 98 
    23case $1 in 
  • trunk/freewrt/package/base-files/files/etc/init.d/hotplug

    r2566 r2653  
     1#!/bin/sh 
    12#FWINIT 80 
    23case $1 in 
  • trunk/freewrt/package/base-files/files/etc/init.d/rcK

    r2498 r2653  
    66            sort -rnk2 | \ 
    77            while read line; do 
    8                 /bin/sh ${line%%:*} autostop 2>&1 
     8                shebang=$(sed -n '1s/^#![        ]*//p' ${line%%:*}) 
     9                case $shebang in 
     10                *[\     \ ]*) shebang=\'$(echo X"$shebang" | sed \ 
     11                    -e 's/^X//' -e "s/'/'\\\\''/g" \ 
     12                    -e 's/^\([^  ][^     ]*\)[   ]*$/\1/' \ 
     13                    -e 's/^\([^  ][^     ]*\)[   ][      ]*\(..*\)$/\1 \2/' \ 
     14                    -e 's/^\([^ ][^ ]*\) /\1'\'' '\''/')\' ;; 
     15                esac 
     16                ${shebang:-/bin/sh} ${line%%:*} autostop 2>&1 
    917        done 
    1018} | logger -s -p 6 -t '' & 
  • trunk/freewrt/package/base-files/files/etc/init.d/rcS

    r2485 r2653  
    55            sort -nk2 | \ 
    66            while read line; do 
    7                 /bin/sh ${line%%:*} autostart 2>&1 
     7                shebang=$(sed -n '1s/^#![        ]*//p' ${line%%:*}) 
     8                case $shebang in 
     9                *[\     \ ]*) shebang=\'$(echo X"$shebang" | sed \ 
     10                    -e 's/^X//' -e "s/'/'\\\\''/g" \ 
     11                    -e 's/^\([^  ][^     ]*\)[   ]*$/\1/' \ 
     12                    -e 's/^\([^  ][^     ]*\)[   ][      ]*\(..*\)$/\1 \2/' \ 
     13                    -e 's/^\([^ ][^ ]*\) /\1'\'' '\''/')\' ;; 
     14                esac 
     15                ${shebang:-/bin/sh} ${line%%:*} autostart 2>&1 
    816        done 
    917        test -e /etc/rc.local && (/bin/sh /etc/rc.local) 2>&1 
  • trunk/freewrt/package/bind/Makefile

    r2642 r2653  
    99PKG_NAME:=              bind 
    1010PKG_VERSION:=           9.3.4 
    11 PKG_RELEASE:=           4 
     11PKG_RELEASE:=           5 
    1212PKG_MD5SUM:=            df5417e7e7cf017fa28b65d0a3d6e999 
    1313PKG_SOURCE_URL:=        ftp://ftp.isc.org/isc/bind9/${PKG_VERSION}/ 
  • trunk/freewrt/package/bind/files/named.init

    r2642 r2653  
     1#!/bin/sh 
    12#FWINIT 60 
    23. /etc/rc.conf 
  • trunk/freewrt/package/bitchx/Makefile

    r2642 r2653  
    99PKG_NAME:=              bitchx 
    1010PKG_VERSION:=           1.1 
    11 PKG_RELEASE:=           6 
     11PKG_RELEASE:=           7 
    1212PKG_MD5SUM:=            611d2dda222f00c10140236f4c331572 
    1313PKG_SOURCE_URL:=        http://bitchx.org/files/source/ 
  • trunk/freewrt/package/bitchx/files/bitchx.init

    r2642 r2653  
     1#!/bin/sh 
    12#FWINIT 90 
    23. /etc/rc.conf 
  • trunk/freewrt/package/bitlbee/Makefile

    r2642 r2653  
    99PKG_NAME:=              bitlbee 
    1010PKG_VERSION:=           1.0.3 
    11 PKG_RELEASE:=           2 
     11PKG_RELEASE:=           3 
    1212PKG_MD5SUM:=            e46682d54cbd6265dd4436b3b6838d63 
    1313PKG_SOURCE_URL:=        http://get.bitlbee.org/src \ 
  • trunk/freewrt/package/bitlbee/files/bitlbee.init

    r2642 r2653  
     1#!/bin/sh 
    12#FWINIT 80 
    23. /etc/rc.conf 
  • trunk/freewrt/package/bluez-utils/Makefile

    r2642 r2653  
    99PKG_NAME:=              bluez-utils 
    1010PKG_VERSION:=           3.9 
    11 PKG_RELEASE:=           4 
     11PKG_RELEASE:=           5 
    1212PKG_MD5SUM:=            023a5e6a436f86a28baeec91e4c62736 
    1313PKG_SOURCE_URL:=        http://bluez.sourceforge.net/download 
  • trunk/freewrt/package/bluez-utils/files/bluez.init

    r2642 r2653  
     1#!/bin/sh 
    12#FWINIT 90 
    23. /etc/rc.conf 
  • trunk/freewrt/package/broadcom-watchbutton/Makefile

    r2642 r2653  
    99PKG_NAME:=              broadcom-watchbutton 
    1010PKG_VERSION:=           1.0 
    11 PKG_RELEASE:=           5 
     11PKG_RELEASE:=           6 
    1212NO_DISTFILES:=          1 
    1313 
  • trunk/freewrt/package/broadcom-watchbutton/files/watchbutton.init

    r2642 r2653  
     1#!/bin/sh 
    12#FWINIT 50 
    23. /etc/rc.conf 
  • trunk/freewrt/package/busybox/Makefile

    r2644 r2653  
    99PKG_NAME:=              busybox 
    1010PKG_VERSION:=           1.4.2 
    11 PKG_RELEASE:=           14 
     11PKG_RELEASE:=           15 
    1212PKG_MD5SUM:=            b4c61fb15642be9dde20e8493788c585 
    1313PKG_SOURCE:=            $(PKG_NAME)-$(PKG_VERSION).tar.bz2 
     
    5353        $(INSTALL_DIR) $(IDIR_BUSYBOX)/etc/network/if-down.d 
    5454        $(INSTALL_DIR) $(IDIR_BUSYBOX)/etc/network/if-post-down.d 
     55ifneq (${BUSYBOX_CONFIG_INETD},) 
     56        ${INSTALL_DATA} files/inetd.init ${IDIR_BUSYBOX}/etc/init.d/inetd 
     57        echo 'add_rcconf inetd' >>${IDIR_BUSYBOX}/CONTROL/postinst 
     58endif 
    5559ifneq (${BUSYBOX_CONFIG_APP_UDHCPD},) 
    5660        ${INSTALL_DATA} ./files/udhcpd.init \ 
  • trunk/freewrt/package/busybox/files/crond.init

    r2642 r2653  
     1#!/bin/sh 
    12#FWINIT 60 
    23. /etc/rc.conf 
  • trunk/freewrt/package/busybox/files/network.init

    r2642 r2653  
     1#!/bin/sh 
    12#FWINIT 40 
    23. /etc/rc.conf 
  • trunk/freewrt/package/busybox/files/syslog.init

    r2642 r2653  
     1#!/bin/sh 
    12#FWINIT 05 
    23. /etc/rc.conf 
  • trunk/freewrt/package/busybox/files/udhcpd.init

    r2642 r2653  
     1#!/bin/sh 
    12#FWINIT 60 
    23. /etc/rc.conf 
  • trunk/freewrt/package/busybox/ipkg/busybox.postinst

    r2644 r2653  
    55add_rcconf crond crond NO 
    66add_rcconf syslogd syslogd YES 
    7 add_rcconf syslogd_flags syslogd_flags "\"-C16\"" 
    8 (if test -e $IPKG_INSTROOT/usr/sbin/inetd; then 
    9         add_rcconf inetd 
    10         cd $IPKG_INSTROOT/etc/init.d; test ! -e inetd && cat >inetd <<-'EOF' 
    11                 #FWINIT 41 
    12                 . /etc/rc.conf 
    13                 case $1 in 
    14                 autostart) 
    15                         test x"$inetd" = x"NO" && exit 0 
    16                         test -e /etc/inetd.conf || exit 0 
    17                         exec sh $0 start 
    18                         ;; 
    19                 start) 
    20                         /usr/sbin/inetd 
    21                         ;; 
    22                 autostop) 
    23                         ;; 
    24                 stop) 
    25                         killall inetd 
    26                         ;; 
    27                 restart) 
    28                         sh $0 stop 
    29                         exec sh $0 start 
    30                         ;; 
    31                 *) 
    32                         echo "Usage: $0 {start | stop | restart}" 
    33                         exit 1 
    34                         ;; 
    35                 esac 
    36                 exit $? 
    37         EOF 
    38 fi) 
     7add_rcconf syslogd_flags syslogd_flags '"C16"' 
  • trunk/freewrt/package/chillispot/Makefile

    r2642 r2653  
    99PKG_NAME:=              chillispot 
    1010PKG_VERSION:=           1.0 
    11 PKG_RELEASE:=           5 
     11PKG_RELEASE:=           6 
    1212PKG_MD5SUM:=            997827a9302a85920cfbc1334092ac0c 
    1313PKG_SOURCE_URL:=        http://www.chillispot.org/download 
  • trunk/freewrt/package/chillispot/files/chillispot.init

    r2642 r2653  
     1#!/bin/sh 
    12#FWINIT 70 
    23. /etc/rc.conf 
  • trunk/freewrt/package/collectd/Makefile

    r2642 r2653  
    99PKG_NAME:=              collectd 
    1010PKG_VERSION:=           3.9.4 
    11 PKG_RELEASE:=           5 
     11PKG_RELEASE:=           6 
    1212PKG_MD5SUM:=            1e5cab09394e0e5a1e5b3f8c923858a3 
    1313PKG_SOURCE_URL:=        http://verplant.org/collectd/files 
  • trunk/freewrt/package/collectd/files/collectd.init

    r2642 r2653  
     1#!/bin/sh 
    12#FWINIT 75 
    23. /etc/rc.conf 
  • trunk/freewrt/package/cups/Makefile

    r2642 r2653  
    99PKG_NAME:=              cups 
    1010PKG_VERSION:=           1.2.11 
    11 PKG_RELEASE:=           2 
     11PKG_RELEASE:=           3 
    1212PKG_MD5SUM:=            2742f1eec38abb04472b86627da8e493 
    1313PKG_SOURCE:=            ${PKG_NAME}-${PKG_VERSION}-source.tar.bz2 
  • trunk/freewrt/package/cups/files/cupsd.init