1. 程式人生 > 其它 >IMX6ULL - 移植linux-imx_5.4.70_2.3.0

IMX6ULL - 移植linux-imx_5.4.70_2.3.0

作者:zzssdd2

E-mail:[email protected]

一、說明

  • 主機系統:Ubuntu 20.04.3 LTS

  • 開發板:TOPEET-IMX6ULL

  • Linux版本:linux-imx_5.4.70_2.3.0

  • 交叉編譯器:gcc-arm-10.3-2021.07-x86_64-arm-none-linux-gnueabihf

  • 有了前面IMX6ULL-移植uboot-imx_v2020.04_5.4.70_2.3.0的基礎再進行Linux移植就會方便很多。因為Linux的移植更多的是對裝置樹的修改,而在Uboot移植時已經修改過裝置樹,所以接下來會省不少事。

二、環境搭建

2.1、Linux原始碼

  1. 獲取NXP維護的Linux核心原始碼:

    git clone https://source.codeaurora.org/external/imx/linux-imx
    
  2. 使用命令git tag -a檢視版本然後git checkout -b <tag name>切換到目標版本:

    git checkout -b rel_imx_5.4.70_2.3.0
    
  3. 接下來就基於版本原始碼進行linux核心移植

2.2、交叉編譯器

參考IMX6ULL-移植uboot-imx_v2020.04_5.4.70_2.3.0的2.2小節

三、編譯原始碼

  1. linux原始碼根目錄下建立編譯指令碼make.sh

    內容如下:

    #!/bin/bash
    
    # 若之前已經匯入到環境變數則不需要
    export PATH=$PATH:/usr/local/arm/gcc-arm-10.3-2021.07-x86_64-arm-none-linux-gnueabihf/bin
    # 若已經在頂層Makefile檔案中指定則不需要
    export ARCH=arm
    # 若已經在頂層Makefile檔案中指定則不需要
    export CROSS_COMPILE=arm-none-linux-gnueabihf-
    
    make distclean
    # make mrproper
    
    # For I.MX6 --> imx_v7_defconfig
    # For I.MX7 --> imx_v7_defconfig
    # For I.MX8 --> imx_v8_defconfig
    make imx_v7_defconfig
    
    # make menuconfig
     make -j $(nproc) all
    
    
  2. 執行編譯./make.sh並等待編譯完成,如果沒有錯誤出現說明搭建環境OK。

  3. 補充說明:

    1. make命令

      /imx6ull/kernel/linux-imx_5.4.70_2.3.0$ make help
      Cleaning targets:
        clean		  - Remove most generated files but keep the config and
                          enough build support to build external modules
        mrproper	  - Remove all generated files + config + various backup files
        distclean	  - mrproper + remove editor backup and patch files
      
      Configuration targets:
        config	  - Update current config utilising a line-oriented program
        nconfig         - Update current config utilising a ncurses menu based program
        menuconfig	  - Update current config utilising a menu based program
        xconfig	  - Update current config utilising a Qt based front-end
        gconfig	  - Update current config utilising a GTK+ based front-end
        oldconfig	  - Update current config utilising a provided .config as base
        localmodconfig  - Update current config disabling modules not loaded
        localyesconfig  - Update current config converting local mods to core
        defconfig	  - New config with default from ARCH supplied defconfig
        savedefconfig   - Save current config as ./defconfig (minimal config)
        allnoconfig	  - New config where all options are answered with no
        allyesconfig	  - New config where all options are accepted with yes
        allmodconfig	  - New config selecting modules when possible
        alldefconfig    - New config with all symbols set to default
        randconfig	  - New config with random answer to all options
        listnewconfig   - List new options
        olddefconfig	  - Same as oldconfig but sets new symbols to their
                          default value without prompting
        kvmconfig	  - Enable additional options for kvm guest kernel support
        xenconfig       - Enable additional options for xen dom0 and guest kernel support
        tinyconfig	  - Configure the tiniest possible kernel
        testconfig	  - Run Kconfig unit tests (requires python3 and pytest)
      
      Other generic targets:
        all		  - Build all targets marked with [*]
      * vmlinux	  - Build the bare kernel
      * modules	  - Build all modules
        modules_install - Install all modules to INSTALL_MOD_PATH (default: /)
        dir/            - Build all files in dir and below
        dir/file.[ois]  - Build specified target only
        dir/file.ll     - Build the LLVM assembly file
                          (requires compiler support for LLVM assembly generation)
        dir/file.lst    - Build specified mixed source/assembly target only
                          (requires a recent binutils and recent build (System.map))
        dir/file.ko     - Build module including final link
        modules_prepare - Set up for building external modules
        tags/TAGS	  - Generate tags file for editors
        cscope	  - Generate cscope index
        gtags           - Generate GNU GLOBAL index
        kernelrelease	  - Output the release version string (use with make -s)
        kernelversion	  - Output the version stored in Makefile (use with make -s)
        image_name	  - Output the image name (use with make -s)
        headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH
                          (default: ./usr)
      
      Static analysers:
        checkstack      - Generate a list of stack hogs
        namespacecheck  - Name space analysis on compiled kernel
        versioncheck    - Sanity check on version.h usage
        includecheck    - Check for duplicate included header files
        export_report   - List the usages of all exported symbols
        headerdep       - Detect inclusion cycles in headers
        coccicheck      - Check with Coccinelle
      
      Tools:
        nsdeps          - Generate missing symbol namespace dependencies
      
      Kernel selftest:
        kselftest       - Build and run kernel selftest (run as root)
                          Build, install, and boot kernel before
                          running kselftest on it
        kselftest-clean - Remove all generated kselftest files
        kselftest-merge - Merge all the config dependencies of kselftest to existing
                          .config.
      
      Userspace tools targets:
        use "make tools/help"
        or  "cd tools; make help"
      
      Kernel packaging:
        rpm-pkg             - Build both source and binary RPM kernel packages
        binrpm-pkg          - Build only the binary kernel RPM package
        deb-pkg             - Build both source and binary deb kernel packages
        bindeb-pkg          - Build only the binary kernel deb package
        snap-pkg            - Build only the binary kernel snap package (will connect to external hosts)
        tar-pkg             - Build the kernel as an uncompressed tarball
        targz-pkg           - Build the kernel as a gzip compressed tarball
        tarbz2-pkg          - Build the kernel as a bzip2 compressed tarball
        tarxz-pkg           - Build the kernel as a xz compressed tarball
        perf-tar-src-pkg    - Build perf-5.4.70.tar source tarball
        perf-targz-src-pkg  - Build perf-5.4.70.tar.gz source tarball
        perf-tarbz2-src-pkg - Build perf-5.4.70.tar.bz2 source tarball
        perf-tarxz-src-pkg  - Build perf-5.4.70.tar.xz source tarball
      
      Documentation targets:
       Linux kernel internal documentation in different formats from ReST:
        htmldocs        - HTML
        latexdocs       - LaTeX
        pdfdocs         - PDF
        epubdocs        - EPUB
        xmldocs         - XML
        linkcheckdocs   - check for broken external links (will connect to external hosts)
        refcheckdocs    - check for references to non-existing files under Documentation
        cleandocs       - clean all generated files
      
        make SPHINXDIRS="s1 s2" [target] Generate only docs of folder s1, s2
        valid values for SPHINXDIRS are: 
      
        make SPHINX_CONF={conf-file} [target] use *additional* sphinx-build
        configuration. This is e.g. useful to build with nit-picking config.
      
        Default location for the generated documents is Documentation/output
      
      Architecture specific targets (x86):
      * bzImage      - Compressed kernel image (arch/x86/boot/bzImage)
        install      - Install kernel using
                        (your) ~/bin/installkernel or
                        (distribution) /sbin/installkernel or
                        install to $(INSTALL_PATH) and run lilo
        fdimage      - Create 1.4MB boot floppy image (arch/x86/boot/fdimage)
        fdimage144   - Create 1.4MB boot floppy image (arch/x86/boot/fdimage)
        fdimage288   - Create 2.8MB boot floppy image (arch/x86/boot/fdimage)
        isoimage     - Create a boot CD-ROM image (arch/x86/boot/image.iso)
                        bzdisk/fdimage*/isoimage also accept:
                        FDARGS="..."  arguments for the booted kernel
                        FDINITRD=file initrd for the booted kernel
      
        i386_defconfig           - Build for i386
        x86_64_defconfig         - Build for x86_64
      
        make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build
        make V=2   [targets] 2 => give reason for rebuild of target
        make O=dir [targets] Locate all output files in "dir", including .config
        make C=1   [targets] Check re-compiled c source with $CHECK (sparse by default)
        make C=2   [targets] Force check of all c source with $CHECK
        make RECORDMCOUNT_WARN=1 [targets] Warn about ignored mcount sections
        make W=n   [targets] Enable extra build checks, n=1,2,3 where
      		1: warnings which may be relevant and do not occur too often
      		2: warnings which occur quite often but may still be relevant
      		3: more obscure warnings, can most likely be ignored
      		Multiple levels can be combined with W=12 or W=123
      
      Execute "make" or "make all" to build all targets marked with [*] 
      For further info see the ./README file
      
      
    2. nproc命令

      $ nproc --help
       用法:nproc [選項]...
       列印當前程序可用的處理器數,
       此數目可能小於實際工作數
         --all      列印所擁有的處理器數目
         --ignore=N  可能的話,排除 N 個處理單元
         --help		顯示此幫助資訊並退出
         --version		顯示版本資訊並退出
      
    3. openssl/bio.h錯誤

        DTC     arch/arm/boot/dts/imx6dl-gw560x.dtb
         HOSTCC  scripts/extract-cert
       scripts/extract-cert.c:21:10: fatal error: openssl/bio.h: 沒有那個檔案或目錄
          21 | #include <openssl/bio.h>
             |          ^~~~~~~~~~~~~~~
       compilation terminated.
       make[1]: *** [scripts/Makefile.host:107:scripts/extract-cert] 錯誤 1
       make: *** [Makefile:1123:scripts] 錯誤 2
       

      解決方法:

      缺少相關依賴庫,安裝即可

      sudo apt install libssl-dev
      

