Re: Announce: initrd-tftp 0.1

From: Bas Mevissen (sgm@plamev.demon.nl)
Date: Mon Jan 10 2000 - 15:51:32 EST


On Mon, 10 Jan 2000, Simon Kirby wrote:
> On Sun, Jan 09, 2000 at 08:58:05PM +0000, Philip Blundell wrote:
>
>
> ---
>
> void abort() { _exit(); };
> void exit() { _exit(); };
> void atexit() { };
> void *__libc_stack_end;
>
> int main(){
> write(1,"Hello world\n",12);
> }
>
> ---
>
> glibc2.1:
>
> [sroot@oof:/root]# gcc -O1 -o test test.c && ls -l test
> -rwxr-xr-x 1 root root 4316 Jan 9 20:56 test*
> [sroot@oof:/root]# gcc -O1 -static -o test test.c && ls -l test
> -rwxr-xr-x 1 root root 6699 Jan 9 20:56 test*
>

These results just melt away any objections against doing dhcp, bootp,
tfp, ftp, whatever in initrd and not in kernelspace.

So it is just a matter of a small patch to statically link dhcpcd or
whatever you need for booting and putting it in an easy to maintain
initrd-files directory on your development system. Maintaining just a few
patches for statically linking those utils is a lot easier than kernel
code. If we make some proper patches, they could be included in the
standard distribution of dhcpcd, tftp etc.

Thanks Philip and Simon for that 4 lines of code that 'kill' the almost
300kbyte code that glibc2.1 would normally pollute the .static binary
with!!! Just wondering: is this something that could glibc or gcc learned
to do by default to make life of embedded developers simpler?

 Hmmm. Can someone help shrinking /sbin/insmod.static and
/sbin/rmmod.static on my Red Hat 6.1 system, because they are used for an
initrd. It would be good to have static versions of these build in
standard modutils package! Philip, can you please do this or point me to
the correct one to ask for it?

Bas.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Jan 15 2000 - 21:00:16 EST