[uClibc] fail to invoke sh at login

Jin Ho Park lampbread at yahoo.co.kr
Sat Mar 8 05:08:13 UTC 2003


Hello,

I have a problem of login and sh.

I make toolchain gcc-9.25 and uClib-0.9.19 using Makefile provided by Erik

All are maked successfully for the toolchain, uClib and /lib of target system's root disk image.

I make linux kernel (2.4.2) for NFS.

My target system is IBM 405gp PowerPC cpu.

I make only busybox-0.60.5 and tinylogin-1.4 for applications.

When booting target system, the target system gets successfully NFS root.

And init process is invoked and run /etc/inittab entries.

/etc/inittab file as follows.

     null::sysinit:/bin/mount -o remount,rw /
     null::sysinit:/bin/mount -t proc proc /proc
     null::sysinit:/bin/mount -a
     ttyS0::respawn:/sbin/getty ttyS0 9600 vt100

When init invokes getty, getty prompt "login" and accept user-id.
Then getty invokes login and login process seems to invoke /bin/sh.
But, the sh process is exited and init respawn getty.

So, I add a debug printk at do_execve() in Linux Kernel as follows 

for looking what process is invoked by init.

        printk("filename = %s\n", filename);
        for(i=0;argv[i] != NULL; i++)   printk("argv[%d] = %s\n", i, argv[i]);
        for(i=0;envp[i] != NULL; i++)  printk("envp[%d] = %s\n", i, envp[i]);

The follows is the Console Logging. 

Linux booting ....
...
IP-Config: Got BOOTP answer from 192.168.0.1, my address is 192.168.0.23
Looking up port of RPC 100003/2 on 192.168.0.1
Looking up port of RPC 100005/2 on 192.168.0.1
Application Starting ....
filename = /sbin/init
argv[0] = init
envp[0] = HOME=/
envp[1] = TERM=linux
do_execve: success, rc = 0
init started:  BusyBox v0.60.5 (2003.03.08-03:22+0000) multi-call binary

filename = /bin/mount
argv[0] = /bin/mount
argv[1] = -o
argv[2] = remount,rw
argv[3] = /
envp[0] = TERM=vt102
envp[1] = HOME=/
envp[2] = PATH=/usr/bin:/bin:/usr/sbin:/sbin
envp[3] = SHELL=/bin/sh
envp[4] = USER=root
do_execve: success, rc = 0

filename = /bin/mount
argv[0] = /bin/mount
argv[1] = -t
argv[2] = proc
argv[3] = proc
argv[4] = /proc
envp[0] = TERM=vt102
envp[1] = HOME=/
envp[2] = PATH=/usr/bin:/bin:/usr/sbin:/sbin
envp[3] = SHELL=/bin/sh
envp[4] = USER=root
do_execve: success, rc = 0

filename = /bin/mount
argv[0] = /bin/mount
argv[1] = -a
envp[0] = TERM=vt102
envp[1] = HOME=/
envp[2] = PATH=/usr/bin:/bin:/usr/sbin:/sbin
envp[3] = SHELL=/bin/sh
envp[4] = USER=root
do_execve: success, rc = 0

filename = /sbin/getty
argv[0] = /sbin/getty
argv[1] = ttyS0
argv[2] = 9600
argv[3] = vt100
envp[0] = TERM=vt102
envp[1] = HOME=/
envp[2] = PATH=/usr/bin:/bin:/usr/sbin:/sbin
envp[3] = SHELL=/bin/sh
envp[4] = USER=root
do_execve: success, rc = 0

Welcome to the Erik's uClibc development environment.

192.168.0.23 login: root

filename = /bin/login
argv[0] = /bin/login
argv[1] = --
argv[2] = root
envp[0] = TERM=vt100
envp[1] = HOME=/
envp[2] = PATH=/usr/bin:/bin:/usr/sbin:/sbin
envp[3] = SHELL=/bin/sh
envp[4] = USER=root
do_execve: success, rc = 0

filename = /sbin/getty
argv[0] = /sbin/getty
argv[1] = ttyS0
argv[2] = 9600
argv[3] = vt100
envp[0] = TERM=vt102
envp[1] = HOME=/
envp[2] = PATH=/usr/bin:/bin:/usr/sbin:/sbin
envp[3] = SHELL=/bin/sh
envp[4] = USER=root
do_execve: success, rc = 0


Welcome to the Erik's uClibc development environment.

192.168.0.23 login:


Why is /bin/sh exited ?

Welcome any suggestion and notice. 

Thank you in advance.

Best regards,

Jin Ho Park.


More information about the uClibc mailing list