09.最简根文件系统制作
下载busybox
官网下载 https://busybox.net/
$ wget https://busybox.net/downloads/busybox-1.34.1.tar.bz2
$ tar -xvf busybox-1.34.1.tar.bz2
$ cd busybox-1.34.1
编译
$ make menuconfig
Setting
[*] Build static binary (no shared libs)
(aarch64-linux-gnu-) Cross compiler prefix
$ make
$ file busybox
$ make install
$ cd _install
$ ls
bin linuxrc sbin usr
填充内容
$ mkdir dev etc var proc tmp home root mnt sys
$ cp -rf ../examples/bootfloppy/etc
$ cp /usr/local/aarch64-linux-gnu/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/libc/lib/ . -a
$ du -mh lib
$ rm lib
$ cd lib
$ rm -f libstdc++*
$ rm -f libtsan*
$ rm -f libgfortran*
$ cd ..
$ du -mh lib
$ cd ..
$ du -mh _install/
7.2M够了
$ cd _install/
$ sudo mknod dev/null c 1 3
$ sudo mknod dev/console c 5 1