Non-interactive interactive shell !!

Levend Sayar levend.sayar at karel.com.tr
Mon Apr 9 09:04:34 UTC 2007


Hi, all
My current problem with busybox is getting a really interactive shell. Since
my shell does not respond to any command.
I posted my log coming from my embedded board console. Below you will see
lines starting with "LS:". They are belong to printk's inserted into kernel
code by me. And also I added a driver KLOG into the kernel (Not module). It
simply printk whatever written to it from user-space. It is a gateway from
user-space to kernel ring buffer. So I changed ash.c to use my device, not
trace into "./trace" file. My motive was to see what's going on when ash
shell started to run,since it has built-in trace code when you define DEBUG
as 2.
Please refer to my last post with subject "Where is my shell ? (Static vs.
Dynamic)" to see my configuration.

TIA


Uncompressing Linux... Ok, booting the kernel.
Linux version 2.4.32 (root at soft2000) (gcc version 3.2.2 20030222 (Red Hat
Linux 3.2.2-5)) #48 Fri Apr 6 20:21:58 EEST 2007
BIOS-provided physical RAM map:
 BIOS-e801: 0000000000000000 - 000000000009f000 (usable)
 BIOS-e801: 0000000000100000 - 0000000000a00000 (usable)
10MB LOWMEM available.
On node 0 totalpages: 2560
zone(0): 2560 pages.
zone(1): 0 pages.
zone(2): 0 pages.
DMI not present.
Kernel command line: root=/dev/ram rw
Initializing CPU#0
Calibrating delay loop... 4.04 BogoMIPS
Memory: 4824k/10240k available (511k kernel code, 5028k reserved, 101k data,
40k
 init, 0k highmem)
Checking if this processor honours the WP bit even in supervisor mode... No.
Dentry cache hash table entries: 2048 (order: 2, 16384 bytes)
Inode cache hash table entries: 1024 (order: 1, 8192 bytes)
Mount cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 4096 (order: 2, 16384 bytes)
CPU: 386
Checking 'hlt' instruction... disabled
Checking for popad bug... OK.
POSIX conformance testing by UNIFIX
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Starting kswapd
pty: 256 Unix98 ptys configured
KLOG: Initializing (Build: Apr  5 2007 - 20:17:21)
Serial driver version 5.05c (2001-07-08) with no serial options enabled
ttyS00 at 0x03f8 (irq = 4) is a 16450
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
LS:sys_open(/dev/ram)
LS:sys_open(/dev/ram)->0
LS:sys_open(/dev/initrd)
LS:sys_open(/dev/initrd)->1
RAMDISK: ext2 filesystem found at block 0
RAMDISK: Loading 4096 blocks [1 disk] into ram disk... done.
LS:sys_close(1)
Freeing initrd memory: 4096k freed
LS:sys_close(0)
EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended
VFS: Mounted root (ext2 filesystem).
Freeing unused kernel memory: 40k freed
LS:sys_open(/dev/console)
LS:sys_open(/dev/console)->0
LS:run_init_process(/sbin/init)
LS:do_execve(/sbin/init)
LS:sys_close(3)
LS:sys_open(/dev/klog)
KLOG: Opened
LS:sys_open(/dev/klog)->3
KLOG: main at busybox.c
LS:sys_close(3)
KLOG: Released
LS:sys_open(/dev/ttyS0)
LS:sys_open(/dev/ttyS0)->3
LS:sys_close(3)
LS:sys_open(/dev/ttyS0)
LS:sys_open(/dev/ttyS0)->3
console=/dev/ttyS0
LS:sys_close(0)
LS:sys_close(1)
LS:sys_close(2)
LS:sys_open(/dev/ttyS0)
LS:sys_open(/dev/ttyS0)->0
LS:sys_close(0)
init started:  BusyBox v1.4.2 (2007-04-09 10:09:53 EEST) multi-call binary
LS:sys_open(/dev/console)
LS:sys_open(/dev/console)->0
init started:  BusyBox v1.4.2 (2007-04-09 10:09:53 EEST) multi-call binary
LS:sys_close(0)
LS:sys_open(/etc/inittab)
LS:sys_open(/etc/inittab)->0
command='/etc/init.d/rcS' action='1' terminal='/dev/ttyS0'

LS:sys_open(/dev/console)
LS:sys_open(/dev/console)->1
command='/etc/init.d/rcS' action='1' terminal='/dev/ttyS0'

LS:sys_close(1)
command='-/bin/sh -i' action='2' terminal='/dev/ttyS0'

LS:sys_open(/dev/console)
LS:sys_open(/dev/console)->1
command='-/bin/sh -i' action='2' terminal='/dev/ttyS0'

LS:sys_close(1)
LS:sys_close(0)
LS:sys_close(0)
LS:sys_close(1)
LS:sys_close(2)
LS:sys_open(/dev/ttyS0)
LS:sys_open(/dev/ttyS0)->0
Starting pid 8, console /dev/ttyS0: '/etc/init.d/rcS'
LS:do_execve(/etc/init.d/rcS)
LS:sys_close(3)
LS:sys_close(4)
LS:sys_open(/dev/klog)
KLOG: Opened
LS:sys_open(/dev/klog)->3
KLOG: main at busybox.c
LS:sys_close(3)
KLOG: Released
LS:sys_open(/etc/init.d/rcS)
LS:sys_open(/etc/init.d/rcS)->3
LS:sys_close(3)
LS:sys_open(/dev/klog)
KLOG: Opened
LS:sys_open(/dev/klog)->3
KLOG:
KLOG: Tracing started.
KLOG: LS:interactive(0)
KLOG: cmdloop(1) called
KLOG: token newline
KLOG: evaltree(NULL) called
KLOG: token newline
KLOG: evaltree(NULL) called
KLOG: token word /bin/mount
KLOG: pipeline: entered
KLOG: reread token word /bin/mount
KLOG: reread token word /bin/mount
KLOG: reread token word /bin/mount
KLOG: token word -a
KLOG: token newline
KLOG: reread token newline
KLOG: reread token newline
KLOG: reread token newline
KLOG: pid 8, evaltree(0x80d73bc: 0, 0) called
KLOG: evalcommand(0x80d73bc, 0) called
KLOG: evalcommand arg: /bin/mount
KLOG: evalcommand arg: -a
KLOG: makejob(0x80d73bc, 1) returns %1
KLOG: forkshell(%1, 0x80d73bc, 0) called
KLOG: Child shell 9
LS:sys_close(10)
LS:do_execve(/bin/mount)
LS:sys_close(4)
LS:sys_open(/dev/klog)
KLOG: Opened
LS:sys_open(/dev/klog)->4
KLOG: main at busybox.c
LS:sys_close(4)
KLOG: Released
LS:sys_open(/etc/fstab)
LS:sys_open(/etc/fstab)->4
KLOG: In parent shell:  child = 9
KLOG: waitforjob(%1) called
KLOG: dowait(1) called
LS:do_exit(pid:9,comm:mount)
KLOG: wait returns pid 9, status=0
KLOG: Job 1: changing status of proc 9 from 0xffffffff to 0x0
KLOG: Job 1: changing state from 0 to 2
KLOG: getstatus: job 1, nproc 1, status 0, retval 0
KLOG: token newline
KLOG: evaltree(NULL) called
KLOG: token newline
KLOG: evaltree(NULL) called
KLOG: token newline
KLOG: evaltree(NULL) called
KLOG: token end of file
KLOG: pid 8, exitshell(0)
LS:do_exit(pid:8,comm:rcS)
KLOG: Released
LS:do_exit(pid:10,comm:init)
LS:do_exit(pid:7,comm:init)
LS:sys_close(0)
LS:sys_close(1)
LS:sys_close(2)
LS:sys_open(/dev/ttyS0)
LS:sys_open(/dev/ttyS0)->0
LS:do_execve(/bin/sh)
LS:sys_close(3)
LS:sys_close(4)
LS:sys_open(/dev/klog)
KLOG: Opened
LS:sys_open(/dev/klog)->3
KLOG: main at busybox.c
LS:sys_close(3)
KLOG: Released
LS:sys_open(/dev/klog)
KLOG: Opened
LS:sys_open(/dev/klog)->3
KLOG:
KLOG: Tracing started.


BusyBox v1.4.2 (2007-04-09 10:09:53 EEST) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

KLOG: LS:interactive(1)
LS:sys_open(/etc/profile)
LS:sys_open(/etc/profile)->4
LS:sys_close(4)
KLOG: cmdloop(0) called
KLOG: token newline
KLOG: evaltree(NULL) called
KLOG: token newline
KLOG: evaltree(NULL) called
KLOG: token word PATH=/bin:/sbin:/usr/bin:/usr/sbin
KLOG: pipeline: entered
KLOG: reread token word PATH=/bin:/sbin:/usr/bin:/usr/sbin
KLOG: reread token word PATH=/bin:/sbin:/usr/bin:/usr/sbin
KLOG: reread token word PATH=/bin:/sbin:/usr/bin:/usr/sbin
KLOG: token newline
KLOG: reread token newline
KLOG: reread token newline
KLOG: reread token newline
KLOG: pid 11, evaltree(0x80d73bc: 0, 0) called
KLOG: evalcommand(0x80d73bc, 0) called
KLOG: token word export
KLOG: pipeline: entered
KLOG: reread token word export
KLOG: reread token word export
KLOG: reread token word export
KLOG: token word PATH
KLOG: token newline
KLOG: reread token newline
KLOG: reread token newline
KLOG: reread token newline
KLOG: pid 11, evaltree(0x80d73b4: 0, 0) called
KLOG: evalcommand(0x80d73b4, 0) called
KLOG: evalcommand arg: export
KLOG: evalcommand arg: PATH
KLOG: token newline
KLOG: evaltree(NULL) called
KLOG: token end of file
LS:sys_close(10)
LS:sys_open(.profile)
LS:sys_open(.profile)->-2
KLOG: cmdloop(1) called
#


_lvnd_
 (^_^)



-----------------------------------------------------------------------
Bu mesaj Karel MailScanner ile tehlikeli icerik ve virus kontrolunden gecirilmistir.
KAREL A.S. - Bilgi Teknolojileri Bolumu
This message has been scanned for viruses and dangerous content by Karel MailScanner, and is believed to be clean.
KAREL A.S. - Information Technologies Department




More information about the busybox mailing list