[elbe-devel] busybox: Use raw_cmd?

Ralf Schlatterbeck rsc at runtux.com
Sat Oct 1 15:41:05 CEST 2016


I'm currently developing a root fs image based on busybox.
I noticed that the example armel-rescue-busybox-cpio.xml that gets
installed with elbe-doc is quite complicated (and didn't work for me
probably because of wrong versions of libs etc) because it first copies
dash, ln + related libs over to the target and later deletes them again
(because the target at this point doesn't have a shell to execute the
script).

I wanted to suggest something that doesn't use a shell to invoke
commands in the chroot of the target and noticed this already exists,
there is an (undocumented?) "raw_cmd". With this no shell is used in the
chroot (The python Popen is still using a shell but this is invoked
outside the chroot when calling chroot).

My solution uses:
<raw_cmd>/install_bb.sh</raw_cmd>
instead of <command> with a script that uses the busybox shell and
busybox ln:

#!/bin/busybox sh
for i in $(busybox --list)
do
   busybox ln bin/busybox bin/$i
done
ln bin/busybox sbin/init

I'm linking busybox to /sbin/init because my kernel parameters use this
and I didn't want to change the path to init -- note also that the last
line already has a working 'ln' after the busybox links exist.

So I suggest to change the example and make "raw_cmd" a documented
feature.

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