3 # Script to take a stable-queue, and turn it into a -rc release to be
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/"
12 SCRIPT_NAME
=`basename ${0}`
13 DIR
="$( cd "$
( dirname "${BASH_SOURCE[0]}" )" && pwd )"
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
21 if [ "${MBOX}" == "" ] ; then
22 echo "using default 'mbox' name for the mailbox."
27 BASE_VERSION
=${FULL_VERSION/-rc?/}
28 VERSION
=`basename \`pwd\
``
29 ROOT_VERSION
=${VERSION/\.y/}
30 ROOT_VERSION
=${ROOT_VERSION/linux-/}
32 REL_ARRAY
=(${FULL_VERSION//./ })
36 #DATE=`date -u --date="2 days"`
37 DATE
=`date -u --rfc-822 --date="2 days"`
39 if [ ${FULL_VERSION} == ${BASE_VERSION} ] ; then
40 echo "Makefile says the version is ${FULL_VERSION}, did you forget to set the -rc version?"
45 # create a directory for everything to live in
46 TMP_DIR
=`mktemp -d ${TMP_DIR}/stable-${ROOT_VERSION}-XXXX` ||
exit 1
48 # Generate the Makefile diff, with just the version number change in it
49 # relies on filterdiff from the wonderful patchutils package
50 git
diff Makefile | filterdiff
--hunks 1 > ${TMP_DIR}/Makefile.
patch
53 # make a git tree to create the log file in the format that Linus likes.
54 echo "Creating a git tree of the commits..."
56 TMP_TREE
=`mktemp -d ${TMP_DIR}/stable-${ROOT_VERSION}-XXXX` ||
exit 1
57 TMP_LOG
=`mktemp ${TMP_DIR}/stable-log-XXXX` ||
exit 1
58 git clone
-s .
${TMP_TREE}
60 git checkout
-b temp_branch
61 git quiltimport
--patches=${STABLE_QUEUE}/queue-
${ROOT_VERSION}
63 echo "git quilt import failed!!!"
67 # Apply the Makefile patch and commit it
68 patch -p1 < ${TMP_DIR}/Makefile.
patch
69 git commit
-a -m "Linux ${FULL_VERSION}"
71 # Generate the diffstat and patch
72 git
diff ${VERSION}..HEAD > ${TMP_DIR}/patch-${FULL_VERSION}
73 git
diff --stat ${VERSION}..HEAD
> ${TMP_DIR}/diffstat
76 gpg
-a -b ${TMP_DIR}/patch-
${FULL_VERSION}
78 # generate the log file
79 git log
--abbrev=12 --format="%aN <%aE>%n %s%n" ${VERSION}..HEAD
> ${TMP_LOG}
81 # clean up the git tree by deleting it
86 echo "Creating the mailbox for kernel release ${FULL_VERSION}"
87 TMPFILE
=`mktemp ${TMP_DIR}/stable_header.XXXXXX` ||
exit 1
88 NUM_PATCHES
=`quilt series | wc -l`
91 echo "This is the start of the stable review cycle for the ${BASE_VERSION} release."
92 echo "There are ${NUM_PATCHES} patches in this series, all will be posted as a response"
93 echo "to this one. If anyone has any issues with these being applied, please"
96 echo "Responses should be made by ${DATE}."
97 echo "Anything received after that time might be too late."
99 echo "The whole patch series can be found in one patch at:"
100 echo " https://www.kernel.org/pub/linux/kernel/v${VER}/stable-review/patch-${FULL_VERSION}.gz"
101 echo "or in the git tree and branch at:"
102 echo " git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-${ROOT_VERSION}.y"
103 echo "and the diffstat can be found below."
110 echo "Pseudo-Shortlog of commits:"
120 cat ${TMP_DIR}/diffstat
123 FROM
="Greg Kroah-Hartman <gregkh@linuxfoundation.org>"
124 TO
="linux-kernel@vger.kernel.org"
125 CC
="stable@vger.kernel.org"
126 #SUBJECT="${BASE_VERSION}-stable review"
127 SUBJECT
="${FULL_VERSION} review"
129 quilt
mail --mbox ${TMP_DIR}/${MBOX} \
130 -m "$(cat ${TMPFILE})" \
135 --prefix "PATCH ${ROOT_VERSION}" \
136 --subject "${SUBJECT}"
138 rm ${TMPFILE} ${TMP_LOG}
140 echo "mbox is now in ${TMP_DIR}/${MBOX}"
143 ${STABLE_QUEUE}../mbox2send ${ROOT_VERSION} ${FULL_VERSION} ${MBOX}
144 #< ${MBOX}.new formail -ds sh -c 'cat > msg.$FILENO'
145 splitmbox.py
${MBOX}.new .
147 # Add Linus and Andrew and others to the first email only:
148 #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
149 #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
150 #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
151 #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
152 #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
153 #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
154 #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
155 #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
156 #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
157 #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
158 #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
159 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
162 # Create a script to upload the patch to kernel.org and to send the patches out
163 echo "#!/bin/bash" > ${TMP_DIR}/send_it_off
164 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
165 echo "git send-email msg.
*" >> ${TMP_DIR}/send_it_off
166 echo "#git send-email msg.000" >> ${TMP_DIR}/send_it_off
167 chmod 755 ${TMP_DIR}/send_it_off
170 # Push a version of the patches out to the world in a git tree
172 git checkout linux-
${ROOT_VERSION}.y
173 git merge
-q temp_branch
174 echo "git push --force gitolite@ra.kernel.org:/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-${ROOT_VERSION}.y"
175 git push
--force gitolite@ra.kernel.org
:/pub
/scm
/linux
/kernel
/git
/stable
/linux-stable-rc.git linux-
${ROOT_VERSION}.y
177 # clean up the git tree by deleting it
181 # announce what needs to be done