OpenWrt Forum Archive

Topic: booting failed

The content of this topic has been archived on 7 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I changed "openwrt-all\target\linux\ar71xx\image\Makefile" to couple my flash and uboot as below:
#$(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLMR3420,tl-mr3420-v1,TL-MR3420,ttyS0,115200,0x34200001,1,4M))
$(eval $(call SingleProfile,AthLzma,$(fs_64k),TLMR3420,tl-mr3420-v1,TL-MR3420,ttyS0,115200,$$(lp-wr934x_mtdlayout),1048576,6619136,KRuImage))

I got a error when kernel was mounting rootfs as below:

Starting kernel ...

[    0.000000] Linux version 3.3.8 (leaf@leaf) (gcc version 4.6.3 20120201 (prerelease) (Linaro GCC 4.6-2012.02) ) #8 Wed Aug 17 17:26:46 CST 2016
..........
[    3.070000] TCP cubic registered
[    3.080000] NET: Registered protocol family 17
[    3.080000] 8021q: 802.1Q VLAN Support v1.8
[    3.090000] VFS: Cannot open root device "(null)" or unknown-block(0,0)
[    3.090000] Please append a correct "root=" boot option; here are the available partitions:
[    3.100000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

What is the cause?

leaf_ee wrote:

What is the cause?

Please ...

leaf_ee wrote:

[    3.100000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

depends on your config missing root fs.
So initramfs or root partition needed.

Check your kernel cmdline

Or kernel cmdline is provided via bootloader.

If you changed the layout, partition scheme (not sizes), of the flash aka MTD, you must change this also in the DTS file of the platform

If the platform is old you must check the board files in the kernel source directory

Hi elektroman, thanks for your advice.
But I can't quite catch what you said.
Could you give me some details, ie filename, codes, makefile,,,

Other I tried to change uboot Env to couple my firmware like this:

setenv bootargs 'console=ttyS0,115200 root=31:03 rootfstype=squashfs init=/init verbose noinitrd mtdparts=ath-nor0:256k(u-boot),64k(u-boot-env),1152k(kernel),6336k(rootfs),256k(cfg),64k(EXT),64k(EEPROM)'

and save it:

saveenv


But it seems those "env" was not adopted by uboot (or kernel).
Still error as below:
" Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,3)"

leaf_ee wrote:

I changed "openwrt-all\target\linux\ar71xx\image\Makefile" to couple my flash and uboot as below:
#$(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLMR3420,tl-mr3420-v1,TL-MR3420,ttyS0,115200,0x34200001,1,4M))
$(eval $(call SingleProfile,AthLzma,$(fs_64k),TLMR3420,tl-mr3420-v1,TL-MR3420,ttyS0,115200,$$(lp-wr934x_mtdlayout),1048576,6619136,KRuImage))

AthLzma
$$(lp-wr934x_mtdlayout)
1048576
6619136
KRuImage

looks suspicious
for beginners check every change, if it's caused the error.

Noted and thanks!

Those MACROs had been changed already.
And I had checked those MACROs before I changed uboot --- 'setenv....'!

Here are the detail of those updated MACROs:

define Sysupgrade/KRuImage
    $(call CatFiles,$(KDIR_TMP)/vmlinux-$(2).uImage,$(3),$(KDIR)/root.$(1),$(4),$(call sysupname,$(1),$(2)))
    if [ $(2) = "lp-wr934x" -a $(1) = "squashfs-64k" ]; then \
    mkdir -p $(TOPDIR)/image; \
    cp -f $(call sysupname,$(1),$(2)) $(TOPDIR)/image/$(2)-was-V2.0-$(shell date "+%Y-%m-%d").bin; \
    fi
endef

lp-wr934x_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),1152k(kernel),6336k(rootfs),256k(cfg),64k(nvram)ro,64k(art)ro,7488k@0x50000(firmware)

define Image/Build/AthLzma
    $(call MkuImageLzma,$(2),$(3) $(4))
    $(call Image/Build/Ath,$(1),$(2),$(3),$(4),$(5),$(6),$(7))
endef

define Image/Build/AthLzma/initramfs
    $(call MkuImageLzma/initramfs,$(2),$(3) $(4))
endef

$(eval $(call SingleProfile,AthLzma,$(fs_64k),LPWR934X,lp-wr934x,LP-WR934X,ttyS0,115200,$$(lp-wr934x_mtdlayout),1179628,6488064,KRuImage))

Is there anything wrong with those MACROs?

Another question may be relative:

The existing "uboot" is not changed before and after uploading my firmware.
It seems the "uboot" (or kernel) doesn't adopt such "setenv bootargs .." change. that means, if a firmware boots successfully in the existing "uboot", then no matter what change made to "bootargs" , like '1216k(kernel),6272k(rootfs)', the firmware will always boot successfully.
"setenv .../saveenv" takes no effect at all, why?

Solved.

My kernel image is about 1.05 MB,  should be rounded to 1088KB flash rom, not 1152KB flash rom. That means flash rom does not allow blank. I don't know why. corrected and compliled through as below:

lp-wr934x_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),1088k(kernel),6400k(rootfs),256k(cfg),64k(nvram)ro,64k(art)ro,7488k@0x50000(firmware)



Another question, generally, Linux Kernel will use its own index map of flash ROM, not inherit/adopt uboot's.

The discussion might have continued from here.