如何定制 initrd.img

167 天前
 wuzhewuyou
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 解不开啊解不开
988 次点击
所在节点    Linux
3 条回复
fugu37
167 天前
不要手动修改,用对应的工具,比如 fedora 的 dracut ,archlinux 的 mkinitcpio
choury
167 天前
看起来是 debian 的内核,用 unmkinitramfs 命令,这是一个脚本,你也可以直接看脚本里面的逻辑
wuzhewuyou
167 天前
@choury 感谢大佬

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1050785

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX