sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be
我想编写一个脚本,它将执行以下命令:
${CROSS_COMPILE}gcc -static myinit.c -o myinit
cd initramfs
fakeroot # this is pure magic (it allows us to pretend to be root)
mkdir -p dev
mknod dev/console c 5 1
chown root init
find . | cpio -H newc -o > ../initramfs.cpio # <-- this is the actual initramfs
exit # leave th
Linux上的initramfs档案可以由一系列连接的、gzipped压缩的cpio文件组成。
给定这样的存档,如何提取所有嵌入的档案,而不是仅仅提取第一个?
以下是一种模式的示例,虽然它似乎具有工作潜力,但只提取第一个存档:
while gunzip -c | cpio -i; do :; done <input.cgz
我还尝试使用来自dracut的skipcpio助手将文件指针移过第一个cpio映像,但是以下结果导致将一个损坏的流(而不是输入中的正确点)发送到cpio:
# this isn't ideal -- presumably would need to rerun
我跟踪这篇文章并生成了一个initramfs.cpio文件。
现在,教程提到我必须将这个文件放在构建目录中:
Finally, you have to rebuild the kernel again:
# 0. Copy the CPIO archive to your kernel build directory:
cp initramfs.cpio .
但是我没有看到任何构建目录:
[root@xilinx linux-xlnx]# ls
arch CREDITS drivers include Kbuild lib mm