Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 160 lines (141 sloc) 5.801 kb
6fdf249 Greg Kroah-Hartman initial import from old git tree
authored
1 #!/bin/bash
2 # build -stable release from current -stable series
3 # Copyright (c) 2005 Chris Wright <chrisw@osdl.org>
e5d31e8 Greg Kroah-Hartman add copyright to dorelease
authored
4 # Copyright (c) 2006-2011 Greg Kroah-Hartman <greg@kroah.com>
5 #
6
6fdf249 Greg Kroah-Hartman initial import from old git tree
authored
7
8 if [ $# -ne 1 ]; then
15eca4a Greg Kroah-Hartman dorelease save and changes due to kup
authored
9 KETCHUP=`which ketchup 2>/dev/null`
10 if [ -z "$KETCHUP" ]; then
11 echo -e "Usage:\t $0 release_number"
12 echo -e "e.g.\t $0 2.6.11.12"
13 echo -e "or install ketchup to automatically release the latest kernel version."
14 exit 1
15 fi
32de452 Greg Kroah-Hartman dorelease: fixes for 3.0 number change
authored
16 RELEASE=`ketchup -m`
17 else
18 RELEASE=$1
6fdf249 Greg Kroah-Hartman initial import from old git tree
authored
19 fi
20
21 REL_ARRAY=(${RELEASE//./ })
22 BASE=${REL_ARRAY[0]}.${REL_ARRAY[1]}.${REL_ARRAY[2]}
23 REL=${REL_ARRAY[3]}
63346e6 Greg Kroah-Hartman dorelease: fix bug found when trying to release the 3.0.27 kernel.
authored
24 MAJOR=${REL_ARRAY[0]}
0e42376 Greg Kroah-Hartman updated dorelease script
authored
25 MINOR=${REL_ARRAY[2]}
26
27 LONGTERM=0
28 # see if this is a "longterm" kernel or not
63346e6 Greg Kroah-Hartman dorelease: fix bug found when trying to release the 3.0.27 kernel.
authored
29 if [ $MAJOR == "2" ]; then
30 if [ $MINOR == "27" ]; then
31 LONGTERM=1
32 fi
33 if [ $MINOR == "32" ]; then
34 LONGTERM=1
35 fi
36 if [ $MINOR == "33" ]; then
37 LONGTERM=1
38 fi
39 if [ $MINOR == "34" ]; then
40 LONGTERM=1
41 fi
42 if [ $MINOR == "35" ]; then
43 LONGTERM=1
44 fi
15eca4a Greg Kroah-Hartman dorelease save and changes due to kup
authored
45 fi
63346e6 Greg Kroah-Hartman dorelease: fix bug found when trying to release the 3.0.27 kernel.
authored
46 #echo "major = $MAJOR, minor = $MINOR, longterm = $LONGTERM"
0e42376 Greg Kroah-Hartman updated dorelease script
authored
47
32de452 Greg Kroah-Hartman dorelease: fixes for 3.0 number change
authored
48 # 3.0 or 2.6?
49 VER="2.6"
63346e6 Greg Kroah-Hartman dorelease: fix bug found when trying to release the 3.0.27 kernel.
authored
50 if [ ${MAJOR} == "3" ] ; then
32de452 Greg Kroah-Hartman dorelease: fixes for 3.0 number change
authored
51 # 3.x series
52 VER="3.0"
53 BASE=${REL_ARRAY[0]}.${REL_ARRAY[1]}
54 REL=${REL_ARRAY[2]}
55 MINOR=${REL_ARRAY[1]}
56 fi
57
0e42376 Greg Kroah-Hartman updated dorelease script
authored
58
6fdf249 Greg Kroah-Hartman initial import from old git tree
authored
59 LAST=$(($REL - 1))
15eca4a Greg Kroah-Hartman dorelease save and changes due to kup
authored
60 INCREMENTAL=1
6fdf249 Greg Kroah-Hartman initial import from old git tree
authored
61 if [ $LAST -eq 0 ]; then
62 LAST_REL=${BASE}
15eca4a Greg Kroah-Hartman dorelease save and changes due to kup
authored
63 INCREMENTAL=0
6fdf249 Greg Kroah-Hartman initial import from old git tree
authored
64 else
65 LAST_REL=${BASE}.${LAST}
66 fi
15eca4a Greg Kroah-Hartman dorelease save and changes due to kup
authored
67 echo "# About to create stable release $RELEASE (base $BASE last version $LAST_REL)"
0e42376 Greg Kroah-Hartman updated dorelease script
authored
68 echo "# "
6fdf249 Greg Kroah-Hartman initial import from old git tree
authored
69
0e42376 Greg Kroah-Hartman updated dorelease script
authored
70 BASE_COMMIT="$(git cat-file tag v${BASE} | grep object | cut -d" " -f2)"
71 LAST_COMMIT="$(git cat-file tag v${LAST_REL} | grep object | cut -d" " -f2)"
72 RELEASE_COMMIT="$(git cat-file tag v${RELEASE} | grep object | cut -d" " -f2)"
15eca4a Greg Kroah-Hartman dorelease save and changes due to kup
authored
73 #echo "# BASE_COMMIT=$BASE_COMMIT"
74 #echo "# LAST_COMMIT=$LAST_COMMIT"
75 #echo "# RELEASE_COMMIT=$RELEASE_COMMIT"
76 #echo "#"
0e42376 Greg Kroah-Hartman updated dorelease script
authored
77
78 echo -n "# [ret] to continue"
79 read
80
81 RELDIR="../release-$RELEASE"
6fdf249 Greg Kroah-Hartman initial import from old git tree
authored
82
888b49e Greg Kroah-Hartman dorelease: some directory fixups
authored
83 if [ -d ${RELDIR} ] ; then
84 rm ${RELDIR}/*
85 else
86 mkdir ${RELDIR}
87 fi
88
89 echo "# building tree in ${RELDIR}"
6fdf249 Greg Kroah-Hartman initial import from old git tree
authored
90
91 # build release materials, tarball, base patch, incr patch, changelog
15eca4a Greg Kroah-Hartman dorelease save and changes due to kup
authored
92 #git archive --format=tar --prefix=linux-$RELEASE/ HEAD | gzip -9 > $RELDIR/linux-${RELEASE}.tar.gz
93 #git diff-tree -p $BASE_COMMIT $RELEASE_COMMIT | gzip -9 > $RELDIR/patch-${RELEASE}.gz
94 #if [ $INCREMENTAL -ne 0 ]; then
95 # git diff-tree -p $LAST_COMMIT $RELEASE_COMMIT | gzip -9 > $RELDIR/patch-${LAST_REL}-${REL}.gz
96 #fi
97 #zcat $RELDIR/patch-${LAST_REL}-${REL}.gz | diffstat -p1 > $RELDIR/diffstat-${LAST_REL}-${REL} 2>/dev/null
0e42376 Greg Kroah-Hartman updated dorelease script
authored
98
76a506a Greg Kroah-Hartman fix proper release for dorelease
authored
99 git archive --format=tar --prefix=linux-$RELEASE/ $RELEASE_COMMIT > $RELDIR/linux-${RELEASE}.tar
15eca4a Greg Kroah-Hartman dorelease save and changes due to kup
authored
100 git diff-tree -p $BASE_COMMIT $RELEASE_COMMIT > $RELDIR/patch-${RELEASE}
101 if [ $INCREMENTAL -ne 0 ]; then
102 git diff-tree -p $LAST_COMMIT $RELEASE_COMMIT > $RELDIR/patch-${LAST_REL}-${REL}
888b49e Greg Kroah-Hartman dorelease: some directory fixups
authored
103 cat $RELDIR/patch-${LAST_REL}-${REL} | diffstat -p1 > $RELDIR/diffstat-${LAST_REL}-${REL} 2>/dev/null
104 else
105 cat $RELDIR/patch-${RELEASE} | diffstat -p1 > $RELDIR/diffstat-${RELEASE} 2>/dev/null
15eca4a Greg Kroah-Hartman dorelease save and changes due to kup
authored
106 fi
6fdf249 Greg Kroah-Hartman initial import from old git tree
authored
107 git log ${LAST_COMMIT}..${RELEASE_COMMIT} > $RELDIR/ChangeLog-$RELEASE
0e42376 Greg Kroah-Hartman updated dorelease script
authored
108 < $RELDIR/ChangeLog-$RELEASE git shortlog > $RELDIR/shortlog-$RELEASE
6fdf249 Greg Kroah-Hartman initial import from old git tree
authored
109
15eca4a Greg Kroah-Hartman dorelease save and changes due to kup
authored
110 # sign all the needed files
111 gpg -a -b ${RELDIR}/linux-${RELEASE}.tar
112 gpg -a -b ${RELDIR}/patch-${RELEASE}
113 gpg -a -b ${RELDIR}/ChangeLog-${RELEASE}
114 if [ $INCREMENTAL -ne 0 ]; then
115 gpg -a -b ${RELDIR}/patch-${LAST_REL}-${REL}
116 fi
117
118
0e42376 Greg Kroah-Hartman updated dorelease script
authored
119 echo "# "
15eca4a Greg Kroah-Hartman dorelease save and changes due to kup
authored
120 HOST="gregkh@geb.kernel.org"
f3d8449 Greg Kroah-Hartman stable/dorelease: make it easier to upload older longterm releases
authored
121 SCRIPT="${RELDIR}/upload_v${RELEASE}"
122 touch ${SCRIPT}
a5ec975 Greg Kroah-Hartman stable: dorelease: chmod the script to make it easier to execute
authored
123 chmod 755 ${SCRIPT}
f3d8449 Greg Kroah-Hartman stable/dorelease: make it easier to upload older longterm releases
authored
124
0e42376 Greg Kroah-Hartman updated dorelease script
authored
125 if [ $LONGTERM -eq 1 ]; then
126 echo "# This is a longterm release"
127 echo "# finalize the release:"
db838f4 Greg Kroah-Hartman fix the kup tar command
authored
128 echo "cd ${RELDIR}"
f3d8449 Greg Kroah-Hartman stable/dorelease: make it easier to upload older longterm releases
authored
129 echo "kup --host=${HOST} put --tar --prefix=linux-${RELEASE}/ /pub/scm/linux/kernel/git/stable/linux-stable.git v${RELEASE} linux-${RELEASE}.tar.asc /pub/linux/kernel/v${VER}/longterm/v${BASE}/linux-${RELEASE}.tar.gz" | tee -a ${SCRIPT}
130 echo "kup --host=${HOST} put ChangeLog-${RELEASE} ChangeLog-${RELEASE}.asc /pub/linux/kernel/v${VER}/longterm/v${BASE}/" | tee -a ${SCRIPT}
131 echo "kup --host=${HOST} put patch-${RELEASE} patch-${RELEASE}.asc /pub/linux/kernel/v${VER}/longterm/v${BASE}/patch-${RELEASE}.gz" | tee -a ${SCRIPT}
991d9f3 Greg Kroah-Hartman update dorelease for longterm kernels
authored
132 if [ $INCREMENTAL -ne 0 ]; then
f3d8449 Greg Kroah-Hartman stable/dorelease: make it easier to upload older longterm releases
authored
133 echo "kup --host=${HOST} put patch-${LAST_REL}-${REL} patch-${LAST_REL}-${REL}.asc /pub/linux/kernel/v${VER}/longterm/v${BASE}/incr/patch-${LAST_REL}-${REL}.gz" | tee -a ${SCRIPT}
991d9f3 Greg Kroah-Hartman update dorelease for longterm kernels
authored
134 fi
135 # echo "mv $RELDIR/linux-${RELEASE}.tar.gz ~/v2.6/longterm/v${BASE}/"
136 # echo "mv $RELDIR/ChangeLog-${RELEASE} ~/v2.6/longterm/v${BASE}/"
137 # echo "mv $RELDIR/patch-${RELEASE}.gz ~/v2.6/longterm/v${BASE}/"
138 # echo "cp $RELDIR/patch-${LAST_REL}-${REL}.gz ~/v2.6/longterm/v${BASE}/incr/"
139 # echo "mv $RELDIR/patch-${LAST_REL}-${REL}.gz ~"
140 # echo "mv $RELDIR/diffstat-${LAST_REL}-${REL} ~"
141 # echo "mv $RELDIR/shortlog-${RELEASE} ~"
0e42376 Greg Kroah-Hartman updated dorelease script
authored
142 else
143 echo "# This is a stable release"
144 echo "# finalize it:"
db838f4 Greg Kroah-Hartman fix the kup tar command
authored
145 echo "cd ${RELDIR}"
7ce72f3 Greg Kroah-Hartman linux/dorelease: add "normal" releases a update script
authored
146 echo "kup --host=${HOST} put --tar --prefix=linux-${RELEASE}/ /pub/scm/linux/kernel/git/stable/linux-stable.git v${RELEASE} linux-${RELEASE}.tar.asc /pub/linux/kernel/v${VER}/linux-${RELEASE}.tar.gz" | tee -a ${SCRIPT}
147 echo "kup --host=${HOST} put ChangeLog-${RELEASE} ChangeLog-${RELEASE}.asc /pub/linux/kernel/v${VER}/" | tee -a ${SCRIPT}
148 echo "kup --host=${HOST} put patch-${RELEASE} patch-${RELEASE}.asc /pub/linux/kernel/v${VER}/patch-${RELEASE}.gz" | tee -a ${SCRIPT}
15eca4a Greg Kroah-Hartman dorelease save and changes due to kup
authored
149 if [ $INCREMENTAL -ne 0 ]; then
7ce72f3 Greg Kroah-Hartman linux/dorelease: add "normal" releases a update script
authored
150 echo "kup --host=${HOST} put patch-${LAST_REL}-${REL} patch-${LAST_REL}-${REL}.asc /pub/linux/kernel/v${VER}/incr/patch-${LAST_REL}-${REL}.gz" | tee -a ${SCRIPT}
15eca4a Greg Kroah-Hartman dorelease save and changes due to kup
authored
151 fi
86262dc Greg Kroah-Hartman dorelease: fix Changelog hard coded name and remove LATEST-IS logic
authored
152 # echo "mv $RELDIR/patch-${LAST_REL}-${REL}.gz ~"
153 # echo "mv $RELDIR/diffstat-${LAST_REL}-${REL} ~"
154 # echo "mv $RELDIR/shortlog-${RELEASE} ~"
155 # LATEST=`ls ~/v${VER}/LATEST-IS*`
156 # LATEST=`basename $LATEST`
157 # echo "# current LATEST-IS is '$LATEST' is that what it should be?"
158 # echo "# mv ~/v${VER}/${LATEST} ~/v${VER}/LATEST-IS-${RELEASE}"
0e42376 Greg Kroah-Hartman updated dorelease script
authored
159 fi
Something went wrong with that request. Please try again.