From 67ea43e0b06214e63140070253f38e2fb56efa86 Mon Sep 17 00:00:00 2001 From: Eric Curtin Date: Tue, 19 Dec 2023 12:03:02 +0000 Subject: [PATCH] Shellless initrd By nulling out bash, we can get a shellless initrd, this gets us down to 12M initrd size in Fedora. Once you mount storage and initoverlayfs you have a shell again. Kindof try and think of initrd as extended kernelspace with some userspace capabilities. Signed-off-by: Eric Curtin --- lib/dracut/modules.d/81initoverlayfs/module-setup.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/dracut/modules.d/81initoverlayfs/module-setup.sh b/lib/dracut/modules.d/81initoverlayfs/module-setup.sh index 0aca379..8f0b402 100644 --- a/lib/dracut/modules.d/81initoverlayfs/module-setup.sh +++ b/lib/dracut/modules.d/81initoverlayfs/module-setup.sh @@ -17,5 +17,7 @@ install() { if [ ! -e "/sbin/init" ]; then ln_r /usr/sbin/storage-init "/sbin/init" fi + + > "${initdir}/usr/bin/bash" }