Skip to contentSkip to conversation

Do you have your minimum ramdisk image which can provide basic network services ?

DISCUSSION SangTae Ha 4 participants 6 messages May 29, 2000 – May 31, 2000

lore
Share & tools
lore

SangTae Ha

author
#0 lore raw

I want to make my ramdisk image which can provide basic network services such as "ping","traceroute","telnet" and "ftp". I want to reduce my file size within (1or2)M bytes. I already downloaded full image file at ftp://ftp.ppc.kernel.org/pub/linuxppc/embedded/mbxroot.full.tgz This file is so big including all of things. I am currently pruning various directories and files in it. I hope that it doesn't take too much time.
I have two choices.
1) compile the LRP(Linux Router Project) package and make it into root file system image
2) reducing file size from full image file and make final small size image

How do you think about above solutions?

I just want to use TCP/IP networking facilities. I will really be happy if you already got that image..

Thank you for your help

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#1 lore raw
Quoted 3 lines · In message <020e01bfc93f$5dc075c0$db52df8d@helsinki> you wrote:

I want to make my ramdisk image which can provide basic network services such as "ping","traceroute","telnet" and "ftp". I want to reduce my file size within (1or2)M bytes. I already downloaded full image file at ftp://ftp.ppc.kernel.org/pub/linuxppc/em bedded/mbxroot.full.tgz

This is most probably not the best approach.

You should not start with a full installation of everything, but instead start with an empty system and design what you need to have it it.

/bin/ping, /usr/sbin/traceroute, /usr/bin/ftp, and /usr/bin/telnet together need (compressed) well below 100 kB, so if you don't need glibc2 for any reasons you can easily fit this within your limits (hell, in 1 MB you can have a compressed image with a full web server including >560 kB of web pages *plus* the Linux kernel).

Quoted 4 lines

This file is so big including all of things. I am currently pruning various directories and files in it. I hope that it doesn't take too much time. I have two choices.
1) compile the LRP(Linux Router Project) package and make it into root file system image
2) reducing file size from full image file and make final small size image

What's wrong with using one of the existing embedded releases, and building your system from buttom up? Both the Montavista HHL release or our CD-ROM should get you started easily (see
http://www.denx.de/solutions-en.html for a start).

Quoted 1 line

How do you think about above solutions?

I think you are on a wrong track.

Quoted 1 line

I just want to use TCP/IP networking facilities. I will really be happy if you already got that image..

What is the purpose of your embedded system?

What do you want to have FTP for, when you don't have any files to send, or any commands to process files you "get"? It's difficult to make recommendations (especially for embedded systems) when you hold back essential information...

Wolfgang Denk

--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: [email protected]
Nothing ever becomes real until it is experienced. - John Keats

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#2 lore raw
In reply to SangTae Ha
Quoted 1 line · SangTae Ha

I already downloaded full image file at > ftp://ftp.ppc.kernel.org/pub/linuxppc/embedded/mbxroot.full.tgz

I just downloaded that file, too. As you say, it is HUGE (133 MB gzipped).

Unfortunately, it is also incomplete. In particular, it is missing:
init (/etc/telinit is a link to init, but no init)
inetd

I had been hoping to simply build up an initrd image from selected pieces of it, because I now have the Linux kernel, console, and initrd-ramdisk up and running on my hardware (Hurrah!). But I'm having difficulty building a sufficient initrd image to actually use the network driver I have written (:-(). So far, I cannot even ping myself using the loopback device (no inetd, I suppose).

Tom Roberts [email protected]

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#3 lore raw

Tom,

The quick-and-dirty way of enabling your loopback device is:

    ifconfig lo 127.0.0.1

Daris

SiSIC Inc/SNMC
www.snmc.com

Quoted 10 lines · Tom Roberts
Quoted 1 line · SangTae Ha

I already downloaded full image file at > ftp://ftp.ppc.kernel.org/pub/linuxppc/embedded/mbxroot.full.tgz

I just downloaded that file, too. As you say, it is HUGE (133 MB gzipped).

Unfortunately, it is also incomplete. In particular, it is missing:
init (/etc/telinit is a link to init, but no init)
inetd

Quoted 9 lines

I had been hoping to simply build up an initrd image from selected pieces of it, because I now have the Linux kernel, console, and initrd-ramdisk up and running on my hardware (Hurrah!). But I'm having difficulty building a sufficient initrd image to actually use the network driver I have written (:-(). So far, I cannot even ping myself using the loopback device (no inetd, I suppose).

Tom Roberts [email protected]

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#4 lore raw
Quoted 3 lines · Daris Nevil

The quick-and-dirty way of enabling your loopback device is:

    ifconfig lo 127.0.0.1

Yes, I did that; I get:

	$ ifconfig lo 127.0.0.1
	127.0.0.1: Resolver Error 0 (no error)
	Usage: ifconfig [-a] [-i] [-v] interface
	                [inet address]
	                [hw] [ax25 address]
	                [metric NN] [mtu NN]
	                [trailers] [-trailers]
	                [arp] [-arp]
	                [netmask aa.bb.cc.dd]
	                [dstaddr aa.bb.cc.dd]
	                [mem_start NN] [io_addr NN] [irq NN]
	                [[-] broadcast [aa.bb.cc.dd]]
	                [[-]pointopoint [aa.bb.cc.dd]]
	                [up] [down] ...

I have no idea what "Resolver error 0" is, nor why ifconfig thinks that is an invalid command line....

	$ ping 127.0.0.1
	ping: unknown protocol icmp.

I think I need to be running inetd to implement the ping protocol, and so far I have been unable to find a PowerPC image of inetd.

My /etc/protocols has icmp listed (copied from a working i386 linux). I may have more serious errors, like incompatible libraries....

Tom Roberts [email protected]

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#5 lore raw

Tom,

I'm not sure what the Resolver Error 0 zero is either. I don't remember seeing that one.

However, I do know that you don't need inetd for ping. If you want to use ping the way it is then you will need the nss libraries in addition to your /etc/protocols file. I cheated and hacked ping.c and hard-coded the icmp protocol number. The patch for the hack is included below.

Daris Nevil
SiSIC Inc/SNMC

----------------------------------------------

Patch for ping.c that removes the need for /etc/protocols and nss libraries.
By Daris Nevil ([email protected])
To patch:
cd netkit-base-0.10/ping
patch -Np1 < ping-no-protocols.patch

ping.c Tue May 30 22:26:54 2000 renamed from ping.old Tue May 30 22:26:48 2000 +1 -0
@@ -87,6 +87,7 @@
  */
 #ifdef __linux__
 #define SAFE_TO_DROP_ROOT
+#define NO_PROTOCOLS   // Elimnates the need for /etc/protocols and nss

libs
#endif

#if defined(__GLIBC__) && (__GLIBC__ >= 2)
@@ -223,13 +224,16 @@

        /*
         * Pull this stuff up front so we can drop root if desired.
         */
+#ifdef NO_PROTOCOLS
        setprotoent(0);  // Leave the /etc/protocols file open

        if (!(proto = getprotobyname("icmp"))) {
                (void)fprintf(stderr, "ping: unknown protocol icmp.\n");
                exit(2);
        }

-
+#else
+ proto->p_proto = 1; // ICMP, from /etc/protocols
+#endif

        if ((s = socket(AF_INET, SOCK_RAW, proto->p_proto)) < 0) {
                if (errno==EPERM) {
                        fprintf(stderr, "ping: ping must run as root\n");

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/