From owner-svn-src-stable-8@FreeBSD.ORG Thu Jul 28 09:56:56 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B05E1065675; Thu, 28 Jul 2011 09:56:56 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mail.kirov.so-cdu.ru (ns.kirov.so-ups.ru [178.74.170.1]) by mx1.freebsd.org (Postfix) with ESMTP id 320088FC17; Thu, 28 Jul 2011 09:56:55 +0000 (UTC) Received: from kas30pipe.localhost (localhost.kirov.so-cdu.ru [127.0.0.1]) by mail.kirov.so-cdu.ru (Postfix) with SMTP id 1F97FB801F; Thu, 28 Jul 2011 13:38:03 +0400 (MSD) Received: from kirov.so-cdu.ru (unknown [172.21.81.1]) by mail.kirov.so-cdu.ru (Postfix) with ESMTP id 19BA7B801B; Thu, 28 Jul 2011 13:38:03 +0400 (MSD) Received: by ns.kirov.so-cdu.ru (Postfix, from userid 1010) id 14308B8400; Thu, 28 Jul 2011 13:38:03 +0400 (MSD) Received: from [10.118.3.52] (elsukov.kirov.oduur.so [10.118.3.52]) by ns.kirov.so-cdu.ru (Postfix) with ESMTP id D29D8B83FD; Thu, 28 Jul 2011 13:38:02 +0400 (MSD) Message-ID: <4E312DF5.2050306@FreeBSD.org> Date: Thu, 28 Jul 2011 13:37:57 +0400 From: "Andrey V. Elsukov" User-Agent: Mozilla Thunderbird 1.5 (FreeBSD/20051231) MIME-Version: 1.0 To: Jason Hellenthal References: <201107270410.p6R4AXc3040342@svn.freebsd.org> <20110728024007.GB55550@DataIX.net> In-Reply-To: <20110728024007.GB55550@DataIX.net> X-Enigmail-Version: 1.1.1 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigC86E7A483DB4FA181B6735A7" X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0284], KAS30/Release X-SpamTest-Info: Not protected Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r224464 - in stable/8/sys: geom/part sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2011 09:56:56 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigC86E7A483DB4FA181B6735A7 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable On 28.07.2011 6:40, Jason Hellenthal wrote: >> + uint32_t dsn; >> + >> + if (gpp->gpp_codesize !=3D MBRSIZE) >> + return (ENODEV); >=20 > Is it known for an absolute fact that the size being written is always > going to be the size of MBRSIZE ? never less ? wouldnt ">=3D" greater-t= han > or equal make sense here ? though I would seriously doubt it needs to > return on equal too as that could be written. Yes. Now the size of bootcode must be equal to MBRSIZE. We do not have any of bootcode images with size different than MBRSIZE. If you want to write bootcode with size less than MBRSIZE, then just fill up your image with zeroes to MBRSIZE. >> - codesz =3D DOSPARTOFF; >> table =3D (struct g_part_mbr_table *)basetable; >> - bzero(table->mbr, codesz); >> - codesz =3D MIN(codesz, gpp->gpp_codesize); >> - if (codesz > 0) >> - bcopy(gpp->gpp_codeptr, table->mbr, codesz); >> + dsn =3D *(uint32_t *)(table->mbr + DOSDSNOFF); >> + bcopy(gpp->gpp_codeptr, table->mbr, DOSPARTOFF); >> + if (dsn !=3D 0) >=20 > Shit happens... any case that the product might return less than 0 > causing this to still fall through and process... ? ">" ? Variable with type uint32_t could not be less than zero. This code only restores old DSN if it is not zero. In any other cases you can use boot0c= fg(8) to set or change it. --=20 WBR, Andrey V. Elsukov --------------enigC86E7A483DB4FA181B6735A7 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 (MingW32) iQEcBAEBAgAGBQJOMS36AAoJEAHF6gQQyKF6OIcIAK4l/muhv/PMUMqhnQHVSAFj afLFgFAgul4ENbVD9k7o9WZoJy2Dk0285jKxang8m+O//7iATdCt9fHSle9VRh+e LuhH+kk541Lq6TXae/EtyBR1+tcSUXOUapioioRxjst+bgFqmh4uskGnTGyJL+vl TIhH3FhsPca+FTadlDI4cGGXOKmym6hiyi3pV/V1eZHbMkWUhCY7sNtmg718qlum y4LHUajOjC6+KF1Lomu2x5iHmkW7MUAlFGnp1BdSobEcVM5fQn7C8zodM3ar98cX bmvZNWV86hMWdyDJJM0C/SiQUkj94/C8TaTEcw37JvLl10UQHmPi4HVzXyhRc5M= =gDKy -----END PGP SIGNATURE----- --------------enigC86E7A483DB4FA181B6735A7--