Bug#239111: Patch for xfs_freeze

Robert Millan Robert Millan <zeratul2@wanadoo.es>, 239111@bugs.debian.org
Tue, 20 Jul 2004 22:06:20 +0200


--ZGiS0Q5IWpPtfppv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline


Hi!

I think this should do it. Joey, could you test the attached patch?

-- 
Robert Millan

"[..] but the delight and pride of Aule is in the deed of making, and in the
thing made, and neither in possession nor in his own mastery; wherefore he
gives and hoards not, and is free from care, passing ever on to some new work."

 -- J.R.R.T., Ainulindale (Silmarillion)

--ZGiS0Q5IWpPtfppv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="xfs.diff"

Index: util/grub-install.in
===================================================================
RCS file: /cvsroot/grub/grub/util/grub-install.in,v
retrieving revision 1.48
diff -u -r1.48 grub-install.in
--- util/grub-install.in	20 Jul 2004 19:30:24 -0000	1.48
+++ util/grub-install.in	20 Jul 2004 20:03:42 -0000
@@ -450,6 +450,20 @@
 # Create a safe temporary file.
 test -n "$mklog" && log_file=`$mklog`
 
+# Sync to prevent GRUB from not finding stage files (notably, on XFS)
+sync
+
+# XFS needs special magic
+xfs_frozen=false
+if which xfs_freeze > /dev/null ; then
+  cat << EOF
+Due to a bug in xfs_freeze, the following command might produce a segmentation
+fault when ${grubdir} is not in an XFS filesystem. This error is harmless and
+can be ignored.
+EOF
+  if xfs_freeze -f ${grubdir} ; then xfs_frozen=true ; fi
+fi
+
 # Now perform the installation.
 $grub_shell --batch $no_floppy --device-map=$device_map <<EOF >$log_file
 root $root_drive
@@ -457,6 +471,10 @@
 quit
 EOF
 
+if ${xfs_frozen} ; then
+  xfs_freeze -u ${grubdir}
+fi
+
 if grep "Error [0-9]*: " $log_file >/dev/null || test $debug = yes; then
     cat $log_file 1>&2
     exit 1

--ZGiS0Q5IWpPtfppv--