[elbe-devel] /bin/sh

Ralf Schlatterbeck rsc at runtux.com
Thu Jan 26 12:45:16 CET 2017


On Thu, Jan 26, 2017 at 11:25:12AM +0100, John Ogness wrote:
> If there are no disagreements, I would provide a patch to remove all use
> of /bin/sh for executing commands. And in particular, removing its use
> for such simple tasks as writing text files. A quick recursive search
> for "sh -c" shows some bizarre usages.

>From what I understood so far, some of it is due to running chrooted.
But there is an undocumented raw_cmd-Feature that doesn't use a shell on
the target (it *does* seem to use a shell for calling the chroot
command, though afair and that usage of the shell could be removed).

I'm using this for a busybox-based system to create the busybox links
like so:

    <finetuning>
          <raw_cmd>/install_bb.sh</raw_cmd>

And the install_bb has
#!/bin/busybox sh
...
for i in $(busybox --list)
    do something

Contrary to the original busybox example we don't need to temporarily
copy a shell with associated libs to the target and remove it later.

So I guess sometimes it is very convenient to be able to use
shell-commands with pipelines, redirection etc and resort to raw_cmd if
you don't want a shell. The raw_cmd feature should be (better?)
documented, I've found it by accident.

Ralf
-- 
Dr. Ralf Schlatterbeck                  Tel:   +43/2243/26465-16
Open Source Consulting                  www:   http://www.runtux.com
Reichergasse 131, A-3411 Weidling       email: office at runtux.com




More information about the elbe-devel mailing list