diff options
author | Ben Hutchings <ben@decadent.org.uk> | 2020-01-30 18:34:52 +0100 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2020-01-30 18:35:56 +0100 |
commit | 1b28d253a9b757c49a8e17855efd8af426f761d9 (patch) | |
tree | 5075d1f2cdd0ebc8776aaf72036a8ce9e095cfca | |
parent | 21edcb0b36e0368bb1a19a7ea95a443f81844501 (diff) |
Document copy_exec as usable for shared libraries
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r-- | hook-functions | 4 | ||||
-rw-r--r-- | initramfs-tools.7 | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/hook-functions b/hook-functions index 925a332..72c3674 100644 --- a/hook-functions +++ b/hook-functions @@ -170,7 +170,7 @@ copy_file() { cp -pP "${src}" "${DESTDIR}/${target}" || return $(($? + 1)) } -# $1 = executable to copy to initramfs, with library dependencies +# $1 = executable/shared library to copy to initramfs, with dependencies # $2 (optional) Name for the file on the initramfs # Location of the image dir is assumed to be $DESTDIR # We never overwrite the target if it exists. @@ -199,7 +199,7 @@ copy_exec() { x="${nonoptlib}" fi - copy_file library "${x}" || { + copy_file binary "${x}" || { ret=$? [ ${ret} = 1 ] || return $((ret - 1)) } diff --git a/initramfs-tools.7 b/initramfs-tools.7 index a36b50a..2d5d2d2 100644 --- a/initramfs-tools.7 +++ b/initramfs-tools.7 @@ -267,14 +267,14 @@ copy_modules_dir kernel/drivers/ata .RE .SS Including binaries -If you need to copy binaries to the initramfs module, a command like this -should be used: +If you need to copy an executable or shared library to the initramfs +module, use a command like this: .PP .RS copy_exec /sbin/mdadm /sbin .RE -mkinitramfs will automatically detect which libraries the executable depends on +mkinitramfs will automatically detect which libraries it depends on and copy them to the initramfs. This means that most executables, unless compiled with klibc, will automatically include glibc in the image which will increase its size by several hundred kilobytes. |