4.9 inmates on ARM

63 views
Skip to first unread message

Ralf Ramsauer

unread,
Jan 10, 2017, 12:06:11 PM1/10/17
to Jailhouse
Hi,

I'm experiencing some issues with Linux inmates on ARM on my Jetson TK1
since inmate kernel 4.9.

While the same .config works fine with 4.8, since 4.9 I get the
following error message:

[ 0.311186] Unpacking initramfs...
[ 0.311211] Initramfs unpacking failed: junk in compressed archive

and of course, a few messages later this is followed by an 'unable to
mount rootfs'.

Now, the point is that my initramfs is actually an uncompressed one (I'm
using buildroot for generating it). There is no point in compressing it.

But even if I'm gzipping it before: I still get the same error message
(while 4.8 is able to successfully boot the compressed archive).
Recompressing it with cpio doesn't solve the issue as well, so I doubt
that my archive is broken...

The code producing this error message (in init/initramfs.c) wasn't
touched since 09/15, so this must be something else...

Anyone any suggestions?

Best
Ralf

Jan Kiszka

unread,
Jan 10, 2017, 12:28:05 PM1/10/17
to Ralf Ramsauer, Jailhouse
On 2017-01-10 18:05, Ralf Ramsauer wrote:
> Hi,
>
> I'm experiencing some issues with Linux inmates on ARM on my Jetson TK1
> since inmate kernel 4.9.
>
> While the same .config works fine with 4.8, since 4.9 I get the
> following error message:
>
> [ 0.311186] Unpacking initramfs...
> [ 0.311211] Initramfs unpacking failed: junk in compressed archive
>
> and of course, a few messages later this is followed by an 'unable to
> mount rootfs'.
>
> Now, the point is that my initramfs is actually an uncompressed one (I'm
> using buildroot for generating it). There is no point in compressing it.

Mine are uncompressed as well, hmm...

>
> But even if I'm gzipping it before: I still get the same error message
> (while 4.8 is able to successfully boot the compressed archive).
> Recompressing it with cpio doesn't solve the issue as well, so I doubt
> that my archive is broken...
>
> The code producing this error message (in init/initramfs.c) wasn't
> touched since 09/15, so this must be something else...
>
> Anyone any suggestions?

Kernel too big? Try playing with our magic formula:

# leave sufficient space between the kernel and the initrd
image_size += kernel_size * 4

(this sucks...)

I had an offlist report on x86 issues as well.

Jan

--
Siemens AG, Corporate Technology, CT RDA ITP SES-DE
Corporate Competence Center Embedded Linux

Ralf Ramsauer

unread,
Jan 10, 2017, 1:08:54 PM1/10/17
to Jan Kiszka, Jailhouse
On 01/10/2017 06:28 PM, Jan Kiszka wrote:
> On 2017-01-10 18:05, Ralf Ramsauer wrote:
>> Hi,
>>
>> I'm experiencing some issues with Linux inmates on ARM on my Jetson TK1
>> since inmate kernel 4.9.
>>
>> While the same .config works fine with 4.8, since 4.9 I get the
>> following error message:
>>
>> [ 0.311186] Unpacking initramfs...
>> [ 0.311211] Initramfs unpacking failed: junk in compressed archive
>>
>> and of course, a few messages later this is followed by an 'unable to
>> mount rootfs'.
>>
>> Now, the point is that my initramfs is actually an uncompressed one (I'm
>> using buildroot for generating it). There is no point in compressing it.
>
> Mine are uncompressed as well, hmm...
>
>>
>> But even if I'm gzipping it before: I still get the same error message
>> (while 4.8 is able to successfully boot the compressed archive).
>> Recompressing it with cpio doesn't solve the issue as well, so I doubt
>> that my archive is broken...
>>
>> The code producing this error message (in init/initramfs.c) wasn't
>> touched since 09/15, so this must be something else...
>>
>> Anyone any suggestions?
>
> Kernel too big? Try playing with our magic formula:
Nope, kernel is not really too big:
3.3M zImage-inmate-4.8 (working one)
3.4M zImage-inmate-4.9
so it just got ~100KB larger.
>
> # leave sufficient space between the kernel and the initrd
> image_size += kernel_size * 4
>
> (this sucks...)
Thanks, and in deed some magic happened! This did the trick:

diff --git a/tools/jailhouse-cell-linux b/tools/jailhouse-cell-linux
index 790f474..0d195a3 100755
--- a/tools/jailhouse-cell-linux
+++ b/tools/jailhouse-cell-linux
@@ -310,7 +310,7 @@ class ARMCommon:
ramdisk_size =
page_align(os.fstat(args.initrd.fileno()).st_size)
# leave sufficient space between the kernel and the initrd
image_size += kernel_size * 4
- kernel_size *= 5
+ kernel_size *= 6

if not args.dtb:
print('No device tree specified', file=sys.stderr)


Though I don't really understand why it now works and what I actually
changed. :-)

Params before:
[...] /root/zImage-inmate-4.9 -a 0xe8002000 /root/rootfs.cpio -a
0xe908d000 /dev/null -a 0xe8000000

Params after:
[...] /root/zImage-inmate-4.9 -a 0xe8002000 /root/rootfs.cpio -a
0xe93dc000 /dev/null -a 0xe8000000

Seems that there is now more (free) space between the kernel and the initrd.

Jan Kiszka

unread,
Jan 10, 2017, 1:12:50 PM1/10/17
to Ralf Ramsauer, Jailhouse
That's compressed. You need to look at the uncompressed Image to tell
the real difference.
The kernel is apparently unpacked right after the packed image (plus
some alignment). If the unpacked image gets too large and overwrites the
initrd - outch...

We should probably move the initrd at the end of the memory region, on
all archs. That would also move the responsibility for the gap to the
user ;).
Reply all
Reply to author
Forward
0 new messages