All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Franke <Christian.Franke@t-online.de>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [PATCH] update-grub for Cygwin
Date: Thu, 24 Jul 2008 22:39:04 +0200	[thread overview]
Message-ID: <4888E868.10404@t-online.de> (raw)
In-Reply-To: <4888E3C5.9090707@t-online.de>

[-- Attachment #1: Type: text/plain, Size: 174 bytes --]

Christian Franke wrote:
> This patch allows to run update-grub on Cygwin.
>
... and here is a simple example for /etc/grub.d/10_cygwin

Only adds current OS yet.

Christian


[-- Attachment #2: grub2-10_cygwin.patch --]
[-- Type: text/x-diff, Size: 1420 bytes --]

diff --git a/util/grub.d/10_cygwin.in b/util/grub.d/10_cygwin.in
new file mode 100644
index 0000000..1dd1116
--- /dev/null
+++ b/util/grub.d/10_cygwin.in
@@ -0,0 +1,48 @@
+#! /bin/sh -e
+
+# update-grub helper script.
+# Copyright (C) 2008  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
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# GRUB is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
+
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+sbindir=@sbindir@
+
+grub_probe=${sbindir}/grub-probe
+
+case "`uname 2>/dev/null`" in
+  CYGWIN_NT-5.0) OS="Windows 2000" ;;
+  CYGWIN_NT-5.1) OS="Windows XP" ;;
+  CYGWIN*) OS="Windows" ;;
+  *) exit 0 ;;
+esac
+
+[ "$SYSTEMDRIVE" != "" ] || exit 0
+
+p="`cygpath -a "$SYSTEMDRIVE"`"
+
+[ -f "$p"/ntldr ] || exit 0
+
+d="`${grub_probe} -t drive "$p" 2>/dev/null`" || exit 0
+
+echo "Found $OS on $d" >&2
+cat << EOF
+menuentry "$OS" {
+	root=$d
+	chainloader +1
+}
+EOF
+

  reply	other threads:[~2008-07-24 20:39 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-24 20:19 [PATCH] update-grub for Cygwin Christian Franke
2008-07-24 20:39 ` Christian Franke [this message]
2008-07-25 20:42   ` Robert Millan
2008-07-31 21:32     ` Christian Franke
2008-08-04 19:46       ` Christian Franke
2008-08-04 20:00         ` Robert Millan
2008-08-04 20:40           ` Christian Franke
2008-08-04 21:41             ` Robert Millan
2008-08-05 12:13               ` Christian Franke
2008-08-05 20:09                 ` Robert Millan
2008-08-06 18:48                   ` Christian Franke
2008-07-25 20:40 ` Robert Millan
2008-07-26 12:53   ` Christian Franke
2008-07-27  6:09     ` Pavel Roskin
2008-07-27 12:39       ` Robert Millan
2008-07-29 15:40         ` Christian Franke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4888E868.10404@t-online.de \
    --to=christian.franke@t-online.de \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.