Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(squash): use busybox for early setup if available
Use busybox can help reduce the size of early setup environment. With this change, everything is packed in the squash image, and the setup files will be dropped once squash image setup is done, so initramfs stage memory usage is reduced to the minimun, and initramfs decompress is also faster. File layout of a squash initramfs looks like this: ======================================================================== drwxr-xr-x 1 root root 0 Feb 15 14:07 . -rwxr-xr-x 1 root root 946 Feb 15 14:07 init lrwxrwxrwx 1 root root 7 Feb 15 14:07 lib -> usr/lib drwxr-xr-x 1 root root 0 Feb 15 14:07 squash -rw-r--r-- 1 root root 91000832 Feb 15 14:07 squash-root.img drwxr-xr-x 1 root root 0 Feb 15 14:07 usr drwxr-xr-x 1 root root 0 Feb 15 14:07 usr/bin -rwxr-xr-x 1 root root 1293688 Jul 27 2020 usr/bin/busybox lrwxrwxrwx 1 root root 7 Feb 15 14:07 usr/bin/echo -> busybox lrwxrwxrwx 1 root root 7 Feb 15 14:07 usr/bin/mkdir -> busybox lrwxrwxrwx 1 root root 7 Feb 15 14:07 usr/bin/modprobe -> busybox lrwxrwxrwx 1 root root 7 Feb 15 14:07 usr/bin/mount -> busybox lrwxrwxrwx 1 root root 7 Feb 15 14:07 usr/bin/sh -> busybox lrwxrwxrwx 1 root root 7 Feb 15 14:07 usr/bin/switch_root -> busybox drwxr-xr-x 1 root root 0 Feb 15 14:07 usr/lib drwxr-xr-x 1 root root 0 Feb 15 14:07 usr/lib/dracut -rw-r--r-- 1 root root 23 Feb 15 14:07 usr/lib/dracut/build-parameter.txt -rw-r--r-- 1 root root 31 Feb 15 14:07 usr/lib/dracut/dracut-051-93.git20210215.fc33 -rw-r--r-- 1 root root 358 Feb 15 14:07 usr/lib/dracut/modules.txt -rw-r--r-- 1 root root 0 Feb 15 14:07 usr/lib/dracut/need-initqueue drwxr-xr-x 1 root root 0 Feb 15 14:07 usr/lib/modules drwxr-xr-x 1 root root 0 Feb 15 14:07 usr/lib/modules/5.10.11-200.fc33.x86_64 drwxr-xr-x 1 root root 0 Feb 15 14:07 usr/lib/modules/5.10.11-200.fc33.x86_64/kernel <... kernel module misc files skipped ... > ========================================================================
- Loading branch information