Wrtnode (MT7620) recording via USB boot OpenWrt process (bottom)

Source: Internet
Author: User

Now the core problem: solve the USB rootfs problem.

Find this article: http://macbruins.com/2011/09/01/easy-live-usb-for-x86-openwrt/

The inside says:

Why booting from USB fails

A Desktop Linux system typically boots up in these steps:a bootloader, usually Grub, loads Linux kernel and initial ROOTF s image into memory and starts kernel execution. From initial Rootfs Kernel starts a initialization program, usually "/init", to set up essential system components, INCLU Ding root file system. If the necessary drivers is not built in the kernel, they is loaded from kernel modules. These modules was included in the initial rootfs because it's custom built for each system (by "Dracut" or "MKINITRD" usu Ally). Finally, the control is transferred to the "real" initialization program on the root file system.

The official x86 OpenWRT distribution differs from this flow.  It skips the second step.  The OpenWRT kernel itself initializes the root file system and transfer controls to it.  This isn ' t a problem when the root file system resides in an ext2 partition of a IDE or SATA hard disk.  The ext2 and ATA drivers is already in the kernel. The USB drivers however is not, and this turns booting from USB to a catch-22:the kernel can ' t access the root file s Ystem without the USB modules, but the USB modules aren ' t available because they is on the root file system.

decided to compile the USB storage into the kernel.

Check the relevant information, found that: if the kernel to support USB Storage, you must first turn on SCSI support first.

Enter the Kernel_menuconfig, configure the relevant information, compile and run, the information of the console indeed has changed, but unfortunately, still can not mount to the USB

Rt3xxx-usbphy ubsphy.3:loaded
EHCI_HCD:USB 2.0 ' enhanced ' Host Controller (EHCI) Driver
OHCI_HCD:USB 1.1 ' Open ' Host Controller (OHCI) Driver
Rt3xxx-usbphy ubsphy.3:remote USB Device Wakeup disabled
Rt3xxx-usbphy UBSPHY.3:UTMI 16bit 30MHz
Ohci-platform 101c1000.ohci:generic Platform OHCI Controller
Ohci-platform 101c1000.ohci:new USB Bus registered, assigned bus number 1
Ohci-platform 101c1000.ohci:irq, io mem 0x101c1000
Hub 1-0:1.0:USB Hub found
Hub 1-0:1.0:1 Port Detected
Usbcore:registered New Interface Driver Usb-storage
Usbcore:registered New Interface Driver Ums-alauda
Usbcore:registered New Interface Driver ums-cypress
Usbcore:registered New Interface Driver Ums-datafab
Usbcore:registered New Interface Driver ums_eneub6250
Usbcore:registered New Interface Driver ums-freecom
Usbcore:registered New Interface Driver ums-isd200
Usbcore:registered New Interface Driver Ums-jumpshot
Usbcore:registered New Interface Driver Ums-karma
Usbcore:registered New Interface Driver Ums-onetouch
Usbcore:registered New Interface Driver Ums-realtek
Usbcore:registered New Interface Driver ums-sddr09
Usbcore:registered New Interface Driver ums-sddr55
Usbcore:registered New Interface Driver Ums-usbat
RT2880_WDT 10000120.watchdog:initialized
Usbcore:registered New Interface Driver USHC
Tcp:cubic Registered
Net:registered Protocol Family 17
8021q:802.1q VLAN Support v1.8
Key type Dns_resolver Registered
Vfs:cannot Open Root Device "sda2" or Unknown-block (0,0): error-6

The normal load log is as follows:

...    ...
0.190000] usbcore:registered new Interface driver USBFS
0.200000] usbcore:registered new Interface driver hub
0.210000] usbcore:registered new device driver USB
...    ...
0.740000] EHCI_HCD:USB 2.0 ' enhanced ' Host Controller (EHCI) Driver
0.750000] EHCI-PLATFORM:EHCI Generic platform driver
0.760000] Ehci-platform 101c0000.ehci:ehci Host Controller
0.770000] Ehci-platform 101c0000.ehci:new USB bus registered, assigned bus number 1
0.790000] ehci-platform 101c0000.ehci:irq, io mem 0x101c0000
0.820000] Ehci-platform 101C0000.EHCI:USB 2.0 started, EHCI 1.00
0.830000] Hub 1-0:1.0:USB hub found
0.840000] Hub 1-0:1.0:1 Port detected
...    ...
1.180000] USB 1-1: New high-speed USB device number 2 using Ehci-platform
4.640000] SCSI subsystem initialized
4.690000] usb-storage 1-1:1.0:USB Mass storage device detected
4.700000] Scsi0:usb-storage 1-1:1.0
4.710000] usbcore:registered new Interface driver Usb-storage
...    ...
5.710000] SCSI 0:0:0:0: direct-access HP USB 2.0 Flash 5.00 pq:0 ansi:2
5.730000] SD 0:0:0:0: [SDA] 2063360 512-byte logical blocks: (1.05 gb/1007 MiB)
5.740000] SD 0:0:0:0: [SDA] Write Protect is off
5.750000] SD 0:0:0:0: [SDA] No Caching Mode page found
5.760000] SD 0:0:0:0: [SDA] assuming drive cache:write through
5.780000] SD 0:0:0:0: [SDA] No Caching Mode page found
5.790000] SD 0:0:0:0: [SDA] assuming drive cache:write through
5.800000] SDA:SDA1 sda2
5.810000] SD 0:0:0:0: [SDA] No Caching Mode page found
5.820000] SD 0:0:0:0: [SDA] assuming drive cache:write through
5.840000] SD 0:0:0:0: [SDA] attached SCSI removable disk

Compared to the normal kernel log, found that there is a detail has not been noticed, the normal log more than a message:

SCSI subsystem Initialized

Then it is the information that registers the Usb-storage driver.

This is the time to start probe USB storage devices.

Also, the normal log shows the driver of the EHCI, while the OHCI driver with the problematic display. Don't...... USB drive Configuration is another issue.

Cancel the OHCI driver, compile, and sure enough EHCI the driver to load successfully, however, again. Once again. Still is. Failed to load to USB storage before mount.

So, I thought: will be USB storage probe time is a bit slow, not in the footsteps of Mount.

Learn the NFS mount code, plus some delay try it:) code in INIT/DO_MOUNTS.C

Retry
    for (p = fs_names; *p; p + strlen (p) +1) {

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.