linux内核启动报错Kernel panic - not syncing: No working init found. 问题分析

涉及到linux的内核驱动,前几次编译都正常,突然有一次无法启动,启动日志如下:

完整的日志:

U-Boot 2019.01 (Oct 31 2023 - 03:45:03 -0700)

CPU:   Zynq 7z020
Silicon: v3.1
Model: Zynq MZ7X Development Board
DRAM:  ECC disabled 768 MiB
MMC:   mmc@e0100000: 0, mmc@e0101000: 1
Loading Environment from SPI Flash... SF: unrecognized JEDEC id bytes: 20, ba, 18
*** Warning - spi_flash_probe_bus_cs() failed, using default environment

In:    serial@e0001000
Out:   serial@e0001000
Err:   serial@e0001000
Net:   ZYNQ GEM: e000b000, phyaddr ffffffff, interface rgmii-id
eth0: ethernet@e000b000
Hit any key to stop autoboot:  0 
SDCARD Boot Mode
[INFO] Scanning mmc 0...
switch to partitions #0, OK
mmc0 is current device
** Unable to read file uEnv.txt **
[INFO] Trying to boot from mmc 0
4262576 bytes read in 511 ms (8 MiB/s)
17215 bytes read in 15 ms (1.1 MiB/s)
1545152 bytes read in 195 ms (7.6 MiB/s)
INFO:post config was not run, please run manually if needed
** Unable to read file uramdisk.image.gz **
console=ttyPS0,115200 earlyprintk root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait
## Booting kernel from Legacy Image at 02080000 ...
   Image Name:   Linux-4.19.0-xilinx
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4262512 Bytes = 4.1 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 02000000
   Booting using the fdt blob at 0x2000000
   Loading Kernel Image ... OK
   Loading Device Tree to 1fff8000, end 1ffff33e ... OK

Starting kernel ...

Booting Linux on physical CPU 0x0
Linux version 4.19.0-xilinx (root@ubuntu) (gcc version 7.5.0 (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04)) #36 SMP PREEMPT Thu Sep 14 03:43:21 PDT 2023
CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
OF: fdt: Machine model: Zynq MZ7X Development Board
Memory policy: Data cache writealloc
cma: Reserved 128 MiB at 0x27c00000
random: get_random_bytes called from start_kernel+0x80/0x3c4 with crng_init=0
percpu: Embedded 16 pages/cpu @(ptrval) s35212 r8192 d22132 u65536
Built 1 zonelists, mobility grouping on.  Total pages: 195071
Kernel command line: console=ttyPS0,115200 earlyprintk root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Memory: 637880K/786428K available (6144K kernel code, 216K rwdata, 1764K rodata, 1024K init, 134K bss, 17476K reserved, 131072K cma-reserved, 0K highmem)
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    vmalloc : 0xf0000000 - 0xff800000   ( 248 MB)
    lowmem  : 0xc0000000 - 0xeffff000   ( 767 MB)
    pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
    modules : 0xbf000000 - 0xbfe00000   (  14 MB)
      .text : 0x(ptrval) - 0x(ptrval)   (7136 kB)
      .init : 0x(ptrval) - 0x(ptrval)   (1024 kB)
      .data : 0x(ptrval) - 0x(ptrval)   ( 217 kB)
       .bss : 0x(ptrval) - 0x(ptrval)   ( 135 kB)
