Date: Mon, 10 Jan 2011 23:09:57 +0100 From: Pawel Jakub Dawidek <pjd@FreeBSD.org> To: Josh Paetzel <jpaetzel@FreeBSD.org> 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 Message-ID: <20110110220957.GB1923@garage.freebsd.pl> In-Reply-To: <201101101911.p0AJBQKG090310@svn.freebsd.org> References: <201101101911.p0AJBQKG090310@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110110220957.GB1923>