Skip to content

Commit fff7930

Browse files
committed
setup: work around initramfs-tools bug
A recent update (or at least recent to Raspberry Pi OS. The change appears to have occurred between 0.142 (which works) and 0.142+deb12u1 (which does not work) to the initramfs-tools package made it so that copying an indirectly symlinked host file to the initramfs would create a symlink instead of copying the file if a file with the same name was already indirectly symlinked in the initramfs. Work around this by using the canonical name when copying. Also make it so debian-resizefs.sh only updates the currently used initramfs, to speed up setup. fixes #881
1 parent cfe5f14 commit fff7930

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/debian-resizefs.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ case "$1" in
3232
esac
3333
3434
. /usr/share/initramfs-tools/hook-functions
35-
copy_exec /sbin/findfs /sbin/findfs-full
35+
copy_exec $(readlink -f /sbin/findfs) /sbin/findfs-full
3636
copy_exec /sbin/e2fsck /sbin
3737
copy_exec /sbin/resize2fs /sbin
3838
EOF
@@ -84,7 +84,7 @@ EOF
8484
chmod +x /etc/initramfs-tools/scripts/init-premount/resize
8585

8686
# Regenerate initrd
87-
update-initramfs -v -u
87+
update-initramfs -v -u -k "$(uname -r)"
8888

8989
# Remove files
9090
rm -f /etc/initramfs-tools/hooks/resize2fs /etc/initramfs-tools/scripts/init-premount/resize

0 commit comments

Comments
 (0)