rcu: Preemptible hierarchical RCU implementation.
rcu: 	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 (ptrval)
slcr mapped to (ptrval)
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 (ptrval)
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 (ptrval), 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: Spectre v2: using BPIALL workaround
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
Setting up static identity map for 0x100000 - 0x10003c
rcu: Hierarchical SRCU implementation.
smp: Bringing up secondary CPUs ...
CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
CPU1: Spectre v2: using BPIALL workaround
smp: Brought up 1 node, 2 CPUs
SMP: Total of 2 processors activated (1333.33 BogoMIPS).
CPU: All CPU(s) started in SVC mode.
devtmpfs: initialized
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 @ 0x(ptrval)
zynq-pinctrl 700.pinctrl: zynq pinctrl initialized
e0000000.serial: ttyPS1 at MMIO 0xe0000000 (irq = 27, base_baud = 6249999) is a xuartps
e0001000.serial: ttyPS0 at MMIO 0xe0001000 (irq = 28, base_baud = 6249999) is a xuartps
console [ttyPS0] enabled
XGpio: gpio@41200000: registered, base is 1006
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
videodev: 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
Advanced Linux Sound Architecture Driver Initialized.
clocksource: Switched to clocksource arm_global_timer
NET: Registered protocol family 2
tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes)
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)  ? 2001-2006 Red Hat, Inc.
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
xilinx-vdma 40400000.dma: Xilinx AXI DMA Engine Driver Probed!!
xilinx-vdma 43000000.dma: Xilinx AXI VDMA Engine Driver Probed!!
axidma: axidma_dma.c: axidma_dma_init: 718: DMA: Found 1 transmit channels and 1 receive channels.
axidma: axidma_dma.c: axidma_dma_init: 720: VDMA: Found 0 transmit channels and 0 receive channels.
42c00000.serial: ttyUL1 at MMIO 0x42c00000 (irq = 57, base_baud = 0) is a uartlite
pwm-backlight backlight: backlight supply power not found, using dummy regulator
pwm-backlight backlight: Linked as a consumer to regulator.0
pwm-backlight backlight: Dropping the link to regulator.0
Console: switching to colour frame buffer device 100x30
brd: module loaded
loop: module loaded
m25p80 spi0.0: found n25q128a13, expected n25q128a11
m25p80 spi0.0: n25q128a13 (16384 Kbytes)
libphy: Fixed MDIO Bus: probed
CAN device driver interface
libphy: MACB_mii_bus: probed
RTL8211F Gigabit Ethernet e000b000.ethernet-ffffffff:00: attached PHY driver [RTL8211F Gigabit Ethernet] (mii_bus:phy_addr=e000b000.ethernet-ffffffff:00, irq=POLL)
macb e000b000.ethernet eth0: Cadence GEM rev 0x00020118 at 0xe000b000 irq 30 (00:0a:35:00:01:22)
e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
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
chipidea-usb2 e0002000.usb: Linked as a consumer to regulator.0
ULPI transceiver vendor/product ID 0x0451/0x1507
Found TI TUSB1210 ULPI transceiver.
ULPI integrity check: passed.
ci_hdrc ci_hdrc.0: EHCI Host Controller
ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
Gt9xx driver installing..
i2c /dev entries driver
goodix-ts 4-0014: GTP Driver Version: V2.8.0.2<2017/12/14>
goodix-ts 4-0014: GTP I2C Address: 0x14
goodix-ts 4-0014: Unset touchscreen-max-id, use default
goodix-ts 4-0014: touch input parameters is [id x y w p]<16 800 480 512 512>
goodix-ts 4-0014: int-sync enabled
goodix-ts 4-0014: esd-protect enabled
goodix-ts 4-0014: 4-0014 supply vdd_ana not found, using dummy regulator
goodix-ts 4-0014: Linked as a consumer to regulator.0
goodix-ts 4-0014: 4-0014 supply vcc_i2c not found, using dummy regulator
goodix-ts 4-0014: No pinctrl found
goodix-ts 4-0014: Success request irq-gpio
goodix-ts 4-0014: Success request rst-gpio
goodix-ts 4-0014: Guitar reset
goodix-ts 4-0014: I2C Addr is 14
goodix-ts 4-0014: IC Version: 911_1060
goodix-ts 4-0014: Driver set not send config
goodix-ts 4-0014: Use slot report protocol
input: goodix-ts as /devices/virtual/input/input0
goodix-ts 4-0014: INT num 76, trigger type:1
goodix-ts 4-0014: create proc entry gt9xx_config success
goodix-ts 4-0014: Alloc memory size:1534.
goodix-ts 4-0014: I2C function: without pre and end cmd!
goodix-ts 4-0014: Create proc entry success!
goodix-ts 4-0014: ESD on
cdns-i2c e0004000.i2c: 200 kHz mmio e0004000 irq 23
cdns-i2c e0005000.i2c: 400 kHz mmio e0005000 irq 24
Driver for 1-wire Dallas network protocol.
ds18b20 _driver_init
cdns-wdt f8005000.watchdog: Xilinx Watchdog Timer 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.mmc [e0100000.mmc] using ADMA
mmc1: SDHCI controller on e0101000.mmc [e0101000.mmc] using ADMA
ledtrig-cpu: registered to indicate activity on CPUs
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
fpga_manager fpga0: Xilinx Zynq FPGA Manager registered
NET: Registered protocol family 10
Segment Routing with IPv6
mmc0: new high speed SDHC card at address aaaa
sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
mmcblk0: mmc0:aaaa SL32G 29.7 GiB 
NET: Registered protocol family 17
can: controller area network core (rev 20170425 abi 9)
NET: Registered protocol family 29
can: raw protocol (rev 20170425)
 mmcblk0: p1 p2