四、移植

參考NXP官方imx6ull-14x14-evk開發板移植

4.1、原始碼管理

  1. 安裝VScode

  2. 開啟VScode,然後選擇檔案->開啟資料夾...選擇linux原始碼資料夾

  3. 在原始碼根目錄建立資料夾.vscode,然後選擇檔案->將工作區另存為...儲存檔名linux.code-workspace在.vscode資料夾下,檔案內容如下:

    {
    	"folders": [
    		{
    			"path": ".."
    		}
    	],
    	
    	"settings": {
    		"files.exclude": {
    			"**/.git": true,
    			"**/.svn": true,
    			"**/.hg": true,
    			"**/CVS": true,
    			"**/.DS_Store": true,
    			"**/Thumbs.db": true,
    
    			"arch/[!a]*": true,
    			"arch/a[!r]*": true,
    			"arch/ar[!m]*": true,
    			"arch/arm64": true,
    			"arch/arm/mach-[!i]*": true,
    			"arch/arm/mach-i[!m]*": true,
    			"arch/arm/configs/[!i]*": true,
    			"arch/arm/configs/i[!m]*": true,
    			"arch/arm/configs/im[!x]*": true,
    			"arch/arm/boot/dts/.*": true,
    			"arch/arm/boot/dts/[!i]*.dt*": true,
    			"arch/arm/boot/dts/i[!m]*.dt*": true,
    			"arch/arm/boot/dts/im[!x]*.dt*": true,
    			"arch/arm/boot/dts/imx[!6]*.dt*": true,
    			"arch/arm/boot/dts/imx6[!u]*.dt*": true,
    		},
    
    		"search.exclude": {
    			"**/node_modules": true,
    			"**/bower_components": true,
    			"**/*.code-search": true,
    
    			"arch/[!a]*": true,
    			"arch/a[!r]*": true,
    			"arch/ar[!m]*": true,
    			"arch/arm64": true,
    			"arch/arm/mach-[!i]*": true,
    			"arch/arm/mach-i[!m]*": true,
    			"arch/arm/configs/[!i]*": true,
    			"arch/arm/configs/i[!m]*": true,
    			"arch/arm/configs/im[!x]*": true,
    			"arch/arm/boot/dts/.*": true,
    			"arch/arm/boot/dts/[!i]*.dt*": true,
    			"arch/arm/boot/dts/i[!m]*.dt*": true,
    			"arch/arm/boot/dts/im[!x]*.dt*": true,
    			"arch/arm/boot/dts/imx[!6]*.dt*": true,
    			"arch/arm/boot/dts/imx6[!u]*.dt*": true,
    		}
    	}
    }
    

    該檔案"settings"內容用來排除部分用不到的檔案,以便查閱程式碼。

4.2、新增檔案

  1. imx6ull-14x14-topeet-emmc.dts

    cp arch/arm/boot/dts/imx6ull-14x14-evk-emmc.dts arch/arm/boot/dts/imx6ull-14x14-topeet-emmc.dts
    
  2. imx6ull-14x14-topeet.dts

    cp arch/arm/boot/dts/imx6ull-14x14-evk.dts arch/arm/boot/dts/imx6ull-14x14-topeet.dts
    
  3. imx6ul-14x14-topeet.dtsi

    cp arch/arm/boot/dts/imx6ul-14x14-evk.dtsi arch/arm/boot/dts/imx6ul-14x14-topeet.dtsi
    

4.3、修改檔案

  1. 裝置樹

    參考IMX6ULL-移植uboot-imx_v2020.04_5.4.70_2.3.0文章的4.3.4節內容

    補充:

    imx6ul-14x14-topeet.dtsi檔案ov5640節點修改pwn-gpiosrst-gpios為自己開發板所使用的引腳(官方evk開發板使用74lv595晶片控制):

    	ov5640: ov5640@3c {
    		compatible = "ovti,ov5640";
    		reg = <0x3c>;
    		pinctrl-names = "default";
    		pinctrl-0 = <&pinctrl_csi1>;
    		clocks = <&clks IMX6UL_CLK_CSI>;
    		clock-names = "csi_mclk";
    		/*
    		pwn-gpios = <&gpio_spi 6 1>;
    		rst-gpios = <&gpio_spi 5 0>;
    		*/
    		pwn-gpios = <&gpio1 4 1>;
    		rst-gpios = <&gpio1 2 0>;
    		csi_id = <0>;
    		mclk = <24000000>;
    		mclk_source = <0>;
    		status = "disabled";
    		port {
    			ov5640_ep: endpoint {
    				remote-endpoint = <&csi1_ep>;
    			};
    		};
    	};
    
  2. arch/arm/boot/dts/Makefile檔案新增imx6ull-14x14-topeet-emmc.dtb,如下

    dtb-$(CONFIG_SOC_IMX6UL) += \
    	imx6ul-14x14-evk.dtb \
    	imx6ul-14x14-evk-csi.dtb \
    	imx6ul-14x14-evk-emmc.dtb \
    	imx6ul-14x14-evk-btwifi.dtb \
    	imx6ul-14x14-evk-btwifi-oob.dtb \
    	imx6ul-14x14-evk-ecspi-slave.dtb \
    	imx6ul-14x14-evk-ecspi.dtb \
    	imx6ul-14x14-evk-gpmi-weim.dtb \
    	imx6ul-9x9-evk.dtb \
    	imx6ul-9x9-evk-ldo.dtb \
    	imx6ul-9x9-evk-btwifi.dtb \
    	imx6ul-9x9-evk-btwifi-oob.dtb \
    	imx6ul-ccimx6ulsbcexpress.dtb \
    	imx6ul-ccimx6ulsbcpro.dtb \
    	imx6ul-geam.dtb \
    	imx6ul-isiot-emmc.dtb \
    	imx6ul-isiot-nand.dtb \
    	imx6ul-kontron-n6310-s.dtb \
    	imx6ul-kontron-n6310-s-43.dtb \
    	imx6ul-liteboard.dtb \
    	imx6ul-opos6uldev.dtb \
    	imx6ul-pico-hobbit.dtb \
    	imx6ul-pico-pi.dtb \
    	imx6ul-phytec-segin-ff-rdk-nand.dtb \
    	imx6ul-tx6ul-0010.dtb \
    	imx6ul-tx6ul-0011.dtb \
    	imx6ul-tx6ul-mainboard.dtb \
    	imx6ull-14x14-evk.dtb \
    	imx6ull-14x14-evk-emmc.dtb \
    	imx6ull-14x14-topeet-emmc.dtb \
    	imx6ull-14x14-evk-btwifi.dtb \
    	imx6ull-14x14-evk-btwifi-oob.dtb \
    	imx6ull-14x14-evk-gpmi-weim.dtb \
    	imx6ull-9x9-evk.dtb \
    	imx6ull-9x9-evk-ldo.dtb \
    	imx6ull-9x9-evk-btwifi.dtb \
    	imx6ull-9x9-evk-btwifi-oob.dtb \
    	imx6ull-colibri-eval-v3.dtb \
    	imx6ull-colibri-wifi-eval-v3.dtb \
    	imx6ull-phytec-segin-ff-rdk-nand.dtb \
    	imx6ull-phytec-segin-ff-rdk-emmc.dtb \
    	imx6ull-phytec-segin-lc-rdk-nand.dtb \
    	imx6ulz-14x14-evk.dtb \
    	imx6ulz-14x14-evk-btwifi.dtb \
    	imx6ulz-14x14-evk-gpmi-weim.dtb \
    	imx6ulz-14x14-evk-emmc.dtb
    

