public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Musl custom initramfs kernel panic
@ 2024-03-09 14:03 efeizbudak
  2024-03-09 16:23 ` Alexandru N. Barloiu
  2024-03-09 16:26 ` Alexandru N. Barloiu
  0 siblings, 2 replies; 5+ messages in thread
From: efeizbudak @ 2024-03-09 14:03 UTC (permalink / raw
  To: Gentoo User

Hi all,

After updating my musl, my custom initramfs had stopped working. Can 
anyone give me a hand with this? I recompiled util-linux and updated the 
related files in my initramfs and also tried building it with 
static-libs but neither of these helped. On the other hand, the 
initramfs I built using genkernel works just fine.

The init error:

Error relocating /bin/mount: mnt_context_enable_noautofs: symbol not 
found
Error relocating /bin/mount: mnt_context_enable_onlyonce: symbol not 
found
Error relocating /bin/mount: mnt_context_enable_noautofs: symbol not 
found
Error relocating /bin/mount: mnt_context_enable_onlyonce: symbol not 
found
Error relocating /bin/mount: mnt_context_enable_noautofs: symbol not 
found
Error relocating /bin/mount: mnt_context_enable_onlyonce: symbol not 
found
/init: 6: cannot create /proc/sys/kernel/printk: Directory nonexistent
Fatal error during RNG initialisation
Cannot initialize crypto RNG backend.
Device /dev/sda3 is not a valid LUKS device.
/init: 8: cannot create /proc/sys/kernel/printk: Directory nonexistent
Error relocating /bin/mount: mnt_context_enable_noautofs: symbol not 
found
Error relocating /bin/mount: mnt_context_enable_onlyonce: symbol not 
found
umount: /dev: not mounted.
umount: /proc: not mounted.
umount: /sys: not mounted.
switch_root: failed to mount moving /mnt/root to /: Invalid argument
switch_root: failed. Sorry.
Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000100
Kernel Offset: 0x9000000 from 0xffffffff81000000 (relocation range: 
0xffffffff80000000-0xffffffffbfffffff)
---[ end Kernel panic - not syncing: Attempted to kill init! 
exitcode+0x00000100 ]---

my init file in my initramfs:

#!/bin/dash

mount -t devtmpfs none /dev
mount -t proc none /proc
mount -t sysfs none /sys
echo 0 > /proc/sys/kernel/printk
cryptsetup luksOpen --allow-discards /dev/sda3 root
echo 1 > /proc/sys/kernel/printk
mount -o ro /dev/mapper/root /mnt/root
umount /dev /proc /sys
exec switch_root /mnt/root /sbin/init

my initramfs files:

.
├── bin
│   ├── dash
│   ├── mount
│   └── umount
├── dev
│   ├── console
│   ├── null
│   ├── sda3
│   └── tty
├── etc
├── init
├── lib
│   ├── ld-musl-x86_64.so.1
│   ├── libblkid.so.1
│   ├── libcap.so.2
│   ├── libdevmapper.so.1.02
│   ├── libmount.so.1
│   ├── libudev.so.1
│   └── libuuid.so.1
├── lib64
├── mnt
│   └── root
├── proc
├── root
├── run
├── sbin
│   ├── cryptsetup
│   └── switch_root
├── sys
├── trq.map
├── usr
│   ├── bin
│   └── lib
│       ├── libblkid.so.1
│       ├── libc.so
│       ├── libcap.so.2
│       ├── libcryptsetup.so.12
│       ├── libgcrypt.so.20
│       ├── libgpg-error.so.0
│       ├── libjson-c.so.5
│       ├── libmount.so.1
│       ├── libpopt.so.0
│       └── libuuid.so.1
└── var
     ├── log
     └── run

how I update my initramfs:

lddtree.py --copy-to-tree /usr/src/initramfs /bin/mount /sbin/cryptsetup 
/bin/dash /sbin/switch_root /bin/umount
cd /usr/src/initramfs
find . -print0 | cpio --null --create --verbose --format=newc > 
/boot/custom-initramfs.img



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-03-10  0:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-09 14:03 [gentoo-user] Musl custom initramfs kernel panic efeizbudak
2024-03-09 16:23 ` Alexandru N. Barloiu
2024-03-09 17:59   ` efeizbudak
2024-03-10  0:41     ` Hoël Bézier
2024-03-09 16:26 ` Alexandru N. Barloiu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox