Jump to content

BusyBox Binary SELinux Support Enabled


Guest android_cat

Recommended Posts

Guest android_cat

I am working on porting SELinux to my Evo 4G based off of the work done in Securing Android-Powered Mobile Devices Using SELinux I have tried compiling Busy Box after enabling support for SE Linux.

When I cross compile busybox with ARM using the command

LDFLAGS="--static" CFLAGS="--static" make CROSS_COMPILE=arm-none-linux-gnueabi-

I get the following error:

CC applets/applets.o

In file included from include/busybox.h:10,

from applets/applets.c:11:

include/libbb.h:60: fatal error: selinux/selinux.h: No such file or directory

compilation terminated.

make[1]: *** [applets/applets.o] Error 1

make: *** [applets_dir] Error 2

--Update--

I fixed the issue with the header files by using the absolute file path for each header file that caused an error, but now I need to figure out how to get the lselinux library for ARM. I tried using the ones in my usr/lib, but I get errors saying that they are not compatible and will be skipped.

When I just use make, I get the following output at the end:

LINK busybox_unstripped

Trying libraries: crypt m selinux sepol

Library crypt is not needed, excluding it

Library m is needed, can't exclude it (yet)

Library selinux is needed, can't exclude it (yet)

Library sepol is needed, can't exclude it (yet)

Library m is needed, can't exclude it (yet)

Library selinux is needed, can't exclude it (yet)

Library sepol is needed, can't exclude it (yet)

Final link with: m selinux sepol

I do get a busybox file when just using the command Make, but when I put it on my Evo and try to install I get the following

ELF,4h: not found

,4h: not found

4h: not found

h: not found

./busybox: 5: Syntax error: "(" unexpected

Edited by android_cat
Link to comment
Share on other sites

Guest Vu Anh Duy

Hi friend,

I am also working on poring SELinux on Android.

I got this error too.

Fortunately, I have just solved it.

This is what I have done:

1) Download libsepol and libselinux at http://userspace.selinuxproject.org/trac/wiki/Releases (libselinux requires libsepol)

2) Cross compile them (I'm using angstrom toolchain so please modify the code to suit your toolchain)

Code: make CC=/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/cc LIBDIR=<angstrom-toolchain dir>/arm/arm-angstrom-linux-gnueabi/lib LDFLAGS=”--static” CFLAGS=”--static”

3) Copy libsepol.a, libselinux.a, headers of libsepol and libselinux to your toolchain lib and include directory.

4) Cross compile busybox

--> Done

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.