[ale] custom boot disk woes
Christopher Fowler
cfowler at outpostsentinel.com
Wed Sep 3 08:32:06 EDT 2003
Oh yea one more thing. glibc will not fit. If you create a static binary
it will be about 400k. What you need to look at is busybox and uClibc.
Use uClibc to compile busybox. This is a stripped down version of
libc for use in tight spaces. You iptables program may be a issues. It may or
may not be able to compile under uClibc. In that case you may
have to compile it statically.
In the past if I had to compile many things statically liked this I used
a concept called a "mulit-call" binary. Like busybox. It keeps all the
objects in one file. You use symbolic links to point to the main 400k
executable. The main() function looks at argv[0] to see what reall
function has to be called. This approach allowed me to place many programs
in the same 400k+ space. The downside you'll have to modify the iptables source
to not have a main() and to be called by the mult-call binary
crudy example:
if(strcmp(argv[0], "iptables") == 0) {
return iptables_main(argc, argv);
} else if (strcmp(argv[0], "netstat") == 0){
return netstat_main(argc,argv);
}
fpritnf(stderr, "module %s not found!\n", argv[0]);
exit(1);
On Wed, Sep 03, 2003 at 07:14:53AM -0500, Kevin Krumwiede wrote:
> I'm just messin' around with an old P75 I found in the trash. Right now all it has is a floppy drive and a couple EtherExpress/10s... and wow, it's QUIET. I'm hoping to make it into a firewall.
>
> I built a 2.4 kernel and wrote it to a floppy. It boots OK and of course hangs when it can't find init.
>
> I then made a root filesystem containing only /sbin/init and /dev/tty0 and added it to the floppy. The kernel finds and loads the compressed disk image, but then I get this message:
>
> Warning: unable to open an initial console
>
> I don't know if my init is running. This might be pretty naive, but here's what I'm using for /sbin/init (compiled with -static):
>
> #include <stdio.h>
> int main(int argc, void* argv[]) {
> puts("init executed successfully");
> while(1) { }
> }
>
> I'm not seeing that message. I'm assuming that's because there's no console.
>
> BTW, I originally tried using a 2.2 kernel to save space, but I can't get it to boot at all. It oopses right away with a null pointer exception. I Googled for that error, and the results seemed to suggest a bad memory chip or something. But 2.4 boots fine and MS-DOS was working on the machine when I got it, so I don't think that's the problem. This happens with a fresh bzImage, before I mess with the ramdisk word or anything. Ideas?
>
> Thanks,
> Krum
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale
_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale
More information about the Ale
mailing list