UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Adventurer
Adventurer
4,674 Views
Registered: ‎06-13-2011

Problem adding libraries to initramfs on MicroBlaze

Jump to solution

I started with the Xilinx reference design and a SP605 board and got linux booting on MicroBlaze.  I created a new MicroBlaze system almost identical to the reference design with the SysACE_CompactFlash taken out as we won't be using this on our own board.  I also matched the addresses for the hardware in the new MicroBlaze system for now.  Using the same sp605_le_defconfig for configuring the kernel, and a new dts file I am able to get linux booting on the new MicroBlaze system I created.

 

I am working on running a custom linux application on the MicroBlaze and there are some shared libraries that are missing that our application needs, so I copy them over the network to /lib on the MicroBlaze system after it is up and running.  Our application runs just fine when the libraries are found in /lib.  So, I want to add these libraries to the initramfs image so I won't need to copy them manually anymore.  This is where I am running into a problem.  I am trying to add the following from /microblazeel-unknown-linux-gnu/microblazeel-unknown-linux-gnu/sys-root/lib.

 

libpthread.so.0
librt.so.1
libdl.so.2
libstdc++.so.6
libgcc_s.so.1

 

I have previously modifed the initramfs cpio archive that Xilinx provides (initramfs_minimal_le.cpio.gz) to change a line or two of a startup script and have successfully booted the system afterwards.  Now that I am adding files, the cpio archive goes from ~1.5 MB to ~2.9 MB in size.  The systems boots and hangs apparently because it now cannot open a console, output inserted below.

 

Is there a filesize limit on the initramfs archive?

 

Thanks,

 

Steve

 

 

early_printk_console is enabled at 0x84001000
Ramdisk addr 0x00000003, Compiled-in FDT at 0xc021b188
Linux version 2.6.37-00715-gf5f5376-dirty (shoaf@xray-vm-rhel6.aps.anl.gov) (gcc versi
on 4.1.2) #34 Mon Nov 28 09:59:15 CST 2011
setup_cpuinfo: initialising
setup_cpuinfo: No PVR support. Using static CPU info from FDT
cache: wt_msr_noirq
setup_memory: max_mapnr: 0x8000
setup_memory: min_low_pfn: 0x40000
setup_memory: max_low_pfn: 0x48000
On node 0 totalpages: 32768
free_area_init_node: node 0, pgdat c02a3894, node_mem_map c059b000
Normal zone: 256 pages used for memmap
Normal zone: 0 pages reserved
Normal zone: 32512 pages, LIFO batch:7
pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
pcpu-alloc: [0] 0
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 32512
Kernel command line: console=ttyS0 root=/dev/ram
PID hash table entries: 512 (order: -1, 2048 bytes)
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 124032k/131072k available
NR_IRQS:32
xlnx,xps-intc-1.00.a #0 at 0xc8000000, num_irq=7, edge=0x0
xlnx,xps-timer-1.00.a #0 at 0xc8004000, irq=3
microblaze_timer_set_mode: shutdown
microblaze_timer_set_mode: periodic
Calibrating delay loop... 48.89 BogoMIPS (lpj=97792)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
NET: Registered protocol family 16
XGpio: /axi@0/gpio@81440000: registered
XGpio: /axi@0/gpio@81420000: registered
XGpio: /axi@0/gpio@81400000: registered
Switching to clocksource microblaze_clocksource
microblaze_timer_set_mode: oneshot
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 4096 (order: 3, 32768 bytes)
TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
Skipping unavailable RESET gpio -2 (reset)
GPIO pin is already allocated
JFFS2 version 2.2. (NAND) (SUMMARY) © 2001-2006 Red Hat, Inc.
msgmni has been set to 242
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
84000000.serial: ttyS0 at MMIO 0x84001000 (irq = 2) is a 16550
console [ttyS0] enabled
Xilinx Axi Ethernet MDIO: probed
eth0: Dropping NETIF_F_SG since no checksum feature.
Device Tree Probing 'i2c'
xilinx-iic #0 at 0x81600000 mapped to 0xC80E0000, irq=6
TCP cubic registered
NET: Registered protocol family 17
Warning: unable to open an initial console.
Freeing unused kernel memory: 2950k freed

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Adventurer
Adventurer
5,815 Views
Registered: ‎06-13-2011

Re: Problem adding libraries to initramfs on MicroBlaze

Jump to solution

Finally got back to this and resolved the issue.  On this particular instance of modifying the initramfs image, I was not root when I did it.

 

Sorry about the distraction,

 

Steve

4 Replies
Xilinx Employee
Xilinx Employee
4,662 Views
Registered: ‎09-10-2008

Re: Problem adding libraries to initramfs on MicroBlaze

Jump to solution

I don't know of a file size limitation and that is still very small compared to many initrd ramdisks.

 

I'll listen to see if anyone else has any similar issues.

 

Thanks, sorry no instant answer.

0 Kudos
Adventurer
Adventurer
4,656 Views
Registered: ‎06-13-2011

Re: Problem adding libraries to initramfs on MicroBlaze

Jump to solution

John,

 

Just in case I am doing something wrong creating a new initramfs, here is how I have been doing it.  Am I missing anything?

 

Modifying the linux file system initramfs_minimal_le.cpio.gz

1. Copy the file to an empty folder
2. Unzip the file, gunzip initramfs_minimal_le.cpio.gz
3. Copy the files from the archive, cpio -ivdum < initramfs_minimal_le.cpio.gz
4. Remove the old archive, rm initramfs_minimal_le.cpio.gz
5. Make the required changes.
6. Create a new archive, find -print | cpio -H newc -o > ../initramfs_minimal_le.cpio
7. Zip the new archive up, gzip initramfs_minimal_le.cpio

 

Thanks,

 

Steve

0 Kudos
Adventurer
Adventurer
4,642 Views
Registered: ‎06-13-2011

Re: Problem adding libraries to initramfs on MicroBlaze

Jump to solution

I haven't solved this yet, but I have learned a couple of things.

 

I tried moving to the new linux 3.0 kernel released by Xilinx to see if it would help.  No change in behaviour.

 

I tried using the XMD console in SDK to remove the boot loader loading from SPI Flash as a possible problem.  That did not change anything either.  I did learn that the initramfs change in size is being seen correctly when downloading the system into the fpga.

 

Xilinx provided default initramfs,section, .init.ramfs: 0xc02d70e0-0xc0444a6b

(1497483 bytes, actual file size = 1497330 bytes)

 

My initramfs after adding libraries, section, .init.ramfs: 0xc02d70e0-0xc0582fc3

(2801379 bytes, actual file size = 2801370 bytes)

 

 

I found some information that the initial size for the file system when using initramfs should be ~1/2 of your available ram.  Which looks to be true in my system when I boot using the unmodified initramfs file from Xilinx.

 

/ # mount
rootfs on / type rootfs (rw)
none on /proc type proc (rw,relatime)
none on /sys type sysfs (rw,relatime)
none on /tmp type tmpfs (rw,relatime)
/ # df -h
Filesystem Size Used Available Use% Mounted on
none 62.0M 0 62.0M 0% /tmp
/ #

 

Back to the investigation,

 

Steve

0 Kudos
Highlighted
Adventurer
Adventurer
5,816 Views
Registered: ‎06-13-2011

Re: Problem adding libraries to initramfs on MicroBlaze

Jump to solution

Finally got back to this and resolved the issue.  On this particular instance of modifying the initramfs image, I was not root when I did it.

 

Sorry about the distraction,

 

Steve