[yocto] Unable to get serial console login prompt - PowerPC 440 Virtex 5 processor

Elvis Dowson elvis.dowson at gmail.com
Tue Aug 7 13:24:19 PDT 2012


Hi,

On Aug 8, 2012, at 12:13 AM, Khem Raj wrote:

> On Tue, Aug 7, 2012 at 1:10 PM, Elvis Dowson <elvis.dowson at gmail.com> wrote:
>> Hi,
>>        I decided to modify the bash and busybox recipes to build
>> statically, and try to create a core-image-minimal root filesystem, so that
>> I can get a sensible prompt with paths set, etc, to debug the dynamic
>> linking issue.
>> 
>> Just copying a static bash binary to the root of the ramdisk image and
>> specifying init=/bash didn't work for a static bash+core-image-minimal root
>> filesystem, it aborts with a panic. If I have only the bash executable in
>> the ramdisk and nothing else, it displays the bash prompt.
>> 
>> Now, I've noticed something weird during core-image-minimal image
>> generation.
>> 
>> When I build the static versions of bash, the size of the binary is 8MB, but
>> when I explore the binary in the tar.gz image or extract it to my ramdisk,
>> it shows as being only 1.6MB.
>> 
>> How can there be a difference between the statically built bash file
>> 
>> /tool/yocto/poky/build/tmp/work/ppc440-poky-linux/bash-4.2-r4/image/bin/bash
>> (8MB)
>> 
>> and in the file contained in the core-image-minimal-virtex-5.tar.gz
>> 
>> /bin/bash (1.6MB)
>> 
>> I'm seeing the same discrepancy for busybox
>> 
>> /tool/yocto/poky/build/tmp/work/ppc440-poky-linux/busybox-1.19.4-r18/image/bin/busybox
>> (8.2 MB)
>> 
>> and in the generate rootfs image
>> 
>> /bin/busybox (1.4MB)
>> 
>> This shouldn't happen, right?
> 
> I assume they are stripped in case where they are smaller.

I tried running the newly created root filesystem, and passed init=/bin/bash to the kernel boot args, and get the kernel panic, as shown below. It doesn't happen when I just have only a static bash binary alone, in the ramdisk.

zImage starting: loaded at 0x00800000 (sp: 0x015cffb0)
Allocating 0x540e0c bytes for kernel ...
gunzipping (0x00000000 <- 0x0080f000:0x00a17de0)...done 0x4235c0 bytes
Attached initrd image at 0x00a18000-0x015cec21
initrd head: 0x1f8b0808

Linux/PowerPC load: console=ttyS0,9600n8 ip=off root=/dev/ram rw rootwait init=/bin/bash
Finalizing device tree... flat tree at 0x15dc0e0
 PM: Adding info for No Bus:ttyv9
[    0.555146] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    0.560456] 83e00000.serial: ttyS0 at MMIO 0x83e01003 (irq = 20) is a 16550
[    0.755976] console [ttyS0] enabled
[    0.820014] brd: module loaded
[    0.866758] loop: module loaded
[    0.903967] xsysace 83600000.sysace: Xilinx SystemACE revision 1.0.12
[    0.980712] xsysace 83600000.sysace: No CF in slot
[    1.039777] Xilinx SystemACE device driver, major=254
[    1.100658] xilinx_emaclite 81000000.ethernet: Device Tree Probing
[    1.174186] xilinx_emaclite 81000000.ethernet: error registering MDIO bus
[    1.255272] xilinx_emaclite 81000000.ethernet: MAC address is now 00:0a:35:b7:78:00
[    1.348888] xilinx_emaclite 81000000.ethernet: Xilinx EmacLite at 0x81000000 mapped to 0xD10A0000, irq=17
[    1.463802] xilinx_ps2 81480000.ps2: Device Tree Probing 'ps2'                                                           
[    1.533064] xilinx_ps2 81480000.ps2: Xilinx PS2 at 0x81480000 mapped to 0xd1036000, irq=22                               
[    1.632441] xilinx_ps2 81481000.ps2: Device Tree Probing 'ps2'                                                           
[    1.702118] xilinx_ps2 81481000.ps2: Xilinx PS2 at 0x81481000 mapped to 0xd1038000, irq=23                               
[    1.802689] mousedev: PS/2 mouse device common for all mice                                                              
[    1.870186] i2c /dev entries driver                                                                                      
[    1.911796] Device Tree Probing 'i2c'                                                                                    
[    1.956057] xilinx-iic #0 at 0x81600000 mapped to 0xD10C0000, irq=18                                                     
[    2.033628] TCP cubic registered                                                                                         
[    2.071533] NET: Registered protocol family 17                                                                           
[    2.866390] atkbd serio0: keyboard reset failed on xilinxps2/serio at 81480000                                           
[    3.350664] RAMDISK: gzip image found at block 0                                                                         
<7>[    3.870893] device: 'input0': device_add                                                                              
[    3.971153] input: AT Raw Set 2 keyboard as /devices/plb.0/xps-ps2.1/81481000.ps2/serio1/input/input0                    
[    6.262826] VFS: Mounted root (ext2 filesystem) on device 1:0.                                                           
[    6.332844] Freeing unused kernel memory: 152k freed                                                                     
[    6.439032] Kernel panic - not syncing: Attempted to kill init!                                                          
[    6.509122] Rebooting in 180 seconds..


I need bash to run, with a representative rootfilesystem, with all the libraries, so that I can run the commands that you asked me to earlier:

/lib/ld.so.1

and then

LD_DEBUG=all /lib/ld.so.1 ./helloworlddynamic

Is there something that I can disable to get static bash to run to the prompt, with the core-image-minimal image?

Elvis Dowson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20120808/31c5bcb2/attachment.html>


More information about the yocto mailing list