From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1LTPwk-00025c-1F for mharc-grub-devel@gnu.org; Sat, 31 Jan 2009 19:12:22 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LTPwi-00024T-GD for grub-devel@gnu.org; Sat, 31 Jan 2009 19:12:20 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LTPwg-000247-EC for grub-devel@gnu.org; Sat, 31 Jan 2009 19:12:19 -0500 Received: from [199.232.76.173] (port=49314 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LTPwg-000244-9Z for grub-devel@gnu.org; Sat, 31 Jan 2009 19:12:18 -0500 Received: from fg-out-1718.google.com ([72.14.220.153]:22354) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LTPwf-0004xl-OC for grub-devel@gnu.org; Sat, 31 Jan 2009 19:12:18 -0500 Received: by fg-out-1718.google.com with SMTP id l27so348677fgb.30 for ; Sat, 31 Jan 2009 16:12:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type; bh=WuOrteqOaHztINrNbRAWQJ81WHMNuKxADlSRrt2Spok=; b=SrfGRvdaKegoq3mtIIRJsDPVRz44criDnl/WYopa9VCXrphpppniqgI2x24raMqO2m BqnC5pOPZIDsGwAY1KKRxbuo2hNkqWKjLZFOW4u5dcpdly6UsJWLvjzXRmzUhpw4aB52 xJr796vmnSJWanqhmOZS8b1TN1iqGNk4Bat7E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type; b=N8+sa+yXOmXh00HY9ZP29YhKLWzQsC2/Blo8jMbXxVpVftG3ExswtcRGnHIawi7Z+F OYy9kz5O9fTbLWNZ5ZSx+UyoX8uxeo2jnaeOLzatjvZIs44hMAI+ZvvnvfSOYGYQIR0j fFO2yQ7PDGACIccJRuztv3FTjJnqUutzqWfOU= Received: by 10.86.95.8 with SMTP id s8mr530582fgb.28.1233447136185; Sat, 31 Jan 2009 16:12:16 -0800 (PST) Received: from ?192.168.1.25? (197-193.203-62.cust.bluewin.ch [62.203.193.197]) by mx.google.com with ESMTPS id l19sm1761946fgb.47.2009.01.31.16.12.14 (version=SSLv3 cipher=RC4-MD5); Sat, 31 Jan 2009 16:12:15 -0800 (PST) Message-ID: <4984E8DE.2090608@gmail.com> Date: Sun, 01 Feb 2009 01:12:14 +0100 From: phcoder User-Agent: Thunderbird 2.0.0.19 (X11/20090105) MIME-Version: 1.0 To: The development of GRUB 2 Content-Type: multipart/mixed; boundary="------------050803020908000806060108" X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: [PATCH] Allow to install in non-default prefixes 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, 01 Feb 2009 00:12:20 -0000 This is a multi-part message in MIME format. --------------050803020908000806060108 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit This patch adds -p option for grub-setup on i386-pc. Without it install to any prefix different from /boot/grub failed Thank Vladimir 'phcoder' Serbinenko --------------050803020908000806060108 Content-Type: text/plain; name="prefpatch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="prefpatch" Index: util/i386/pc/grub-setup.c =================================================================== --- util/i386/pc/grub-setup.c (revision 1964) +++ util/i386/pc/grub-setup.c (working copy) @@ -94,6 +94,7 @@ static void setup (const char *dir, + const char *prefix, const char *boot_file, const char *core_file, const char *root, const char *dest, int must_embed) { @@ -373,7 +374,7 @@ /* Make sure that GRUB reads the identical image as the OS. */ tmp_img = xmalloc (core_size); - core_path_dev = grub_util_get_path (DEFAULT_DIRECTORY, core_file); + core_path_dev = grub_util_get_path (prefix, core_file); /* It is a Good Thing to sync two times. */ sync (); @@ -540,6 +541,7 @@ -b, --boot-image=FILE use FILE as the boot image [default=%s]\n\ -c, --core-image=FILE use FILE as the core image [default=%s]\n\ -d, --directory=DIR use GRUB files in the directory DIR [default=%s]\n\ + -p, --prefix=DIR specify the name of GRUB directory relative to partition root [default=%s]\n \ -m, --device-map=FILE use FILE as the device map [default=%s]\n\ -r, --root-device=DEV use DEV as the root device [default=guessed]\n\ -h, --help display this message and exit\n\ @@ -548,7 +550,8 @@ \n\ Report bugs to <%s>.\n\ ", - DEFAULT_BOOT_FILE, DEFAULT_CORE_FILE, DEFAULT_DIRECTORY, + DEFAULT_BOOT_FILE, DEFAULT_CORE_FILE, DEFAULT_DIRECTORY, + DEFAULT_DIRECTORY, DEFAULT_DEVICE_MAP, PACKAGE_BUGREPORT); exit (status); @@ -575,6 +578,7 @@ char *dev_map = 0; char *root_dev = 0; char *dest_dev; + char *prefix = 0; int must_embed = 0; progname = "grub-setup"; @@ -582,7 +586,7 @@ /* Check for options. */ while (1) { - int c = getopt_long (argc, argv, "b:c:d:m:r:hVv", options, 0); + int c = getopt_long (argc, argv, "p:b:c:d:m:r:hVv", options, 0); if (c == -1) break; @@ -603,6 +607,14 @@ core_file = xstrdup (optarg); break; + case 'p': + if (prefix) + free (prefix); + + prefix = xstrdup (optarg); + break; + + case 'd': if (dir) free (dir); @@ -723,6 +735,7 @@ for (i = 0; devicelist[i]; i++) { setup (dir ? : DEFAULT_DIRECTORY, + prefix ? : DEFAULT_DIRECTORY, boot_file ? : DEFAULT_BOOT_FILE, core_file ? : DEFAULT_CORE_FILE, root_dev, grub_util_get_grub_dev (devicelist[i]), 1); @@ -732,6 +745,7 @@ #endif /* Do the real work. */ setup (dir ? : DEFAULT_DIRECTORY, + prefix ? : DEFAULT_DIRECTORY, boot_file ? : DEFAULT_BOOT_FILE, core_file ? : DEFAULT_CORE_FILE, root_dev, dest_dev, must_embed); --------------050803020908000806060108--