Closed 0neday closed 2 years ago
You are not booting from usb. The system is still booted from emmc.
Re-download the firmware, re-write the U-disk, insert the U-disk into the box, and then re-plug the power supply to boot from the U-disk.
What does extracting initrd.img do? Compile the kernel?
Re-download the firmware, re-write the U-disk, insert the U-disk into the box, and then re-plug the power supply to boot from the U-disk.
result is same.
What does extracting initrd.img do? Compile the kernel?
nop, kernel is not key, I dont care about kernel. I check why mount /dev/mmcblk2p2, rather than /dev/sda2?
cat /proc/cmdline
get some bootargs,
BOOT=ROOTFS
from . /scripts/local
, function local_mount_root
is key function to mount rootfs
I dont know how initrd get rootfs uuid?
maybe I need a console to get into init ramdisk
when system boot.
If I know how initrd get rootfs uuid, I will add a if else
condition to boot rootfs from usb when detect /dev/sda
devices, It is easy to realize in init
script.
As long as boot from usb, sda is automatically mounted. Your current situation shows that you have not booted from usb, some n1 boxes choose a U disk, change a U disk, or change another socket, change the firmware.
But the firmware in the U disk is invalid.
Do you have a usb keyboard plugged in? Unplug it, insert the u disk into the socket near the hdmi
insert the u disk into the socket near the hdmi
yes
But the firmware in the U disk is invalid.
is valid, I confirm!
I can mount /dev/sda2
and /dev/sda1
on current system.
Your U disk is manually mounted for storage. The firmware in your USB flash drive is invalid, and the boot from the USB flash drive is not properly booted.
Change the U disk, change the firmware. Solve the function that the firmware in the U disk can boot normally.
@ophub
use blkid
get your firmware UUID of rootfs,
xx-pc@xx-virtual-machine:~/Desktop$ sudo blkid /dev/loop3p2
/dev/loop3p2: LABEL="ROOTFS" UUID="b250e917-e0a6-4061-9145-b8ee0cc20fea" UUID_SUB="fdb0d788-5b35-4d1e-8619-75a37574ddba" TYPE="btrfs"
and then flush your firmware into usb, then change
sed -i "s/LABEL=ROOTFS/UUID=b250e917-e0a6-4061-9145-b8ee0cc20fea/" uEnv.txt
plug usb into N1 box, and boot successfully
I flash your latest firmware
openwrt_s905d_k5.4.171_2022.01.15.1130.img
, and then plug into usb port.I found, maybe boot from usb work, but
Initrd ramdisk
mount /dev/mmcblk2p2this show ramdisk init kernel and load drivers for hardware, and then mount rootfs is
/dev/mmcblk2p2
, rather than/dev/sda2
this so wierd!I use this to extract
initrd.img
and checkinit
script