对于更有趣的交互式系统,这是一个(主要是教育性的)小脚本,其中:
下载内核和busybox的源代码
编译它们
用它们生成可引导的8Mb ISO
然后,ISO会将您留在带有busybox的最小外壳中。
借助QEMU,您可以轻松启动系统。
用法:
git clone https://github.com/ivandavidov/minimal
cd minimal/src
./build_minimal_linux_live.sh
# Wait.
# Install QEMU.
# minimal_linux_live.iso was generated
./qemu64.sh
然后您将被留在QEMU窗口中,并带有新的最小系统。太棒了
由于它很小,因此是阅读源代码并了解正在发生什么的一个很好的选择。
在Ubuntu 16.04上测试。
大型的Makefile脚本管理:
GCC交叉编译工具链
内核编译
引导程序编译
rootfs的生成
在源代码树中有大量的软件包下载/构建配方,包括GTK之类的复杂内容。有一个依赖系统。
最小示例:
git clone git://git.buildroot.net/buildroot
cd buildroot
git checkout 2016.05
make qemu_x86_defconfig
# Can't use -jN, use `BR2_JLEVEL=2` instead.
BR2_JLEVEL=2 make
# Wait.
# cat board/qemu/x86_64/readme.txt
qemu-system-x86_64 -M pc -kernel output/images/bzImage -drive file=output/images/rootfs.ext2,if=virtio,format=raw -append root=/dev/vda -net nic,model=virtio -net user
# You are now in a shell with BusyBox utilities.
专业的东西。
带有软件包管理器的嵌入式分发,该软件包管理器提供了来自网站的预编译二进制文件。
单个可执行文件rootfs