initramfs 文件系统制作

源码下载:https://busybox.net/downloads/

源码版本:busybox-1.30.0.tar.bz2

 

[ 源码编译步骤 ]

make menuconfig ARCH= COMPILE_CROSS= --prefix=
①[*] Build static binary (no shared libs) (/home/lance/nanopi/busybox/rootfs) Destination path for 'make install' (aarch64-linux-gnu-) Cross compiler prefix ②make ③make install

[ 编辑文件 ]

1 ln -s /dev/null /dev/tty1  ///< 加入ttyx
2 cp linuxr init         ///< 加入init,做为启动入口
3 touch /etc/init.d/rcs      ///< 加入初始化脚本,写入自定义内容

[ 最终的根目录 ]

lance@ubuntu:~/busybox/rootfs$ ls
    bin  dev  etc  init  linuxrc  mnt  proc  sbin  sys  tmp  usr

[ initramfs 打包 ]

find . | cpio -o -H newc | gzip > ../rootfs.cpio.gz

最终可用的文件系统即为: rootfs.cpio.gz 

 

猜你喜欢

转载自www.cnblogs.com/GyForever1004/p/11992309.html