Jump to content


Photo

linux tools coming to MCR

- - - - -

  • Please log in to reply
215 replies to this topic

#41
fyremoon

fyremoon

    Regular

  • MoDaCo Silver
  • PipPip
  • 97 posts
  • Location:St Leonards, UK
  • Devices:HTC Hero/T-mobile G2
  • Twitter:@fyremoon

If somebody needs it, I compiled for myself at the beginning of my android experience :) nmap, netcat, joe, hts/htc, kismet, aircrack, wireless-tools,gpsd.. as static compiled binaries. For all the non daily use stuff I'm using debian in a chroot environment (bootdeb) much more flexible.


I know nc (netcat) is part of busybox, so that is one less thing to think about.

  • 0

#42
freeasabeer

freeasabeer

    Regular

  • Members
  • PipPip
  • 88 posts
  • Location:Paris, France
  • Devices:HTC Hero

I checked for cron earlier this week but got the message "crontab: unknown uid 0" when running crontab -e
rsync + cron would be even more amazing :)

This is because there is no /etc/passwd file...
You can add one that contain the following line:
root::0:0:root:/data:/system/xbin/ash

but then you will face: chdir (/var/spool/cron/crontabs): no such file or directory !

Need to check if we can tweak crontab config in busybox...

  • 0

#43
Andcr

Andcr

    Regular

  • Members
  • PipPip
  • 53 posts
  • Devices:HCT Hero (Euro)
thanks for the info!
I'll be sure to keep an eye on this thread :)
still learning more and more about Linux every day :)

Edited by Andcr, 14 January 2010 - 09:00 PM.

  • 0

#44
fyremoon

fyremoon

    Regular

  • MoDaCo Silver
  • PipPip
  • 97 posts
  • Location:St Leonards, UK
  • Devices:HTC Hero/T-mobile G2
  • Twitter:@fyremoon

This is because there is no /etc/passwd file...
You can add one that contain the following line:
root::0:0:root:/data:/system/xbin/ash

but then you will face: chdir (/var/spool/cron/crontabs): no such file or directory !

Need to check if we can tweak crontab config in busybox...


call crond -c to define an alternate crontab directory, for instance:
crond -c /data/data/crontabs

  • 0

#45
stevenz

stevenz

    Diehard

  • MoDaCo Silver
  • PipPipPipPip
  • 473 posts
  • Gender:Male
  • Location:Wellington, New Zealand
  • Interests:Motorcycling
    Tinkering
  • Devices:OG Tab, Note, Touchpad, N7
  • Twitter:@KnightNZ
Made the /etc/passwd file containing;

root::0:0:root:/data:/system/xbin/ash

Created /etc/root with

* * * * * echo "New line" >> /data/cronout

Started crond using;

crond -l 0 -L /var/log/cron.log -c /etc (-l and -L switches are just for excessive logging)

crond tries to run scripts via /bin/sh so symlinked /bin to /system/bin to keep it happy.

And bingo, crond happily running amending a line to a file once a minute.

The crontab command needs the -c switch to change the working folder to /etc as well ifyou use that for anything.

Edited by stevenz, 14 January 2010 - 10:06 PM.

  • 0
Motorcycling watchmaker.

#46
freeasabeer

freeasabeer

    Regular

  • Members
  • PipPip
  • 88 posts
  • Location:Paris, France
  • Devices:HTC Hero

but then you will face: chdir (/var/spool/cron/crontabs): no such file or directory !
Need to check if we can tweak crontab config in busybox...

Checked: this is actually something we can set in busybox configuration.
Paul, would you mind to build a new busybox with something that make more sense for the crond spool directory ? By the way, could you also enable the bbconfig applet so that we can extract busybox configuration file from the binary ?

  • 0

#47
fyremoon

fyremoon

    Regular

  • MoDaCo Silver
  • PipPip
  • 97 posts
  • Location:St Leonards, UK
  • Devices:HTC Hero/T-mobile G2
  • Twitter:@fyremoon

Checked: this is actually something we can set in busybox configuration.
Paul, would you mind to build a new busybox with something that make more sense for the crond spool directory ? By the way, could you also enable the bbconfig applet so that we can extract busybox configuration file from the binary ?


What about adding:
mkdir /var
mkdir /var/spool
mkdir /var/spool/cron
mkdir /var/spool/cron/crontabs

to /etc/init.rc so that it creates these folders automatically after it mounts /system, would that do it?

  • 0

#48
PaulOBrien

PaulOBrien

    It's My Party

  • Founder
  • PipPipPipPipPipPip
  • 36,345 posts
  • Gender:Male
  • Location:Norwich, UK
  • Devices:All the Nexus!
  • Twitter:@paulobrien
Here's a busybox with bbconfig enabled and with the crond directory set to /data/cron. Feels like a good idea to work together to also get busybox as 'right' as possible for Android. :)

Incidentally, busybox compilation with the Google toolchain is indeed a PITA, I use codesourcery.

P

Attached Files


  • 0

You can follow me on Twitter - http://twitter.com/paulobrien / Follow MoDaCo on Twitter - http://twitter.com/modaco

Want to donate? MoDaCo is raising money for the Multiple Sclerosis society.

Posted Image


#49
fyremoon

fyremoon

    Regular

  • MoDaCo Silver
  • PipPip
  • 97 posts
  • Location:St Leonards, UK
  • Devices:HTC Hero/T-mobile G2
  • Twitter:@fyremoon

Here's a busybox with bbconfig enabled and with the crond directory set to /data/cron. Feels like a good idea to work together to also get busybox as 'right' as possible for Android. :)

Incidentally, busybox compilation with the Google toolchain is indeed a PITA, I use codesourcery.

P


