Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 129 lines (108 sloc) 4.119 kb
#!/bin/bash
# build -stable release from current -stable series
# Copyright (c) 2005 Chris Wright <chrisw@osdl.org>
# Copyright (c) 2006-2011 Greg Kroah-Hartman <greg@kroah.com>
#
if [ $# -ne 1 ]; then
RELEASE=`ketchup -m`
#echo -e "Usage:\t $0 release_number\ne.g.\t $0 2.6.11.12"
#exit 1
else
RELEASE=$1
fi
#if [ -z "${GIT_GPG_KEY}" ]; then
# echo -e "Error:\tMust set GIT_GPG_KEY env variable"
# exit 1
#fi
#
#git-tag -u "${GIT_GPG_KEY}" -m "this is a TEST" vTest
#exit 0
#RELEASE=$1
REL_ARRAY=(${RELEASE//./ })
BASE=${REL_ARRAY[0]}.${REL_ARRAY[1]}.${REL_ARRAY[2]}
REL=${REL_ARRAY[3]}
MINOR=${REL_ARRAY[2]}
LONGTERM=0
# see if this is a "longterm" kernel or not
if [ $MINOR == "32" ]; then
LONGTERM=1
fi
if [ $MINOR == "33" ]; then
LONGTERM=1
fi
#echo "longterm = $LONGTERM"
# 3.0 or 2.6?
VER="2.6"
if [ ${REL_ARRAY[0]} == "3" ] ; then
# 3.x series
VER="3.0"
BASE=${REL_ARRAY[0]}.${REL_ARRAY[1]}
REL=${REL_ARRAY[2]}
MINOR=${REL_ARRAY[1]}
fi
LAST=$(($REL - 1))
if [ $LAST -eq 0 ]; then
LAST_REL=${BASE}
else
LAST_REL=${BASE}.${LAST}
fi
echo "# creating stable release $RELEASE (base $BASE last version $LAST_REL)"
echo "# "
# commit EXTRAVERSION change
#git-update-cache Makefile
#RELEASE_COMMIT=$(echo "Linux $RELEASE" | git-commit-tree $(git-write-tree) -p HEAD)
#echo $RELEASE_COMMIT > .git/HEAD
# tag it
#git-tag-script -u ${GIT_GPG_KEY} -m "This is the $RELEASE stable release" v$RELEASE
#BASE_COMMIT="$(git cat-file tag $(cat .git/refs/tags/v${BASE}) | grep object | cut -d" " -f2)"
#LAST_COMMIT="$(git cat-file tag $(cat .git/refs/tags/v${LAST_REL}) | grep object | cut -d" " -f2)"
#RELEASE_COMMIT="$(git cat-file tag $(cat .git/refs/tags/v${RELEASE}) | grep object | cut -d" " -f2)"
BASE_COMMIT="$(git cat-file tag v${BASE} | grep object | cut -d" " -f2)"
LAST_COMMIT="$(git cat-file tag v${LAST_REL} | grep object | cut -d" " -f2)"
RELEASE_COMMIT="$(git cat-file tag v${RELEASE} | grep object | cut -d" " -f2)"
echo "# BASE_COMMIT=$BASE_COMMIT"
echo "# LAST_COMMIT=$LAST_COMMIT"
echo "# RELEASE_COMMIT=$RELEASE_COMMIT"
echo "#"
echo -n "# [ret] to continue"
read
RELDIR="../release-$RELEASE"
mkdir $RELDIR
echo "# building tree in $RELDIR"
# build release materials, tarball, base patch, incr patch, changelog
#git tar-tree HEAD linux-$RELEASE | gzip -9 > $RELDIR/linux-${RELEASE}.tar.gz
git archive --format=tar --prefix=linux-$RELEASE/ HEAD | gzip -9 > $RELDIR/linux-${RELEASE}.tar.gz
git diff-tree -p $BASE_COMMIT $RELEASE_COMMIT | gzip -9 > $RELDIR/patch-${RELEASE}.gz
git diff-tree -p $LAST_COMMIT $RELEASE_COMMIT | gzip -9 > $RELDIR/patch-${LAST_REL}-${REL}.gz
zcat $RELDIR/patch-${LAST_REL}-${REL}.gz | diffstat -p1 > $RELDIR/diffstat-${LAST_REL}-${REL} 2>/dev/null
git log ${LAST_COMMIT}..${RELEASE_COMMIT} > $RELDIR/ChangeLog-$RELEASE
< $RELDIR/ChangeLog-$RELEASE git shortlog > $RELDIR/shortlog-$RELEASE
#echo "ready to upload files"
#echo "scp $RELDIR/* master.kernel.org:$RELDIR/"
#echo "don't forget to update LATEST-IS"
echo "# "
if [ $LONGTERM -eq 1 ]; then
echo "# This is a longterm release"
echo "# finalize the release:"
echo "mv $RELDIR/linux-${RELEASE}.tar.gz ~/v2.6/longterm/v${BASE}/"
echo "mv $RELDIR/ChangeLog-${RELEASE} ~/v2.6/longterm/v${BASE}/"
echo "mv $RELDIR/patch-${RELEASE}.gz ~/v2.6/longterm/v${BASE}/"
echo "cp $RELDIR/patch-${LAST_REL}-${REL}.gz ~/v2.6/longterm/v${BASE}/incr/"
echo "mv $RELDIR/patch-${LAST_REL}-${REL}.gz ~"
echo "mv $RELDIR/diffstat-${LAST_REL}-${REL} ~"
echo "mv $RELDIR/shortlog-${RELEASE} ~"
else
echo "# This is a stable release"
echo "# finalize it:"
echo "mv $RELDIR/linux-${RELEASE}.tar.gz ~/v${VER}/"
echo "mv $RELDIR/ChangeLog-${RELEASE} ~/v${VER}/"
echo "mv $RELDIR/patch-${RELEASE}.gz ~/v${VER}/"
echo "cp $RELDIR/patch-${LAST_REL}-${REL}.gz ~/v${VER}/incr/"
echo "mv $RELDIR/patch-${LAST_REL}-${REL}.gz ~"
echo "mv $RELDIR/diffstat-${LAST_REL}-${REL} ~"
echo "mv $RELDIR/shortlog-${RELEASE} ~"
LATEST=`ls ~/v${VER}/LATEST-IS*`
LATEST=`basename $LATEST`
echo "# current LATEST-IS is '$LATEST' is that what it should be?"
echo "# mv ~/v${VER}/${LATEST} ~/v${VER}/LATEST-IS-${RELEASE}"
fi
Jump to Line
Something went wrong with that request. Please try again.