Skip to contentSkip to conversation

initramfs too large?

DISCUSSION Dave Littell 2 participants 5 messages Sep 10, 2008 – Sep 11, 2008

lore
Share & tools
lore
#0 lore raw

Hi all,

I believe my initramfs has grown beyond some limit, but I'm at a loss to know how to correct it. We recognized that we would have to allow a larger initramfs than the defaults provided, so I modified the following (on a 2.6.18 kernel):

1. .../arch/powerpc/boot/wrapper: A "-Ttext=0x1000000" was added to the ld args.

2. .../arch/powerpc/boot/zImage.lds.S: The ALIGN() directive was changed to use 16 instead of 4.

I thought I was finished and everything seemed to be working well with an initramfs CPIO archive size of approx. 9 MB. However, we just had another size increase (to a CPIO archive size of approx. 12 MB) and now I'm rewarded with this at boot:

## Booting image at 08000000 ...

   Image Name:   Linux-2.6.18_pro500-440epx_eval
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:    7113720 Bytes =  6.8 MB

Load Address: 01000000
Entry Point: 01000410
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
CPU clock-frequency <- 0x27bc86ae (667MHz)
CPU timebase-frequency <- 0x27bc86ae (667MHz) /plb: clock-frequency <- 9ef21ab (167MHz) /plb/opb: clock-frequency <- 4f790d5 (83MHz) /plb/opb/ebc: clock-frequency <- 34fb5e3 (56MHz) /plb/opb/serial@ef600300: clock-frequency <- a8c000 (11MHz) /plb/opb/serial@ef600400: clock-frequency <- a8c000 (11MHz) /plb/opb/serial@ef600500: clock-frequency <- a8c000 (11MHz) /plb/opb/serial@ef600600: clock-frequency <- a8c000 (11MHz) Memory <- <0x0 0x0 0x10000000> (256MB)
ENET0: local-mac-address <- 00:80:3f:0d:80:0d
ENET1: local-mac-address <- 79:60:04:ea:d9:a1

zImage starting: loaded at 0x01000000 (sp: 0x0ff182e8) Allocating 0x904dc0 bytes for kernel ...
gunzipping (0x00000000 <- 0x0100d000:0x01912c90)...done 0x8de100 bytes

Linux/PowerPC load: console=ttyS0,115200 console=ttyMTD3 Finalizing device tree... flat tree at 0x191f3a0

Here it sits, forever. I poked around a bit with the JTAG and found (in one instance) that probe_machine() (from setup_common.c) was taking a DataTLBError exception because it appears the machine descriptors are scrubbed to 0. I added some debug code to setup_common.c, but on the next attempted boot the JTAG showed that DataTLBError exceptions in identify_cpu() (cputable.c).

If I reduce the size of initramfs back to it's original size the system runs just fine. So, I'm guessing the larger initramfs is somehow stomping on something, but have no idea how to proceed to resolve this.

Thanks very much,
Dave

#1 lore raw

Hi Dave,

if I well understood you've done a "manual" operation very ugly. You can adjust the default settings in the kernel menu under device drivers/block devices and set the number of ramdisk device and the default size. You can use even the kernel command line option "ramdisk_size" to tell to the kernel the size of the ramdisk size you are using.

Regards.

Dave Littell ha scritto:

Quoted 68 lines

Hi all,

I believe my initramfs has grown beyond some limit, but I'm at a loss to know how to correct it. We recognized that we would have to allow a larger initramfs than the defaults provided, so I modified the following (on a 2.6.18 kernel):

1. .../arch/powerpc/boot/wrapper: A "-Ttext=0x1000000" was added to the ld args.

2. .../arch/powerpc/boot/zImage.lds.S: The ALIGN() directive was changed to use 16 instead of 4.

I thought I was finished and everything seemed to be working well with an initramfs CPIO archive size of approx. 9 MB. However, we just had another size increase (to a CPIO archive size of approx. 12 MB) and now I'm rewarded with this at boot:

## Booting image at 08000000 ...

   Image Name:   Linux-2.6.18_pro500-440epx_eval
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:    7113720 Bytes =  6.8 MB

Load Address: 01000000
Entry Point: 01000410
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
CPU clock-frequency <- 0x27bc86ae (667MHz)
CPU timebase-frequency <- 0x27bc86ae (667MHz) /plb: clock-frequency <- 9ef21ab (167MHz) /plb/opb: clock-frequency <- 4f790d5 (83MHz) /plb/opb/ebc: clock-frequency <- 34fb5e3 (56MHz) /plb/opb/serial@ef600300: clock-frequency <- a8c000 (11MHz) /plb/opb/serial@ef600400: clock-frequency <- a8c000 (11MHz) /plb/opb/serial@ef600500: clock-frequency <- a8c000 (11MHz) /plb/opb/serial@ef600600: clock-frequency <- a8c000 (11MHz) Memory <- <0x0 0x0 0x10000000> (256MB)
ENET0: local-mac-address <- 00:80:3f:0d:80:0d
ENET1: local-mac-address <- 79:60:04:ea:d9:a1