If busybox was recompiled to resolve exactly like ping does, the network functions will work properly. Currently, none of them can resolve an IP from a hostname. Its almost like it needs a /etc/resolv.conf, not all that useful.

  • 0

#50
freeasabeer

freeasabeer

    Regular

  • Members
  • PipPip
  • 88 posts
  • Location:Paris, France
  • Devices:HTC Hero

Here's a busybox with bbconfig enabled and with the crond directory set to /data/cron. Feels like a good idea to work together to also get busybox as 'right' as possible for Android. :)

Great! Yeah, I think there are still too much applets in your busybox.... the more obvious to me being ftpd, httpd, telnetd, udhcpd, syslogd and maybe some more.
Well, unless we want a real unix system in parallel to android ...

Incidentally, busybox compilation with the Google toolchain is indeed a PITA, I use codesourcery.



I use my own brewed toolchain.... optimized for armv6j / arm1136jf-s (the cpu inside the MSM7200) and with compilation switch set to optimize for speed  :)

  • 0

#51
freeasabeer

freeasabeer

    Regular

  • Members
  • PipPip
  • 88 posts
  • Location:Paris, France
  • Devices:HTC Hero
New release for rsync.
Changes are actually related to dropbear, not to rsync itself.
See changelog here.

  • 0

#52
Loxley

Loxley

    Newbie

  • Members
  • Pip
  • 43 posts
  • Devices:Hero

If busybox was recompiled to resolve exactly like ping does, the network functions will work properly. Currently, none of them can resolve an IP from a hostname. Its almost like it needs a /etc/resolv.conf, not all that useful.


Resolv.conf won't help. Busybox needs to be linked against android's own libc.

Peace

Niki

Edited by Loxley, 15 January 2010 - 05:59 AM.

  • 0

#53
Loxley

Loxley

    Newbie

  • Members
  • Pip
  • 43 posts
  • Devices:Hero

Great! Yeah, I think there are still too much applets in your busybox.... the more obvious to me being ftpd, httpd, telnetd, udhcpd, syslogd and maybe some more.


Cool down, I regularly use httpd to access a r/o copy of my personal wiki on my Hero.

Have a nice day

Niki

  • 0

#54
wroopy

wroopy

    Newbie

  • Members
  • Pip
  • 3 posts
  • Devices:Hero

Cool down, I regularly use httpd to access a r/o copy of my personal wiki on my Hero.


That was interesting. Which Wiki do you use on the Hero?

/Andreas

  • 0

#55
PaulOBrien

PaulOBrien

    It's My Party

  • Founder
  • PipPipPipPipPipPip
  • 36,345 posts
  • Gender:Male
  • Location:Norwich, UK
  • Devices:All the Nexus!
  • Twitter:@paulobrien

Great! Yeah, I think there are still too much applets in your busybox.... the more obvious to me being ftpd, httpd, telnetd, udhcpd, syslogd and maybe some more.
Well, unless we want a real unix system in parallel to android ...
I use my own brewed toolchain.... optimized for armv6j / arm1136jf-s (the cpu inside the MSM7200) and with compilation switch set to optimize for speed  :)

Care to share? :)

P

  • 0

You can follow me on Twitter - http://twitter.com/paulobrien / Follow MoDaCo on Twitter - http://twitter.com/modaco

Want to donate? MoDaCo is raising money for the Multiple Sclerosis society.

Posted Image


#56
PaulOBrien

PaulOBrien

    It's My Party

  • Founder
  • PipPipPipPipPipPip
  • 36,345 posts
  • Gender:Male
  • Location:Norwich, UK
  • Devices:All the Nexus!
  • Twitter:@paulobrien

Resolv.conf won't help. Busybox needs to be linked against android's own libc.

Peace

Niki

How does one go about achieving this when running a ship version of the OS?

P

  • 0

You can follow me on Twitter - http://twitter.com/paulobrien / Follow MoDaCo on Twitter - http://twitter.com/modaco

Want to donate? MoDaCo is raising money for the Multiple Sclerosis society.

Posted Image


#57
Loxley

Loxley

    Newbie

  • Members
  • Pip
  • 43 posts
  • Devices:Hero

How does one go about achieving this when running a ship version of the OS?


I'm not sure that's possible. You would have to replace the libc headers and object-files in your toolchain with the ones from android. I wouldn't know where to start, though.

I used http://github.com/tm...m/droid-wrapper together with a conglomerate of the android sources (to get the header's) and parts of the NDK to get some binaries (like crtend_android.o). That is enough to compile not too large projects and link them dynamically. Unfortunately busybox's build-system refused to cooperate. Perhaps it would be easier to work on androids Toolbox

I might give it another try in late February when I have some days off.

Have a nice day

Niki

  • 0

#58
paulsmith

paulsmith

    Regular

  • MoDaCo Silver
  • PipPip
  • 75 posts
  • Devices:HTC Hero , Advent Vega
Im trying to install the rsync binary supplied at the start of this thread using the RA tools.

Im getting the error:

Copying files.........
E: Cant Symlink /system/xbin/ssh
E: Failure at line 14
symlink dropbear SYSTEM:xbin/ssh

Any ideas?

  • 0

#59
freeasabeer

freeasabeer

    Regular

  • Members
  • PipPip
  • 88 posts
  • Location:Paris, France
  • Devices:HTC Hero
Maybe... was the previous release of rsync already installed on you phone ?

Edited by freeasabeer, 15 January 2010 - 11:47 AM.

  • 0

#60
freeasabeer

freeasabeer

    Regular

  • Members
  • PipPip
  • 88 posts
  • Location:Paris, France
  • Devices:HTC Hero

Care to share? :)

P


Yeap. x86 or x86_64 version ?

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users