11 Replies Latest reply on Nov 30, 2015 7:10 AM by bbolo1

    Load root filesystem

    pawel_krzy

      Hi,

      I have create custom board based on RIoTBoard. And I am trying to boot linux on it.

      Since I have different DDR3 configuration I had to make custom u-boot and Image.

      U-boot is up and running nicely.

       

      My card have 2 partitions:

      1st fat

      2nd ext3

      Kernel is from: git clone git://github.com/embest-tech/linux-imx.git -b embest_imx_3.0.35_4.0.0

       

      when I list files (ext2ls mmc0:2) I get root tree catalog

      Than I load my custom uImage

      ext2load mmc 0:2 0x80800000 /boot/uImage

      and run it:

      bootm 0x80800000

       

      Kernel is booting (resolve already few minor errors) and stuck when trying to load root file system (log attached)

       

      I thought the reason might be no support for ext3 in Kernel but there is ext3 support build and compile to kernel.

      Any hints or reasons? Might be that I have been loading uImage to RAM and that's why it doesn't see filesystem on card? I can provide more specific data/logs if any needed

        • Re: Load root filesystem
          bbolo1

          The 1st problem I can see is the mismatch between the rootfs type you have on your card ("ext3"), the partition name and the one supplied in the kernel command line.

          In your attached log, I can see the following kernel command line:

          Kernel command line: noinitrd console=ttymxc0,115200 root=/dev/mtdblock0 rw rootfstype=jffs2 ip=off
          
          
          
          

           

          So, the kernel is trying to mount "mtdblock0", which is a typical partition for a NAND flash chip, while an SD card is typically named "mmcblk". In addition, the kernel tries to mount a "jffs2" filesystem, which is again typical for raw flash chips.

          From your log, I cannot see the kernel is able to identify the SD card, nor its partitions, thus you won't be able to mount your SD card partitions. You definitely need a kernel with different options.

          Cheers,

          Bogdan

            • Re: Load root filesystem
              pawel_krzy

              Hi,

              You are right about jffs2 file type, (I also mount with ext3 options, but result is same since problem is with kernel which is not even see properly partition list).

               

              I tried with mmcblkXpY with changing X na Y (porper should be X=0 Y=2(or 1) since I use SD1 slot and 2nd partition) but result is same Kernel do not see any partition and panic.

              The funny thing is that kernel is shipped on SD card and to boot it I am loading it from SD card to memory

              ext2load mmc 0:2 0x80800000 /boot/uImage

              bootm 0x80800000


              I totally agree that I need too change boot parameters but changing to (which is typical solution I think) don't change error type:

               

              noinitrd console=ttymxc0,115200 root=/dev/mmcblk0p2 rw rootfstype=ext3 ip=off
              
              
              

               


                • Re: Load root filesystem
                  bbolo1

                  Could you try a different card? I guess the kernel tries to initialize the host SD card with different parameters than your own U-Boot. The bootloader shows the controller works fine with the card but maybe the kernel driver is using different ones.

                  If the kernel cannot find the SD card partitions on other cards, then the kernel SD host driver needs some patching.

                    • Re: Load root filesystem
                      pawel_krzy

                      I have tried with 2 different cards.

                      1st is made by 'dd' from original RIoTboard card

                      2nd. partitioned by fdisk utility.

                       

                      It looks like kernel is trying to use get SDHCI using DMA

                       

                      mmc0: mmc_rescan_try_freq: trying to init card at 400000 Hz

                      mmc0: SDHCI controller on platform [sdhci-esdhc-imx.0] using DMA

                      mmc1: SDHCI controller on platform [sdhci-esdhc-imx.1] using DMA

                      sdhci sdhci-esdhc-imx.2: no write-protect pin available!

                      mmc2: SDHCI controller on platform [sdhci-esdhc-imx.2] using DMA

                      Thermal calibration data is 0x59c52d5f

                      Thermal sensor with ratio = 158

                      Anatop Thermal registered as thermal_zone0

                      mmc0: mmc_rescan_try_freq: trying to init card at 300000 Hz

                      anatop_thermal_probe: default cooling device is cpufreq!

                      dcp dcp.0: DCP crypto enabled.!

                      usbcore: registered new interface driver usbhid

                      usbhid: USB HID core driver

                      usbcore: registered new interface driver snd-usb-audio

                      mxc_spdif mxc_spdif.0: MXC SPDIF Audio

                      Cirrus Logic CS42888 ALSA SoC Codec Driver

                      i2c-core: driver [cs42888] using legacy suspend method

                      i2c-core: driver [cs42888] using legacy resume method

                      mmc0: mmc_rescan_try_freq: trying to init card at 200000 Hz

                      mmc0: mmc_rescan_try_freq: trying to init card at 100000 Hz

                      wm8962 1-001a: Device is not a WM8962, ID 0 != 6243

                      wm8962 1-001a: asoc: failed to probe CODEC wm8962.1-001a: -22

                      asoc: failed to instantiate card wm8962-audio: -22

                      imx_3stack asoc driver

                      asoc: mxc-spdif <-> imx-spdif-dai.0 mapping ok

                      Initialize HDMI-audio failed. Load HDMI-video first!

                      ALSA device list:

                        #0: imx-spdif

                      TCP cubic registered

                      NET: Registered protocol family 17

                      can: controller area network core (rev 20090105 abi 8)

                      NET: Registered protocol family 29

                      mmc1: mmc_rescan_try_freq: trying to init card at 400000 Hz

                      can: raw protocol (rev 20090105)

                      can: broadcast manager protocol (rev 20090105 t)

                      Bluetooth: RFCOMM TTY layer initialized

                      Bluetooth: RFCOMM socket layer initialized

                      Bluetooth: RFCOMM ver 1.11

                      Bluetooth: BNEP (Ethernet Emulation) ver 1.3

                      Bluetooth: BNEP filters: protocol multicast

                      Bluetooth: HIDP (Human Interface Emulation) ver 1.2

                      lib80211: common routines for IEEE802.11 drivers

                      VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4

                      Bus freq driver module loaded

                      Bus freq driver Enabled

                      mxc_dvfs_core_probe

                      DVFS driver module loaded

                      regulator_init_complete: PFUZE100_VGEN6: incomplete constraints, leaving on

                      mmc1: mmc_rescan_try_freq: trying to init card at 300000 Hz

                      regulator_init_complete: PFUZE100_VGEN5: incomplete constraints, leaving on

                      regulator_init_complete: SPKVDD: incomplete constraints, leaving on

                      snvs_rtc snvs_rtc.0: setting system clock to 1970-01-01 01:14:32 UTC (4472)

                      jffs2: Too few erase blocks (2)

                      List of all partitions:

                      1f00              64 mtdblock0  (driver?)

                      No filesystem could mount root, tried:  jffs2

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

                      [<8003d438>] (unwind_backtrace+0x0/0xf8) from [<8048d23c>] (panic+0x74/0x188)

                      [<8048d23c>] (panic+0x74/0x188) from [<80008d74>] (mount_block_root+0x1e0/0x224)

                      [<80008d74>] (mount_block_root+0x1e0/0x224) from [<80008ea0>] (mount_root+0xe8/0x108)

                      [<80008ea0>] (mount_root+0xe8/0x108) from [<80008fe0>] (prepare_namespace+0x120/0x178)

                      [<80008fe0>] (prepare_namespace+0x120/0x178) from [<800089d0>] (kernel_init+0xf4/0x124)

                      [<800089d0>] (kernel_init+0xf4/0x124) from [<800385b0>] (kernel_thread_exit+0x0/0x8)

                        • Re: Load root filesystem
                          bbolo1

                          You can try to put a "rootwait" parameter in the kernel command line. This would allow the SD card driver to initialize if it needs some more time to do so.

                          "rootwait" would hold on the kernel from booting until the specified partition is ready. A similar parameter is "rootdelay", which would tell the kernel to wait for a few seconds (e.g. "rootdelay=5" to wait 5 seconds before trying to mount rootfs). The latter would allow the kernel to mount rootfs after the specified amount, however, if the root partition is not ready after the specified time, the rootfs mount process would fail.

                          Please, try to add the "rootwait" parameter and tell if the kernel is able to identify the SD card after all the waiting.

                            • Re: Load root filesystem
                              pawel_krzy

                              Ok I am closer

                              "host SD card with different parameters than your own U-Boot" <-- there were key.

                              I change card MUX setting on configuration files.

                              (had 8bit support while using only 4 to communicate with SD).

                               

                              Now kernel command line look:

                              Kernel command line: noinitrd console=ttymxc0,115200 root=/dev/mmcblk0p2 rootwait rw rootfstype=ext3 ip=off
                              

                               

                              now partitions are visible.

                               

                              VFS: Cannot open root device "mmcblk0p2" or unknown-block(179,2)
                              Please append a correct "root=" boot option; here are the available partitions:
                              mmc1: mmc_rescan_try_freq: trying to init card at 100000 Hz
                              1f00              64 mtdblock0  (driver?)
                              b300         3931136 mmcblk0  driver: mmcblk
                                b301          204800 mmcblk0p1 00000000-0000-0000-0000-000000000000
                                b302         3725312 mmcblk0p2 00000000-0000-0000-0000-000000000000
                              Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,2)
                              

                               

                              so close but why it is not booting since it looks ok?

                                • Re: Load root filesystem
                                  bbolo1

                                  It is good you have the kernel detecting the SD card partitions.

                                  Are you sure the kernel supports ext3 FS? One reason for mount failure might be the kernel's inability to recognize the filesystem in your partition. Can you try with a 2nd SD card? But please use ext2 as its filesystem for your partition. My guess is maybe the default compilation options for your kernel only included just the ext2 fs type.

                                    • Re: Load root filesystem
                                      pawel_krzy

                                      Yes I just have checked with 2nd card and filesystem is loading. BTW. Really appreciate Your help. I owe You a beer

                                      Although it is default one form RIoTboard and cause problem during loading.

                                      It looks like some packages are missing but to be honest I don't know why I can't build whole root filesystem (actually can't set install path during kernel compilation):

                                      here is how I try to build filesystem:

                                       

                                      :~$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -j4 INSTALL_PATH=/home/user_imx/linux-imx/rootfs install
                                        CHK     include/linux/version.h
                                        CHK     include/generated/utsrelease.h
                                      make[1]: `include/generated/mach-types.h' is up to date.
                                        CALL    scripts/checksyscalls.sh
                                        CHK     include/generated/compile.h
                                        Kernel: arch/arm/boot/Image is ready
                                      /bin/sh /home/user_imx/linux-imx/arch/arm/boot/install.sh 3.0.35-02887-g731b440-dirty \
                                        arch/arm/boot/Image System.map "/home/user_imx/linux-imx/rootfs"
                                      run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.0.35-02887-g731b440-dirty /home/user_imx/linux-imx/rootfs/vmlinuz-3.0.35-02887-g731b440-dirty
                                      /etc/kernel/postinst.d/apt-auto-removal: line 75: /etc/apt/apt.conf.d//01autoremove-kernels.dpkg-new: Permission denied
                                      run-parts: /etc/kernel/postinst.d/apt-auto-removal exited with return code 1
                                      make[1]: *** [install] Error 1
                                      make: *** [install] Error 2
                                      

                                       

                                       

                                      And below is my actual log from board.

                                      DVFS driver module loaded
                                      regulator_init_complete: PFUZE100_VGEN6: incomplete constraints, leaving on
                                      regulator_init_complete: PFUZE100_VGEN5: incomplete constraints, leaving on
                                      regulator_init_complete: SPKVDD: incomplete constraints, leaving on
                                      snvs_rtc snvs_rtc.0: setting system clock to 1970-01-01 01:19:00 UTC (4740)
                                      
                                      
                                      EXT3-fs: barriers not enabled
                                      kjournald starting.  Commit interval 5 seconds
                                      EXT3-fs (mmcblk0p2): using internal journal
                                      EXT3-fs (mmcblk0p2): mounted filesystem with ordered data mode
                                      VFS: Mounted root (ext3 filesystem) on device 179:2.
                                      Freeing init memory: 168K
                                      INIT: version 2.88 booting
                                      Error opening /dev/fb0: No such device
                                      Starting udev
                                      Missing devtmpfs, which is required for udev to run
                                      Halting...
                                      <7>mmc0: req done (CMD13): 0: 00000e00 00000000 00000000 00000000
                                      <7>sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
                                      <7>mmc0: starting CMD13 arg 59b40000 flags 00000195
                                      <7>mmc0: req done (CMD13): 0: 00000e00 00000000 00000000 00000000
                                      <7>mmc0: req done (CMD13): 0: 00000e00 00000000 00000000 00000000
                                      <7>mmc0: starting CMD13 arg 59b40000 flags 00000195
                                      INIT: Sending processes the TERM signaStopping Dropbear SSH server: no /usr/sbin/dropbear found; none killed
                                       * Stopping Avahi mDNS/DNS-SD Daemon: avahi-daemon
                                         ...fail!
                                      Stopping advanced power management daemon: no /usr/sbin/apmd found; none killed
                                      apmd.
                                      Stopping system message bus: dbus.
                                      hwclock: can't open '/dev/misc/rtc': No such file or directory
                                      stopping statd: done
                                      stopping mountd: done
                                      stopping nfsd: done
                                      Stopping OProfileUI server
                                      
                                      
                                      Stopping syslogd/klogd: Error opening /dev/fb0: No such device
                                      no syslogd found; none killed
                                      Stopping Telephony daemon
                                      ALSA: Storing mixer settings...
                                      /usr/sbin/alsactl: save_state:1590: No soundcards found...
                                      Deconfiguring network interfaces... ifdown: interface lo not configured
                                      ifdown: interface eth0 not configured
                                      done.
                                      Stopping Linux NFC daemon
                                      Sending all processes the TERM signal...
                                      mmc1: new high speed MMC card at address 0001
                                      mmcblk1: mmc1:0001 MMC04G 3.65 GiB
                                      mmcblk1boot0: mmc1:0001 MMC04G partition 1 1.00 MiB
                                      mmcblk1boot1: mmc1:0001 MMC04G partition 2 1.00 MiB
                                       mmcblk1: unknown partition table
                                       mmcblk1boot1: unknown partition table
                                       mmcblk1boot0: unknown partition table
                                      mmc2: mmc_rescan_try_freq: trying to init card at 400000 Hz
                                      mmc2: mmc_rescan_try_freq: trying to init card at 300000 Hz
                                      mmc2: mmc_rescan_try_freq: trying to init card at 200000 Hz
                                      mmc2: mmc_rescan_try_freq: trying to init card at 100000 Hz
                                      <7>sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
                                      <7>sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
                                      Sending all processes the KILL signal...
                                      Unmounting remote filesystems...
                                      Stopping rpcbind daemon...
                                      not running.
                                      Deactivating swap...
                                      Unmounting local filesystems...
                                      <7>mmc0: starting CMD13 arg 59b40000 flags 00000195
                                      <7>mmc0: req done (CMD13): 0: 00000e00 00000000 00000000 00000000
                                      <7>sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
                                      <7>sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
                                      <7>sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
                                      <7>sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
                                      <7>mmc0: req done (CMD13): 0: 00000e00 00000000 00000000 00000000
                                      <7>mmc0: starting CMD13 arg 59b40000 flags 00000195
                                      <7>sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
                                      <7>sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
                                      <7>mmc0: starting CMD13 arg 59b40000 flags 00000195
                                      Power down.
                                      umount: can't forcibly umount /mnt/.psplash: Invalid argument
                                      
                                      
                                      DVFS driver module loaded
                                      regulator_init_complete: PFUZE100_VGEN6: incomplete constraints, leaving on
                                      regulator_init_complete: PFUZE100_VGEN5: incomplete constraints, leaving on
                                      regulator_init_complete: SPKVDD: incomplete constraints, leaving on
                                      snvs_rtc snvs_rtc.0: setting system clock to 1970-01-01 01:19:00 UTC (4740)
                                      
                                      
                                      EXT3-fs: barriers not enabled
                                      kjournald starting.  Commit interval 5 seconds
                                      EXT3-fs (mmcblk0p2): using internal journal
                                      EXT3-fs (mmcblk0p2): mounted filesystem with ordered data mode
                                      VFS: Mounted root (ext3 filesystem) on device 179:2.
                                      Freeing init memory: 168K
                                      INIT: version 2.88 booting
                                      Error opening /dev/fb0: No such device
                                      Starting udev
                                      Missing devtmpfs, which is required for udev to run
                                      Halting...
                                      <7>mmc0: req done (CMD13): 0: 00000e00 00000000 00000000 00000000
                                      <7>sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
                                      <7>mmc0: starting CMD13 arg 59b40000 flags 00000195
                                      <7>mmc0: req done (CMD13): 0: 00000e00 00000000 00000000 00000000
                                      <7>mmc0: req done (CMD13): 0: 00000e00 00000000 00000000 00000000
                                      <7>mmc0: starting CMD13 arg 59b40000 flags 00000195
                                      INIT: Sending processes the TERM signaStopping Dropbear SSH server: no /usr/sbin/dropbear found; none killed
                                       * Stopping Avahi mDNS/DNS-SD Daemon: avahi-daemon
                                         ...fail!
                                      Stopping advanced power management daemon: no /usr/sbin/apmd found; none killed
                                      apmd.
                                      Stopping system message bus: dbus.
                                      hwclock: can't open '/dev/misc/rtc': No such file or directory
                                      stopping statd: done
                                      stopping mountd: done
                                      stopping nfsd: done
                                      Stopping OProfileUI server
                                      
                                      
                                      Stopping syslogd/klogd: Error opening /dev/fb0: No such device
                                      no syslogd found; none killed
                                      Stopping Telephony daemon
                                      ALSA: Storing mixer settings...
                                      /usr/sbin/alsactl: save_state:1590: No soundcards found...
                                      Deconfiguring network interfaces... ifdown: interface lo not configured
                                      ifdown: interface eth0 not configured
                                      done.
                                      Stopping Linux NFC daemon
                                      Sending all processes the TERM signal...
                                      mmc1: new high speed MMC card at address 0001
                                      mmcblk1: mmc1:0001 MMC04G 3.65 GiB
                                      mmcblk1boot0: mmc1:0001 MMC04G partition 1 1.00 MiB
                                      mmcblk1boot1: mmc1:0001 MMC04G partition 2 1.00 MiB
                                       mmcblk1: unknown partition table
                                       mmcblk1boot1: unknown partition table
                                       mmcblk1boot0: unknown partition table
                                      mmc2: mmc_rescan_try_freq: trying to init card at 400000 Hz
                                      mmc2: mmc_rescan_try_freq: trying to init card at 300000 Hz
                                      mmc2: mmc_rescan_try_freq: trying to init card at 200000 Hz
                                      mmc2: mmc_rescan_try_freq: trying to init card at 100000 Hz
                                      <7>sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
                                      <7>sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
                                      Sending all processes the KILL signal...
                                      Unmounting remote filesystems...
                                      Stopping rpcbind daemon...
                                      not running.
                                      Deactivating swap...
                                      Unmounting local filesystems...
                                      <7>mmc0: starting CMD13 arg 59b40000 flags 00000195
                                      <7>mmc0: req done (CMD13): 0: 00000e00 00000000 00000000 00000000
                                      <7>sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
                                      <7>sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
                                      <7>sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
                                      <7>sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
                                      <7>mmc0: req done (CMD13): 0: 00000e00 00000000 00000000 00000000
                                      <7>mmc0: starting CMD13 arg 59b40000 flags 00000195
                                      <7>sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
                                      <7>sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
                                      <7>mmc0: starting CMD13 arg 59b40000 flags 00000195
                                      Power down.
                                      umount: can't forcibly umount /mnt/.psplash: Invalid argument
                                      
                                      
                                        • Re: Load root filesystem
                                          bbolo1

                                          Great to hear my advises were helpful

                                          I guess the SD host controller is a bit picky since it doesn't accept easily any SD card. Good to know about this ...

                                          When building the rootfs and kernel, could you try the same command with "sudo" as a prefix? From your log, it seems the error is caused by insufficient permissions on certain files/directories.

                                          Now, on the boot log itself. It seems you still need to make some tweaks into your rootfs in order to be able to boot the board as you would need.

                                          It seems there's no entry for some /dev devices and this causes the kernel to halt.

                                          1. Missing devtmpfs, which is required for udev to run 
                                          2. Halting... 

                                          This probably means, the kernel had no support for "devtmpfs" which is an issue. If you want to use this kernel you might need to create the missing /dev entries manually but it might be easier to use a properly compiled kernel (e.g. including all the necessary support).