V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
wuzhewuyou
V2EX  ›  Linux

如何定制 initrd.img

  •  
  •   wuzhewuyou · 155 天前 · 980 次点击
    这是一个创建于 155 天前的主题,其中的信息可能已经有所发展或是发生改变。
    binwalk /boot/initrd.img-6.1.0-13-amd64

    DECIMAL HEXADECIMAL DESCRIPTION
    --------------------------------------------------------------------------------
    0 0x0 ASCII cpio archive (SVR4 with no CRC), file name: "kernel", file name length: "0x00000007", file size: "0x00000000"
    120 0x78 ASCII cpio archive (SVR4 with no CRC), file name: "kernel/x86", file name length: "0x0000000B", file size: "0x00000000"
    244 0xF4 ASCII cpio archive (SVR4 with no CRC), file name: "kernel/x86/microcode", file name length: "0x00000015", file size: "0x00000000"
    376 0x178 ASCII cpio archive (SVR4 with no CRC), file name: "kernel/x86/microcode/.enuineIntel.align.0123456789abc", file name length: "0x00 000036", file size: "0x00000000"
    540 0x21C ASCII cpio archive (SVR4 with no CRC), file name: "kernel/x86/microcode/GenuineIntel.bin", file name length: "0x00000026", file si ze: "0x006DDC00"
    7200432 0x6DDEB0 ASCII cpio archive (SVR4 with no CRC), file name: "TRAILER!!!", file name length: "0x0000000B", file size: "0x00000000"
    12847157 0xC40835 gzip compressed data, ASCII, last modified: 1993-0 9-23 09:11:30
    44020969 0x29FB4E9 Object signature in DER format (PKCS header length : 4, sequence length: 407
    60068642 0x3949322 Zlib compressed data, best compression
    60075195 0x394ACBB Zlib compressed data, default compression
    64419970 0x3D6F882 XML document, version: "1.0"
    64423732 0x3D70734 Zlib compressed data, best compression

    找了很多教程,基本过时了,直接解压得到很小的文件夹,截取 12847157 后的 gzip 解不开啊解不开
    3 条回复    2024-06-19 15:16:19 +08:00
    fugu37
        1
    fugu37  
       155 天前 via Android   ❤️ 1
    不要手动修改,用对应的工具,比如 fedora 的 dracut ,archlinux 的 mkinitcpio
    choury
        2
    choury  
       155 天前
    看起来是 debian 的内核,用 unmkinitramfs 命令,这是一个脚本,你也可以直接看脚本里面的逻辑
    wuzhewuyou
        3
    wuzhewuyou  
    OP
       155 天前
    @choury 感谢大佬
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3263 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 12:05 · PVG 20:05 · LAX 04:05 · JFK 07:05
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.