You are not logged in.

#1 2018-01-25 21:03:49

piomiq
Member
From: Warsaw, Poland
Registered: 2017-08-04
Posts: 11
Website

[SOLVED] mkinitcpio creates broken initramfs-linux.img

Hi

Couple days ago I updated system and next day it wasn't able to start it. I got "kernel panic" error. Turned out that initramfs-linux.img and initramfs-linux-fallback.img were broken. The try of recreating this image (using chroot in live Linux distribution) or installation newly downloaded Linux kernel finished with the same generated broken images.
How do I know that image is broken? I compared size of files and newly created is always 3 times smaller than correct one (I compared with 4.14.9). Also I opened cpio file and noticed that many files is missing in newly created image comparing to correct old version. OK. Maybe better word would be "not complete" image.

Image file I tried to generate by following command:

mkinitcpio -g /boot/initramfs-linux.img -k 4.14.14-1-ARCH

I didn't receive any errors in result of running this command, skipping this: "bsdcpio: Failed to set default locale". I'm not sure is this the reason of broken/not complete image file.

I reinstalled mkinitcpio (ver.24-2), but didn't help.

Manual installation of kernel shows me messages as below:

# pacman -U linux-4.14.14-1-x86_64.pkg.tar.xz
loading packages...
warning: linux-4.14.14-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) linux-4.14.14-1

Total Installed Size:  101.16 MiB
Net Upgrade Size:        0.00 MiB

:: Proceed with installation? [Y/n] Y
(1/1) checking keys in keyring                                                           [###################################################] 100%
(1/1) checking package integrity                                                         [###################################################] 100%
(1/1) loading package files                                                              [###################################################] 100%
(1/1) checking for file conflicts                                                        [###################################################] 100%
(1/1) checking available disk space                                                      [###################################################] 100%
:: Processing package changes...
(1/1) reinstalling linux                                                                 [###################################################] 100%
:: Running post-transaction hooks...
(1/3) Updating linux module dependencies...
(2/3) Updating linux initcpios...
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'default'
  -> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img
==> Starting build: 4.14.14-1-ARCH
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [autodetect]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
  -> Running build hook: [keyboard]
  -> Running build hook: [keymap]
  -> Running build hook: [filesystems]
  -> Running build hook: [fsck]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-linux.img
bsdcpio: Failed to set default locale
==> Image generation successful
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'fallback'
  -> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-fallback.img -S autodetect
==> Starting build: 4.14.14-1-ARCH
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
==> WARNING: Possibly missing firmware for module: aic94xx
==> WARNING: Possibly missing firmware for module: wd719x
  -> Running build hook: [keyboard]
  -> Running build hook: [keymap]
  -> Running build hook: [filesystems]
  -> Running build hook: [fsck]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-linux-fallback.img
bsdcpio: Failed to set default locale
==> Image generation successful
(3/3) Arming ConditionNeedsUpdate...

Installation the newest kernel didn't help. Still initramfs-linux.img weighs ~2MB

Below please find content of presets, so file: /etc/mkinitcpio.d/linux.preset

# mkinitcpio preset file for the 'linux' package

ALL_config="/etc/mkinitcpio.conf"
ALL_kver="/boot/vmlinuz-linux"

PRESETS=('default' 'fallback')

#default_config="/etc/mkinitcpio.conf"
default_image="/boot/initramfs-linux.img"
#default_options=""

#fallback_config="/etc/mkinitcpio.conf"
fallback_image="/boot/initramfs-linux-fallback.img"
fallback_options="-S autodetect"

And  /etc/mkinitcpio.conf file:

# grep -v '#' mkinitcpio.conf 
MODULES=()

BINARIES=()

FILES=()

HOOKS=(base udev autodetect modconf block filesystems keyboard fsck)

Could anybody help me find the reason and fix this issue?
I'm not able to install any Linux kernel. I use some archived one, for which I made backup sometime ago.
Thanks in advance.

Last edited by piomiq (2018-01-26 21:22:48)

Offline

#2 2018-01-25 21:19:36

lo1
Member
Registered: 2017-09-25
Posts: 584

Re: [SOLVED] mkinitcpio creates broken initramfs-linux.img

Fixing your locale is not a bad idea, start from there to keep it out of the equation.

Offline

#3 2018-01-25 21:58:25

piomiq
Member
From: Warsaw, Poland
Registered: 2017-08-04
Posts: 11
Website

Re: [SOLVED] mkinitcpio creates broken initramfs-linux.img

I'm not sure what is wrong hmm.
I checked it like this:

$ locale -a
C
pl_PL.utf8
POSIX

$ locale
LANG=pl_PL.UTF-8
LC_CTYPE="pl_PL.UTF-8"
LC_NUMERIC="pl_PL.UTF-8"
LC_TIME="pl_PL.UTF-8"
LC_COLLATE=pl_PL.UTF-8
LC_MONETARY="pl_PL.UTF-8"
LC_MESSAGES="pl_PL.UTF-8"
LC_PAPER="pl_PL.UTF-8"
LC_NAME="pl_PL.UTF-8"
LC_ADDRESS="pl_PL.UTF-8"
LC_TELEPHONE="pl_PL.UTF-8"
LC_MEASUREMENT="pl_PL.UTF-8"
LC_IDENTIFICATION="pl_PL.UTF-8"
LC_ALL=

$ cat /etc/locale.gen | grep -v '#'
pl_PL.UTF-8 UTF-8  

$ cat /etc/locale.conf
LANG=pl_PL.UTF-8
LC_COLLATE=pl_PL.UTF-8

$ env | grep -i pl
LANG=pl_PL.UTF-8
DISPLAY=:0
LC_COLLATE=pl_PL.UTF-8
LANGUAGE=en_US:pl

$ localedef --list-archive
pl_PL.utf8

$ localectl list-locales
pl_PL.utf8

Anyway I set locale by:

localectl set-locale LANG=en_US.UTF-8
$ sudo pacman -S linux
...
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-linux-fallback.img
==> Image generation successful
(3/3) Arming ConditionNeedsUpdate...

As you can see in result warning about failed locale disappeared, but image files after installation new Linux kernel still are not complete:

$ ls -lh | grep img
-rw-r--r-- 1 root root  22M 01-25 22:46 initramfs-linux-fallback.img
-rw-r--r-- 1 root root 2,0M 01-25 22:45 initramfs-linux.img
-rw-r--r-- 1 root root 1,6M 11-18 20:44 intel-ucode.img
$ file vmlinuz-linux 
vmlinuz-linux: Linux kernel x86 boot executable bzImage, version 4.14.15-1-ARCH (builduser@heftig) #1 SMP PREEMPT Tue Jan 23 21:49:25 UTC 2018, RO-rootFS, swap_dev 0x4, Normal VGA

Offline

#4 2018-01-25 22:29:47

seth
Member
Registered: 2012-09-03
Posts: 10,911

Re: [SOLVED] mkinitcpio creates broken initramfs-linux.img

noticed that many files is missing

lsinitcpio /boot/initramfs-linux.img

Offline

#5 2018-01-26 20:36:49

piomiq
Member
From: Warsaw, Poland
Registered: 2017-08-04
Posts: 11
Website

Re: [SOLVED] mkinitcpio creates broken initramfs-linux.img

Yes it is. The issue is why, and what this happened. I don't remember to I would "rummaged in the system" at the day before I was not be able to run system. I was really surprised and angry on this situation.

As I said before I uncompressed image and opened cpio file (in mc) and also noticed that a lot of files is missing. I compared list from broken correct one.
Anyway below please find full list of files from broken image:

$ lsinitcpio initramfs-linux.img

usr
usr/lib64
usr/lib
usr/lib/modules
usr/lib/modules/4.14.14-1-ARCH
usr/lib/modules/4.14.14-1-ARCH/kernel
usr/lib/modules/4.14.14-1-ARCH/kernel/xhci-hcd.ko
usr/lib/modules/4.14.14-1-ARCH/kernel/libahci.ko
usr/lib/modules/4.14.14-1-ARCH/kernel/usb-common.ko
usr/lib/modules/4.14.14-1-ARCH/kernel/ahci.ko
usr/lib/modules/4.14.14-1-ARCH/kernel/crc32c_generic.ko
usr/lib/modules/4.14.14-1-ARCH/kernel/mbcache.ko
usr/lib/modules/4.14.14-1-ARCH/kernel/jbd2.ko
usr/lib/modules/4.14.14-1-ARCH/kernel/hid-generic.ko
usr/lib/modules/4.14.14-1-ARCH/kernel/fscrypto.ko
usr/lib/modules/4.14.14-1-ARCH/kernel/cdrom.ko
usr/lib/modules/4.14.14-1-ARCH/kernel/hid-microsoft.ko
usr/lib/modules/4.14.14-1-ARCH/kernel/scsi_mod.ko
usr/lib/modules/4.14.14-1-ARCH/kernel/crc32c-intel.ko
usr/lib/modules/4.14.14-1-ARCH/kernel/usbcore.ko
usr/lib/modules/4.14.14-1-ARCH/kernel/libata.ko
usr/lib/modules/4.14.14-1-ARCH/kernel/serio.ko
usr/lib/modules/4.14.14-1-ARCH/kernel/ext4.ko
usr/lib/modules/4.14.14-1-ARCH/kernel/uas.ko
usr/lib/modules/4.14.14-1-ARCH/kernel/hid.ko
usr/lib/modules/4.14.14-1-ARCH/kernel/sd_mod.ko
usr/lib/modules/4.14.14-1-ARCH/kernel/xhci-pci.ko
usr/lib/modules/4.14.14-1-ARCH/kernel/usbhid.ko
usr/lib/modules/4.14.14-1-ARCH/kernel/serio_raw.ko
usr/lib/modules/4.14.14-1-ARCH/kernel/crc16.ko
usr/lib/modules/4.14.14-1-ARCH/kernel/i8042.ko
usr/lib/modules/4.14.14-1-ARCH/kernel/libps2.ko
usr/lib/modules/4.14.14-1-ARCH/kernel/sr_mod.ko
usr/lib/modules/4.14.14-1-ARCH/kernel/atkbd.ko
usr/lib/modules/4.14.14-1-ARCH/kernel/usb-storage.ko
usr/lib/modules/4.14.14-1-ARCH/modules.softdep
usr/lib/modules/4.14.14-1-ARCH/modules.dep.bin
usr/lib/modules/4.14.14-1-ARCH/modules.alias.bin
usr/lib/modules/4.14.14-1-ARCH/modules.builtin.bin
usr/lib/modules/4.14.14-1-ARCH/modules.symbols.bin
usr/lib/modules/4.14.14-1-ARCH/modules.devname
usr/lib/systemd
usr/lib/systemd/systemd-udevd
usr/lib/udev
usr/lib/udev/scsi_id
usr/lib/udev/ata_id
usr/lib/udev/rules.d
usr/lib/udev/rules.d/50-udev-default.rules
usr/lib/udev/rules.d/64-btrfs.rules
usr/lib/udev/rules.d/60-persistent-storage.rules
usr/lib/udev/rules.d/80-drivers.rules
usr/lib/modprobe.d
usr/lib/modprobe.d/bluetooth-usb.conf
usr/lib/modprobe.d/systemd.conf
usr/sbin
usr/local
usr/local/lib
usr/local/sbin
usr/local/bin
usr/bin
usr/bin/awk
usr/bin/sleep
usr/bin/init
usr/bin/iptunnel
usr/bin/cut
usr/bin/wget
usr/bin/openvt
usr/bin/grep
usr/bin/mv
usr/bin/wc
usr/bin/ps
usr/bin/uniq
usr/bin/ifconfig
usr/bin/[
usr/bin/nslookup
usr/bin/setfont
usr/bin/ipaddr
usr/bin/reboot
usr/bin/seq
usr/bin/modinfo
usr/bin/fallocate
usr/bin/blkdiscard
usr/bin/mount
usr/bin/ln
usr/bin/iprule
usr/bin/printf
usr/bin/fsck.ext2
usr/bin/rmdir
usr/bin/chroot
usr/bin/xxd
usr/bin/sh
usr/bin/busybox
usr/bin/unshare
usr/bin/fsck.ext4
usr/bin/paste
usr/bin/fstrim
usr/bin/sha1sum
usr/bin/ip
usr/bin/lsmod
usr/bin/less
usr/bin/ping
usr/bin/loadfont
usr/bin/free
usr/bin/sed
usr/bin/mkfifo
usr/bin/link
usr/bin/switch_root
usr/bin/unlink
usr/bin/install
usr/bin/dmesg
usr/bin/mountpoint
usr/bin/sha512sum
usr/bin/mkdir
usr/bin/tac
usr/bin/nc
usr/bin/cttyhack
usr/bin/pgrep
usr/bin/lsscsi
usr/bin/fatattr
usr/bin/pidof
usr/bin/mknod
usr/bin/yes
usr/bin/sha256sum
usr/bin/rm
usr/bin/vi
usr/bin/fsck
usr/bin/chgrp
usr/bin/kbd_mode
usr/bin/expr
usr/bin/fsfreeze
usr/bin/ipneigh
usr/bin/getopt
usr/bin/chown
usr/bin/chmod
usr/bin/stat
usr/bin/du
usr/bin/touch
usr/bin/basename
usr/bin/iplink
usr/bin/iproute
usr/bin/cat
usr/bin/halt
usr/bin/route
usr/bin/loadkmap
usr/bin/true
usr/bin/echo
usr/bin/systemd-tmpfiles
usr/bin/false
usr/bin/insmod
usr/bin/cp
usr/bin/dirname
usr/bin/shuf
usr/bin/sync
usr/bin/fsck.ext3
usr/bin/dd
usr/bin/poweroff
usr/bin/tftp
usr/bin/uname
usr/bin/losetup
usr/bin/ls
usr/bin/env
usr/bin/readlink
usr/bin/mktemp
usr/bin/modprobe
usr/bin/tail
usr/bin/uptime
usr/bin/hexdump
usr/bin/partprobe
usr/bin/rmmod
usr/bin/blkid
usr/bin/nproc
usr/bin/kmod
usr/bin/pwd
usr/bin/strings
usr/bin/sort
usr/bin/clear
usr/bin/mkpasswd
usr/bin/udevadm
usr/bin/ash
usr/bin/netstat
usr/bin/kill
usr/bin/test
usr/bin/depmod
usr/bin/head
usr/bin/killall
usr/bin/nsenter
usr/bin/truncate
usr/bin/umount
usr/bin/ping6
usr/bin/df
usr/bin/md5sum
usr/bin/telnet
init
lib64
config
sys
lib
keymap.utf8
buildconfig
etc
etc/initrd-release
etc/mtab
etc/modprobe.d
etc/modprobe.d/i915.conf
etc/ld.so.cache
etc/ld.so.conf
etc/fstab
keymap.bin
sbin
new_root
proc
init_functions
hooks
hooks/udev
hooks/keymap
VERSION
dev
tmp
bin
run

I would be appreciate for some ideas how to fix it.

Last edited by piomiq (2018-01-26 20:37:38)

Offline

#6 2018-01-26 20:53:03

seth
Member
Registered: 2012-09-03
Posts: 10,911

Re: [SOLVED] mkinitcpio creates broken initramfs-linux.img

Offline

#7 2018-01-26 20:53:11

lo1
Member
Registered: 2017-09-25
Posts: 584

Re: [SOLVED] mkinitcpio creates broken initramfs-linux.img

http://paste2.org/n4E9GKXA

Look at my (working) initramfs for reference (ignore modprobe, radeon etc...). I don't know what's wrong but: how did you update your system? A pacman.log would be nice at this point.

EDIT: seth was faster...

Last edited by lo1 (2018-01-26 20:53:58)

Offline

#8 2018-01-26 21:12:13

piomiq
Member
From: Warsaw, Poland
Registered: 2017-08-04
Posts: 11
Website

Re: [SOLVED] mkinitcpio creates broken initramfs-linux.img

@Seth
Thanks a lot. Your suggestion helped smile.
Your link pointed out the source of my problem. I'm not sure which update removed this symbolic link :S. I didn't installed mentioned in that post Firebird DBMS, but seems some package did it. Maybe I installed something from AUR hmm.

Anyway after creating symlink lib64 pointing to lib I installed new kernel and size of files look like both images would be correct.

$ cd /boot
$ ls -lh
total 39M
drwxr-xr-x 2 root root 4,0K 12-19 23:04 efi
drwxr-xr-x 6 root root 4,0K 12-19 23:14 grub
-rw-r--r-- 1 root root  27M 01-26 21:56 initramfs-linux-fallback.img
-rw-r--r-- 1 root root 6,8M 01-26 21:55 initramfs-linux.img
-rw-r--r-- 1 root root 1,6M 11-18 20:44 intel-ucode.img
-rw-r--r-- 1 root root 4,6M 01-23 22:53 vmlinuz-linux

$ file vmlinuz-linux
vmlinuz-linux: Linux kernel x86 boot executable bzImage, version 4.14.15-1-ARCH (builduser@heftig) #1 SMP PREEMPT Tue Jan 23 21:49:25 UTC 2018, RO-rootFS, swap_dev 0x4, Normal VGA

[UPDATE]
After restart. The system has risen without any problem smile.
Thanks a lot again.

Last edited by piomiq (2018-01-26 21:18:02)

Offline

#9 2018-01-26 21:17:47

seth
Member
Registered: 2012-09-03
Posts: 10,911

Re: [SOLVED] mkinitcpio creates broken initramfs-linux.img

You're welcome.
Please always remember to mark resolved threads by editing your first posts subject.

PS,  in case it's not clear: I wanted to see that list to look for a pattern of missing files to get an idea about possible causes :-)

Offline

Board footer

Powered by FluxBB