You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Kernel panic报错排查:基于Buildroot 20011.02的ARMv7 Cortex-A9 NFS启动问题

Troubleshooting and Fixing "Kernel panic - not syncing: Attempted to kill init" for NFS Boot

Alright, let's break down how to troubleshoot this kernel panic you're facing when booting your ARMv7 Cortex-A9 board via NFS. I’ve run into this exact issue a few times with older kernels like 3.18, so here’s a step-by-step approach to get to the bottom of it:

1. Validate Your U-Boot Boot Arguments

First, double-check your U-Boot bootargs—incorrect parameters here are a super common culprit. Your bootargs should look something like this:

setenv bootargs 'console=ttyAMA0,115200 root=/dev/nfs nfsroot=<YOUR_NFS_SERVER_IP>:/export/users/buildroot,proto=tcp rw ip=dhcp'

Pay close attention to these details:

  • Ensure the nfsroot path matches exactly what you exported (no typos in directory names!)
  • Add proto=tcp—UDP can cause flaky mounts with older NFS setups
  • Don’t forget the rw flag—init needs write permissions to run properly
  • For kernel 3.18, explicitly add nfsvers=3 if your NFS server defaults to v4 (many older setups don’t support v4 well)

2. Verify NFS Server Export Configuration & Permissions

This is another top cause of init panics:

  • Open /etc/exports on your NFS server and confirm your export line includes no_root_squash:
    /export/users/buildroot  <YOUR_BOARD_SUBNET>(rw,sync,no_root_squash,no_subtree_check)
    
    Without no_root_squash, your board’s root user gets mapped to nobody on the server, which will block init from accessing critical files.
  • Run exportfs -v to check the active export permissions—make sure rw and no_root_squash are listed.
  • Test the export from another machine (or your board, if you can get to a U-Boot shell) with:
    showmount -e <YOUR_NFS_SERVER_IP>
    
    If the directory doesn’t show up, your NFS export isn’t working correctly.

3. Check Root Filesystem Integrity & Toolchain Compatibility

Your rootfs might be corrupted or mismatched with your kernel/board:

  • On the NFS server, verify that /export/users/buildroot/init (or /export/users/buildroot/sbin/init) exists and has executable permissions:
    ls -l /export/users/buildroot/init /export/users/buildroot/sbin/init
    
    Buildroot’s default rootfs uses /init as the startup script—if it’s missing or has wrong permissions, init can’t run.
  • Test the rootfs locally with chroot to rule out filesystem issues:
    cd /export/users/buildroot
    sudo chroot . /bin/sh
    
    If this fails (e.g., missing libraries), your rootfs is broken—rebuild it with Buildroot, making sure you selected the correct ARMv7 Cortex-A9 target.
  • Confirm your Buildroot toolchain matches your kernel’s ARM configuration: Check if both use hard-float (CONFIG_ARM_FP in kernel, corresponding toolchain setting in Buildroot) or soft-float—mismatched ABIs will break binary execution.

4. Audit Kernel Configuration for NFS & Boot Support

Even if you enabled ext4, you need specific NFS-related kernel configs:

  • Ensure these options are set (either built-in y or module m—built-in is safer for boot):
    • CONFIG_NFS_FS=y
    • CONFIG_NFS_V3=y
    • CONFIG_ROOT_NFS=y
    • CONFIG_IP_PNP=y (for DHCP support)
  • Make sure your board’s network driver is compiled into the kernel (not as a module)—modules can’t be loaded before the root filesystem is mounted.
  • Check that CONFIG_INITRAMFS_SOURCE is empty—if you set an initramfs, it might override your NFS root setup.

5. Get More Debug Logs to Pinpoint the Issue

Add debug to your bootargs to get more detailed kernel output before the panic:

setenv bootargs 'console=ttyAMA0,115200 root=/dev/nfs nfsroot=<IP>:/export/users/buildroot,proto=tcp rw ip=dhcp debug'

Look for messages right before the panic—common clues include:

  • execve failed for /init (permission or binary issue)
  • error loading shared library (missing libraries or ABI mismatch)
  • VFS: Unable to mount root fs via NFS (NFS mount failure)

Quick Win Checks

If you’re short on time, start with these high-probability fixes:

  1. Add no_root_squash to your NFS export line and re-run exportfs -rv
  2. Confirm /export/users/buildroot/init has 755 permissions
  3. Verify your bootargs include rw and proto=tcp

内容的提问来源于stack exchange,提问作者shaikh kamal

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 10:04:54