* [PATCH] Fix grub.d/10_windows for Cygwin 1.7
@ 2010-05-05 20:16 Christian Franke
2010-05-09 13:29 ` Vladimir 'φ-coder/phcoder' Serbinenko
0 siblings, 1 reply; 4+ messages in thread
From: Christian Franke @ 2010-05-05 20:16 UTC (permalink / raw)
To: grub-devel
[-- Attachment #1: Type: text/html, Size: 335 bytes --]
[-- Attachment #2: grub2-10_windows.patch --]
[-- Type: text/x-patch, Size: 1826 bytes --]
=== modified file 'ChangeLog'
--- ChangeLog 2010-05-05 19:19:55 +0000
+++ ChangeLog 2010-05-05 20:09:01 +0000
@@ -1,3 +1,9 @@
+2010-05-05 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-05 Vladimir Serbinenko <phcoder@gmail.com>
* video/readers/jpeg.c: Indented.
=== modified file 'util/grub.d/10_windows.in'
--- util/grub.d/10_windows.in 2009-11-20 08:41:20 +0000
+++ util/grub.d/10_windows.in 2010-05-05 12:22:43 +0000
@@ -28,8 +28,8 @@
# 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 @@
}
-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 @@
# 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 @@
# 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
}
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Fix grub.d/10_windows for Cygwin 1.7
2010-05-05 20:16 [PATCH] Fix grub.d/10_windows for Cygwin 1.7 Christian Franke
@ 2010-05-09 13:29 ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-05-09 14:37 ` Christian Franke
0 siblings, 1 reply; 4+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2010-05-09 13:29 UTC (permalink / raw)
To: The development of GNU GRUB
[-- Attachment #1: Type: text/plain, Size: 975 bytes --]
Christian Franke wrote:
> This change is already included in Cygwin package grub-1.98-2.
>
-
+ test -z "$needmap" || cat <<EOF
+ drivemap -s (hd0) \$root
+EOF
You can't be sure on script runtime that C: is on hd0. Ironically especially when drivemap is used.
But drivemap -s (hd0) (hd0) is a nop, so no harm done.
On the other hand Vista and 7 are incompatible with drivemap so you have to skip drivemap on those systems. Look at 30_os-prober.in:
case ${LONGNAME} in
Windows\ Vista*|Windows\ 7*)
;;
*)
cat << EOF
drivemap -s (hd0) \${root}
EOF
;;
esac
> --
> Regards,
> Christian Franke
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 293 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Fix grub.d/10_windows for Cygwin 1.7
2010-05-09 13:29 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2010-05-09 14:37 ` Christian Franke
2010-05-09 14:56 ` Vladimir 'φ-coder/phcoder' Serbinenko
0 siblings, 1 reply; 4+ messages in thread
From: Christian Franke @ 2010-05-09 14:37 UTC (permalink / raw)
To: The development of GNU GRUB
Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> Christian Franke wrote:
>
>> This change is already included in Cygwin package grub-1.98-2.
>>
>>
> -
> + test -z "$needmap" || cat<<EOF
> + drivemap -s (hd0) \$root
> +EOF
> You can't be sure on script runtime that C: is on hd0. Ironically especially when drivemap is used.
> But drivemap -s (hd0) (hd0) is a nop, so no harm done.
> On the other hand Vista and 7 are incompatible with drivemap so you have to skip drivemap on those systems. Look at 30_os-prober.in:
> case ${LONGNAME} in
> Windows\ Vista*|Windows\ 7*)
> ;;
> *)
> cat<< EOF
> drivemap -s (hd0) \${root}
> EOF
> ;;
> esac
>
This is already considered in the script: $needmap is set if ntldr is
found but not if bootmgr is found.
--
Regards,
Christian Franke
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Fix grub.d/10_windows for Cygwin 1.7
2010-05-09 14:37 ` Christian Franke
@ 2010-05-09 14:56 ` Vladimir 'φ-coder/phcoder' Serbinenko
0 siblings, 0 replies; 4+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2010-05-09 14:56 UTC (permalink / raw)
To: The development of GNU GRUB
[-- Attachment #1: Type: text/plain, Size: 652 bytes --]
Christian Franke wrote:
>> -
>> + test -z "$needmap" || cat<<EOF
>> + drivemap -s (hd0) \$root
>> +EOF
>> You can't be sure on script runtime that C: is on hd0. Ironically
>> especially when drivemap is used.
>> But drivemap -s (hd0) (hd0) is a nop, so no harm done.
>> On the other hand Vista and 7 are incompatible with drivemap so you
>> have to skip drivemap on those systems.
>>
>
> This is already considered in the script: $needmap is set if ntldr is
> found but not if bootmgr is found.
>
I misread your script then. You can commit the patch into mainline.
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 293 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-05-09 14:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-05 20:16 [PATCH] Fix grub.d/10_windows for Cygwin 1.7 Christian Franke
2010-05-09 13:29 ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-05-09 14:37 ` Christian Franke
2010-05-09 14:56 ` Vladimir 'φ-coder/phcoder' Serbinenko
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.