From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MDKRk-0001xA-Qz for mharc-grub-devel@gnu.org; Sun, 07 Jun 2009 11:38:08 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MDKRj-0001wU-11 for grub-devel@gnu.org; Sun, 07 Jun 2009 11:38:07 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MDKRe-0001uz-Ex for grub-devel@gnu.org; Sun, 07 Jun 2009 11:38:06 -0400 Received: from [199.232.76.173] (port=50669 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MDKRe-0001ut-0Z for grub-devel@gnu.org; Sun, 07 Jun 2009 11:38:02 -0400 Received: from moutng.kundenserver.de ([212.227.17.8]:64694) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MDKRd-0003TZ-ER for grub-devel@gnu.org; Sun, 07 Jun 2009 11:38:01 -0400 Received: from [85.180.41.14] (e180041014.adsl.alicedsl.de [85.180.41.14]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0MKt2u-1MDKRc0ibF-0005Dd; Sun, 07 Jun 2009 17:38:00 +0200 From: Felix Zielcke To: The development of GRUB 2 Content-Type: multipart/mixed; boundary="=-Ry7cPPK2gECDPh0JWQ5A" Date: Sun, 07 Jun 2009 17:37:59 +0200 Message-Id: <1244389079.3791.7.camel@fz.local> Mime-Version: 1.0 X-Mailer: Evolution 2.26.2 X-Provags-ID: V01U2FsdGVkX1+EruZMUJLhH8olMYhz3rpNqPPEvI5dzPwSGR2 8PT3snPMeSFsZjcShOSavNM5JDlrtUATLV+pZSFs1+oTmo18Pn luYTQo/m6UgmAuZREjKtN1BiFXQSwht X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [PATCH] add drivemap support to 30_os-prober.in and use UUIDs 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: Sun, 07 Jun 2009 15:38:07 -0000 --=-Ry7cPPK2gECDPh0JWQ5A Content-Type: text/plain Content-Transfer-Encoding: 7bit Attached patch uses `prepare_grub_to_access_device' to set the root in the generated entrys. And it adds drivemap to the chainload ones, if root isn't (hd0). The Debian grub-installer adds map only with Dos and Windows, should I do the same or is it okay to do it for all? -# update-grub helper script. +# grub-mkconfig helper script. Does this needs to be mentioned in ChangeLog? -- Felix Zielcke --=-Ry7cPPK2gECDPh0JWQ5A Content-Disposition: attachment; filename="os-prober.patch" Content-Type: text/x-patch; name="os-prober.patch"; charset="UTF-8" Content-Transfer-Encoding: 7bit 2009-06-07 Felix Zielcke * util/grub.d/30_os-prober.in: Source ${libdir}/grub/grub-mkconfig_lib. Use prepare_grub_to_access_device to set the root device. diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in index 7d4d17e..9a6dff4 100644 --- a/util/grub.d/30_os-prober.in +++ b/util/grub.d/30_os-prober.in @@ -1,7 +1,7 @@ #! /bin/sh -e -# update-grub helper script. -# Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. +# grub-mkconfig helper script. +# Copyright (C) 2006,2007,2008,2009 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 @@ -16,6 +16,12 @@ # You should have received a copy of the GNU General Public License # along with GRUB. If not, see . +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ + +. ${libdir}/grub/grub-mkconfig_lib + if [ -z "`which os-prober 2> /dev/null`" -o -z "`which linux-boot-prober 2> /dev/null`" ] ; then # missing os-prober and/or linux-boot-prober exit 0 @@ -45,7 +51,15 @@ for OS in ${OSPROBED} ; do cat << EOF menuentry "${LONGNAME} (on ${DEVICE})" { - set root=${CHAINROOT} +EOF + prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/" + + if [ `echo ${CHAINROOT} | sed -e 's/,[0-9]*[a-z]*//g'` != "(hd0)" ] ; then + cat << EOF + drivemap -s (hd0) \$root +EOF + fi + cat << EOF chainloader +1 } EOF @@ -61,15 +75,15 @@ EOF LINITRD="`echo ${LINUX} | cut -d ':' -f 5`" LPARAMS="`echo ${LINUX} | cut -d ':' -f 6- | tr '^' ' '`" - LINUXROOT="`grub-probe --target=drive --device ${LBOOT} 2> /dev/null`" - if [ -z "${LLABEL}" ] ; then LLABEL="${LONGNAME}" fi cat << EOF menuentry "${LLABEL} (on ${DEVICE})" { - set root=${LINUXROOT} +EOF + prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/" + cat << EOF linux ${LKERNEL} ${LPARAMS} EOF if [ -n "${LINITRD}" ] ; then @@ -88,7 +102,9 @@ EOF OSXDISK=disk"`echo ${OSXROOT} | awk -F , '{ print $1 ; }' | sed 's/(hd//;'`"s"`echo ${OSXROOT} | awk -F , '{ print $2 ; }' | sed 's/)//;'`" cat << EOF menuentry "${LONGNAME} (on ${DEVICE})" { - set root=${OSXROOT} +EOF + prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/" + cat << EOF insmod vbe do_resume=0 if [ /var/vm/sleepimage -nt10 / ]; then --=-Ry7cPPK2gECDPh0JWQ5A--