0

I installed MIPS port of Linux on qemu. So I downloaded initrd and vmlinux (kernel 4.9.0) images from http://ftp.debian.org/debian/dists/Debian9.5/main/installer-mips/20170615+deb9u4/images/malta/netboot/ Installation completed well and I could boot qemu:

$ qemu-system-mips -M malta -m 1G -hda ./debian-mips.qcow2 \
      -initrd $initrd \
      -kernel $vmlinux \
      -append "nokaslr root=/dev/sda1" -nographic

where $initrd and $vmlinux are from the link above.

However, when I cross-compiled fresh kernel 4.18.0 using the same config as for 4.9.0 and then boot qemu again, it fails as follows:

...
[    4.019974] serial8250.0: ttyS1 at I/O 0x2f8 (irq = 3, base_baud = 115200) is a 16550A
[    4.022670] cacheinfo: Failed to find cpu0 device node
[    4.022950] cacheinfo: Unable to detect cache hierarchy for CPU 0
[    4.024763] mousedev: PS/2 mouse device common for all mice
[    4.027981] rtc_cmos 70.rtc: registered as rtc0
[    4.028277] rtc_cmos 70.rtc: alarms up to one day, 242 bytes nvram
[    4.030893] NET: Registered protocol family 10
[    4.036155] Segment Routing with IPv6
[    4.036660] mip6: Mobile IPv6
[    4.036903] NET: Registered protocol family 17
...  [    4.045894] rtc_cmos 70.rtc: setting system clock to 2018-07-23 02:26:58 UTC (1532312818)
[    4.076247] Freeing unused kernel memory: 1528K
[    4.076491] This architecture does not have kernel memory protection.
Loading, please wait...
starting version 232
[    4.685538] random: systemd-udevd: uninitialized urandom read (16 bytes read)
[    4.703542] random: systemd-udevd: uninitialized urandom read (16 bytes read)
[    4.754874] random: udevadm: uninitialized urandom read (16 bytes read)
Begin: Loading essential drivers ... done.
Begin: Running /scripts/init-premount ... done.
Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done.
Begin: Running /scripts/local-premount ... Begin: Waiting for suspend/resume device ... Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
...
done.
Gave up waiting for suspend/resume device
done.
Begin: Waiting for root file system ... Begin: Running /scripts/local-block ...
done.
done.
Gave up waiting for root file system device.  Common problems:
 - Boot args (cat /proc/cmdline)
   - Check rootdelay= (did the system wait long enough?)
 - Missing modules (cat /proc/modules; ls /dev)
ALERT!  /dev/sda1 does not exist.  Dropping to a shell!


BusyBox v1.22.1 (Debian 1:1.22.0-19+b3) built-in shell (ash)
Enter 'help' for a list of built-in commands.

(initramfs)

So for some reason it fails to mount /dev/sda1 device, although kernel has all the necessary support (file system, SCSI drivers etc.).

What could be the reason? Am I supposed to re-build initrd images every time I build new kernels?

Thanks.

  • 2
    Yes, you need to rebuild. – Ipor Sircer Jul 23 '18 at 4:50
  • @IporSircer, thanks for response. Could you elaborate on how does rebuilding initrd image help to proceed with booting the system? It looks that boot process trips over script local-block. And by the way, I don't see this script run when I boot original vmlinux and initrd.img taken from ftp.debian.org – Mark Jul 23 '18 at 23:31
  • initrd contains a lot of kernel modules to be loaded at boot, and modules can be used with only the exact same version as kernel. Every distribution recreate initrd when upgrading (changing) kernel. Your modules built for your previous kernel, so the block device driver also can't be loaded. – Ipor Sircer Jul 23 '18 at 23:43
  • But I mounted my qemu image, and did make modules_install in there, so the image does have the correct modules. Also, I extracted initrd.img and didn't see any modules in there. – Mark Jul 23 '18 at 23:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.