zImage starting: loaded at 0x01000000 (sp: 0x0ff182e8) Allocating 0x904dc0 bytes for kernel ...
gunzipping (0x00000000 <- 0x0100d000:0x01912c90)...done 0x8de100 bytes

Linux/PowerPC load: console=ttyS0,115200 console=ttyMTD3 Finalizing device tree... flat tree at 0x191f3a0

Here it sits, forever. I poked around a bit with the JTAG and found (in one instance) that probe_machine() (from setup_common.c) was taking a DataTLBError exception because it appears the machine descriptors are scrubbed to 0. I added some debug code to setup_common.c, but on the next attempted boot the JTAG showed that DataTLBError exceptions in identify_cpu() (cputable.c).

If I reduce the size of initramfs back to it's original size the system runs just fine. So, I'm guessing the larger initramfs is somehow stomping on something, but have no idea how to proceed to resolve this.

Thanks very much,
Dave

_______________________________________________
Linuxppc-embedded mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-embedded

Signature · 7 lines
Marco Stornelli
Embedded Software Engineer
CoRiTeL - Consorzio di Ricerca sulle Telecomunicazioni
http://www.coritel.it

[email protected]
+39 06 72582838
#2 lore raw
Quoted 11 lines · Marco Stornelli

Hi Dave,

if I well understood you've done a "manual" operation very ugly. You can adjust the default settings in the kernel menu under device drivers/block devices and set the number of ramdisk device and the default size. You can use even the kernel command line option "ramdisk_size" to tell to the kernel the size of the ramdisk size you are using.

Regards.

Hi Marco,

Thanks for the reply. I believe the ramdisk settings are OK, but I'll post them later to confirm. I did try changing those settings, but that didn't help.

Is the kernel command-line option "ramdisk_size" or "ramdisk-size" for 2.6.18?

Thanks,
Dave

Quoted 71 lines

Dave Littell ha scritto:

Quoted 68 lines

Hi all,

I believe my initramfs has grown beyond some limit, but I'm at a loss to know how to correct it. We recognized that we would have to allow a larger initramfs than the defaults provided, so I modified the following (on a 2.6.18 kernel):

1. .../arch/powerpc/boot/wrapper: A "-Ttext=0x1000000" was added to the ld args.

2. .../arch/powerpc/boot/zImage.lds.S: The ALIGN() directive was changed to use 16 instead of 4.

I thought I was finished and everything seemed to be working well with an initramfs CPIO archive size of approx. 9 MB. However, we just had another size increase (to a CPIO archive size of approx. 12 MB) and now I'm rewarded with this at boot:

## Booting image at 08000000 ...

   Image Name:   Linux-2.6.18_pro500-440epx_eval
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:    7113720 Bytes =  6.8 MB

Load Address: 01000000
Entry Point: 01000410
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
CPU clock-frequency <- 0x27bc86ae (667MHz)
CPU timebase-frequency <- 0x27bc86ae (667MHz) /plb: clock-frequency <- 9ef21ab (167MHz) /plb/opb: clock-frequency <- 4f790d5 (83MHz) /plb/opb/ebc: clock-frequency <- 34fb5e3 (56MHz) /plb/opb/serial@ef600300: clock-frequency <- a8c000 (11MHz) /plb/opb/serial@ef600400: clock-frequency <- a8c000 (11MHz) /plb/opb/serial@ef600500: clock-frequency <- a8c000 (11MHz) /plb/opb/serial@ef600600: clock-frequency <- a8c000 (11MHz) Memory <- <0x0 0x0 0x10000000> (256MB)
ENET0: local-mac-address <- 00:80:3f:0d:80:0d
ENET1: local-mac-address <- 79:60:04:ea:d9:a1

zImage starting: loaded at 0x01000000 (sp: 0x0ff182e8) Allocating 0x904dc0 bytes for kernel ...
gunzipping (0x00000000 <- 0x0100d000:0x01912c90)...done 0x8de100 bytes

Linux/PowerPC load: console=ttyS0,115200 console=ttyMTD3 Finalizing device tree... flat tree at 0x191f3a0

Here it sits, forever. I poked around a bit with the JTAG and found (in one instance) that probe_machine() (from setup_common.c) was taking a DataTLBError exception because it appears the machine descriptors are scrubbed to 0. I added some debug code to setup_common.c, but on the next attempted boot the JTAG showed that DataTLBError exceptions in identify_cpu() (cputable.c).

If I reduce the size of initramfs back to it's original size the system runs just fine. So, I'm guessing the larger initramfs is somehow stomping on something, but have no idea how to proceed to resolve this.

Thanks very much,
Dave

_______________________________________________
Linuxppc-embedded mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-embedded

#3 lore raw

Hi Dave,

no if well remeber for 2.6.18 it's "ramdisk_size" (before this option had a name slightly different) but you can check it out in the kernel documentation (in the documentation folder of your kernel). Another thing: you should check out that the kernel, the initram disk and the dtb are loaded in ram from your bootloader without overlapping, maybe you've changed the dimensions and something is overlapped.

Regards.

Dave Littell ha scritto:

Quoted 108 lines
Quoted 12 lines · Marco Stornelli

Hi Dave,

if I well understood you've done a "manual" operation very ugly. You can adjust the default settings in the kernel menu under device drivers/block devices and set the number of ramdisk device and the default size. You can use even the kernel command line option "ramdisk_size" to tell to the kernel the size of the ramdisk size you are using.

Regards.

Hi Marco,

Thanks for the reply. I believe the ramdisk settings are OK, but I'll post them later to confirm. I did try changing those settings, but that didn't help.

Is the kernel command-line option "ramdisk_size" or "ramdisk-size" for 2.6.18?

Thanks,
Dave

Quoted 71 lines

Dave Littell ha scritto:

Quoted 69 lines

Hi all,

I believe my initramfs has grown beyond some limit, but I'm at a loss to know how to correct it. We recognized that we would have to allow a larger initramfs than the defaults provided, so I modified the following (on a 2.6.18 kernel):

1. .../arch/powerpc/boot/wrapper: A "-Ttext=0x1000000" was added to the ld args.

2. .../arch/powerpc/boot/zImage.lds.S: The ALIGN() directive was changed to use 16 instead of 4.

I thought I was finished and everything seemed to be working well with an initramfs CPIO archive size of approx. 9 MB. However, we just had another size increase (to a CPIO archive size of approx. 12 MB) and now I'm rewarded with this at boot:

## Booting image at 08000000 ...

   Image Name:   Linux-2.6.18_pro500-440epx_eval
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:    7113720 Bytes =  6.8 MB

Load Address: 01000000
Entry Point: 01000410
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
CPU clock-frequency <- 0x27bc86ae (667MHz)
CPU timebase-frequency <- 0x27bc86ae (667MHz) /plb: clock-frequency <- 9ef21ab (167MHz) /plb/opb: clock-frequency <- 4f790d5 (83MHz) /plb/opb/ebc: clock-frequency <- 34fb5e3 (56MHz) /plb/opb/serial@ef600300: clock-frequency <- a8c000 (11MHz) /plb/opb/serial@ef600400: clock-frequency <- a8c000 (11MHz) /plb/opb/serial@ef600500: clock-frequency <- a8c000 (11MHz) /plb/opb/serial@ef600600: clock-frequency <- a8c000 (11MHz) Memory <- <0x0 0x0 0x10000000> (256MB)
ENET0: local-mac-address <- 00:80:3f:0d:80:0d
ENET1: local-mac-address <- 79:60:04:ea:d9:a1

zImage starting: loaded at 0x01000000 (sp: 0x0ff182e8) Allocating 0x904dc0 bytes for kernel ...
gunzipping (0x00000000 <- 0x0100d000:0x01912c90)...done 0x8de100 bytes

Linux/PowerPC load: console=ttyS0,115200 console=ttyMTD3 Finalizing device tree... flat tree at 0x191f3a0

Here it sits, forever. I poked around a bit with the JTAG and found (in one instance) that probe_machine() (from setup_common.c) was taking a DataTLBError exception because it appears the machine descriptors are scrubbed to 0. I added some debug code to setup_common.c, but on the next attempted boot the JTAG showed that DataTLBError exceptions in identify_cpu() (cputable.c).

If I reduce the size of initramfs back to it's original size the system runs just fine. So, I'm guessing the larger initramfs is somehow stomping on something, but have no idea how to proceed to resolve this.

Thanks very much,
Dave

_______________________________________________
Linuxppc-embedded mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-embedded

_______________________________________________
Linuxppc-embedded mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-embedded

Signature · 7 lines
Marco Stornelli
Embedded Software Engineer
CoRiTeL - Consorzio di Ricerca sulle Telecomunicazioni
http://www.coritel.it

[email protected]
+39 06 72582838
#4 lore raw
Quoted 9 lines · Marco Stornelli

Hi Dave,

no if well remeber for 2.6.18 it's "ramdisk_size" (before this option had a name slightly different) but you can check it out in the kernel documentation (in the documentation folder of your kernel). Another
thing: you should check out that the kernel, the initram disk and the dtb are loaded in ram from your bootloader without overlapping, maybe you've changed the dimensions and something is overlapped.

Everything is included in one zImage, so where things are placed in memory is all a function of the linker, wrapper, and gunzip, right? I did try a "ramdisk_size" command-line argument and saw no change in behavior.

I noticed today that with the smaller initramfs the kernel is smaller than 8 MB (_end < 0xc0800000), but with the larger initramfs all the symbols following the end marker for initramfs are beyond 8 MB. Is this a clue?

Using the JTAG I stopped at early_init() and looked at the __machine_desc_start area. I noticed that when booting with the smaller initramfs there's (apparently) good information in there but with the larger initramfs the area is mostly filled with 0xff's. I'm now wondering if there's some relationship between this 8 MB boundary and possibly some problem in the zImage wrapper, the wrapper's gunzip, or something in that area.

So, is 8 MB some magic number for the PowerPC kernel?

Thanks,
Dave