From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1OOC4D-0002O5-K9 for mharc-grub-devel@gnu.org; Mon, 14 Jun 2010 11:59:17 -0400 Received: from [140.186.70.92] (port=33452 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OOC48-0002LH-Hq for grub-devel@gnu.org; Mon, 14 Jun 2010 11:59:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OOC45-0006RQ-Q1 for grub-devel@gnu.org; Mon, 14 Jun 2010 11:59:11 -0400 Received: from mail-bw0-f41.google.com ([209.85.214.41]:56770) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OOC45-0006Ql-Gt for grub-devel@gnu.org; Mon, 14 Jun 2010 11:59:09 -0400 Received: by bwz4 with SMTP id 4so86156bwz.0 for ; Mon, 14 Jun 2010 08:59:05 -0700 (PDT) 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:references:in-reply-to :x-enigmail-version:content-type; bh=6fO1tYLkPuWbGHpGoDDn6jeu4UgFEzgPk+1hDaSqI5c=; b=hc9uBOYYXYCDFU+rMq0O7dSiUtdicHOROWRZEJJjEKQrXn8SPesjfy44XhUGZykFzw Ua309rffe6putdaP4YwxoIG1a2sIcHPzLqjseSNSGRIXa28eGNXu/59xBzULz6qXQYUD w7XJcchI8wijaJnOWKu6ecA5plcTybp8jMqFs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type; b=T9NJKqoiIw3R612k8vBUVVbOw7iwTIil7q2Obzfc1rGjpkU0wXopQhC4MFObRTQfLj CNRrRR5SvdXTs2Bs0fm3/qvXTQ+2VrEUpVrMxCGnUhUmAiJ2McSIuRmIVrafCv9v1EEX G/wV7VO5gFiNUDeCrGNTQ4crtD91fOVQPFRj0= Received: by 10.204.2.71 with SMTP id 7mr4428487bki.213.1276531145152; Mon, 14 Jun 2010 08:59:05 -0700 (PDT) Received: from debian.bg45.phnet (70-63.76-83.cust.bluewin.ch [83.76.63.70]) by mx.google.com with ESMTPS id z20sm20041829bkx.21.2010.06.14.08.59.02 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 14 Jun 2010 08:59:03 -0700 (PDT) Message-ID: <4C1651BF.9010306@gmail.com> Date: Mon, 14 Jun 2010 17:58:55 +0200 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100515 Icedove/3.0.4 MIME-Version: 1.0 To: grub-devel@gnu.org References: <4C0BE2C7.4020407@gmail.com> <4C0D5AAE.6070504@gmail.com> <4C13B6A8.7060102@gmail.com> <4C13C33B.4090302@gmail.com> <4C15044D.9050608@gmail.com> <20100614113702.GN21862@riva.ucam.org> <20100614132536.GO21862@riva.ucam.org> <20100614150251.GA19053@riva.ucam.org> In-Reply-To: <20100614150251.GA19053@riva.ucam.org> X-Enigmail-Version: 1.0.1 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enigA1484184C6392AF81A1EE76A" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: Which partitioning schemes should be supported by GRUB? X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jun 2010 15:59:15 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigA1484184C6392AF81A1EE76A Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 06/14/2010 05:02 PM, Colin Watson wrote: > > 2010-06-14 Colin Watson > > Fix i386-pc prefix handling with nested partitions (Debian bug > #585068). > > * kern/i386/pc/init.c (make_install_device): If the prefix starts > with "(,", fill the boot drive in between those two characters, but > expect that a full partition specification including partition map > names will follow. > * util/i386/pc/grub-setup.c (setup): Unless an explicit prefix was > specified, write a prefix without the drive name but including a > full partition specification. > > =20 That makes a regression for multiboot loading of image if it was moved from one partition to another. > =3D=3D=3D modified file 'kern/i386/pc/init.c' > --- kern/i386/pc/init.c 2010-05-21 18:08:48 +0000 > +++ kern/i386/pc/init.c 2010-06-14 14:44:13 +0000 > @@ -83,6 +83,14 @@ make_install_device (void) > grub_snprintf (ptr, sizeof (dev) - (ptr - dev), ")%s", grub_pref= ix); > grub_strcpy (grub_prefix, dev); > } > + else if (grub_prefix[1] =3D=3D ',') > + { > + /* We have a prefix, but still need to fill in the boot drive. = */ > + grub_snprintf (dev, sizeof (dev), > + "(%cd%u%s", (grub_boot_drive & 0x80) ? 'h' : 'f', > + grub_boot_drive & 0x7f, grub_prefix + 1); > + grub_strcpy (grub_prefix, dev); > + } > =20 > =20 Or grub_prefix[1] =3D=3D ')' to allow ()/boot/grub syntax for unpartition= ed devices > return grub_prefix; > } > > =3D=3D=3D modified file 'util/i386/pc/grub-setup.c' > --- util/i386/pc/grub-setup.c 2010-06-11 20:31:16 +0000 > +++ util/i386/pc/grub-setup.c 2010-06-14 14:45:24 +0000 > @@ -99,6 +99,7 @@ setup (const char *dir, > struct grub_boot_blocklist *first_block, *block; > grub_int32_t *install_dos_part, *install_bsd_part; > grub_int32_t dos_part, bsd_part; > + char *prefix; > char *tmp_img; > int i; > grub_disk_addr_t first_sector; > @@ -230,6 +231,8 @@ setup (const char *dir, > + GRUB_KERNEL_MACHINE_INSTALL_DOS_PART); > install_bsd_part =3D (grub_int32_t *) (core_img + GRUB_DISK_SECTOR_S= IZE > + GRUB_KERNEL_MACHINE_INSTALL_BSD_PART); > + prefix =3D (char *) (core_img + GRUB_DISK_SECTOR_SIZE + > + GRUB_KERNEL_MACHINE_PREFIX); > =20 > /* Open the root device and the destination device. */ > root_dev =3D grub_device_open (root); > @@ -289,21 +292,45 @@ setup (const char *dir, > override the current setting. */ > if (*install_dos_part !=3D -2) > { > + grub_partition_t root_part =3D root_dev->disk->partition; > + > /* Embed information about the installed location. */ > - if (root_dev->disk->partition) > + if (root_part) > { > - if (root_dev->disk->partition->parent) > + char *new_prefix; > + > + if (root_part->parent) > { > - if (root_dev->disk->partition->parent->parent) > + if (root_part->parent->parent) > grub_util_error ("Installing on doubly nested partitions is " > "not supported"); > =20 This error must go away with that new syntax. > - dos_part =3D root_dev->disk->partition->parent->number; > - bsd_part =3D root_dev->disk->partition->number; > + dos_part =3D root_part->parent->number; > + bsd_part =3D root_part->number; > + > + if (prefix[0] !=3D '(') > + { > + new_prefix =3D xasprintf ("(,%s%d,%s%d)%s", > + root_part->parent->partmap->name, > + root_part->parent->number + 1, > + root_part->partmap->name, > + root_part->number + 1, > + prefix); > + strcpy (prefix, new_prefix); > + } > =20 Please use grub_partition_get_name. It will greatly simplify this part. > } > else > { > - dos_part =3D root_dev->disk->partition->number; > + dos_part =3D root_part->number; > bsd_part =3D -1; > + > + if (prefix[0] !=3D '(') > + { > + new_prefix =3D xasprintf ("(,%s%d)%s", > + root_part->partmap->name, > + root_part->number + 1, > + prefix); > + strcpy (prefix, new_prefix); > + } > } > } > else > > Thanks, > > =20 --=20 Regards Vladimir '=CF=86-coder/phcoder' Serbinenko --------------enigA1484184C6392AF81A1EE76A Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iF4EAREKAAYFAkwWUb8ACgkQNak7dOguQgkARgD9E0dDorHZlcsDKXdyqqb0zJSk LJIozYr7GYaoH6jHUEAA/R97cHwYsk383mkYHU4az/hrUhi5ML0LaeqlSFRZObpG =zM3h -----END PGP SIGNATURE----- --------------enigA1484184C6392AF81A1EE76A--