From owner-svn-src-head@FreeBSD.ORG Mon Jan 10 22:10:12 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1165B106566C; Mon, 10 Jan 2011 22:10:12 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id A07998FC12; Mon, 10 Jan 2011 22:10:11 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id DF02345B36; Mon, 10 Jan 2011 23:10:09 +0100 (CET) Received: from localhost (89-73-192-49.dynamic.chello.pl [89.73.192.49]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 9DEA445CA6; Mon, 10 Jan 2011 23:10:04 +0100 (CET) Date: Mon, 10 Jan 2011 23:09:57 +0100 From: Pawel Jakub Dawidek To: Josh Paetzel Message-ID: <20110110220957.GB1923@garage.freebsd.pl> References: <201101101911.p0AJBQKG090310@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="CUfgB8w4ZwR/yMy5" Content-Disposition: inline In-Reply-To: <201101101911.p0AJBQKG090310@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217229 - head/usr.sbin/pc-sysinstall/backend X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jan 2011 22:10:12 -0000 --CUfgB8w4ZwR/yMy5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 10, 2011 at 07:11:26PM +0000, Josh Paetzel wrote: [...] > while read line > do > # Check for data on this slice > - echo $line | grep "^${DISKTAG}-part=3D" >/dev/null 2>/dev/null > + echo $line | grep "^${_dTag}-part=3D" >/dev/null 2>/dev/null You can just use 'grep -q' instead of redirecting grep's output to /dev/null. > if [ "$?" =3D "0" ] This will work, but more elegant way is [ $? -eq 0 ] - there is no need to convert exit code to string. > + FOUNDROOT=3D"1" ; export FOUNDROOT 'export FOUNDROOT=3D"1"' should work too. > + if [ "${FS}" !=3D "UFS" -a "${FS}" !=3D "UFS+S" -a "${FS}" !=3D = "UFS+J" -a "${FS}" !=3D "UFS+SUJ" ] ; then Something like this should work too: if [ "${FS%+*}" !=3D "UFS" ]; then > + dd if=3D/dev/zero of=3D${_pDisk}p${CURPART} count=3D2048 >/dev/n= ull 2>/dev/null If you specify 'of=3D' there is no need to redirect standard output to /dev/null, as it is already redirected somewhere else. > + if [ ! -z "${ENCPASS}" ] ; then '[ ! -z "{str}" ]' is equivalent of '[ -n "${str}" ]'. > + CURPART=3D"`expr ${CURPART} + 1`" Simpler: CURPART=3D$((CURPART+1)) > + if [ "$?" !=3D "0" ] ; then return ; fi [ $? -eq 0 ] || return > - rc_halt "gpart add -b 34 -s 128 -t freebsd-boot ${_intDISK}" > + rc_halt "gpart add -b 34 -s 64 -t freebsd-boot ${_intDISK}" Gptzfsboot in HEAD is 27463 bytes. Gptzfsboot in ZFSv28 is 29659, so using 64 sectors leaves only 3109 bytes for it to grow. Note that, eg. RAIDZ3 support is not yet implemented and I expect it might be not be enough place left to implement it if you do that. PS. Only because those are shell scripts doesn't mean style is not important. They could really be easier to read if they follow style used in rcNG. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --CUfgB8w4ZwR/yMy5 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk0rg7UACgkQForvXbEpPzQAOgCgxqx2Mbs+nkaEdtO/vNLOhMAJ WZ0AmwTKQ0JCHWwhA8Mb+glo9u3X053x =Ikjz -----END PGP SIGNATURE----- --CUfgB8w4ZwR/yMy5--