修改完成後執行./make.sh等待編譯完成。編譯完成後在arch/arm/boot/目錄下生成核心映象檔案zImage,在目錄arch/arm/boot/dts/下生成裝置樹二進位制檔案imx6ull-14x14-topeet-emmc.dtb

五、驗證

5.1、SD卡方式

  1. 檢視SD卡掛載在系統中的名稱:cat /proc/partitions,我的是sdb,包含兩個分割槽sdb1sdb2

    $ cat /proc/partitions
    major minor  #blocks  name
    
       7        0          4 loop0
       7        1     101828 loop1
       7        2     101824 loop2
       7        3      56772 loop3
       7        4      63252 loop4
       7        5      56768 loop5
       7        6      63316 loop6
       7        7     166776 loop7
      11        0    1048575 sr0
       8        0  104857600 sda
       8        1   83884032 sda1
       7        8     224248 loop8
       7        9     224256 loop9
       7       10     247156 loop10
       7       11       2544 loop11
       7       12     168712 loop12
       7       13        276 loop13
       7       14        548 loop14
       7       15       2540 loop15
       7       16     248160 loop16
       7       17        548 loop17
       7       18       2560 loop18
       7       19        704 loop19
       7       20      52180 loop20
       7       21      66776 loop21
       7       22       2288 loop22
       7       23      66660 loop23
       8       16   30578688 sdb
       8       17    1048576 sdb1
       8       18   29512704 sdb2
    
  2. 使用fdisk工具對SD卡進行格式化和分割槽:sudo fdisk /dev/sdx

    注意:在使用fdisk工具前先將裝置解除安裝:sudo umount /dev/sdx

    $ sudo fdisk /dev/sdb
    
    歡迎使用 fdisk (util-linux 2.34)。
    更改將停留在記憶體中,直到您決定將更改寫入磁碟。
    使用寫入命令前請三思。
    
    
    命令(輸入 m 獲取幫助): m
    
    幫助:
    
      DOS (MBR)
       a   開關 可啟動 標誌
       b   編輯巢狀的 BSD 磁碟標籤
       c   開關 dos 相容性標誌
    
      常規
       d   刪除分割槽
       F   列出未分割槽的空閒區
       l   列出已知分割槽型別
       n   新增新分割槽
       p   列印分割槽表
       t   更改分割槽型別
       v   檢查分割槽表
       i   列印某個分割槽的相關資訊
    
      雜項
       m   列印此選單
       u   更改 顯示/記錄 單位
       x   更多功能(僅限專業人員)
    
      指令碼
       I   從 sfdisk 指令碼檔案載入磁碟佈局
       O   將磁碟佈局轉儲為 sfdisk 指令碼檔案
    
      儲存並退出
       w   將分割槽表寫入磁碟並退出
       q   退出而不儲存更改
    
      新建空磁碟標籤
       g   新建一份 GPT 分割槽表
       G   新建一份空 GPT (IRIX) 分割槽表
       o   新建一份的空 DOS 分割槽表
       s   新建一份空 Sun 分割槽表
    

    格式化SD卡:

    命令(輸入 m 獲取幫助): d
    分割槽號 (1,2, 預設  2): 1
    
    分割槽 1 已刪除。
    
    命令(輸入 m 獲取幫助): d
    已選擇分割槽 2
    分割槽 2 已刪除。
    
    命令(輸入 m 獲取幫助): d
    還沒有定義分割槽!
    
    命令(輸入 m 獲取幫助): 
    

    SD卡重新分割槽:

    分割槽如下:

    • 前面4M空間留給uboot
    • uboot空間之後建立分割槽1給核心和裝置樹
    • 分割槽一之後建立分割槽2給根檔案系統
    命令(輸入 m 獲取幫助): n
    分割槽型別
       p   主分割槽 (0個主分割槽,0個擴充套件分割槽,4空閒)
       e   擴充套件分割槽 (邏輯分割槽容器)
    選擇 (預設 p): 
    
    將使用預設迴應 p。
    分割槽號 (1-4, 預設  1): 
    第一個扇區 (2048-61157375, 預設 2048): 8192
    Last sector, +/-sectors or +/-size{K,M,G,T,P} (8192-61157375, 預設 61157375): 2105344
    
    建立了一個新分割槽 1,型別為“Linux”,大小為 1 GiB。
    
    命令(輸入 m 獲取幫助): n
    分割槽型別
       p   主分割槽 (1個主分割槽,0個擴充套件分割槽,3空閒)
       e   擴充套件分割槽 (邏輯分割槽容器)
    選擇 (預設 p): 
    
    將使用預設迴應 p。
    分割槽號 (2-4, 預設  2): 
    第一個扇區 (2048-61157375, 預設 2048): 2105345
    Last sector, +/-sectors or +/-size{K,M,G,T,P} (2105345-61157375, 預設 61157375): 
    
    建立了一個新分割槽 2,型別為“Linux”,大小為 28.2 GiB。
    

    檢視SD卡分割槽情況

    命令(輸入 m 獲取幫助): p
    Disk /dev/sdb:29.17 GiB,31312576512 位元組,61157376 個扇區
    Disk model: Multi-Card      
    單元:扇區 / 1 * 512 = 512 位元組
    扇區大小(邏輯/物理):512 位元組 / 512 位元組
    I/O 大小(最小/最佳):512 位元組 / 512 位元組
    磁碟標籤型別:dos
    磁碟識別符號:0x00000000
    
    裝置       啟動    起點     末尾     扇區  大小 Id 型別
    /dev/sdb1          8192  2105344  2097153    1G 83 Linux
    /dev/sdb2       2105345 61157375 59052031 28.2G 83 Linux
    

    儲存分割槽

    命令(輸入 m 獲取幫助): w
    分割槽表已調整。
    正在同步磁碟。
    
  3. uboot寫入SD卡

    $ sudo dd if=u-boot-dtb.imx of=/dev/sdb bs=1k seek=1 conv=fsync
    記錄了519+0 的讀入
    記錄了519+0 的寫出
    531456位元組(531 kB,519 KiB)已複製,0.239474 s,2.2 MB/s
    
  4. 將核心映象和裝置樹檔案寫入SD卡

    格式化分割槽1為VFAT格式:sudo mkfs.vfat /dev/sdx1

    $ sudo umount /dev/sdb1
    $ sudo mkfs.vfat /dev/sdb1
    

    掛載分割槽並將檔案寫入分割槽:

    $ mkdir mountpoint
    $ sudo mount /dev/sdb1 mountpoint
    $ sudo cp kernel/linux-imx_5.4.70_2.3.0/arch/arm/boot/zImage mountpoint/
    $ sudo cp kernel/linux-imx_5.4.70_2.3.0/arch/arm/boot/dts/imx6ull-14x14-topeet-emmc.dtb mountpoint/
    $ sudo umount mountpoint
    
  5. 從SD卡啟動並進入uboot模式

    # uboot模式下執行如下命令設定啟動命令,從SD卡載入核心映象和裝置樹
    setenv bootcmd 'fatload mmc 0:1 80800000 zImage;fatload mmc 0:1 83000000 imx6ull-14x14-topeet-emmc.dtb;bootz 80800000 - 83000000'
    # 儲存
    saveenv
    # 重新啟動
    reset
    

