summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerhard Brauer <gerbra@archlinux.de>2009-06-04 17:14:23 +0200
committerDieter Plaetinck <dieter@plaetinck.be>2009-06-14 22:31:49 +0200
commitba0e266b9d26ac1ab0e1afb050df9dfeb9b7500f (patch)
treee7dd42d027a1abf7c0fcef0f612c3c03305ce2ef
parentdc1d9fd59ed758a09383c4b4f839f42a0bc85570 (diff)
Fix xfs freezing during grub installation
Since kernel 2.6.29 xfs_freeze could also freeze non-xfs partitions. This leeds to the problem that in the process of grub installation all our TARGET partitions ($target/ and $target/boot) get freezed - regardless which filesystem they have. The result is a stuck grub install. Better way is: freeze above TARGETS only if they realy have an xfs FS.
-rw-r--r--src/core/libs/lib-ui-interactive.sh20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh
index 8beb6fb..2b57346 100644
--- a/src/core/libs/lib-ui-interactive.sh
+++ b/src/core/libs/lib-ui-interactive.sh
@@ -807,10 +807,12 @@ EOF
cp -a $var_TARGET_DIR/usr/lib/grub/i386-pc/* $var_TARGET_DIR/boot/grub/
sync
# freeze xfs filesystems to enable grub installation on xfs filesystems
- if [ -x /usr/sbin/xfs_freeze ]; then
- /usr/sbin/xfs_freeze -f $var_TARGET_DIR/boot > /dev/null 2>&1
- /usr/sbin/xfs_freeze -f $var_TARGET_DIR/ > /dev/null 2>&1
- fi
+ for xfsdev in $(blkid -t TYPE=xfs -o device); do
+ mnt=$(mount | grep $xfsdev | cut -d' ' -f 3)
+ if [ $mnt = "$var_TARGET_DIR/boot" -o $mnt = "$var_TARGET_DIR/"
+ /usr/sbin/xfs_freeze -f $mnt > /dev/null 2>&1
+ fi
+ done
# look for a separately-mounted /boot partition
bootpart=$(mount | grep $var_TARGET_DIR/boot | cut -d' ' -f 1)
if [ "$bootpart" = "" ]; then
@@ -843,10 +845,12 @@ quit
EOF
cat /tmp/grub.log >$LOG
# unfreeze xfs filesystems
- if [ -x /usr/sbin/xfs_freeze ]; then
- /usr/sbin/xfs_freeze -u $var_TARGET_DIR/boot > /dev/null 2>&1
- /usr/sbin/xfs_freeze -u $var_TARGET_DIR/ > /dev/null 2>&1
- fi
+ for xfsdev in $(blkid -t TYPE=xfs -o device); do
+ mnt=$(mount | grep $xfsdev | cut -d' ' -f 3)
+ if [ $mnt = "$var_TARGET_DIR/boot" -o $mnt = "$var_TARGET_DIR/"
+ /usr/sbin/xfs_freeze -u $mnt > /dev/null 2>&1
+ fi
+ done
if grep "Error [0-9]*: " /tmp/grub.log >/dev/null; then
notify "Error installing GRUB. (see $LOG for output)"