[X]关闭

zynq jffs2 或者ubi根文件系统的制作问题

文档创建者:woshinieao
浏览次数:7972
最后更新:2018-12-18
悬赏1积分未解决
首选在内核中把 filesystem下的相关支持jffs2的文件系统的选项全部选上




然后用开发包中的make_rootfs.sh 可以得到一个root.rar的文件系统。
用nfs 文件系统时,开发板可以正常启动。



自己制作成jffs2的文件系统命令:
mkfs.jffs2 -r ./filesystem -o rootfs.jffs2 -s 0x800 -e 0x10000 --pad=0x800000
mkimage -A arm -T ramdisk  -d rootfs.jffs2 urootfs.jffs2.gz


内核启动后挂载jffs2文件系统失败:


Bytes transferred = 8388672 (800040 hex)
## Booting kernel from Legacy Image at 02080000 ...
   Image Name:   Linux-4.14.0-xilinx+
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3984624 Bytes = 3.8 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 04000000 ...
   Image Name:   
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    8388608 Bytes = 8 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 02000000
   Booting using the fdt blob at 0x2000000
   Loading Kernel Image ... OK
   Loading Ramdisk to 1f800000, end 20000000 ... OK
   Loading Device Tree to 1f7fa000, end 1f7ff865 ... OK


Starting kernel ...


Booting Linux on physical CPU 0x0
Linux version 4.14.0-xilinx+ (hs@hs-Vostro-3667) (gcc version 5.2.1 20151005 (Linaro GCC 5.2-2015.11-2)) #60 SMP PREEMPT Mon Dec 17 16:09:00 CST 2018
CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
OF: fdt: Machine model: Zynq Zed Development Board
Memory policy: Data cache writealloc
Reserved memory: created DMA memory pool at 0x04000000, size 128 MiB
OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
cma: Reserved 16 MiB at 0x3f000000
random: fast init done
percpu: Embedded 16 pages/cpu @ef7cf000 s34752 r8192 d22592 u65536
Built 1 zonelists, mobility grouping on.  Total pages: 227840
Kernel command line:  root=/dev/mtdblock3 noinitrd init=/linuxrc console=ttyPS0,115200 rootfstype=jffs2 rootwait
PID hash table entries: 4096 (order: 2, 16384 bytes)
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Memory: 874652K/917504K available (6144K kernel code, 237K rwdata, 1656K rodata, 1024K init, 153K bss, 26468K reserved, 16384K cma-reserved, 245760K highmem)
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    vmalloc : 0xf0800000 - 0xff800000   ( 240 MB)
    lowmem  : 0xc0000000 - 0xf0000000   ( 768 MB)
    pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
    modules : 0xbf000000 - 0xbfe00000   (  14 MB)
      .text : 0xc0008000 - 0xc0700000   (7136 kB)
      .init : 0xc0900000 - 0xc0a00000   (1024 kB)
      .data : 0xc0a00000 - 0xc0a3b400   ( 237 kB)
       .bss : 0xc0a3b400 - 0xc0a61b9c   ( 154 kB)
Preemptible hierarchical RCU implementation.
        RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
        Tasks RCU enabled.
RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
efuse mapped to f0800000
slcr mapped to f0802000
L2C: platform modifies aux control register: 0x72360000 -> 0x72760000
L2C: DT/platform modifies aux control register: 0x72360000 -> 0x72760000
L2C-310 erratum 769419 enabled
L2C-310 enabling early BRESP for Cortex-A9
L2C-310 full line of zeros enabled for Cortex-A9
L2C-310 ID prefetch enabled, offset 1 lines
L2C-310 dynamic clock gating enabled, standby mode enabled
L2C-310 cache controller enabled, 8 ways, 512 kB
L2C-310: CACHE_ID 0x410000c8, AUX_CTRL 0x76760001
zynq_clock_init: clkc starts at f0802100
Zynq clock init
sched_clock: 64 bits at 333MHz, resolution 3ns, wraps every 4398046511103ns
clocksource: arm_global_timer: mask: 0xffffffffffffffff max_cycles: 0x4ce07af025, max_idle_ns: 440795209040 ns
Switching to timer-based delay loop, resolution 3ns
clocksource: ttc_clocksource: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 537538477 ns
timer #0 at f080a000, irq=17
Console: colour dummy device 80x30
Calibrating delay loop (skipped), value calculated using timer frequency.. 666.66 BogoMIPS (lpj=3333333)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
CPU: Testing write buffer coherency: ok
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
Setting up static identity map for 0x100000 - 0x100060
Hierarchical SRCU implementation.
smp: Bringing up secondary CPUs ...
CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
smp: Brought up 1 node, 2 CPUs
SMP: Total of 2 processors activated (1333.33 BogoMIPS).
CPU: All CPU(s) started in SVC mode.
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
futex hash table entries: 512 (order: 3, 32768 bytes)
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
cpuidle: using governor menu
hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
hw-breakpoint: maximum watchpoint size is 4 bytes.
zynq-ocm f800c000.ocmc: ZYNQ OCM pool: 256 KiB @ 0xf0880000
zynq-pinctrl 700.pinctrl: zynq pinctrl initialized
e0001000.serial: ttyPS0 at MMIO 0xe0001000 (irq = 25, base_baud = 6249999) is a xuartps
console [ttyPS0] enabled
vgaarb: loaded
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
media: Linux media interface: v0.10
Linux video capture interface: v2.00
pps_core: LinuxPPS API ver. 1 registered
pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
PTP clock support registered
EDAC MC: Ver: 3.0.0
FPGA manager framework
fpga-region fpga-full: FPGA Region probed
clocksource: Switched to clocksource arm_global_timer
NET: Registered protocol family 2
TCP established hash table entries: 8192 (order: 3, 32768 bytes)
TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
UDP hash table entries: 512 (order: 2, 16384 bytes)
UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
hw perfevents: no interrupt-affinity property for /pmu@f8891000, guessing.
hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available
workingset: timestamp_bits=30 max_order=18 bucket_order=0
jffs2: version 2.2. (NAND) (SUMMARY)  &#169; 2001-2006 Red Hat, Inc.
bounce: pool size: 64 pages
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
io scheduler mq-deadline registered
io scheduler kyber registered
dma-pl330 f8003000.dmac: Loaded driver for PL330 DMAC-241330
dma-pl330 f8003000.dmac:         DBUFF-128x8bytes Num_Chans-8 Num_Peri-4 Num_Events-16
brd: module loaded
loop: module loaded
m25p80 spi0.0: found s25fl256s1, expected n25q128a11
m25p80 spi0.0: s25fl256s1 (65536 Kbytes)
4 ofpart partitions found on MTD device spi0.0
Creating 4 MTD partitions on "spi0.0":
0x000000000000-0x000000f00000 : "qspi-fsbl-uboot-hs"
0x000000f00000-0x000001400000 : "qspi-linux-hs"
0x000001400000-0x000001420000 : "qspi-device-tree-hs"
0x000001420000-0x000002000000 : "qspi-rootfs-hs"
libphy: Fixed MDIO Bus: probed
libphy: MACB_mii_bus: probed
macb e000b000.ethernet eth0: Cadence GEM rev 0x00020118 at 0xe000b000 irq 27 (00:0a:35:00:01:22)
Marvell 88E1510 e000b000.ethernet-ffffffff:00: attached PHY driver [Marvell 88E1510] (mii_bus:phy_addr=e000b000.ethernet-ffffffff:00, irq=POLL)
libphy: MACB_mii_bus: probed
macb e000c000.ethernet eth1: Cadence GEM rev 0x00020118 at 0xe000c000 irq 28 (00:0a:35:00:00:02)
Xilinx PCS/PMA PHY e000c000.ethernet-ffffffff:00: attached PHY driver [Xilinx PCS/PMA PHY] (mii_bus:phy_addr=e000c000.ethernet-ffffffff:00, irq=POLL)
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-pci: EHCI PCI platform driver
usbcore: registered new interface driver usb-storage
chipidea-usb2 e0002000.usb: e0002000.usb supply vbus not found, using dummy regulator
ci_hdrc ci_hdrc.0: unable to init phy: -110
ci_hdrc: probe of ci_hdrc.0 failed with error -110
udc-core: couldn't find an available UDC - added [g_ether] to list of pending drivers
i2c /dev entries driver
IR NEC protocol handler initialized
IR RC5(x/sz) protocol handler initialized
IR RC6 protocol handler initialized
IR JVC protocol handler initialized
IR Sony protocol handler initialized
IR SANYO protocol handler initialized
IR Sharp protocol handler initialized
IR MCE Keyboard/mouse protocol handler initialized
IR XMP protocol handler initialized
cdns-wdt f8005000.watchdog: Xilinx Watchdog Timer at f098c000 with timeout 10s
EDAC MC: ECC not enabled
Xilinx Zynq CpuIdle Driver started
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
mmc0: SDHCI controller on e0100000.sdhci [e0100000.sdhci] using ADMA
mmc1: SDHCI controller on e0101000.sdhci [e0101000.sdhci] using ADMA
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
fpga_manager fpga0: Xilinx Zynq FPGA Manager registered
ipip: IPv4 and MPLS over IPv4 tunneling driver
NET: Registered protocol family 17
Registering SWP/SWPB emulation handler
hctosys: unable to open rtc device (rtc0)
of_cfs_init
of_cfs_init: OK
mmc1: new high speed MMC card at address 0001
mmcblk1: mmc1:0001 Q2J55L 7.09 GiB
mmcblk1boot0: mmc1:0001 Q2J55L partition 1 16.0 MiB
mmcblk1boot1: mmc1:0001 Q2J55L partition 2 16.0 MiB
mmcblk1rpmb: mmc1:0001 Q2J55L partition 3 4.00 MiB
mmcblk1: p1 p2
mmc0: Problem switching card into high-speed mode!
mmc0: new SDHC card at address 0001
mmcblk0: mmc0:0001 SD 14.8 GiB
mmcblk0: p1
jffs2: notice: (1) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
VFS: Mounted root (jffs2 filesystem) readonly on device 31:3.
Freeing unused kernel memory: 1024K
Kernel panic - not syncing: Requested init /linuxrc failed (error -2).
CPU1: stopping
CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.14.0-xilinx+ #60
Hardware name: Xilinx Zynq Platform
[<c010fd24>] (unwind_backtrace) from [<c010b0c0>] (show_stack+0x10/0x14)
[<c010b0c0>] (show_stack) from [<c064c2f0>] (dump_stack+0x80/0x9c)
[<c064c2f0>] (dump_stack) from [<c010d66c>] (ipi_cpu_stop+0x3c/0x70)
[<c010d66c>] (ipi_cpu_stop) from [<c010de70>] (handle_IPI+0x64/0x84)
[<c010de70>] (handle_IPI) from [<c0101414>] (gic_handle_irq+0x7c/0x98)
[<c0101414>] (gic_handle_irq) from [<c010bb0c>] (__irq_svc+0x6c/0xa8)
Exception stack(0xef05ff58 to 0xef05ffa0)
ff40:                                                       00000000 00000000
ff60: 2eea6000 ef7e6d40 00000000 ef7e6200 586c95d5 00000000 5810acff 00000000
ff80: 00000000 00000000 0000000b ef05ffa8 c0558b70 c0558b94 60000113 ffffffff
[<c010bb0c>] (__irq_svc) from [<c0558b94>] (cpuidle_enter_state+0xdc/0x1b0)
[<c0558b94>] (cpuidle_enter_state) from [<c014a92c>] (do_idle+0x14c/0x198)
[<c014a92c>] (do_idle) from [<c014aab0>] (cpu_startup_entry+0x18/0x1c)
[<c014aab0>] (cpu_startup_entry) from [<0010168c>] (0x10168c)
---[ end Kernel panic - not syncing: Requested init /linuxrc failed (error -2).






不知为何会提示  equested init /linuxrc failed (error -2),请问有人遇到过这个问题吗?




附件: 您需要 登录 才可以下载或查看,没有账号?立即注册

发表评论已发布 1

woshinieao

发表于 2018-12-18 10:40:59 | 显示全部楼层

问题已经解决 。Kernel panic - not syncing: Requested init /linuxrc failed (error -2).
这个的意思是没有找到linuxrc的启动程序。fs启动的过程会有很多 ,sbin/init    bin/init  之类的都是在这个里面启动 ,如果启动失败也会显示这样的问题。
我的问题是 rootfs.jffs2 根本就没有解析正确,所以无法找到linuxrc这个东西。


而导致设个问题的关键在于bootm 的参数。
bootm - boot application image from memory


Usage:
bootm [addr [arg ...]]
    - boot application image stored in memory
        passing arguments 'arg ...'; when booting a Linux kernel,
        'arg' can be the address of an initrd image
        When booting a Linux kernel which requires a flat device-tree
        a third argument is required which is the address of the
        device-tree blob. To boot that kernel without an initrd image,
        use a '-' for the second argument. If you do not pass a third
        a bd_info struct will be passed instead
       
For the new multi component uImage format (FIT) addresses
        must be extened to include component or configuration unit name:
        addr:<subimg_uname> - direct component image specification
        addr#<conf_uname>   - configuration specification
        Use iminfo command to get the list of existing component
        images and configurations.


Sub-commands to do part of the bootm sequence.  The sub-commands must be
issued in the order below (it's ok to not issue all sub-commands):
        start [addr [arg ...]]
        loados  - load OS image
        ramdisk - relocate initrd, set env initrd_start/initrd_end
        fdt     - relocate flat device tree
        cmdline - OS specific command line processing/setup
        bdt     - OS specific bd_t processing
        prep    - OS specific prep before relocation or go
        go      - start OS
红色部分就是说明 。bootm 非ramdisk的文件系统时,需要把
bootm ${kernel_load_address} ${ramdisk_load_address} ${devicetree_load_address};

改成
bootm ${kernel_load_address}  - ${devicetree_load_address};


才能不进入ramdisk的校验。直接进行jffs2的文件系统启动。






希望这篇文章能给后来的同学有所帮助。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则