Why start into bash terminal?

It is start into bash terminal on NX emmc module start sometimes, why it start into bash terminal?
kernel.log (119.0 KB)

Because the root device mount failed. Are you sure the device is still there?

[ 58.704617] ERROR: PARTUUID=068a6318-1422-454f-8d08-5dec75a49976 mount fail…

NX module mmcblk0p1 partition is rootfs. I am sure mmcblk0p1 is still there. But why device isn’t start from emmc?

Your device does not boot from mmcblk0p1. As I said in previous comment, it is booting from an external device with UUID.

At first boot from mmcblk0p1, then I test boot from usb, usb boot success. Now pull usb out and start device , but it start into bash terminal. How can I switch to boot from mmcblk0p1?

The method does not support hotplug external device.

Now you can only modify the root device in /boot/extlinut/extlinux.conf and let it be /dev/mmcblk0p1 again.

Or just reflash the board with mmcblk0p1.

The emmc rootfs(mmcblk0p1) /boot/extlinut/extlinux.conf root device is still /dev/mmcblk0p1.I didn’t modify it. I booted from usb(rootfs) was flashed to a USB storage. The emmc and usb are different. The emmc(rootfs) root is still configed /dev/mmcblk0p1, and usb(rootfs) root device was configed /dev/sda1.

I would suggest you can directly reflash the board. Any workaround I shared may crash the board.

For example, you can try to remove cbootargs from extlinux.conf so that the root=PARTUUID=068a6318-1422 will not be passed to kernel.

If you made configuration changes while running on a USB device, then the changes may not have been saved to the correct place (I am speculating, not sure which places, but for example, you now have two extlinux.conf files involved, and I can’t even guess if anything ever gets edited in the QSPI storage via a run time configuration change).

Once NX emmc module start into bash terminal(I am guess,not sure, it started with initrd). I press keyboard on serial console into cboot when NX module start, I attempt start with usb or emmc by use “setvar boot-order usb” or “setvar boot-order emmc”, then enter boot. But it didn’t start nomal, it always start into bash terminal.

The problem is not the boot order or boot device.

It is just the cboot already took UUID=root=PARTUUID=068a6318-1422 as cboot args. So no matter what boot device you are using. It will always send this cbootargs to kernel cmdline.

Emmc extlinux.conf config root is mmcblk0p1, why it use UUID=root=PARTUUID=068a6318-1422, but not use Emmc extlinux.conf root config?

Please check what would happen if you remove the “cbootargs” in your extlinux.conf.

Remove the “cbootargs” in extlinux.conf, it isn’t start from emmc. This is start into bash terminal log:

I> ########## Fixed storage boot ##########
I> Already published: 00010003
I> Look for boot partition
I> Fallback: assuming 0th partition is boot partition
E> Invalid fm_handle (0xa0699978) or mount path passed
I> Fallback: Load binaries from partition
I> A/B: bin_type (37) slot 1
I> Loading kernel_b from partition
I> Loading partition kernel_b at 0xa4ad0000 from device(0x1)
I> Validate kernel …
I> T19x: Authenticate kernel (bin_type: 37), max size 0x5000000
I> Encryption fuse is not ON
I> Checking boot.img header magic … I> [OK]
I> A/B: bin_type (38) slot 1

From this log, i find it cann’t detect filesystem from emmc. But i don’t know why?

It looks like your device does not read extlinux.conf.

Below snippet is from my xavier.

[0005.454] I> ########## Fixed storage boot ##########
[0005.455] I> Already published: 00010003
[0005.455] I> Look for boot partition
[0005.459] I> Fallback: assuming 0th partition is boot partition
[0005.464] I> Detect filesystem
[0005.491] I> Loading extlinux.conf …
[0005.492] I> rootfs path: /sdmmc_user/boot/extlinux/extlinux.conf

Seems filesystem on your emmc is corrupted.

This situation is must appear when start from usb driver, then poweroff、 pull usb out and restart nx module. Would you test according to this?

We don’t support hotplug usb drive case when you set device to boot from usb.

I understand. Thanks.

FYI, the device tree node “chosen->bootargs” is more or less what the extlinux.conf sees as inherited via “${cbootargs}”. Earlier boot stages can edit this before passing to the kernel, but if you compare what you see from the following you’ll get an idea of what was inherited from the device tree:

grep APPEND /boot/extlinux/extlinux.conf
cat /proc/cmdline
cat /proc/device-tree/chosen/bootargs

If you modify the device tree “chosen->bootargs”, then you at least partially edit the boot arguments. There are stages where bootloaders need that content, but when ext4 is not yet readable, thus the complication.

Many (but not all) kernel command line options, if repeated, choose the last occurrence of the option on the command line.