can: broadcast manager protocol (rev 20170425 t)
can: netlink gateway (rev 20170425) max_hops=1
Registering SWP/SWPB emulation handler
of-fpga-region fpga-full: FPGA Region probed
pwm-backlight backlight: backlight supply power not found, using dummy regulator
pwm-backlight backlight: Linked as a consumer to regulator.0
hctosys: unable to open rtc device (rtc0)
of_cfs_init
of_cfs_init: OK
ALSA device list:
  No soundcards found.
mmc1: new high speed MMC card at address 0001
mmcblk1: mmc1:0001 8GSD3R 7.28 GiB 
mmcblk1boot0: mmc1:0001 8GSD3R partition 1 16.0 MiB
mmcblk1boot1: mmc1:0001 8GSD3R partition 2 16.0 MiB
mmcblk1rpmb: mmc1:0001 8GSD3R partition 3 512 KiB, chardev (244:0)
 mmcblk1: p1 p2
random: fast init done
EXT4-fs (mmcblk0p2): recovery complete
EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
VFS: Mounted root (ext4 filesystem) on device 179:2.
devtmpfs: mounted
Freeing unused kernel memory: 1024K
Run /sbin/init as init process
Run /etc/init as init process
Run /bin/init as init process
Run /bin/sh as init process
Kernel panic - not syncing: No working init found.  Try passing init= option to kernel. See Linux Documentation/admin-guide/init.rst for guidance.
CPU0: stopping
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.19.0-xilinx #36
Hardware name: Xilinx Zynq Platform
[<c010edc0>] (unwind_backtrace) from [<c010b088>] (show_stack+0x10/0x14)
[<c010b088>] (show_stack) from [<c06a1228>] (dump_stack+0x80/0xa0)
[<c06a1228>] (dump_stack) from [<c010d3a0>] (ipi_cpu_stop+0x3c/0x70)
[<c010d3a0>] (ipi_cpu_stop) from [<c010dbe4>] (handle_IPI+0x6c/0x90)
[<c010dbe4>] (handle_IPI) from [<c0329718>] (gic_handle_irq+0x84/0x90)
[<c0329718>] (gic_handle_irq) from [<c0101a0c>] (__irq_svc+0x6c/0xa8)
Exception stack(0xc0a01ef8 to 0xc0a01f40)
1ee0:                                                       00000000 00000000
1f00: 2f648000 00000000 eff91278 ffffe000 eff91278 00000000 6c5c17b3 6c7435aa
1f20: 00000000 00000000 fffffff5 c0a01f48 c05255f4 c052561c 60000113 ffffffff
[<c0101a0c>] (__irq_svc) from [<c052561c>] (cpuidle_enter_state+0x148/0x22c)
[<c052561c>] (cpuidle_enter_state) from [<c013e6e8>] (do_idle+0x1c4/0x204)
[<c013e6e8>] (do_idle) from [<c013e884>] (cpu_startup_entry+0x18/0x1c)
[<c013e884>] (cpu_startup_entry) from [<c0900c1c>] (start_kernel+0x34c/0x3c4)
---[ end Kernel panic - not syncing: No working init found.  Try passing init= option to kernel. See Linux Documentation/admin-guide/init.rst for guidance. ]---

前面的uboot启动基本没问题,内核启动中驱动加载以及触屏的驱动也能正常识别等,但是启动到最后报错:

报错问题;init未找到,问题估计出在根文件系统,我们的开发流程是将做好的根文件系统直接解压到sd卡对应的根文件目录中;因此对我的根文件系统进行检查,发现根文件系统小了很多,将其删除,把之前备份的拷贝过来,再次制作sd卡。

解决方法:

1.可以重新编译根文件系统;

2.可以将根文件系统中的文件直接拷贝到sd卡,该方法需要再ubuntu系统下处理;

出问题后的根文件:

正常的的根文件:

重新制作卡后:

问题已解决。

  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值