From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1SfOsY-0004Zd-7O for mharc-grub-devel@gnu.org; Fri, 15 Jun 2012 01:15:26 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55386) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SfOsV-0004ZF-4T for grub-devel@gnu.org; Fri, 15 Jun 2012 01:15:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SfOsT-0006T7-3T for grub-devel@gnu.org; Fri, 15 Jun 2012 01:15:22 -0400 Received: from mail-we0-f169.google.com ([74.125.82.169]:51479) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SfOsS-0006Sx-Qc for grub-devel@gnu.org; Fri, 15 Jun 2012 01:15:21 -0400 Received: by wefh52 with SMTP id h52so2338636wef.0 for ; Thu, 14 Jun 2012 22:15:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type; bh=rKQuyKpD527ORrIdCDR4wMbSuoyDidwRn9wBBOdRMCA=; b=BK2QPOGMPD1z0ZJe/ptgIIsECMuI6pHLuWf/9F2pkXn8rBvfwhiFbJEO1RHvC63LoH jvxRjn1mQTdhEetgvvtdJePHArNg4gtXZRt+SWXm/CyGcD/MuhPhTYejKcAlV05ShOGz EhHTXwY+j3M2pm8NG0i7yC7jY7d3JlLpok1bO4shPDgAdGBnyrq+SQu8VlwC7160r+iT d3vehbv4EUn/NxeV3RN0MEtMa751xvT7t7SKO2aUXCW1U+eMOOHNeFKo3RSfzdljqOn6 JIPWqp6hcn3l115EeB7G1Z62V2Ok2uvaPlzvOCuHwMgWpa8Mue3pKVsfFBd6OIDzvMZL N4Cg== Received: by 10.216.141.98 with SMTP id f76mr2443162wej.32.1339737318361; Thu, 14 Jun 2012 22:15:18 -0700 (PDT) Received: from debian.x201.phnet (63-232.197-178.cust.bluewin.ch. [178.197.232.63]) by mx.google.com with ESMTPS id f7sm1530383wiv.2.2012.06.14.22.15.17 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 14 Jun 2012 22:15:17 -0700 (PDT) Message-ID: <4FDAC4E4.402@gmail.com> Date: Fri, 15 Jun 2012 07:15:16 +0200 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.4) Gecko/20120510 Icedove/10.0.4 MIME-Version: 1.0 To: The development of GNU GRUB Subject: Re: [PATCH] Don't look for a partition map on a floppy References: <4FDAC3B1.3010303@comcast.net> In-Reply-To: <4FDAC3B1.3010303@comcast.net> X-Enigmail-Version: 1.4.1 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enigC7B3138B0E5DB204547F4BF7" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 74.125.82.169 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 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: Fri, 15 Jun 2012 05:15:25 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigC7B3138B0E5DB204547F4BF7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 15.06.2012 07:10, Robert Mabee wrote: > "echo *" takes about 12 seconds on my system (PC, BIOS, empty floppy dr= ive) > because grub_partition_iterate tries to enumerate the partitions on the= > floppy. > "search --no-floppy" probably hits the same delay (not verified) since > it has to > generate the partition names before it can discard fd[0-9]. >=20 search -s stops when it finds first matching device and floppies are checked in the last place. > I suggest skipping tiny devices (ie < 4 MB) rather than looking at the = name > so it won't affect various 100 MB super floppies that might appear as B= IOS > floppies and therefore get indistinguishable names in fd[0-9]. Arguabl= y > these drives should continue to support partition maps, at the expense = of > long timeouts if they don't handle missing media any better than plain-= old > floppy drives do. Minix floppies are partitioned. >=20 > =3D=3D=3D modified file 'ChangeLog' > --- old/ChangeLog 2012-06-09 17:58:38 +0000 > +++ new/ChangeLog 2012-06-15 04:34:50 +0000 > @@ -1,3 +1,15 @@ > +2012-06-15 Bob Mabee > + > + * kern/partition.c (grub_partition_is_plausible): New function to > + decide drive is too small (like floppy) to support partitioning. > + * (grub_partition_iterate): Use above so search and (*) avoid long= > + timeouts trying to read partmap from a missing floppy. > + > 2012-06-09 Vladimir Serbinenko >=20 > * tests/grub_script_expansion.in: Explicitly tell grep that we han= dle >=20 > =3D=3D=3D modified file 'grub-core/kern/partition.c' > --- old/grub-core/kern/partition.c 2012-02-08 19:19:44 +0000 > +++ new/grub-core/kern/partition.c 2012-06-14 05:30:02 +0000 > @@ -162,12 +162,23 @@ > return part; > } >=20 > +/* Very unlikely to find a partmap on a tiny floppy, but looking for a= > + map costs a long timeout if drive is empty, so skip device < 4 MB. > + (Allowing for a lower-overhead format on biggest media, 2.88 MB.) *= / > +static int > +grub_partition_is_plausible (struct grub_disk *disk) > +{ > + grub_uint64_t n_bytes =3D grub_disk_get_size (disk) << > GRUB_DISK_SECTOR_BITS; > + return n_bytes >=3D 4 << 20; > +} > + > int > grub_partition_iterate (struct grub_disk *disk, > int (*hook) (grub_disk_t disk, > const grub_partition_t partition)) > { > int ret =3D 0; > + if (!grub_partition_is_plausible (disk)) return ret; >=20 > auto int part_iterate (grub_disk_t dsk, const grub_partition_t p); >=20 >=20 >=20 >=20 > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel >=20 --=20 Regards Vladimir '=CF=86-coder/phcoder' Serbinenko --------------enigC7B3138B0E5DB204547F4BF7 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.12 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iF4EAREKAAYFAk/axOQACgkQNak7dOguQgnmPgD/XeMZIfWKlNJl0SdSmkpm28F4 0HT0ek2MmAv7D/24HEUA/AvCH7+lhiDNM/QThr1zjfclKGX9W64+JuYXFj+K5Bdp =8sgh -----END PGP SIGNATURE----- --------------enigC7B3138B0E5DB204547F4BF7--