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/"
9 SCRIPT_NAME
=`basename ${0}`
11 if [ "${MBOX}" == "" ] ; then
12 echo "ERROR, you must specify a mailbox name."
14 echo " ${SCRIPT_NAME} mailbox_name"
19 BASE_VERSION
=${FULL_VERSION/-rc?/}
20 VERSION
=`basename \`pwd\
``
21 ROOT_VERSION
=${VERSION/\.y/}
22 ROOT_VERSION
=${ROOT_VERSION/linux-/}
24 REL_ARRAY
=(${FULL_VERSION//./ })
28 DATE
=`date -u --date="2 days"`
30 if [ ${FULL_VERSION} == ${BASE_VERSION} ] ; then
31 echo "Makefile says the version is ${FULL_VERSION}, did you forget to set the -rc version?"
36 # create a directory for everything to live in
37 TMP_DIR
=`mktemp -d ${TMP_DIR}/stable-${ROOT_VERSION}-XXXX` ||
exit 1
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
44 # make a git tree to create the log file in the format that Linus likes.
45 echo "Creating a git tree of the commits..."
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}
51 git checkout
-b temp_branch
52 git quiltimport
--patches=${STABLE_QUEUE}/queue-
${ROOT_VERSION}
54 # Apply the Makefile patch and commit it
55 patch -p1 < ${TMP_DIR}/Makefile.
patch
56 git commit
-a -m "Linux ${FULL_VERSION}"
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
63 gpg
-a -b ${TMP_DIR}/patch-
${FULL_VERSION}
65 # generate the log file
66 git log
--abbrev=12 --format="%aN <%aE>%n %s%n" ${VERSION}..HEAD
> ${TMP_LOG}
68 # clean up the git tree by deleting it
73 echo "Creating the mailbox for kernel release ${FULL_VERSION}"
74 TMPFILE
=`mktemp ${TMP_DIR}/stable_header.XXXXXX` ||
exit 1
75 NUM_PATCHES
=`quilt series | wc -l`
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"
83 echo "Responses should be made by ${DATE}."
84 echo "Anything received after that time might be too late."
86 echo "The whole patch series can be found in one patch at:"
87 echo " kernel.org/pub/linux/kernel/v${VER}/stable-review/patch-${FULL_VERSION}.gz"
88 echo "or in the git tree and branch at:"
89 echo " git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-${ROOT_VERSION}.y"
90 echo "and the diffstat can be found below."
97 echo "Pseudo-Shortlog of commits:"
107 cat ${TMP_DIR}/diffstat
110 FROM
="Greg Kroah-Hartman <gregkh@linuxfoundation.org>"
111 TO
="linux-kernel@vger.kernel.org"
112 #CC="torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk"
113 #CC="alan@lxorguk.ukuu.org.uk"
114 CC
="stable@vger.kernel.org"
115 SUBJECT
="${BASE_VERSION}-stable review"
117 quilt
mail --mbox ${TMP_DIR}/${MBOX} \
118 -m "$(cat ${TMPFILE})" \
123 --prefix "PATCH ${ROOT_VERSION}" \
124 --subject "${SUBJECT}"
126 rm ${TMPFILE} ${TMP_LOG}
128 echo "mbox is now in ${TMP_DIR}/${MBOX}"
131 #echo "Cc: torvalds@linux-foundation.org, akpm@linux-foundation.org"
132 #echo "to the first email."
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"
137 ${STABLE_QUEUE}../mbox2send ${ROOT_VERSION} ${FULL_VERSION} ${MBOX}
138 #< ${MBOX}.new formail -ds sh -c 'cat > msg.$FILENO'
139 splitmbox.py
${MBOX}.new .
141 # Add Linus and Andrew and others to the first email only:
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
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
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
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
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
149 # Create a script to upload the patch to kernel.org and to send the patches out
150 echo "#!/bin/bash" > ${TMP_DIR}/send_it_off
151 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
152 echo "git send-email msg.
*" >> ${TMP_DIR}/send_it_off
153 chmod 755 ${TMP_DIR}/send_it_off
156 # Push a version of the patches out to the world in a git tree
158 git checkout linux-${ROOT_VERSION}.y
159 #git merge -q temp_branch^
160 git merge -q temp_branch
161 echo "git push
--force gitolite@ra.kernel.org
:/pub
/scm
/linux
/kernel
/git
/stable
/linux-stable-rc.git linux-
${ROOT_VERSION}.y
"
162 git push --force gitolite@ra.kernel.org:/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-${ROOT_VERSION}.y
164 # clean up the git tree by deleting it
168 # announce what needs to be done