Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 129 lines (108 sloc) 4.119 kb
15eca4a @gregkh dorelease save and changes due to kup
authored
1 #!/bin/bash
2 # build -stable release from current -stable series
3 # Copyright (c) 2005 Chris Wright <chrisw@osdl.org>
4 # Copyright (c) 2006-2011 Greg Kroah-Hartman <greg@kroah.com>
5 #
6
7
8 if [ $# -ne 1 ]; then
9 RELEASE=`ketchup -m`
10 #echo -e "Usage:\t $0 release_number\ne.g.\t $0 2.6.11.12"
11 #exit 1
12 else
13 RELEASE=$1
14 fi
15
16 #if [ -z "${GIT_GPG_KEY}" ]; then
17 # echo -e "Error:\tMust set GIT_GPG_KEY env variable"
18 # exit 1
19 #fi
20 #
21 #git-tag -u "${GIT_GPG_KEY}" -m "this is a TEST" vTest
22 #exit 0
23
24 #RELEASE=$1
25 REL_ARRAY=(${RELEASE//./ })
26 BASE=${REL_ARRAY[0]}.${REL_ARRAY[1]}.${REL_ARRAY[2]}
27 REL=${REL_ARRAY[3]}
28 MINOR=${REL_ARRAY[2]}
29
30 LONGTERM=0
31 # see if this is a "longterm" kernel or not
32 if [ $MINOR == "32" ]; then
33 LONGTERM=1
34 fi
35 if [ $MINOR == "33" ]; then
36 LONGTERM=1
37 fi
38 #echo "longterm = $LONGTERM"
39
40 # 3.0 or 2.6?
41 VER="2.6"
42 if [ ${REL_ARRAY[0]} == "3" ] ; then
43 # 3.x series
44 VER="3.0"
45 BASE=${REL_ARRAY[0]}.${REL_ARRAY[1]}
46 REL=${REL_ARRAY[2]}
47 MINOR=${REL_ARRAY[1]}
48 fi
49
50
51 LAST=$(($REL - 1))
52 if [ $LAST -eq 0 ]; then
53 LAST_REL=${BASE}
54 else
55 LAST_REL=${BASE}.${LAST}
56 fi
57 echo "# creating stable release $RELEASE (base $BASE last version $LAST_REL)"
58 echo "# "
59
60 # commit EXTRAVERSION change
61 #git-update-cache Makefile
62 #RELEASE_COMMIT=$(echo "Linux $RELEASE" | git-commit-tree $(git-write-tree) -p HEAD)
63 #echo $RELEASE_COMMIT > .git/HEAD
64
65 # tag it
66 #git-tag-script -u ${GIT_GPG_KEY} -m "This is the $RELEASE stable release" v$RELEASE
67
68 #BASE_COMMIT="$(git cat-file tag $(cat .git/refs/tags/v${BASE}) | grep object | cut -d" " -f2)"
69 #LAST_COMMIT="$(git cat-file tag $(cat .git/refs/tags/v${LAST_REL}) | grep object | cut -d" " -f2)"
70 #RELEASE_COMMIT="$(git cat-file tag $(cat .git/refs/tags/v${RELEASE}) | grep object | cut -d" " -f2)"
71 BASE_COMMIT="$(git cat-file tag v${BASE} | grep object | cut -d" " -f2)"
72 LAST_COMMIT="$(git cat-file tag v${LAST_REL} | grep object | cut -d" " -f2)"
73 RELEASE_COMMIT="$(git cat-file tag v${RELEASE} | grep object | cut -d" " -f2)"
74
75 echo "# BASE_COMMIT=$BASE_COMMIT"
76 echo "# LAST_COMMIT=$LAST_COMMIT"
77 echo "# RELEASE_COMMIT=$RELEASE_COMMIT"
78 echo "#"
79 echo -n "# [ret] to continue"
80 read
81
82 RELDIR="../release-$RELEASE"
83 mkdir $RELDIR
84
85 echo "# building tree in $RELDIR"
86
87 # build release materials, tarball, base patch, incr patch, changelog
88 #git tar-tree HEAD linux-$RELEASE | gzip -9 > $RELDIR/linux-${RELEASE}.tar.gz
89
90 git archive --format=tar --prefix=linux-$RELEASE/ HEAD | gzip -9 > $RELDIR/linux-${RELEASE}.tar.gz
91
92
93 git diff-tree -p $BASE_COMMIT $RELEASE_COMMIT | gzip -9 > $RELDIR/patch-${RELEASE}.gz
94 git diff-tree -p $LAST_COMMIT $RELEASE_COMMIT | gzip -9 > $RELDIR/patch-${LAST_REL}-${REL}.gz
95 zcat $RELDIR/patch-${LAST_REL}-${REL}.gz | diffstat -p1 > $RELDIR/diffstat-${LAST_REL}-${REL} 2>/dev/null
96 git log ${LAST_COMMIT}..${RELEASE_COMMIT} > $RELDIR/ChangeLog-$RELEASE
97 < $RELDIR/ChangeLog-$RELEASE git shortlog > $RELDIR/shortlog-$RELEASE
98
99 #echo "ready to upload files"
100 #echo "scp $RELDIR/* master.kernel.org:$RELDIR/"
101 #echo "don't forget to update LATEST-IS"
102
103 echo "# "
104 if [ $LONGTERM -eq 1 ]; then
105 echo "# This is a longterm release"
106 echo "# finalize the release:"
107 echo "mv $RELDIR/linux-${RELEASE}.tar.gz ~/v2.6/longterm/v${BASE}/"
108 echo "mv $RELDIR/ChangeLog-${RELEASE} ~/v2.6/longterm/v${BASE}/"
109 echo "mv $RELDIR/patch-${RELEASE}.gz ~/v2.6/longterm/v${BASE}/"
110 echo "cp $RELDIR/patch-${LAST_REL}-${REL}.gz ~/v2.6/longterm/v${BASE}/incr/"
111 echo "mv $RELDIR/patch-${LAST_REL}-${REL}.gz ~"
112 echo "mv $RELDIR/diffstat-${LAST_REL}-${REL} ~"
113 echo "mv $RELDIR/shortlog-${RELEASE} ~"
114 else
115 echo "# This is a stable release"
116 echo "# finalize it:"
117 echo "mv $RELDIR/linux-${RELEASE}.tar.gz ~/v${VER}/"
118 echo "mv $RELDIR/ChangeLog-${RELEASE} ~/v${VER}/"
119 echo "mv $RELDIR/patch-${RELEASE}.gz ~/v${VER}/"
120 echo "cp $RELDIR/patch-${LAST_REL}-${REL}.gz ~/v${VER}/incr/"
121 echo "mv $RELDIR/patch-${LAST_REL}-${REL}.gz ~"
122 echo "mv $RELDIR/diffstat-${LAST_REL}-${REL} ~"
123 echo "mv $RELDIR/shortlog-${RELEASE} ~"
124 LATEST=`ls ~/v${VER}/LATEST-IS*`
125 LATEST=`basename $LATEST`
126 echo "# current LATEST-IS is '$LATEST' is that what it should be?"
127 echo "# mv ~/v${VER}/${LATEST} ~/v${VER}/LATEST-IS-${RELEASE}"
128 fi
Something went wrong with that request. Please try again.