zoukankan      html  css  js  c++  java
  • uboot: initramfs image to roofs, and rootfs to initramfs image

    prepare:
    sudo -E apt install u-boot-tools

    initramfs uboot image to rootfs:

    scale@LOS00187dd6aeba:~$ file initramfs.img
    initramfs.img: u-boot legacy uImage, initramfs, Linux/ARM 64-bit, RAMDisk Image (gzip), 1268679 bytes, Wed Jul 28 05:00:07 2021, Load Address: 0x00000000, Entry Point: 0x00000000, Header CRC: 0x7D5C5ED0, Data CRC: 0xC54D90AE
    scale@LOS00187dd6aeba:~$ tail -c+65 < initramfs.img | gunzip > out.gz
    scale@LOS00187dd6aeba:~$ mkdir rootfs
    scale@LOS00187dd6aeba:~$ cd rootfs/
    scale@LOS00187dd6aeba:~/rootfs$ cpio -i -F ../out.gz
    scale@LOS00187dd6aeba:~/rootfs$ ls
    bin etc init lib linuxrc media mnt proc sbin sys usr

    rootfs to initramfs uboot image:
    scale@LOS00187dd6aeba:~$ cd rootfs/
    scale@LOS00187dd6aeba:~/rootfs$ find . | cpio -H newc -o > ../initramfs.cpio

    scale@LOS00187dd6aeba:~/rootfs$ cd ..
    scale@LOS00187dd6aeba:~$ cat initramfs.cpio | gzip > initramfs.igz

    scale@LOS00187dd6aeba:~$ mkimage -n initramfs -A arm64 -T ramdisk -C gzip -d initramfs.igz initramfs.img

    Image Name: initramfs
    Created: Thu Aug 12 16:32:49 2021
    Image Type: AArch64 Linux RAMDisk Image (gzip compressed)
    Data Size: 1265098 Bytes = 1235.45 KiB = 1.21 MiB
    Load Address: 00000000
    Entry Point: 00000000
    scale@LOS00187dd6aeba:~$ ls
    initramfs.cpio initramfs.igz initramfs.img rootfs







  • 相关阅读:
    linux tomcat 突然验证码出不来
    使用open live writer客户端写博客
    创建自己的maven模板
    Dynamic Web Module 3.0 requires Java 1.6 or newer
    win10 操作配置备忘
    Maven使用
    ORA-12514: TNS:listener does not currently know of service …
    PlantUML——4.实例演示1
    C语言基础(一)
    Linux系统挂载FAT32的U盘
  • 原文地址:https://www.cnblogs.com/hkingsp/p/15133503.html
Copyright © 2011-2022 走看看