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=" >/dev/null 2>/dev/null > + echo $line | grep "^${_dTag}-part=" >/dev/null 2>/dev/null
You can just use 'grep -q' instead of redirecting grep's output to /dev/null. > if [ "$?" = "0" ] This will work, but more elegant way is [ $? -eq 0 ] - there is no need to convert exit code to string. > + FOUNDROOT="1" ; export FOUNDROOT 'export FOUNDROOT="1"' should work too. > + if [ "${FS}" != "UFS" -a "${FS}" != "UFS+S" -a "${FS}" != "UFS+J" -a > "${FS}" != "UFS+SUJ" ] ; then Something like this should work too: if [ "${FS%+*}" != "UFS" ]; then > + dd if=/dev/zero of=${_pDisk}p${CURPART} count=2048 >/dev/null > 2>/dev/null If you specify 'of=' 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="`expr ${CURPART} + 1`" Simpler: CURPART=$((CURPART+1)) > + if [ "$?" != "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. -- Pawel Jakub Dawidek http://www.wheelsystems.com p...@freebsd.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am!
pgp6OybTM8aUB.pgp
Description: PGP signature