mirror of
https://salsa.debian.org/kernel-team/initramfs-tools.git
synced 2026-01-26 07:37:54 +00:00
update-initramfs: Run 'sync' after writing the initramfs
Bug #783620 involves several machines with root on xfs being upgraded from wheezy to jessie and then immediately rebooted. In some cases the initramfs was apparently written to the journal but not committed during the reboot. As GRUB doesn't replay the journal, it loaded an empty initramfs and the kernel failed to boot. There is clearly a bug elsewhere (init system or kernel) that prevented the filesystem being cleanly shut down. However, there seems to be a general risk here, so add a 'sync' to mitigate it. Closes: #783620 Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
This commit is contained in:
parent
6a8d18b4e6
commit
fa1985b91f
@ -172,6 +172,8 @@ generate_initramfs()
|
||||
if mkinitramfs ${OPTS} "${initramfs}.new" "${version}"; then
|
||||
mv -f "${initramfs}.new" "${initramfs}"
|
||||
set_sha1
|
||||
# Guard against an unclean shutdown
|
||||
sync
|
||||
else
|
||||
mkinitramfs_return="$?"
|
||||
remove_initramfs_bak
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user