Re: qemu and mips64 - init died (signal 6, exit 0)

From: Łukasz_Moskała <lm_at_lukaszmoskala.pl>
Date: Tue, 31 Jan 2023 12:58:33 UTC
Dnia Tue, Jan 31, 2023 at 03:48:49PM +0500, Eugene M. Zheganin napisał(a):
> Hello,
> 
> 
> Wanted to play locally with mips64 VM to reorganise Juniper SRX300 
> filesystem for smaller device (which runs Cavium CPU, fs is big-endian, 
> so I just cannot mount it from amd64).
> 
> I constructed an image using instructions here: 
> https://wiki.freebsd.org/QemuRecipes#mips . I also added ada0 for 
> mounting (/dev/ada0 / ufs rw 1 1) and I'm starting it using recent 
> emulators/qemu port (everything happens on an 13.1 amd64 system).
> 
> But unfortunately after booting it I have init failing (below). Is there 
> something I missed that can be assumed watching failing init ?
> 
> 
> ===Cut===
> 
> [...]
> 
> lo0: bpf attached
> tcp_init: net.inet.tcp.tcbhashsize auto tuned to 16384
> ata0: reset tp1 mask=03 ostat0=50 ostat1=00
> ata0: stat0=0x50 err=0x01 lsb=0x00 msb=0x00
> ata0: stat1=0x00 err=0x00 lsb=0xff msb=0xff
> ata0: reset tp2 stat0=50 stat1=00 devices=0x1
> ata1: reset tp1 mask=03 ostat0=50 ostat1=00
> ata1: stat0=0x00 err=0x01 lsb=0x14 msb=0xeb
> ata1: stat1=0x00 err=0x00 lsb=0xff msb=0xff
> ata1: reset tp2 stat0=00 stat1=00 devices=0x10000
> Trying to mount root from ufs:ada0 []...
> ada0 at ata0 bus 0 scbus0 target 0 lun 0
> ada0: <QEMU HARDDISK 2.5+> ATA-7 device
> ada0: Serial Number QM00001
> ada0: 33.300MB/s transfers (UDMA2, PIO 8192bytes)
> ada0: 4096MB (8388608 512 byte sectors)
> pass0 at ata0 bus 0 scbus0 target 0 lun 0
> pass0: <QEMU HARDDISK 2.5+> ATA-7 device
> pass0: Serial Number QM00001
> pass0: 33.300MB/s transfers (UDMA2, PIO 8192bytes)
> pass1 at ata1 bus 0 scbus1 target 0 lun 0
> pass1: <QEMU QEMU DVD-ROM 2.5+> Removable CD-ROM SCSI device
> pass1: Serial Number QM00003
> pass1: 33.300MB/s transfers (UDMA2, ATAPI 12bytes, PIO 65534bytes)
> GEOM: new disk cd0
> GEOM: new disk ada0
> cd0 at ata1 bus 0 scbus1 target 0 lun 0
> cd0: <QEMU QEMU DVD-ROM 2.5+> Removable CD-ROM SCSI device
> cd0: Serial Number QM00003
> cd0: 33.300MB/s transfers (UDMA2, ATAPI 12bytes, PIO 65534bytes)
> cd0: Attempt to query device size failed: NOT READY, Medium not present
> Warning: no time-of-day clock registered, system time will not be set 
> accurately
> start_init: trying /sbin/init
> init died (signal 6, exit 0)
> panic: Going nowhere without my init!
> time = 1675089140
> KDB: enter: panic
> [ thread pid 1 tid 100001 ]
> Stopped at      0x4
> db>
> 
> 
> ===Cut===
> 
> 
> Thanks.
> 
> Eugene.

Hi,
Some time ago I was trying to run FreeBSD on SRX240.

I don't know about SRX300, but SRX240 has soldered-in flash that is connected via usb so I couldn't take image from that.

I could load kernel over tftp and it started to boot, however:

- it hung on initializing USB controller
- when I removed USB support from kernel, it couldn't find root fs (as only storage media is attached via usb)

I didn't get to any promising result. I was more or less trying to guess which configuration of kernel will work.

If you want, I can search for commands that I used to load kernel over tftp and boot it. I couldn't get freebsd's loader to work, nor junos loader to load freebsd kernel from external USB drive. I just used u-boot (or j-loader) to load kernel from tftp to RAM, then boot it directly.

BTW, openwrt did boot to initramfs(which I linked into kernel) and could run shell, 3 NICs were detected however none was mapped to any port on SRX.
I guess some or all NICs that you will see in non-junos distributions are connected to ASIC only, and then ASIC handles VLANs.

Also, you can try changing init to /bin/sh and see what will happen.

Sorry for rather chaotic message, this was more than year ago and I don't remember this exactly.
I hope something from here helps you and email me if you have any further questions.

Regards,
Łukasz