[BusyBox] Init Problem - Newbee Question
Berlin Brown
bigbinc at hotmail.com
Thu Feb 13 19:31:03 UTC 2003
Do I really have to respond to this, I am kind of tired. Here is how you
respond to questions. We will have to assume that this particular person
has already read the documentation and may have something else wrong. Here
are some issues that you may have encountered that are not in the docs.
First, make sure that your libc, or uClibc directory is the same as the
development environment. Say for example that you compiled busybox with
your library set to:
output from: /usr/bin/ldd busybox
libc.so.0 => /usr/i386-linux-uclibc/lib/libc.so.0 (0x0x40006000)
ld-uClibc.so.0 => /usr/i386-linux-uclibc/lib/ld-uClibc.so.0 (0x0x40000000)
And also make sure that if you have compiled busybox/tinylogin with library
support, make sure that they libraries were there. For example with me, I
had some programs compiled with -static=true and some false I got them mixed
up.
you can always do an 'ldd' or if you really want to look inside
# objdump --dynamic-syms /bin/busybox
When you run busybox or tinylogin, your system will look for these
libraries.
So when your system runs, it will look for these folder:
'/usr/i386-linux-uclibc/lib/' And if one program for example busybox works
and another program for example 'tinylogin' doesnot work, it may be hard to
know that the login(ie getty) has failed and it may resemble a freeze.
Second: in my case I made the links to busybox and tinylogin manually, so
you may have mixed up the two.
for example ln -s ../../bin/busybox getty which should read
ln -s ../../bin/tinylogin getty.
my system went screwing and gave unexpected results when proc was not
mounted, so here is a section from my /etc/inittab
make sure that proc is mounted. and also I like to make sure that the fs is
read/write. When you boot from the kernel and your system is just hanging
with 'ro', somethings might not work properly.
null::sysinit:/bin/mount -o remount,rw /
null::sysinit:/bin/mount -t proc proc /proc
null::sysinit:/bin/mount -a
and also make sure that you umount the system when done
null::shutdown:/bin/umount -a -r
for example my system went screwy, until I did a 'e2fsck' and since busybox
doensnt have 'e2fsck' but it does have minix 'fsck' assuming you mount into
minixfs, and then I think the version of minix matters for example 'v2'
Compiling tinylogin: for me, I never got shadow passwords to work properly,
but I
did compile shadow with uClibc, but I still had to change this in the
Makefile(tinylogin)
USE_SYSTEM_PWD_GRP = false
USE_SYSTEM_SHADOW = false
And for me I made some changes to init.c and it didnt load the programs
properly.
#if NULL_ACTION0
run_actions(RESPAWN);
/* run the askfirst stuff */
run_actions(ASKFIRST);
/* Wait for a child process to exit */
wpid = wait(&status);
#endif
dont forget to take out debugging code.
And you may want to make sure that you kernel has 'proc' filesystem support
and initrd (ramdisk support). You dont have to add 'ram' fs support.
And some other issues, for me anyway, I didnt use tty1 in inittab but I did
launch tty2 and tty3, and you can check with 'ALT - LEFTARROW' OR 'ALT -
RIGHTARROW'
messed me up anyway, and the login didnot show up.
/etc/inittab:
#tty1::respawn:/sbin/getty 38400 tty1
tty2::respawn:/sbin/getty 38400 tty2
tty3::respawn:/sbin/getty 38400 tty3
tty4::respawn:/sbin/getty 38400 tty4
tty5::respawn:/sbin/getty 38400 tty5
once you get your system up you can do a ps.
PID Uid VmSize Stat Command
1 root 560 S init
2 root S [keventd]
3 root S [ksoftirqd_CPU0]
4 root S [kswapd]
5 root S [bdflush]
6 root S [kupdated]
13 root 560 S init
14 root 564 S /bin/sh /etc/rc.d/rc.sysinit
20 root 552 R ps
and of course make sure that you have the compiled program in busybox before
you run it or on your system
Now I get to respond, I think I have been flamed.
>>a root directory from busybox as opposed to 'initrd'. This is tricky.
>>Say, root.tar.gz unzip to /dev/ram0, for example.
>
>Um, not quite. You can't just untar a tarball to a raw device and unzip
>can't interpret tarballs. You untar to a mounted filesystem. The standard
>initrd mounts to the raw device /dev/ram0. I'm
What I meant was, eventually once you get your files uncompressed then they
will end up in ram. I just didnt feel like typing that.
i.e:
dd if=/dev/zero of=/dev/ram0 bs=1k count=2048
mkfs.minix /dev/ram0 2048
mount /dev/ram0 /mnt -t minix
cp xy.tar.gz /mnt/
tar -zxvf xy.tar.gz
/usr/bin/chroot /mnt
>Berlin Brown, PLEASE read BusyBox.html AND TinyLogin.html (or same file in
>another format) as I TOLD you to do. If you have a inittab, it has to have
>everything you want. If you don't have the file, it just uses the default
>format.
>
Between the 637686lines(24MB) of busybox.maillist archive and the
22662(840k) lines of tinylogin.maillist archive and the html docs,README,
Config.h/Configs and the 79980 lines of busybox code, sometimes all the
answers arent in there.
>Did you EVER try running without /etc/inittab? Looking at every message
>you ever wrote, it sounds like a definite no but I could be wrong.
/etc/inittab, never thought of that one? whats that.
>Honestly, the thing that pisses me off the most about Newbies is when they
>jump in without trying to know anything. I'd be far more >
>I'm sorry but I am starting to get angered right now. If you take the time
>to read it all, it'd be a lot easier.
haha,funny
Berlin Brown
bigbinc at hotmail.com
_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail
More information about the busybox
mailing list