Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initramfs unpacking failed: junk in compressed archive #74

Closed
cleesmith opened this issue Nov 9, 2015 · 10 comments
Closed

Initramfs unpacking failed: junk in compressed archive #74

cleesmith opened this issue Nov 9, 2015 · 10 comments

Comments

@cleesmith
Copy link

Following this article:
https://techblog.lankes.org/2015/05/01/My-Memo-to-build-a-custom-Linux-Kernel-for-Qemu/
then this one:
https://techblog.lankes.org/2015/07/05/Lightweight-Virtualization-on-OS-X/

I get a linux kernel 4.3.0 and initramfs which works using qemu:
qemu-system-x86_64 -smp 2 -kernel ./bzImage -initrd ./myinitrd.cpio -append "root=/dev/ram0 rootfstype=ramfs init=init console=ttyS0" -nographic

... but fails using xhyve:
../build/xhyve -m 1G -c 2 -s 0:0,hostbridge -s 31,lpc -l com1,stdio -f kexec,bzImage,myinitrd.cpio,"earlyprintk=serial root=/dev/ram0 rootfstype=ramfs init=init console=ttyS0"
...or:
../build/xhyve -m 1G -c 2 -s 0:0,hostbridge -s 31,lpc -l com1,stdio -f kexec,bzImage,myinitrd.cpio,"earlyprintk=serial console=ttyS0"

... with this message:

[    0.327131] Initramfs unpacking failed: junk in compressed archive
vm exit[0]
reason      VMX rip     0xffffffff81878ed0
inst_length 3
status      0
exit_reason 2
qualification   0x0000000000000000
inst_type       0
inst_error      0
./my_xhyverun.sh: line 27:  5078 Abort trap: 6

... same result when myinitrd.cpio is gzipped to myinitrd.cpio.gz, probably doesn't matter.

OS X Yosemite 10.10.5
git clone https://github.com/mist64/xhyve.git
The included tiny core linux in the test folder works fine.
Any ideas as to why it's junk to one but not the other?
Did I miss something?
Thanks for this project.

@cleesmith
Copy link
Author

It appears that 4.x kernels from https://www.kernel.org/ do not work with xhyve, odd, but pre-4 kernels work just fine. Thanks.

@luke-clifton
Copy link

I am seeing this issue, why was this closed? Is there a workaround?

@cleesmith
Copy link
Author

There's no work around that I know of, and I never received a response to this issue so I closed it and moved on.

@xez
Copy link
Contributor

xez commented Jun 1, 2016

Did you compile the kernel with CONFIG_KEXEC=y?

@peterwang
Copy link

I came across the same issue while installing NixOS. I solved it by adding an offset of 16777216 (16M) to ramdisk_start (in file src/firmware/kexec.c). btw: I got the 16M value by trial and error. Here is the patch for file kexec.c:

diff --git a/src/firmware/kexec.c b/src/firmware/kexec.c
index 61aeebb..b190289 100644
--- a/src/firmware/kexec.c
+++ b/src/firmware/kexec.c
@@ -186,6 +186,12 @@ kexec_load_ramdisk(char *path) {

        ramdisk_start = ALIGNUP((kernel.base + kernel.size), 0x1000ull);

+        /* temp hack */
+        char* tmpstr = getenv("RAMDISK_START");
+        if (tmpstr != NULL) {
+            ramdisk_start += ((uint32_t) atoi(tmpstr));
+        }
+
        if ((ramdisk_start + sz) > memory.size) {
                /* not enough memory */
                fclose(f);

@zchee
Copy link
Contributor

zchee commented Oct 21, 2016

@peterwang This problem has been fixed on docker/hyperkit
moby/hyperkit#66
https://github.com/docker/hyperkit/pull/66/files

@c4milo
Copy link
Member

c4milo commented Oct 21, 2016

@zchee can it be back ported to xhyve?

@zchee
Copy link
Contributor

zchee commented Oct 21, 2016

@c4milo sure. I'll send a pull request.

@zchee
Copy link
Contributor

zchee commented Oct 21, 2016

@c4milo done :)

@c4milo
Copy link
Member

c4milo commented Oct 25, 2016

Nice, thanks!!
On Fri, Oct 21, 2016 at 1:17 PM Koichi Shiraishi notifications@github.com
wrote:

@c4milo https://github.com/c4milo done :)


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#74 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AACi0TRZykh3Q-mRqQm4dRn9kUOorKjNks5q2POcgaJpZM4GeuXj
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants