]>
Commit | Line | Data |
---|---|---|
59d5c8eb GKH |
1 | #!/bin/bash |
2 | ||
648a1bee GKH |
3 | # locations of some things that you might want to override if you are a |
4 | # different developer than gregkh | |
5 | STABLE_QUEUE="/home/gregkh/linux/stable/stable-queue/" | |
6 | TMP_DIR="/home/gregkh/linux/tmp/" | |
7 | ||
8 | ||
e91e330a GKH |
9 | SCRIPT_NAME=`basename ${0}` |
10 | MBOX="$1" | |
11 | if [ "${MBOX}" == "" ] ; then | |
12 | echo "ERROR, you must specify a mailbox name." | |
13 | echo "usage:" | |
14 | echo " ${SCRIPT_NAME} mailbox_name" | |
15 | exit | |
16 | fi | |
17 | ||
b8d4fad7 | 18 | FULL_VERSION=`kv` |
59d5c8eb | 19 | BASE_VERSION=${FULL_VERSION/-rc?/} |
648a1bee GKH |
20 | VERSION=`basename \`pwd\`` |
21 | ROOT_VERSION=${VERSION/\.y/} | |
22 | ROOT_VERSION=${ROOT_VERSION/linux-/} | |
ccd583c9 GKH |
23 | |
24 | REL_ARRAY=(${FULL_VERSION//./ }) | |
25 | MAJOR=${REL_ARRAY[0]} | |
54f3a4af | 26 | VER="${MAJOR}.x" |
ccd583c9 | 27 | |
59d5c8eb GKH |
28 | DATE=`date -u --date="2 days"` |
29 | ||
30 | if [ ${FULL_VERSION} == ${BASE_VERSION} ] ; then | |
31 | echo "Makefile says the version is ${FULL_VERSION}, did you forget to set the -rc version?" | |
32 | exit | |
33 | fi | |
34 | ||
e91e330a | 35 | |
648a1bee GKH |
36 | # create a directory for everything to live in |
37 | TMP_DIR=`mktemp -d ${TMP_DIR}/stable-${ROOT_VERSION}-XXXX` || exit 1 | |
38 | ||
6ee96ac1 GKH |
39 | # Generate the Makefile diff, with just the version number change in it |
40 | # relies on filterdiff from the wonderful patchutils package | |
41 | git diff Makefile | filterdiff --hunks 1 > ${TMP_DIR}/Makefile.patch | |
42 | ||
648a1bee GKH |
43 | |
44 | # make a git tree to create the log file in the format that Linus likes. | |
648a1bee GKH |
45 | echo "Creating a git tree of the commits..." |
46 | ORIGINAL_DIR=`pwd` | |
47 | TMP_TREE=`mktemp -d ${TMP_DIR}/stable-${ROOT_VERSION}-XXXX` || exit 1 | |
48 | TMP_LOG=`mktemp ${TMP_DIR}/stable-log-XXXX` || exit 1 | |
49 | git clone -s . ${TMP_TREE} | |
50 | cd ${TMP_TREE} | |
51 | git checkout -b temp_branch | |
52 | git quiltimport --patches=${STABLE_QUEUE}/queue-${ROOT_VERSION} | |
6ee96ac1 GKH |
53 | |
54 | # Apply the Makefile patch and commit it | |
55 | patch -p1 < ${TMP_DIR}/Makefile.patch | |
56 | git commit -a -m "Linux ${FULL_VERSION}" | |
57 | ||
58 | # Generate the diffstat and patch | |
59 | git diff ${VERSION}..HEAD > ${TMP_DIR}/patch-${FULL_VERSION} | |
60 | git diff --stat ${VERSION}..HEAD > ${TMP_DIR}/diffstat | |
61 | ||
62 | # sign the patch | |
63 | gpg -a -b ${TMP_DIR}/patch-${FULL_VERSION} | |
64 | ||
65 | # generate the log file | |
648a1bee | 66 | git log --abbrev=12 --format="%aN <%aE>%n %s%n" ${VERSION}..HEAD > ${TMP_LOG} |
6ee96ac1 GKH |
67 | |
68 | # clean up the git tree by deleting it | |
648a1bee | 69 | cd ${ORIGINAL_DIR} |
f29e8e36 | 70 | #rm -rf ${TMP_TREE} |
59d5c8eb | 71 | |
648a1bee GKH |
72 | |
73 | echo "Creating the mailbox for kernel release ${FULL_VERSION}" | |
74 | TMPFILE=`mktemp ${TMP_DIR}/stable_header.XXXXXX` || exit 1 | |
59d5c8eb GKH |
75 | NUM_PATCHES=`quilt series | wc -l` |
76 | ||
77 | ( | |
78 | echo "This is the start of the stable review cycle for the ${BASE_VERSION} release." | |
79 | echo "There are ${NUM_PATCHES} patches in this series, all will be posted as a response" | |
80 | echo "to this one. If anyone has any issues with these being applied, please" | |
e91e330a | 81 | echo "let me know." |
59d5c8eb GKH |
82 | echo "" |
83 | echo "Responses should be made by ${DATE}." | |
84 | echo "Anything received after that time might be too late." | |
85 | echo "" | |
86 | echo "The whole patch series can be found in one patch at:" | |
69849ec2 | 87 | echo " https://www.kernel.org/pub/linux/kernel/v${VER}/stable-review/patch-${FULL_VERSION}.gz" |
f29e8e36 | 88 | echo "or in the git tree and branch at:" |
69849ec2 | 89 | echo " git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-${ROOT_VERSION}.y" |
59d5c8eb GKH |
90 | echo "and the diffstat can be found below." |
91 | echo "" | |
92 | echo "thanks," | |
93 | echo "" | |
94 | echo "greg k-h" | |
95 | echo "" | |
96 | echo "-------------" | |
648a1bee | 97 | echo "Pseudo-Shortlog of commits:" |
5a92fab8 | 98 | echo "" |
648a1bee GKH |
99 | cat ${TMP_LOG} |
100 | #stable-shortlog | |
5a92fab8 GKH |
101 | echo "" |
102 | echo "-------------" | |
103 | echo "" | |
104 | echo "Diffstat:" | |
105 | echo "" | |
106 | ||
6ee96ac1 | 107 | cat ${TMP_DIR}/diffstat |
59d5c8eb GKH |
108 | ) > ${TMPFILE} |
109 | ||
648a1bee | 110 | FROM="Greg Kroah-Hartman <gregkh@linuxfoundation.org>" |
9067845c | 111 | TO="linux-kernel@vger.kernel.org" |
5a92fab8 | 112 | #CC="torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk" |
9067845c GKH |
113 | #CC="alan@lxorguk.ukuu.org.uk" |
114 | CC="stable@vger.kernel.org" | |
59d5c8eb GKH |
115 | SUBJECT="${BASE_VERSION}-stable review" |
116 | ||
648a1bee | 117 | quilt mail --mbox ${TMP_DIR}/${MBOX} \ |
59d5c8eb GKH |
118 | -m "$(cat ${TMPFILE})" \ |
119 | --sender "${FROM}" \ | |
120 | --from "${FROM}" \ | |
121 | --to "${TO}" \ | |
122 | --cc "${CC}" \ | |
aa2ca693 | 123 | --prefix "PATCH ${ROOT_VERSION}" \ |
59d5c8eb GKH |
124 | --subject "${SUBJECT}" |
125 | ||
648a1bee GKH |
126 | rm ${TMPFILE} ${TMP_LOG} |
127 | ||
128 | echo "mbox is now in ${TMP_DIR}/${MBOX}" | |
e91e330a | 129 | |
6ee96ac1 GKH |
130 | #echo "Add:" |
131 | #echo "Cc: torvalds@linux-foundation.org, akpm@linux-foundation.org" | |
132 | #echo "to the first email." | |
5a92fab8 | 133 | |
59d5c8eb GKH |
134 | #q mail --mbox x -m "$(cat ../stable-queue/00)" --sender gregkh@lf.org --from gregkh@lf.org --to foo@foo --subject "This is the subject" |
135 | ||
648a1bee | 136 | cd ${TMP_DIR} |
a6f90cc7 | 137 | ${STABLE_QUEUE}../mbox2send ${ROOT_VERSION} ${FULL_VERSION} ${MBOX} |
a1840513 GKH |
138 | #< ${MBOX}.new formail -ds sh -c 'cat > msg.$FILENO' |
139 | splitmbox.py ${MBOX}.new . | |
648a1bee | 140 | |
c2d74301 | 141 | # Add Linus and Andrew and others to the first email only: |
9067845c | 142 | #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 | 143 | #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 | 144 | #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 | 145 | #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 | 146 | #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 | 147 | #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 GKH |
148 | #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 |
149 | 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 | |
6ee96ac1 GKH |
150 | |
151 | ||
152 | # Create a script to upload the patch to kernel.org and to send the patches out | |
153 | echo "#!/bin/bash" > ${TMP_DIR}/send_it_off | |
ba4c55c4 GKH |
154 | #echo "kup --host=gregkh@geb.kernel.org put patch-${FULL_VERSION} patch-${FULL_VERSION}.asc /pub/linux/kernel/v${VER}/stable-review/patch-${FULL_VERSION}.gz" >> ${TMP_DIR}/send_it_off |
155 | 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 | |
6ee96ac1 GKH |
156 | echo "git send-email msg.*" >> ${TMP_DIR}/send_it_off |
157 | chmod 755 ${TMP_DIR}/send_it_off | |
158 | ||
f29e8e36 GKH |
159 | |
160 | # Push a version of the patches out to the world in a git tree | |
161 | cd ${TMP_TREE} | |
162 | git checkout linux-${ROOT_VERSION}.y | |
5b9cdfb9 GKH |
163 | #git merge -q temp_branch^ |
164 | git merge -q temp_branch | |
f29e8e36 GKH |
165 | echo "git push --force gitolite@ra.kernel.org:/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-${ROOT_VERSION}.y" |
166 | git push --force gitolite@ra.kernel.org:/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-${ROOT_VERSION}.y | |
167 | ||
b4a0b68d GKH |
168 | # clean up the git tree by deleting it |
169 | cd ${ORIGINAL_DIR} | |
170 | rm -rf ${TMP_TREE} | |
f29e8e36 | 171 | |
b4a0b68d | 172 | # announce what needs to be done |
648a1bee | 173 | echo "cd ${TMP_DIR}" |
6ee96ac1 | 174 | echo "./send_it_off" |