From: chrfranke Date: Tue, 29 Jul 2008 16:47:31 +0000 (+0000) Subject: 2008-07-29 Christian Franke X-Git-Tag: 1.98~1367 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2921d33798fbfc625b9f4974a1969db4f6116792;p=thirdparty%2Fgrub.git 2008-07-29 Christian Franke * util/update-grub_lib.in (make_system_path_relative_to_its_root): Add conversion of emulated mount points on Cygwin. --- diff --git a/ChangeLog b/ChangeLog index 985b30ac7..8d18362d3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-07-29 Christian Franke + + * 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 * util/update-grub.in: Add a check for admin diff --git a/util/update-grub_lib.in b/util/update-grub_lib.in index 03a96ce8f..9d0f0c603 100644 --- a/util/update-grub_lib.in +++ b/util/update-grub_lib.in @@ -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 ()