Initramfs: Difference between revisions
From Lolly's Wiki
Jump to navigationJump to search
No edit summary |
|||
Line 1: | Line 1: | ||
[[Category:Bootprocess]] | [[Category:Bootprocess]] | ||
=Adding binaries to the initial ram disk in | =Adding binaries to the initial ram disk in Ubuntu= | ||
See manual page for initramfs-tools for this, too. | |||
== Adding vi to initramfs == | == Adding vi to initramfs == | ||
<SyntaxHighlight lang=bash> | <SyntaxHighlight lang=bash> |
Latest revision as of 09:47, 6 October 2022
Adding binaries to the initial ram disk in Ubuntu
See manual page for initramfs-tools for this, too.
Adding vi to initramfs
$ sudo apt --yes install vim
$ sudo cat >/etc/initramfs-tools/hooks/vi <<EOH
#!/bin/sh -e
PREREQ=""
prereqs()
{
echo "\$PREREQ"
}
case \$1 in
prereqs)
prereqs
exit 0
;;
esac
. /usr/share/initramfs-tools/hook-functions
# Begin real processing below this line
copy_exec /usr/bin/vim.basic /bin
exit 0
EOH
$ sudo chmod 0755 /etc/initramfs-tools/hooks/vi
$ sudo update-initramfs -k $(uname -r) -u -v
...
Calling hook vi
Adding binary /usr/bin/vim.basic
Adding binary-link /usr/lib/x86_64-linux-gnu/libtinfo.so.6
Adding binary /usr/lib/x86_64-linux-gnu/libtinfo.so.6.3
Adding binary-link /usr/lib/x86_64-linux-gnu/libsodium.so.23
Adding binary /usr/lib/x86_64-linux-gnu/libsodium.so.23.3.0
Adding binary /lib/x86_64-linux-gnu/libgpm.so.2
Adding binary /lib/x86_64-linux-gnu/libpython3.10.so.1.0
Adding binary-link /usr/lib/x86_64-linux-gnu/libexpat.so.1
Adding binary /usr/lib/x86_64-linux-gnu/libexpat.so.1.8.7
...
As you can see all needed libraries for the binary are added automatically.