[PROJECT][PORT] GNU CoreUtils on Android v1

Search This thread

alireza7991

Senior Member
Sep 2, 2012
772
2,321
26
Shahrekord
alirezafn.net
@alireza7991, is an APP for this awesome toolset planned? ;)

I need help of an App Developer., since I am building all of my project on my phone and I do not have access to my PC. building am App on phone is impossible (?).

I got some good news! :

1- I've moved to linaro gcc 4.8.2 (HF ABI)
2- I've ported Linux Utils also, it has ~90 Utils (fdisk, m4,...) then 90+103=193 !!!!!!!!!! so we will turn our Android into a powerful linux distro!
3- I've received a mail from the GNU coreutils maintainer!!!!

To do:

1-working on Aroma Installer/Android App to let users install which utils they want.
2-Merging ls and uname utils from KlibC sources.
 
Last edited:

SecUpwN

Senior Member
Jun 12, 2012
2,086
645
DEUTSCHLAND!
secupwn.github.io
I need help of an App Developer., since I am building all of my project on my phone and I do not have access to my PC. building am App on phone is impossible (?).
If you know how to code, your perfect companion for App-development on the go is AIDE.


I got some good news! :

1- I've moved to linaro gcc 4.8.2 (HF ABI)
2- I've ported Linux Utils also, it has ~90 Utils (fdisk, m4,...) then 90+103=193 !!!!!!!!!! so we will turn our Android into a powerful linux distro!
3- I've received a mail from the GNU coreutils maintainer!!!!
Awesome, dude! Keep it up and craft a shiny app for us lazy a$$es! ;)
 
Last edited:
  • Like
Reactions: RayySP and M0RT3ZA

Xoib

Senior Member
Feb 25, 2013
287
34
Does the utils got via this port access to dns resolver of the system ?
By that I mean, with the classic busybox the tools can't solve dns name, it's very annoying. So with this method I can use wget, ping etc. without the need to give them directly the IP but the dns name ?
 

alireza7991

Senior Member
Sep 2, 2012
772
2,321
26
Shahrekord
alirezafn.net
wince

Does the utils got via this port access to dns resolver of the system ?
By that I mean, with the classic busybox the tools can't solve dns name, it's very annoying. So with this method I can use wget, ping etc. without the need to give them directly the IP but the dns name ?

since these utils are linked with musl libc, I guess network related functions would need some effort. but, I have not tested them yet!
 

Androguide.fr

Account currently disabled
Jul 21, 2012
2,056
7,236
GB
meettomy.site
I need help of an App Developer., since I am building all of my project on my phone and I do not have access to my PC. building am App on phone is impossible (?).

I got some good news! :

1- I've moved to linaro gcc 4.8.2 (HF ABI)
2- I've ported Linux Utils also, it has ~90 Utils (fdisk, m4,...) then 90+103=193 !!!!!!!!!! so we will turn our Android into a powerful linux distro!
3- I've received a mail from the GNU coreutils maintainer!!!!

To do:

1-working on Aroma Installer/Android App to let users install which utils they want.
2-Merging ls and uname utils from KlibC sources.
First off, great work, especially if you built it all from your phone :good:
I'll be glad to help you with the app if you want (I might not be able to start working on it before this weekend though).
I'll just need you to give me the right bash commands to list all the applets and to symlink an individual applet, then I can take it from here.

I was also wondering, do you allow Rom developers to include your distribution of CoreUtils in their builds ?

PS: as @SecUpwN said, AIDE could prove useful to you for working with C/C++ (including NDK stuff) and Android app development directly on your device, it's really well made.
 
Last edited:

mad_ady

Senior Member
May 8, 2008
434
262
This looks like a great project! Congratulations to the dev! I tried flashing the zip but it exited with error 7. I'm using neatrom (derived from slimkat) 4.4.2 and cwm-touch 6.0.4.6. I'm guessing it might be related to the updater-script syntax which I heard changed recently, right? I will copy the files manually in the mean time.

---------- Post added at 04:09 PM ---------- Previous post was at 03:58 PM ----------

Update - by doing a manual install, everything worked fine. I'm not sure if you take feature requests at this time, but it would be nice to have grep, ping, traceroute, wget...
 

alireza7991

Senior Member
Sep 2, 2012
772
2,321
26
Shahrekord
alirezafn.net
This looks like a great project! Congratulations to the dev! I tried flashing the zip but it exited with error 7. I'm using neatrom (derived from slimkat) 4.4.2 and cwm-touch 6.0.4.6. I'm guessing it might be related to the updater-script syntax which I heard changed recently, right? I will copy the files manually in the mean time.

---------- Post added at 04:09 PM ---------- Previous post was at 03:58 PM ----------

Update - by doing a manual install, everything worked fine. I'm not sure if you take feature requests at this time, but it would be nice to have grep, ping, traceroute, wget...

Thanks for using CU .

about error I don't know what your problem is related to coz I had no error with the updater-script. however thanks to Androguide.fr an Installer app is comming for the CU on Androi project.

about feature request, it is welcomed but grep,ping,wget are not CU applets . the are standalone GNU software. however I have made a port of grep and wget but I am not sure if it could be implemented in this project (CU on Android). Maybe in another project ,sth like GNU softwares on Android (?).
 

mad_ady

Senior Member
May 8, 2008
434
262
Yeah, I figured they weren't part of coreutils, but they are useful tools for us linux folks :).
Indeed, they would be better off under an umbrella project, with coreutils as a piece of the puzzle :)
 
  • Like
Reactions: aLNG

alireza7991

Senior Member
Sep 2, 2012
772
2,321
26
Shahrekord
alirezafn.net
Yeah, I figured they weren't part of coreutils, but they are useful tools for us linux folks :).
Indeed, they would be better off under an umbrella project, with coreutils as a piece of the puzzle :)

