You are not logged in.

#1 2016-09-24 05:47:46

smash
Member
Registered: 2016-09-24
Posts: 7

[SOLVED] systemd-boot: initramfs unpacking failed: junk in...

I'm new to systemd-boot having used grub for years.

On a new clean install of arch after first boot I receive the error "Initramfs unpacking failed: junk in compressed archive".

I can resolve the issue by changing mkinitcpio.conf to use anything other than the default gzip compression.

Edit: I've not found any other reports of this problem. I did find the following post but had already tried fsck and building my partitions from scratch on clean disks and each time reproduced this problem.


Any ideas?

Last edited by smash (2016-10-04 09:26:16)

Offline

#2 2016-09-24 19:00:21

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,680
Website

Re: [SOLVED] systemd-boot: initramfs unpacking failed: junk in...

Offline

#3 2016-09-25 00:47:43

smash
Member
Registered: 2016-09-24
Posts: 7

Re: [SOLVED] systemd-boot: initramfs unpacking failed: junk in...

Apologies, I did find that post but had already tried fsck'ing my partitions which showed no problem at all.  I also completely rebuilt my partitions just to be sure and still have the same reproducible problem each time I load Arch (3 times with completely clean disks).

Offline

#4 2016-09-25 16:04:32

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,680
Website

Re: [SOLVED] systemd-boot: initramfs unpacking failed: junk in...

smash wrote:

I can resolve the issue by changing mkinitcpio.conf to use anything other than the default gzip compression.

What is the output of:

grep -v '^$\|^#' /etc/mkinitcpio.conf

Does GRUB boot fine with a gzipped initramfs?

Please also post your systemd-boot configuration files.

Offline

#5 2016-09-26 01:10:58

smash
Member
Registered: 2016-09-24
Posts: 7

Re: [SOLVED] systemd-boot: initramfs unpacking failed: junk in...

This occurs immediately after a base Arch installation, thus any config files are default.

Head_on_a_Stick wrote:
grep -v '^$\|^#' /etc/mkinitcpio.conf
MODULES=""
BINARIES=""
FILES=""
HOOKS="base udev autodetect modconf block filesystems keyboard fsck"
Head_on_a_Stick wrote:

Does GRUB boot fine with a gzipped initramfs?

I purposely didn't use GRUB due to having a UEFI system.  I'll need to create a boot USB disk to test this now.

Head_on_a_Stick wrote:

Please also post your systemd-boot configuration files.

These are stock standard also and contain nothing other than commented out lines.

Offline

#6 2016-09-26 06:50:14

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,680
Website

Re: [SOLVED] systemd-boot: initramfs unpacking failed: junk in...

smash wrote:

These are stock standard also and contain nothing other than commented out lines.

That makes no sense, you have to create the configuration file yourself.

See https://wiki.archlinux.org/index.php/Sy … figuration

Offline

#7 2016-09-27 12:15:56

smash
Member
Registered: 2016-09-24
Posts: 7

Re: [SOLVED] systemd-boot: initramfs unpacking failed: junk in...

Head_on_a_Stick wrote:

That makes no sense, you have to create the configuration file yourself.

OK, now I get you.  Nothing fancy.

loader.conf:

timeout 15
default arch

arch.conf:

title   Arch Linux
linux   /vmlinuz-linux
initrd  /initramfs-linux.img
initrd	/intel-ucode.img
options root=PARTUUID=4e751e1d-f486-46fa-b46f-92ec5f418101 rootfstype=ext4 rw add_efi_memmap

Tested with GRUB and GRUB loads the file no trouble.  Systemd-boot doesn't like something!

Last edited by smash (2016-09-27 12:19:10)

Offline

#8 2016-09-27 12:52:40

ukhippo
Member
From: Non-paged pool
Registered: 2014-02-21
Posts: 366

Re: [SOLVED] systemd-boot: initramfs unpacking failed: junk in...

I don't know if it's related to your problem, but the Intel-ucode has to be the first initrd. Otherwise the CPU microcode will not be updated.

Offline

#9 2016-09-27 21:49:05

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,680
Website

Re: [SOLVED] systemd-boot: initramfs unpacking failed: junk in...

smash wrote:

Tested with GRUB and GRUB loads the file no trouble.

How confusing hmm

Are those rootfstype & add_efi_memmap parameters applied by GRUB?

Have you tried without those added parameters?

If you `umount` the EFI system partition, is there still an initramfs and/or kernel image in /boot?

For the record, although the microcode line should be before the initramfs line my system will still boot with that order reversed.

Offline

#10 2016-09-28 04:08:32

smash
Member
Registered: 2016-09-24
Posts: 7

Re: [SOLVED] systemd-boot: initramfs unpacking failed: junk in...

Head_on_a_Stick wrote:

Are those rootfstype & add_efi_memmap parameters applied by GRUB?
Have you tried without those added parameters?

I don't recall if GRUB added them or not (not at my PC currently), but I ensured GRUB used the same kernel parameters and options that were setup in systemd-boot.

Head_on_a_Stick wrote:

If you `umount` the EFI system partition, is there still an initramfs and/or kernel image in /boot?

No, my EFI partition is mounted as /boot

Head_on_a_Stick wrote:

For the record, although the microcode line should be before the initramfs line my system will still boot with that order reversed.

I would like to say I did that on purpose to see if you were paying attention, but alas it was my mistake.  Thanks smile

I find it interesting that there is only a problem when gzip is used, I have tested every other compression method available in the mkinitcpio.conf (and cat) and they all work fine.  In my mind this suggests a problem in the method used to gzip the file, but mkinitcpio simply gzips with no options set and shouldn't cause an issue (and apparently doesn't for a ton of other arch users).

Offline

#11 2016-09-29 06:39:22

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,680
Website

Re: [SOLVED] systemd-boot: initramfs unpacking failed: junk in...

Does a direct NVRAM entry work?

https://wiki.archlinux.org/index.php/EFISTUB#efibootmgr

Please omit the rootfstype=ext4 & add_efi_memmap parameters for that entry, they should not be needed.

Also, are the systemd-boot configurations being applied correctly?

# efibootmgr -v

Offline

#12 2016-09-30 10:14:41

smash
Member
Registered: 2016-09-24
Posts: 7

Re: [SOLVED] systemd-boot: initramfs unpacking failed: junk in...

Head_on_a_Stick wrote:

Does a direct NVRAM entry work?

Not sure that helps determine what the problem is since we know GRUB can load the file fine and systemd-boot only has a problem if the file is gziped.

Offline

#13 2016-09-30 10:28:38

smash
Member
Registered: 2016-09-24
Posts: 7

Re: [SOLVED] systemd-boot: initramfs unpacking failed: junk in...

OK, went to test some other things and it seems moving intel-ucode.img to the first initrd line has resolved the problem!  Confirmed by moving it back to the 2nd entry.
If someone is able to explain why it would be appreciated.  If I remove the initrd line for intel-ucode all together, the system boots fine, but if it is 'incorrectly' loaded on the 2nd entry systemd-boot fails to extract initramfs correctly and won't boot.
Thanks for your help Head_on_a_Stick.

Offline

Board footer

Powered by FluxBB