=== modified file 'debian/mandos-client.postinst' --- debian/mandos-client.postinst 2019-07-27 10:11:45 +0000 +++ debian/mandos-client.postinst 2024-09-08 02:14:29 +0000 @@ -37,7 +37,19 @@ # Dracut preserves old permissions of initramfs image # files, so we adjust permissions before creating new # initramfs image containing secret keys. - chmod go-r /boot/initrd.img-"$kversion" + if [ -e /boot/initrd.img-"$kversion" ]; then + chmod go-r /boot/initrd.img-"$kversion" + else + # An initrd image has not yet been created for this + # kernel, possibly because this new kernel is about to + # be, but has not yet been, installed. In this case, + # we create an empty file with the right permissions + # so that Dracut will preserve those permissions when + # it creates the real, new initrd image for this + # kernel. + install --mode=u=rw /dev/null \ + /boot/initrd.img-"$kversion" + fi if [ "$kversion" != "*" ]; then /etc/kernel/postinst.d/dracut "$kversion" fi