[OE-core] [PATCH 1/1] sysvinit: start .sh scripts correctly

Burton, Ross ross.burton at intel.com
Tue Feb 26 11:04:39 UTC 2013


On 26 February 2013 01:39,  <Qi.Chen at windriver.com> wrote:
> -
> -  case "$1" in
> -       *.sh)
> -               # Source shell script for speed.
> -               (
> -                       trap - INT QUIT TSTP
> -                       scriptname=$1
> -                       shift
> -                       . $scriptname
> -               )
> -               ;;
> -       *)
> -               "$@"
> -               ;;
> -  esac
> +  "$@"
>    startup_progress
>  }

NACK.

By "fix" you mean "remove the tested and proven optimisation"? The "if
.sh use ." test was designed to speed up booting by not forking a new
bash, and it's been demonstrated to have a noticeable difference on
slower hardware.

You can pass arguments to "." as this little test demonstrates:

$ cat service.sh
echo My arguments are "$@"
$ . service.sh foo bar
My arguments are foo bar

The "shift" command shows that passing the arguments to the script was
the intention, and a few lines of micro-test demonstrate that it
*should* work:

$ cat rc.sh
startup() {
    scriptname=$1
    shift
    . $scriptname
}
startup ./service.sh start
$ busybox sh ./rc.sh
My arguments are start

So, something else is going wrong.

Ross




More information about the Openembedded-core mailing list