#! /bin/bash # user: cd to an appropriate linux kernel tree (version) and then run 'get-mmotm' # to download/apply the mmotm patch; it also renames the top-level directory; # assumes that quilt is installed; stamp=`wget -q -O - http://userweb.kernel.org/~akpm/mmotm/ | grep stamp` #echo "stamp=$stamp" #datetime=`echo "$stamp" | tr -d "/\<\>"` #echo "$datetime" datetime=`echo "$stamp" | sed -e "s/<..>//g" | sed -e "s###g" | sed -e "s/<.*>//g"` #echo "datetime=$datetime" datetime=`echo "$datetime" | sed -e "s/stamp-//g" | tr -d "-"` #echo "datetime=$datetime" year=${datetime:0:4} mmdd=${datetime:4:4} hhmm=${datetime:8:4} #echo "yr, mmdd, hhmm: $year, $mmdd, $hhmm" mmotm_name="mmotm-$year-$mmdd-$hhmm" echo $mmotm_name #touch $mmotm_name . ~/.grabkernelrc cwd=`pwd` cd $PATCHDIR if [ ! -f $mmotm_name.tar.gz ]; then wget http://userweb.kernel.org/~akpm/mmotm/broken-out.tar.gz mv -f broken-out.tar.gz $mmotm_name.tar.gz fi cd $cwd #echo "=== back to $cwd" tar xzf $PATCHDIR/$mmotm_name.tar.gz mv broken-out patches quilt push -a >pushall.txt 2>&1 echo "check pushall.txt for rejects: grep FAIL pushall.txt:" if grep FAIL pushall.txt ; then echo ">>>>>>>>>> patch FAILUREs <<<<<<<<<<" else echo "********** patches OK **********" fi cd .. #echo "=== cd to $PWD" dirname=`basename $cwd` mv $dirname $mmotm_name cd $mmotm_name #echo "=== cd to $mmotm_name"