]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* util/grub.d/10_windows.in: Use path names instead of
authorChristian Franke <franke@computer.org>
Tue, 18 May 2010 19:58:49 +0000 (21:58 +0200)
committerChristian Franke <franke@computer.org>
Tue, 18 May 2010 19:58:49 +0000 (21:58 +0200)
drive letters to prevent warning from Cygwin 1.7.
Add drivemap command to menuentry if needed.

ChangeLog
util/grub.d/10_windows.in

index e8bb242bfc48a1e68668527039b98ebfb12b2a20..46d9e7c340feb12fcd4f1a150d4286e7081a2b41 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-05-18  Christian Franke  <franke@computer.org>
+
+       * util/grub.d/10_windows.in: Use path names instead of
+       drive letters to prevent warning from Cygwin 1.7.
+       Add drivemap command to menuentry if needed.
+
 2010-05-18  Justus Winter  <4winter@informatik.uni-hamburg.de>
 
        * util/grub.d/10_hurd.in: Include all gnumach* kernels, not only
index 35dd4a4cc81145bde90e28741b50896b3aa0b074..7d221eac9bd0941c99be5be311bde1073ad58f6c 100644 (file)
@@ -1,7 +1,7 @@
 #! /bin/sh -e
 
 # grub-mkconfig helper script.
-# Copyright (C) 2008  Free Software Foundation, Inc.
+# Copyright (C) 2008,2009,2010  Free Software Foundation, Inc.
 #
 # GRUB is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -28,8 +28,8 @@ esac
 
 # Try C: even if current system is on other partition.
 case "$SYSTEMDRIVE" in
-  [Cc]:)     dirlist="C:"              ;;
-  [D-Zd-z]:) dirlist="C: $SYSTEMDRIVE" ;;
+  [Cc]:)     drives="C:"              ;;
+  [D-Zd-z]:) drives="C: $SYSTEMDRIVE" ;;
   *) exit 0 ;;
 esac
 
@@ -51,7 +51,13 @@ get_os_name_from_boot_ini ()
 }
 
 
-for dir in $dirlist ; do
+for drv in $drives ; do
+
+  # Convert to Cygwin path.
+  dir=`cygpath "$drv"`
+  test -n "$dir" || continue
+
+  needmap=
 
   # Check for Vista bootmgr.
   if [ -f "$dir"/bootmgr -a -f "$dir"/boot/bcd ] ; then
@@ -60,6 +66,7 @@ for dir in $dirlist ; do
   # Check for NTLDR.
   elif [ -f "$dir"/ntldr -a -f "$dir"/ntdetect.com -a -f "$dir"/boot.ini ] ; then
     OS=`get_os_name_from_boot_ini "$dir"/boot.ini` || OS="Windows NT/2000/XP loader"
+    needmap=t
 
   else
     continue
@@ -68,14 +75,16 @@ for dir in $dirlist ; do
   # Get boot /dev/ice.
   dev=`${grub_probe} -t device "$dir" 2>/dev/null` || continue
 
-  echo "Found $OS on $dir ($dev)" >&2
+  echo "Found $OS on $drv ($dev)" >&2
   cat << EOF
 menuentry "$OS" {
 EOF
 
   save_default_entry | sed -e 's,^,\t,'
   prepare_grub_to_access_device "$dev" | sed 's,^,\t,'
-
+  test -z "$needmap" || cat <<EOF
+       drivemap -s (hd0) \$root
+EOF
   cat << EOF
        chainloader +1
 }