I will expand this project to GNU softwares on Android when I found some times :) I 'm really busy now with school, programming projects, .... .
 
M

Modding.MyMind

Guest
I'm wanting to see coreutils become more popular for android use. To be frank on the matter, busybox is great, but as stated in the OP, it is stripped down which I am becoming to learn more and more how annoying that is. So, coreutils is a must for me now. Great work.
 

weirddan455

Senior Member
Mar 24, 2012
72
1
Hi, I actually had the same idea as you and started working on porting some GNU programs over to Android. I started out because I wanted GnuPG on Android 5.0 and the one on Google Play from the Gaurdian Project wasn't compiled for PIE (Position Independent Executable) which is required as of 5.0. Anyway I got GPG and Bash compiled (those were pretty easy) and then figured I'd go further and try to port over GNU Coreutils. I ran into some trouble compiling and then saw that you've already done it.

Where I'm stuck at the moment is on lib/fseeko.c. I took a peek at your github but it doesn't I don't see any of the FILE related sources in your lib/ Were you able to get those files to compile or did you just exclude them from your build? This code is pretty cryptic with #ifdefs out the wazoo for about 10 different implementations of <stdlib.h> for various OS's. I was able to get the first few files to compile (freading.c, freadahead.c, freadptr.c) by adding "defined __ANDROID__" to the "defined __DragonFly__" branch since Android's C library is based off BSD's. I also had to remove the underscore from the fp_ variable. That worked pretty well until I got to fseeko line 73 "fp_ub._base == NULL" variable is undeclared :/

I'm cloning your git at the moment so maybe I'll try compiling that and find my answers there but anyway if I do get this working I was planning on making an installer app and posting it on Google Play to make it easy for people to be able to install these GNU CLI programs. I could actually go ahead and post GPG and Bash if people are interested since I already have working builds of those.

EDIT: I actually have more questions than answers from your git sources now... you've removed the ./configure script... and there's no makefile. How am I even supposed to build this?
 
Last edited:
  • Like
Reactions: mad_ady

tech128

Senior Member
Oct 14, 2012
177
118
Yes, these binaries still work fine, seeing as they are static binaries.

Static binaries always work under lollipop.

It's the dynamic ones you have to make sure are pie-enabled.

I tested one of them on lollipop by the way, it worked fine.
 
S

SHM

Guest
CoreUtils 8.23 Statically Compiled for ARM

I compiled Coreutils version 8.23 statically for ARM. Will work for pre-JB and onward until Google decides they want to block static binaries lol. To my knowledge and by testing I have not personally experienced any issues with any applets. However, the disclaimer found in the OP applies to this post as well. I am sharing my compilation since it has been a very long time for any updates in this thread. Download attachment and unzip.

Here is an example on how to use the binary:

- I place coreutils at /system/bin

- I want to encode a binary called optipng as base64

The following is done:
Code:
coreutils --coreutils-prog=base64 < "path/to/optipng" > "path/to/optipng_base64"

No matter the program you use always include --coreutils-prog=

Enjoy.

Edit: Feel free to use this binary for whatever projects you have in mind. You do not even have to give me credit for compiling it. It's open to anyone.
 

Attachments

  • coreutils-8.23_Static_ARM.zip
    2.2 MB · Views: 179
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 73
    -> About

    Busybox is a good set of common Unix utilities but the utilities are all striped down version of original ones and they provide less features ; So you may need the original utility with full features for your App or cmd-line ,therefore you should use this project !

    `Core Utils on Android` project provides most GNU Core Utils for Android devices. they may be invoked from Android Apps or from command line terminal.

    All utils has been compiled with Linaro GCC 4.8.1 (Hardware floating point ABI) and O3 optimizations and with Musl LibC to provide best performance.


    -> Disclaimer


    THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
    APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
    HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
    OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
    IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
    ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

    -> Requirements

    an ARM v7 processor with built-in NEON SIMD (scorpion, krait, exynose 4, exynose 5,...)

    -> Installation

    Be sure you meet the requirements !
    Get the zip file
    Flash it via recovery mod
    Reboot and enjoy

    -> Usage

    To avoid issues of having busybox and coreutils at same time , all utils are named in form : cu.${UTIL_NAME} for example :

    cu.echo "hello world!"

    or

    cu.chmod 644 /system/build.prop

    and use this form for invoking any utility !

    to see how to use utilities , take a look at GNU CoreUtil documentations.

    -> Bugs

    a few utils such as ls and uname are broken down till I fix them and add the correct one to repository.

    some utils are missed. ( currently we have 103 applets working)

    -> Download

    ** CoreUtils on Android v1
    initial release . we have 103(working) + 2(not working) utils now

    -> Source

    https://github.com/alireza7991/coreutils
    9
    @alireza7991, is an APP for this awesome toolset planned? ;)

    I need help of an App Developer., since I am building all of my project on my phone and I do not have access to my PC. building am App on phone is impossible (?).

    I got some good news! :

    1- I've moved to linaro gcc 4.8.2 (HF ABI)
    2- I've ported Linux Utils also, it has ~90 Utils (fdisk, m4,...) then 90+103=193 !!!!!!!!!! so we will turn our Android into a powerful linux distro!
    3- I've received a mail from the GNU coreutils maintainer!!!!

    To do:

    1-working on Aroma Installer/Android App to let users install which utils they want.
    2-Merging ls and uname utils from KlibC sources.
    7
    Very cool! I'll be keeping an eye on this project.

    (Edit: Don't want to be that guy, but... First!)

    Sent from my Nexus 10 using Tapatalk

    and maybe last .
    5
    Time to give this great project more attention :)