]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
call fsfreeze(8) on /boot to flush initramfs data & metadata to media 331/head
authorFrançois Cami <fcami@fedoraproject.org>
Sat, 16 Dec 2017 22:21:07 +0000 (23:21 +0100)
committerFrançois Cami <fcami@fedoraproject.org>
Tue, 19 Dec 2017 13:47:11 +0000 (14:47 +0100)
dracut.sh

index 635fdb1c3fa8686ad474d1778666f9c46971d1d7..2687706026463d3125536823d9ee38f297fab51b 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -1828,8 +1828,13 @@ fi
 command -v restorecon &>/dev/null && restorecon -- "$outfile"
 
 if ! sync "$outfile" 2> /dev/null; then
-    dinfo "dracut: sync operartion on newly created initramfs $outfile failed"
+    dinfo "dracut: sync operation on newly created initramfs $outfile failed"
     exit 1
+# use fsfreeze only if we're not writing to /
+elif ! [ "$(stat -c %m -- "$outfile")" == "/" ]; then
+    if ! $(fsfreeze -f $(dirname "$outfile") 2>/dev/null && fsfreeze -u $(dirname "$outfile") 2>/dev/null); then
+        dinfo "dracut: warning: could not fsfreeze $(dirname "$outfile")"
+    fi
 fi
 
 exit 0