]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2008-07-29 Christian Franke <franke@computer.org>
authorchrfranke <chrfranke@localhost>
Tue, 29 Jul 2008 16:47:31 +0000 (16:47 +0000)
committerchrfranke <chrfranke@localhost>
Tue, 29 Jul 2008 16:47:31 +0000 (16:47 +0000)
* util/update-grub_lib.in (make_system_path_relative_to_its_root):
Add conversion of emulated mount points on Cygwin.

ChangeLog
util/update-grub_lib.in

index 985b30ac72b97381d172f11454375f0c6923c370..8d18362d30525d7a4b1f25a62697d23acd8ce6d0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-07-29  Christian Franke  <franke@computer.org>
+
+       * util/update-grub_lib.in (make_system_path_relative_to_its_root):
+       Add conversion of emulated mount points on Cygwin.
+
 2008-07-29  Christian Franke  <franke@computer.org>
 
        * util/update-grub.in: Add a check for admin
index 03a96ce8fcdf7b2c662bcd9cf7c3275312e0cc1c..9d0f0c6031ed290e20168404272a144d9972ae4c 100644 (file)
@@ -68,7 +68,22 @@ make_system_path_relative_to_its_root ()
     dir=""
   fi
 
-  echo $path | sed -e "s,^$dir,,g"
+  # XXX: This fails if $dir contains ','.
+  path=`echo "$path" | sed -e "s,^$dir,,g"` || return 1
+
+  case "`uname 2>/dev/null`" in
+    CYGWIN*)
+      # Cygwin: Check if regular or emulated mount.
+      if [ -z "$dir" ] || [ "`stat -c %D "$dir/.."`" != 620000 ] ; then
+        # Reached some mount point not below /cygdrive.
+        # GRUB does not know Cygwin's emulated mounts,
+        # convert to Win32 path and remove drive letter.
+        path=`cygpath -m "$path" | sed -n 's,^[A-Za-z]:,,p'`
+        test ! -z "$path" || return 1
+      fi ;;
+  esac
+
+  echo "$path"
 }
 
 is_path_readable_by_grub ()