How to extract kernel, rootfs, and dtb images from Linux ITB image

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to extract kernel, rootfs, and dtb images from Linux ITB image

How to extract kernel, rootfs, and dtb images from Linux ITB image

To extract kernel, rootfs, and dtb images from the Linux ITB (LITB) image:

  1. Browse to the folder containing LITB. For example:
    $ cd flexbuild_lsdk2004/build/images/
    
  2. To list the header information of LITB, use the following command: $ dumpimage -l <name of the image>
    $ dumpimage -l  lsdk2004_ubuntu_main_LS_arm64.itb
    FIT description: arm64 kernel, ramdisk and FDT blob
    Created:         Tue Feb  2 18:54:19 2021
     Image 0 (kernel)
      Description:  ARM64 Kernel
      Created:      Tue Feb  2 18:54:19 2021
      Type:         Kernel Image
      Compression:  gzip compressed
      Data Size:    14086432 Bytes = 13756.28 kB = 13.43 MB
      Architecture: AArch64
      OS:           Linux
      Load Address: 0x84080000
      Entry Point:  0x84080000
      Hash algo:    crc32
      Hash value:   1980d6fd
     Image 1 (initrd)
      Description:  initrd for arm64
      Created:      Tue Feb  2 18:54:19 2021
      Type:         RAMDisk Image
      Compression:  uncompressed
      Data Size:    668988861 Bytes = 653309.43 kB = 638.00 MB
      Architecture: AArch64
      OS:           Linux
      Load Address: 0x00000000
      Entry Point:  0x00000000
      Hash algo:    crc32
      Hash value:   24aa3c08
     Image 2 (ls1012ardb-dtb)
      Description:  ls1012ardb-dtb
      Created:      Tue Feb  2 18:54:19 2021
      Type:         Flat Device Tree
      Compression:  uncompressed
      Data Size:    14335 Bytes = 14.00 kB = 0.01 MB
      Architecture: AArch64
      Hash algo:    crc32
      Hash value:   383a8118
     Image 3 (ls1012aqds-dtb)
      Description:  ls1012aqds-dtb
      Created:      Tue Feb  2 18:54:19 2021
      Type:         Flat Device Tree
      Compression:  uncompressed
      Data Size:    15972 Bytes = 15.60 kB = 0.02 MB
      Architecture: AArch64
      Hash algo:    crc32
      Hash value:   7d133305
     Image 4 (ls1012afrwy-dtb)
      Description:  ls1012afrwy-dtb
      Created:      Tue Feb  2 18:54:19 2021
      Type:         Flat Device Tree
      Compression:  uncompressed
      Data Size:    15316 Bytes = 14.96 kB = 0.01 MB
      Architecture: AArch64
      Hash algo:    crc32
      Hash value:   7c456ca3
     Image 5 (ls1028ardb-dtb)
      Description:  ls1028ardb-dtb
      Created:      Tue Feb  2 18:54:19 2021
      Type:         Flat Device Tree
      Compression:  uncompressed
      Data Size:    19767 Bytes = 19.30 kB = 0.02 MB
      Architecture: AArch64
      Hash algo:    crc32
      Hash value:   db86fa4f
     Image 6 (ls1028aqds-dtb)
      Description:  ls1028aqds-dtb
      Created:      Tue Feb  2 18:54:19 2021
      Type:         Flat Device Tree
      Compression:  uncompressed
      Data Size:    24733 Bytes = 24.15 kB = 0.02 MB
      Architecture: AArch64
      Hash algo:    crc32
      Hash value:   e0b7a722
     Image 7 (ls1043ardb-dtb)
      Description:  ls1043ardb-dtb
      Created:      Tue Feb  2 18:54:19 2021
      Type:         Flat Device Tree
      Compression:  uncompressed
      Data Size:    41085 Bytes = 40.12 kB = 0.04 MB
      Architecture: AArch64
      Hash algo:    crc32
      Hash value:   fcc6502c
     Image 8 (ls1043aqds-dtb)
      Description:  ls1043aqds-dtb
      Created:      Tue Feb  2 18:54:19 2021
      Type:         Flat Device Tree
      Compression:  uncompressed
      Data Size:    34544 Bytes = 33.73 kB = 0.03 MB
      Architecture: AArch64
      Hash algo:    crc32
      Hash value:   45f82fba
     Image 9 (ls1046ardb-dtb)
      Description:  ls1046ardb-dtb
      Created:      Tue Feb  2 18:54:19 2021
      Type:         Flat Device Tree
      Compression:  uncompressed
      Data Size:    40270 Bytes = 39.33 kB = 0.04 MB
      Architecture: AArch64
      Hash algo:    crc32
      Hash value:   013f5024
     Image 10 (ls1046aqds-dtb)
      Description:  ls1046aqds-dtb
      Created:      Tue Feb  2 18:54:19 2021
      Type:         Flat Device Tree
      Compression:  uncompressed
      Data Size:    34317 Bytes = 33.51 kB = 0.03 MB
      Architecture: AArch64
      Hash algo:    crc32
      Hash value:   be066013
     Image 11 (ls1046afrwy-dtb)
      Description:  ls1046afrwy-dtb
      Created:      Tue Feb  2 18:54:19 2021
      Type:         Flat Device Tree
      Compression:  uncompressed
      Data Size:    31528 Bytes = 30.79 kB = 0.03 MB
      Architecture: AArch64
      Hash algo:    crc32
      Hash value:   d872df6c
     Image 12 (ls1088ardb-dtb)
      Description:  ls1088ardb-dtb
      Created:      Tue Feb  2 18:54:19 2021
      Type:         Flat Device Tree
      Compression:  uncompressed
      Data Size:    19523 Bytes = 19.07 kB = 0.02 MB
      Architecture: AArch64
      Hash algo:    crc32
      Hash value:   403066bc
     Image 13 (ls1088aqds-dtb)
      Description:  ls1088aqds-dtb
      Created:      Tue Feb  2 18:54:19 2021
      Type:         Flat Device Tree
      Compression:  uncompressed
      Data Size:    19415 Bytes = 18.96 kB = 0.02 MB
      Architecture: AArch64
      Hash algo:    crc32
      Hash value:   a2bf2786
     Image 14 (ls2088ardb-dtb)
      Description:  ls2088ardb-dtb
      Created:      Tue Feb  2 18:54:19 2021
      Type:         Flat Device Tree
      Compression:  uncompressed
      Data Size:    29838 Bytes = 29.14 kB = 0.03 MB
      Architecture: AArch64
      Hash algo:    crc32
      Hash value:   0069fe03
     Image 15 (ls2088aqds-dtb)
      Description:  ls2088aqds-dtb
      Created:      Tue Feb  2 18:54:19 2021
      Type:         Flat Device Tree
      Compression:  uncompressed
      Data Size:    23557 Bytes = 23.00 kB = 0.02 MB
      Architecture: AArch64
      Hash algo:    crc32
      Hash value:   e8e9dfa7
     Image 16 (lx2160ardb-dtb)
      Description:  lx2160ardb-dtb
      Created:      Tue Feb  2 18:54:19 2021
      Type:         Flat Device Tree
      Compression:  uncompressed
      Data Size:    32643 Bytes = 31.88 kB = 0.03 MB
      Architecture: AArch64
      Hash algo:    crc32
      Hash value:   e5859b31
     Image 17 (lx2160aqds-dtb)
      Description:  lx2160aqds-dtb
      Created:      Tue Feb  2 18:54:19 2021
      Type:         Flat Device Tree
      Compression:  uncompressed
      Data Size:    27740 Bytes = 27.09 kB = 0.03 MB
      Architecture: AArch64
      Hash algo:    crc32
      Hash value:   f644de1e
    
  3. To extract a particular image from LITB, use the following command:  $ dumpimage -i <name of the image> -T <type> [-p position] [-o outfile] data_file

    For example:

    1. To extract the kernel image:
      $ dumpimage -T flat_dt -i                                                                                                    lsdk2004_ubuntu_main_LS_arm64.itb -p 0 kernel
      Extracted:
       Image 0 (kernel)
        Description:  ARM64 Kernel
        Created:      Tue Feb  2 18:54:19 2021
        Type:         Kernel Image
        Compression:  gzip compressed
        Data Size:    14086432 Bytes = 13756.28 kB = 13.43 MB
        Architecture: AArch64
        OS:           Linux
        Load Address: 0x84080000
        Entry Point:  0x84080000
        Hash algo:    crc32
        Hash value:   1980d6fd
      
    2. To extract the rootfs image:
      $ dumpimage -T flat_dt -i                                                                                                              lsdk2004_ubuntu_main_LS_arm64.itb -p 1 rootfs
      Extracted:
       Image 1 (initrd)
        Description:  initrd for arm64
        Created:      Tue Feb  2 18:54:19 2021
        Type:         RAMDisk Image
        Compression:  uncompressed
        Data Size:    668988861 Bytes = 653309.43 kB = 638.00 MB
        Architecture: AArch64
        OS:           Linux
        Load Address: 0x00000000
        Entry Point:  0x00000000
        Hash algo:    crc32
        Hash value:   24aa3c08
      
    3. To extract ls1012ardb-dtb (at position 2) and ls1012aqds-dtb (at position 3):
      $ dumpimage -T flat_dt -i                                                                                                              lsdk2004_ubuntu_main_LS_arm64.itb -p 2 dtb1
      Extracted:
       Image 2 (ls1012ardb-dtb)
        Description:  ls1012ardb-dtb
        Created:      Tue Feb  2 18:54:19 2021
        Type:         Flat Device Tree
        Compression:  uncompressed
        Data Size:    14335 Bytes = 14.00 kB = 0.01 MB
        Architecture: AArch64
        Hash algo:    crc32
        Hash value:   383a8118
      $ dumpimage -T flat_dt -i lsdk2004_ubuntu_main_LS_arm64.itb -p 3 dtb2
      Extracted:
       Image 3 (ls1012aqds-dtb)
        Description:  ls1012aqds-dtb
        Created:      Tue Feb  2 18:54:19 2021
        Type:         Flat Device Tree
        Compression:  uncompressed
        Data Size:    15972 Bytes = 15.60 kB = 0.02 MB
        Architecture: AArch64
        Hash algo:    crc32
        Hash value:   7d133305
      

       

 

 

100% 有帮助 (1/1)
版本历史
最后更新:
‎02-17-2021 03:04 AM
更新人: