Skip to content

Commit

Permalink
Shellless initd
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
ericcurtin committed Dec 19, 2023
1 parent 271cbe7 commit 9787db3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/dracut/modules.d/81initoverlayfs/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ install() {
if [ ! -e "/sbin/init" ]; then
ln_r /usr/sbin/storage-init "/sbin/init"
fi

> "${initdir}/usr/bin/bash"
}

0 comments on commit 9787db3

Please sign in to comment.