重新啟動然後在經過Uboot讀秒之後可以看到Linux核心的啟動資訊Starting kernel ...

最後會報根檔案系統無法掛載的錯誤資訊,因為此時還沒有可掛載根檔案系統:

[    2.799286] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    2.807567] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) ]---

補充:Linux系統dd命令使用說明

$ dd --help
用法:dd [運算元] ...
 或:dd 選項
複製檔案,依照指定運算元轉換並格式化。

  bs=位元組數      一次讀寫的位元數(預設:512);
                 會覆蓋 ibs 和 obs 選項
  cbs=位元組數     一次轉換的位元組數
  conv=CONVS     依照每個逗號分割的符號列表轉換檔案
  count=塊數     只將複製指定數量的輸入塊
  ibs=位元組數     一次讀取的位元組數(預設:512)
  if=檔案         從指定檔案而非標準輸入來進行讀取
  iflag=標誌      按照以逗號分隔的符號列表指定的方式讀取
  obs=位元組數      一次寫入指定位元組數(預設:512)
  of=檔案         寫入到指定檔案而非標準輸出
  oflag=標誌      按照以逗號分隔的符號列表指定的方式寫入
  seek=塊數       在輸出開始處跳過指定的 obs 大小的塊數
  skip=塊數       在輸入開始處跳過指定的 ibs 大小的塊數
  status=等級     要輸出到標準錯誤的資訊等級;
                  'none' 將僅輸出錯誤資訊,
                  'noxfer' 將不輸出最終傳輸統計資訊,
                  'progress' 將顯示週期性的傳輸統計資訊

