maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   General (https://talk.maemo.org/forumdisplay.php?f=7)
-   -   where is ping, ifconfig, host? (https://talk.maemo.org/showthread.php?t=6827)

rhackenb 2007-06-14 22:11

where is ping, ifconfig, host?
 
I have xterm installed and I am able to connect through my wireless router to the internet. In my router interface, i don't see the n800 show up as a client on the dhcp client list. This is strange since I am actually connected through the router to the internet.

As a fallback, I tried to issue ping and ifconfig in xterm but I get a "command not found". Aren't these commands included with the operating system? How do I make the n800 tell me what it's ipaddress is?

-- rhackenb

brendan 2007-06-14 22:27

Re: where is ping, ifconfig, host?
 
ifconfig will get you the IP info.

as for ping, traceroute and a bunch of other commands, i think they were stripped from the OS for size/footprint. someone provided those for the 770, but i havent come across them for the n800.

Milhouse 2007-06-14 22:44

Re: where is ping, ifconfig, host?
 
Quote:

Originally Posted by rhackenb (Post 52293)
As a fallback, I tried to issue ping and ifconfig in xterm but I get a "command not found". Aren't these commands included with the operating system? How do I make the n800 tell me what it's ipaddress is?

-- rhackenb

To install ping, go here. I setup the following four symlinks in /usr/bin

Code:

ln -s /bin/busybox2 ping
ln -s /bin/busybox2 ping6
ln -s /bin/busybox2 telnet
ln -s /bin/busybox2 traceroute

ping6 doesn't actually work for me (can't create a raw socket) but ping (ipv4?) works just fine.

ifconfig is already installed by default, but you need to be root to run it (sudo gainroot first, then ifconfig etc.)

rhackenb 2007-06-15 02:38

Re: where is ping, ifconfig, host?
 
It's strange that ifconfig has be run as root. I think I know why. /sbin must be on the path of root but not of user. It can be invoked by user via /sbin/ifconfig.

I'm not sure what your data.tar.tz file does. It looks like it is establishing in /usr/busybox a bunch of symbolic links to various utilities found in /bin /usr/bin /sbin, etc. After I gunzip the data.tar.gz, what location do I do the untarring?

Also, what is busybox2? There is none on my n800.

Thanks,
rhackenb

Milhouse 2007-06-15 03:20

Re: where is ping, ifconfig, host?
 
Quote:

Originally Posted by rhackenb (Post 52321)
It's strange that ifconfig has be run as root. I think I know why. /sbin must be on the path of root but not of user. It can be invoked by user via /sbin/ifconfig.

Well that's not strictly true, you can run it as an ordinary user if you execute it using the full path, which is /sbin/ifconfig. As user "user" by default /sbin isn't on your path so you can't run ifconfig by typing just "ifconfig". When you sudo to root (using the gainroot script) your path will include /sbin.

Quote:

Originally Posted by rhackenb (Post 52321)
I'm not sure what your data.tar.tz file does. It looks like it is establishing in /usr/busybox a bunch of symbolic links to various utilities found in /bin /usr/bin /sbin, etc. After I gunzip the data.tar.gz, what location do I do the untarring?

Also, what is busybox2? There is none on my n800.

The data.tar.gz contains a version of busybox in /bin and this busybox executable supports the ping, telnet, traceroute calls. Your N800 already includes a different version of busybox (with no network support) which you *MUST NOT* replace/remove/rename. So, untar data.tar.gz somewhere safe (eg. in /home/user/temp) then copy (as root) /home/user/temp/bin/busybox to /bin/busybox2. Ensure /bin/busybox2 is chmoded correctly (ie. 755) and owned by root:root, then create your symlinks as outlined in my previous post (cd to /usr/bin first then create the symlinks). Once you've finished, delete the untarred files (rm -fr /home/user/temp) as they're no longer needed.

NOTE: I'm not responsible for data.tar.gz, and can't be held responsible if you hose your N800 (a reflash should fix it) :)

fanoush 2007-06-15 05:43

Re: where is ping, ifconfig, host?
 
As a quick workaround you can use ping from initfs (as root). There is another busybox there configured with more commands. Use ping like
Code:

/home/user # chroot /mnt/initfs ping 10.6.101.1
if you need DNS to work inside initfs do a
Code:

/home/user # cp /etc/resolv.conf  /mnt/initfs/etc/

yerga 2007-06-15 08:52

Re: where is ping, ifconfig, host?
 
You could be interested in this news: http://maemo.org/news/view/1181130611.html
Are traceroute and iputils and others tools for the device.


Best Regards.

rhackenb 2007-06-15 10:43

Re: where is ping, ifconfig, host?
 
Thanks for all the good info. Somehow all this knowledge needs to be coallesced into a wiki for others to refer to.

I basically set up my n800 with xterm and ssh so that I can log on to it wirelessly from my linux desktop so that I can work more easily with a fullsize keyboard and screen.

torx 2007-06-16 15:58

Re: where is ping, ifconfig, host?
 
erm, what's the difference between doing this busybox thing and simply doing a "apt-get install ping"? It worked on my N800..

Milhouse 2007-06-16 16:49

Re: where is ping, ifconfig, host?
 
Quote:

Originally Posted by torx (Post 52515)
erm, what's the difference between doing this busybox thing and simply doing a "apt-get install ping"? It worked on my N800..

I didn't know about "apt-get install ping" :) That does sound a lot easier I have to admit, though the busybox approach does also give you telnet, traceroute and some other command line utilities. Does the apt-get approach install only ping or does it install anything else which might be useful?


All times are GMT. The time now is 14:47.

vBulletin® Version 3.8.8