From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KM7aj-0008Qz-5L for mharc-grub-devel@gnu.org; Thu, 24 Jul 2008 16:39:13 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KM7ag-0008Pl-Eo for grub-devel@gnu.org; Thu, 24 Jul 2008 16:39:10 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KM7ae-0008OQ-Q6 for grub-devel@gnu.org; Thu, 24 Jul 2008 16:39:09 -0400 Received: from [199.232.76.173] (port=60325 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KM7ae-0008O5-CN for grub-devel@gnu.org; Thu, 24 Jul 2008 16:39:08 -0400 Received: from mailout10.t-online.de ([194.25.134.21]:57403) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KM7ad-0000FV-6b for grub-devel@gnu.org; Thu, 24 Jul 2008 16:39:07 -0400 Received: from fwd26.aul.t-online.de by mailout10.sul.t-online.de with smtp id 1KM7ab-00069z-03; Thu, 24 Jul 2008 22:39:05 +0200 Received: from [10.3.2.2] (Go-KnyZbYhRdMWM8nEF+hTlsnTecc4lFzDcMZsrpKu4XhNT6bCe4rHR62bDRUtLgPA@[217.235.201.164]) by fwd26.aul.t-online.de with esmtp id 1KM7aZ-1pEqhc0; Thu, 24 Jul 2008 22:39:03 +0200 Message-ID: <4888E868.10404@t-online.de> Date: Thu, 24 Jul 2008 22:39:04 +0200 From: Christian Franke User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071128 SeaMonkey/1.1.7 MIME-Version: 1.0 To: The development of GRUB 2 References: <4888E3C5.9090707@t-online.de> In-Reply-To: <4888E3C5.9090707@t-online.de> Content-Type: multipart/mixed; boundary="------------020002030707020204000803" X-ID: Go-KnyZbYhRdMWM8nEF+hTlsnTecc4lFzDcMZsrpKu4XhNT6bCe4rHR62bDRUtLgPA X-TOI-MSGID: 9fac38a3-91fd-4689-ab9b-4353b4d1b3d5 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: Re: [PATCH] update-grub for Cygwin X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jul 2008 20:39:11 -0000 This is a multi-part message in MIME format. --------------020002030707020204000803 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 --------------020002030707020204000803 Content-Type: text/x-diff; name="grub2-10_cygwin.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="grub2-10_cygwin.patch" 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 . + + +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 + --------------020002030707020204000803--