N and BYTES may be followed by the following multiplicative suffixes:
c =1, w =2, b =512, kB =1000, K =1024, MB =1000*1000, M =1024*1024, xM =M,
GB =1000*1000*1000, G =1024*1024*1024, and so on for T, P, E, Z, Y.

Each CONV symbol may be:

  ascii     from EBCDIC to ASCII
  ebcdic    from ASCII to EBCDIC
  ibm       from ASCII to alternate EBCDIC
  block     pad newline-terminated records with spaces to cbs-size
  unblock   replace trailing spaces in cbs-size records with newline
  lcase     change upper case to lower case
  ucase     change lower case to upper case
  sparse    try to seek rather than write the output for NUL input blocks
  swab      swap every pair of input bytes
  sync      pad every input block with NULs to ibs-size; when used
            with block or unblock, pad with spaces rather than NULs
  excl      如果輸出檔案已存在則認為操作失敗
  nocreat   不要建立輸出檔案
  notrunc   不要截斷輸出檔案
  noerror   讀取資料發生錯誤後仍然繼續
  fdatasync  結束前將輸出檔案資料物理上寫入磁碟
  fsync     與上者類似,但也將元資料一同寫入

FLAG 符號可以是:

  append	追加模式(僅對輸出有意義;隱含了conv=notrunc)
  direct    使用直接I/O 存取模式
  directory  除非是目錄,否則操作失敗
  dsync     使用同步 I/O 存取模式
  sync      與上者類似,但同時也對元資料生效
  fullblock	為輸入積累完整塊(僅iflag)
  nonblock	使用無阻塞I/O 存取模式
  noatime   不更新訪問時間
  nocache   請求不使用快取。參見 oflag=sync
  noctty	不根據檔案指派控制終端
  nofollow  不跟隨連結檔案
  count_bytes  把 'count=N' 看作位元組計數(僅 iflag)
  skip_bytes  把 'skip=N' 看作位元組計數(僅 iflag)
  seek_bytes  把 'seek=N' 看作位元組計數(僅 oflag)

向正在執行的 'dd' 程序傳送 USR1 訊號可以令其向標準錯誤輸出 I/O
統計資料並繼續進行復制。

選項有:

      --help		顯示此幫助資訊並退出
      --version		顯示版本資訊並退出

GNU coreutils 線上幫助:<https://www.gnu.org/software/coreutils/>
請向 <http://translationproject.org/team/zh_CN.html> 報告 dd 的翻譯錯誤
完整文件請見:<https://www.gnu.org/software/coreutils/dd>
或者在本地使用:info '(coreutils) dd invocation'

5.2、TFTP&NFS方式

《開發板直連電腦搭建NFS&TFTP環境》