]>
Commit | Line | Data |
---|---|---|
59d5c8eb | 1 | #!/bin/bash |
ce36a6e4 GKH |
2 | # |
3 | # Script to take a stable-queue, and turn it into a -rc release to be | |
4 | # sent off in email. | |
5 | # | |
59d5c8eb | 6 | |
648a1bee GKH |
7 | # locations of some things that you might want to override if you are a |
8 | # different developer than gregkh | |
9 | STABLE_QUEUE="/home/gregkh/linux/stable/stable-queue/" | |
10 | TMP_DIR="/home/gregkh/linux/tmp/" | |
11 | ||
e91e330a | 12 | SCRIPT_NAME=`basename ${0}` |
ce36a6e4 GKH |
13 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" |
14 | ||
15 | # programs that we depend on in this script | |
16 | REQUIREMENTS="kv splitmbox.py kup mbox2send filterdiff" | |
17 | # todo check dependancies using hash or something | |
18 | ||
19 | ||
e91e330a GKH |
20 | MBOX="$1" |
21 | if [ "${MBOX}" == "" ] ; then | |
ce36a6e4 GKH |
22 | echo "using default 'mbox' name for the mailbox." |
23 | MBOX="mbox" | |
e91e330a GKH |
24 | fi |
25 | ||
b8d4fad7 | 26 | FULL_VERSION=`kv` |
59d5c8eb | 27 | BASE_VERSION=${FULL_VERSION/-rc?/} |
648a1bee GKH |
28 | VERSION=`basename \`pwd\`` |
29 | ROOT_VERSION=${VERSION/\.y/} | |
30 | ROOT_VERSION=${ROOT_VERSION/linux-/} | |
ccd583c9 GKH |
31 | |
32 | REL_ARRAY=(${FULL_VERSION//./ }) | |
33 | MAJOR=${REL_ARRAY[0]} | |
54f3a4af | 34 | VER="${MAJOR}.x" |
ccd583c9 | 35 | |
6dd6cb63 GKH |
36 | RC_ARRAY=(${FULL_VERSION//-/ }) |
37 | RC=${RC_ARRAY[1]} | |
38 | ||
78a4731d GKH |
39 | #DATE=`date -u --date="2 days"` |
40 | DATE=`date -u --rfc-822 --date="2 days"` | |
59d5c8eb GKH |
41 | |
42 | if [ ${FULL_VERSION} == ${BASE_VERSION} ] ; then | |
43 | echo "Makefile says the version is ${FULL_VERSION}, did you forget to set the -rc version?" | |
44 | exit | |
45 | fi | |
46 | ||
e91e330a | 47 | |
648a1bee GKH |
48 | # create a directory for everything to live in |
49 | TMP_DIR=`mktemp -d ${TMP_DIR}/stable-${ROOT_VERSION}-XXXX` || exit 1 | |
50 | ||
6ee96ac1 GKH |
51 | # Generate the Makefile diff, with just the version number change in it |
52 | # relies on filterdiff from the wonderful patchutils package | |
53 | git diff Makefile | filterdiff --hunks 1 > ${TMP_DIR}/Makefile.patch | |
54 | ||
648a1bee GKH |
55 | |
56 | # make a git tree to create the log file in the format that Linus likes. | |
648a1bee GKH |
57 | echo "Creating a git tree of the commits..." |
58 | ORIGINAL_DIR=`pwd` | |
59 | TMP_TREE=`mktemp -d ${TMP_DIR}/stable-${ROOT_VERSION}-XXXX` || exit 1 | |
60 | TMP_LOG=`mktemp ${TMP_DIR}/stable-log-XXXX` || exit 1 | |
61 | git clone -s . ${TMP_TREE} | |
62 | cd ${TMP_TREE} | |
63 | git checkout -b temp_branch | |
64 | git quiltimport --patches=${STABLE_QUEUE}/queue-${ROOT_VERSION} | |
41d6205e GKH |
65 | if [ $? -ne 0 ]; then |
66 | echo "git quilt import failed!!!" | |
67 | exit 1 | |
68 | fi | |
6ee96ac1 GKH |
69 | |
70 | # Apply the Makefile patch and commit it | |
71 | patch -p1 < ${TMP_DIR}/Makefile.patch | |
72 | git commit -a -m "Linux ${FULL_VERSION}" | |
73 | ||
74 | # Generate the diffstat and patch | |
75 | git diff ${VERSION}..HEAD > ${TMP_DIR}/patch-${FULL_VERSION} | |
76 | git diff --stat ${VERSION}..HEAD > ${TMP_DIR}/diffstat | |
77 | ||
78 | # sign the patch | |
79 | gpg -a -b ${TMP_DIR}/patch-${FULL_VERSION} | |
80 | ||
81 | # generate the log file | |
648a1bee | 82 | git log --abbrev=12 --format="%aN <%aE>%n %s%n" ${VERSION}..HEAD > ${TMP_LOG} |
6ee96ac1 GKH |
83 | |
84 | # clean up the git tree by deleting it | |
648a1bee | 85 | cd ${ORIGINAL_DIR} |
f29e8e36 | 86 | #rm -rf ${TMP_TREE} |
59d5c8eb | 87 | |
648a1bee GKH |
88 | |
89 | echo "Creating the mailbox for kernel release ${FULL_VERSION}" | |
90 | TMPFILE=`mktemp ${TMP_DIR}/stable_header.XXXXXX` || exit 1 | |
59d5c8eb GKH |
91 | NUM_PATCHES=`quilt series | wc -l` |
92 | ||
93 | ( | |
94 | echo "This is the start of the stable review cycle for the ${BASE_VERSION} release." | |
95 | echo "There are ${NUM_PATCHES} patches in this series, all will be posted as a response" | |
96 | echo "to this one. If anyone has any issues with these being applied, please" | |
e91e330a | 97 | echo "let me know." |
59d5c8eb GKH |
98 | echo "" |
99 | echo "Responses should be made by ${DATE}." | |
100 | echo "Anything received after that time might be too late." | |
101 | echo "" | |
102 | echo "The whole patch series can be found in one patch at:" | |
69849ec2 | 103 | echo " https://www.kernel.org/pub/linux/kernel/v${VER}/stable-review/patch-${FULL_VERSION}.gz" |
f29e8e36 | 104 | echo "or in the git tree and branch at:" |
69849ec2 | 105 | echo " git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-${ROOT_VERSION}.y" |
59d5c8eb GKH |
106 | echo "and the diffstat can be found below." |
107 | echo "" | |
108 | echo "thanks," | |
109 | echo "" | |
110 | echo "greg k-h" | |
111 | echo "" | |
112 | echo "-------------" | |
648a1bee | 113 | echo "Pseudo-Shortlog of commits:" |
5a92fab8 | 114 | echo "" |
648a1bee GKH |
115 | cat ${TMP_LOG} |
116 | #stable-shortlog | |
5a92fab8 GKH |
117 | echo "" |
118 | echo "-------------" | |
119 | echo "" | |
120 | echo "Diffstat:" | |
121 | echo "" | |
122 | ||
6ee96ac1 | 123 | cat ${TMP_DIR}/diffstat |
59d5c8eb GKH |
124 | ) > ${TMPFILE} |
125 | ||
648a1bee | 126 | FROM="Greg Kroah-Hartman <gregkh@linuxfoundation.org>" |
9067845c | 127 | TO="linux-kernel@vger.kernel.org" |
9067845c | 128 | CC="stable@vger.kernel.org" |
1261bd4e GKH |
129 | #SUBJECT="${BASE_VERSION}-stable review" |
130 | SUBJECT="${FULL_VERSION} review" | |
59d5c8eb | 131 | |
648a1bee | 132 | quilt mail --mbox ${TMP_DIR}/${MBOX} \ |
699664de | 133 | -M "${TMPFILE}" \ |
59d5c8eb GKH |
134 | --sender "${FROM}" \ |
135 | --from "${FROM}" \ | |
136 | --to "${TO}" \ | |
137 | --cc "${CC}" \ | |
aa2ca693 | 138 | --prefix "PATCH ${ROOT_VERSION}" \ |
59d5c8eb GKH |
139 | --subject "${SUBJECT}" |
140 | ||
648a1bee GKH |
141 | rm ${TMPFILE} ${TMP_LOG} |
142 | ||
143 | echo "mbox is now in ${TMP_DIR}/${MBOX}" | |
e91e330a | 144 | |
648a1bee | 145 | cd ${TMP_DIR} |
6396d71a | 146 | ${STABLE_QUEUE}/scripts/mbox2send ${ROOT_VERSION} ${FULL_VERSION} ${MBOX} |
a1840513 GKH |
147 | #< ${MBOX}.new formail -ds sh -c 'cat > msg.$FILENO' |
148 | splitmbox.py ${MBOX}.new . | |
648a1bee | 149 | |
f4e925a9 GKH |
150 | # find the "0" email message |
151 | if [ -f "msg.0" ]; then | |
152 | MSG="msg.0" | |
153 | elif [ -f "msg.00" ]; then | |
154 | MSG="msg.00" | |
155 | elif [ -f "msg.000" ]; then | |
156 | MSG="msg.000" | |
157 | elif [ -f "msg.0000" ]; then | |
158 | MSG="msg.0000" | |
159 | else | |
160 | echo "mbox.ZERO can not be found???" | |
161 | echo "Aborting!" | |
162 | exit 1 | |
163 | fi | |
164 | echo "MSG=${MSG}" | |
165 | ||
c2d74301 | 166 | # Add Linus and Andrew and others to the first email only: |
9067845c | 167 | #sed -i -e "s/Cc: alan@lxorguk\.ukuu\.org\.uk/Cc: torvalds@linux-foundation\.org, akpm@linux-foundation\.org, alan@lxorguk\.ukuu\.org\.uk/" ${TMP_DIR}/msg.000 |
d8f819c5 | 168 | #sed -i -e "s/Cc: stable@vger\.kernel\.org/Cc: torvalds@linux-foundation\.org, akpm@linux-foundation\.org, stable@vger\.kernel\.org/" ${TMP_DIR}/msg.000 |
468b5721 | 169 | #sed -i -e "s/Cc: stable@vger\.kernel\.org/Cc: torvalds@linux-foundation\.org, akpm@linux-foundation\.org, linux@roeck-us\.net, shuah\.kh@samsung\.com, stable@vger\.kernel\.org/" ${TMP_DIR}/msg.000 |
c2d74301 | 170 | #sed -i -e "s/Cc: stable@vger\.kernel\.org/Cc: torvalds@linux-foundation\.org, akpm@linux-foundation\.org, linux@roeck-us\.net, shuah\.kh@samsung\.com, patches@kernelci\.org stable@vger\.kernel\.org/" ${TMP_DIR}/msg.000 |
bef0d6c8 | 171 | #sed -i -e "s/Cc: stable@vger\.kernel\.org/Cc: torvalds@linux-foundation\.org, akpm@linux-foundation\.org, linux@roeck-us\.net, shuah\.kh@samsung\.com, patches@kernelci\.org, ben\.hutchings@codethink\.co\.uk, stable@vger\.kernel\.org/" ${TMP_DIR}/msg.000 |
089f4a04 | 172 | #sed -i -e "s/Cc: stable@vger\.kernel\.org/Cc: torvalds@linux-foundation\.org, akpm@linux-foundation\.org, linux@roeck-us\.net, shuahkh@osg\.samsung\.com, patches@kernelci\.org, ben\.hutchings@codethink\.co\.uk, stable@vger\.kernel\.org/" ${TMP_DIR}/msg.000 |
95ce1dfc | 173 | #sed -i -e "s/Cc: stable@vger\.kernel\.org/Cc: torvalds@linux-foundation\.org, akpm@linux-foundation\.org, linux@roeck-us\.net, shuahkh@osg\.samsung\.com, patches@kernelci\.org, ben\.hutchings@codethink\.co\.uk, lkft-triage@lists\.linaro\.org, stable@vger\.kernel\.org/" ${TMP_DIR}/msg.000 |
b4928eae | 174 | #sed -i -e "s/Cc: stable@vger\.kernel\.org/Cc: torvalds@linux-foundation\.org, akpm@linux-foundation\.org, linux@roeck-us\.net, shuah@kernel\.org, patches@kernelci\.org, ben\.hutchings@codethink\.co\.uk, lkft-triage@lists\.linaro\.org, stable@vger\.kernel\.org/" ${TMP_DIR}/msg.000 |
200dab58 | 175 | #sed -i -e "s/Cc: stable@vger\.kernel\.org/Cc: torvalds@linux-foundation\.org, akpm@linux-foundation\.org, linux@roeck-us\.net, shuah@kernel\.org, patches@kernelci\.org, ben\.hutchings@codethink\.co\.uk, lkft-triage@lists\.linaro\.org, pavel@denx\.de, stable@vger\.kernel\.org/" ${TMP_DIR}/msg.000 |
2be9ba73 | 176 | #sed -i -e "s/Cc: stable@vger\.kernel\.org/Cc: torvalds@linux-foundation\.org, akpm@linux-foundation\.org, linux@roeck-us\.net, shuah@kernel\.org, patches@kernelci\.org, lkft-triage@lists\.linaro\.org, pavel@denx\.de, stable@vger\.kernel\.org/" ${TMP_DIR}/msg.000 |
b38ab012 | 177 | #sed -i -e "s/Cc: stable@vger\.kernel\.org/Cc: torvalds@linux-foundation\.org, akpm@linux-foundation\.org, linux@roeck-us\.net, shuah@kernel\.org, patches@kernelci\.org, lkft-triage@lists\.linaro\.org, pavel@denx\.de, jonathanh@nvidia\.com, stable@vger\.kernel\.org/" ${TMP_DIR}/msg.000 |
b1a585a9 | 178 | #sed -i -e "s/Cc: stable@vger\.kernel\.org/Cc: torvalds@linux-foundation\.org, akpm@linux-foundation\.org, linux@roeck-us\.net, shuah@kernel\.org, patches@kernelci\.org, lkft-triage@lists\.linaro\.org, pavel@denx\.de, jonathanh@nvidia\.com, f\.fainelli@gmail\.com, stable@vger\.kernel\.org/" ${TMP_DIR}/msg.000 |
f4e925a9 GKH |
179 | #sed -i -e "s/Cc: stable@vger\.kernel\.org/Cc: torvalds@linux-foundation\.org, akpm@linux-foundation\.org, linux@roeck-us\.net, shuah@kernel\.org, patches@kernelci\.org, lkft-triage@lists\.linaro\.org, pavel@denx\.de, jonathanh@nvidia\.com, f\.fainelli@gmail\.com, sudipm\.mukherjee@gmail\.com, stable@vger\.kernel\.org/" ${TMP_DIR}/msg.000 |
180 | sed -i -e "s/Cc: stable@vger\.kernel\.org/Cc: torvalds@linux-foundation\.org, akpm@linux-foundation\.org, linux@roeck-us\.net, shuah@kernel\.org, patches@kernelci\.org, lkft-triage@lists\.linaro\.org, pavel@denx\.de, jonathanh@nvidia\.com, f\.fainelli@gmail\.com, sudipm\.mukherjee@gmail\.com, stable@vger\.kernel\.org/" ${TMP_DIR}/${MSG} | |
6ee96ac1 GKH |
181 | |
182 | ||
183 | # Create a script to upload the patch to kernel.org and to send the patches out | |
184 | echo "#!/bin/bash" > ${TMP_DIR}/send_it_off | |
ba4c55c4 | 185 | echo "kup --host=git@gitolite.kernel.org --subcmd=kup-server put patch-${FULL_VERSION} patch-${FULL_VERSION}.asc /pub/linux/kernel/v${VER}/stable-review/patch-${FULL_VERSION}.gz" >> ${TMP_DIR}/send_it_off |
6dd6cb63 GKH |
186 | |
187 | if [ "${RC}" == "rc1" ] ; then | |
188 | echo "git send-email msg.*" >> ${TMP_DIR}/send_it_off | |
f4e925a9 | 189 | echo "#git send-email ${MSG}" >> ${TMP_DIR}/send_it_off |
6dd6cb63 GKH |
190 | else |
191 | echo "#git send-email msg.*" >> ${TMP_DIR}/send_it_off | |
f4e925a9 | 192 | echo "git send-email ${MSG}" >> ${TMP_DIR}/send_it_off |
6dd6cb63 GKH |
193 | fi |
194 | ||
6ee96ac1 GKH |
195 | chmod 755 ${TMP_DIR}/send_it_off |
196 | ||
f29e8e36 GKH |
197 | |
198 | # Push a version of the patches out to the world in a git tree | |
199 | cd ${TMP_TREE} | |
200 | git checkout linux-${ROOT_VERSION}.y | |
5b9cdfb9 | 201 | git merge -q temp_branch |
cf81b998 GKH |
202 | #echo "git push --force gitolite@ra.kernel.org:/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-${ROOT_VERSION}.y" |
203 | #git push --force gitolite@ra.kernel.org:/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-${ROOT_VERSION}.y | |
204 | echo "git push --force git@gitolite.kernel.org:/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-${ROOT_VERSION}.y" | |
205 | git push --force git@gitolite.kernel.org:/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-${ROOT_VERSION}.y | |
f29e8e36 | 206 | |
b4a0b68d GKH |
207 | # clean up the git tree by deleting it |
208 | cd ${ORIGINAL_DIR} | |
209 | rm -rf ${TMP_TREE} | |
f29e8e36 | 210 | |
b4a0b68d | 211 | # announce what needs to be done |
648a1bee | 212 | echo "cd ${TMP_DIR}" |
6ee96ac1 | 213 | echo "./send_it_off" |