commit: 9918aca88e545eac0e655b86f750feac948d579d Author: Yixun Lan <dlan <AT> gentoo <DOT> org> AuthorDate: Fri Apr 4 07:23:38 2014 +0000 Commit: Lan Yixun <dlan <AT> gentoo <DOT> org> CommitDate: Fri Apr 4 07:23:38 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/virtualization.git;a=commit;h=9918aca8
script for create xen-patches Signed-off-by: Yixun Lan <dlan <AT> gentoo.org> --- scripts/xen-utils/README | 5 ++ scripts/xen-utils/README.Gentoo.patches | 59 ++++++++++++++++++++ scripts/xen-utils/make-tarball.sh | 96 +++++++++++++++++++++++++++++++++ scripts/xen-utils/xen-4.2.4.omit | 1 + scripts/xen-utils/xen-4.3.2.mini.omit | 1 + scripts/xen-utils/xen-4.3.2.omit | 1 + scripts/xen-utils/xen-4.4.0.omit | 3 ++ 7 files changed, 166 insertions(+) diff --git a/scripts/xen-utils/README b/scripts/xen-utils/README new file mode 100644 index 0000000..dc55b7a --- /dev/null +++ b/scripts/xen-utils/README @@ -0,0 +1,5 @@ +Patchset generated on Sat Jun 8 13:48:56 CST 2013. + +This patchset was automatically generated using upstream's git tree +located at /root/xen. +Refer to /root/info/xen-4.3.2.mini.omit if patches are marked to be omitted. diff --git a/scripts/xen-utils/README.Gentoo.patches b/scripts/xen-utils/README.Gentoo.patches new file mode 100644 index 0000000..15e8edf --- /dev/null +++ b/scripts/xen-utils/README.Gentoo.patches @@ -0,0 +1,59 @@ + ================ + === W[hat]TF === + ================ + +Gentoo patchsets that have grown too large to keep on the rsync mirrors have +been moved to our cvs tree. From there, we bundle up all the whee little +patches into a tarball and distribute it via our public mirroring system. + +If you want specific info about a patch (like wtf it does or whose great idea +it was to change the code), read the patch ! We try to fill out the top of +them with useful info such as what it does, why it's needed, bug reports, +original creators, etc... For simple patches, we reserve the right to assume +your IQ is greater than absolute 0 and figure out what it does w/out an +explanation. If, by some miracle of science, it falls below the absolute 0 +mark, you should help mankind by finding some scientists and letting them +probe you with their ... erm ... probes. + + ================= + === W[here]TF === + ================= + +For those with CVS access, you want the 'src/patchsets' dir inside of the +'gentoo' cvs module. + +For those w/out CVS access, this URL should help you: +http://sources.gentoo.org/gentoo/src/patchsets/ + (you can also find anon cvs access there too) + +It should be pretty easy to find your way around, you're a big boy after all. + + =============== + === H[ow]TF === + =============== + +The patch naming/applying convention might be a little confusing to the Gentoo +outsider, so here's a quick rundown. Patch tarballs are applied in Gentoo via +a helper command called "epatch". This command is pretty forgiving when it +comes to applying patches. + +For example, it will autodetect the required -p# by starting at 0 and counting +up until things apply. So do not expect a patch series to all be at the same -p +level even if they all apply from the same source directory. Typically however, +people will use -p0 or -p1. + +The epatch command will also use the -E option by default as the `patch` command +can be pretty picky about removing files. We just force the issue. If you +really need to empty out a file but leave it behind, people can use `touch` in +the ebuild. + +The patch naming convention is part rigorous and part open ended. By default, +the patch should follow: + #_<arch>_<desc>.patch +The number field is to provide strict numerical ordering and has no limit (well, +except for your IMAGINATION). The <arch> field corresponds to the Gentoo arch +naming convention (so expect to see "amd64" instead of "x86_64"). If you see +"all" (which is how we strongly encourage people to manage things), then the +patch should be applied for all arches, and any arch-specific issues can then +be handled at build time (configure detection or something). The <desc> is a +free form field where people can stick whatever they want. diff --git a/scripts/xen-utils/make-tarball.sh b/scripts/xen-utils/make-tarball.sh new file mode 100755 index 0000000..1a16f2c --- /dev/null +++ b/scripts/xen-utils/make-tarball.sh @@ -0,0 +1,96 @@ +#!/bin/bash + +. /etc/init.d/functions.sh + +VER="$1" +PVER="$2" + +DIR="$(pwd)" +GIT_URL="${GIT_URL:-"git://xenbits.xen.org/xen.git"}" +GIT_BRANCH="${GIT_BRANCH:-stable-${VER:0:3}}" +PATCHDIR="tmp/patches-upstream" +INFODIR="${PATCHDIR}/info" +GIT="$(which git)" + +ARCHIVE="xen-${VER}-upstream-patches-${PVER}.tar.xz" +OMITFILE=${3:-"${DIR}/xen-${VER}.omit"} +TAKEFILE=${4:-"${DIR}/xen-${VER}.take"} +EXTRA_DIR="${DIR}/extra-${VER}" + +if [[ $# -lt 2 ]]; then + einfo "Usage: $0 <pkg ver> <patch ver> [omitted file]" + exit 1 +fi + +if [[ -z ${GIT} ]]; then + eerror "git not found!" + exit 1 +fi + +if [[ -e ${ARCHIVE} ]]; then + eerror "Archive '${ARCHIVE}' does already exist! Abort." + exit 1 +fi + +rm -rf tmp +rm -f ${ARCHIVE} + +mkdir -p ${INFODIR} + +pushd ${PATCHDIR} >/dev/null || exit 1 +${GIT} clone -b ${GIT_BRANCH} ${GIT_URL} || exit 1 +pushd xen >/dev/null || exit 1 +${GIT} format-patch $(git rev-parse RELEASE-$1)..$(git rev-parse origin/${GIT_BRANCH}) -o ../. || exit 1 +popd >/dev/null|| exit 1 + +for PATCH in *.patch; do + SUFFIX="" + if [[ -f ${TAKEFILE} ]] && $(grep -q ${PATCH:5} ${TAKEFILE}); then + continue + fi + if [[ -f ${OMITFILE} ]] && $(grep -q ${PATCH:5} ${OMITFILE}); then + ewarn "patch omitted: ${PATCH}" + SUFFIX=".omitted" + mv ${PATCH} ${PATCH/-xen-[0-9].[0-9].[0-9]-/_all_}${SUFFIX} || exit 1 + fi +done + +# copy extra patches, also provided by upstream but not belong to xen repo +if [[ -d ${EXTRA_DIR} ]]; then + cp -rf ${EXTRA_DIR}/* . || exit 1 +fi + +rm -rf xen || exit 1 +popd >/dev/null || exit 1 + +if [[ -e ../README.Gentoo.patches ]]; then + cp ../README.Gentoo.patches ${INFODIR}/ || exit 1 +else + if [[ -e README.Gentoo.patches ]]; then + cp README.Gentoo.patches ${INFODIR}/ || exit 1 + fi +fi +if [[ -f ${TAKEFILE} ]]; then + cp ${TAKEFILE} ${INFODIR}/ || exit 1 +fi + +if [[ -f ${OMITFILE} ]]; then + cp ${OMITFILE} ${INFODIR}/ || exit 1 +fi + +cat >${INFODIR}/README <<-EOF + Patchset generated on $(date). + + This patchset was automatically generated using upstream's git tree + located at ${GIT_URL}. + Refer to ${TAKEFILE} if patches are marked to be applied, also Gentoo bug id. + Refer to ${OMITFILE} if patches are marked to be omitted. +EOF + +cp $0 ${INFODIR}/ || exit 1 + +tar -cJf ${ARCHIVE} -C tmp . || exit 1 +rm -rf tmp + +einfo "Patchset generation run successfully :)" +einfo "File size of ${ARCHIVE}: $(du -bh ${ARCHIVE} | cut -f1)" diff --git a/scripts/xen-utils/xen-4.2.4.omit b/scripts/xen-utils/xen-4.2.4.omit new file mode 100644 index 0000000..6383fae --- /dev/null +++ b/scripts/xen-utils/xen-4.2.4.omit @@ -0,0 +1 @@ +0001-update-Xen-version-to-4.2.5-pre.patch diff --git a/scripts/xen-utils/xen-4.3.2.mini.omit b/scripts/xen-utils/xen-4.3.2.mini.omit new file mode 100644 index 0000000..57870c4 --- /dev/null +++ b/scripts/xen-utils/xen-4.3.2.mini.omit @@ -0,0 +1 @@ +0003-update-Xen-version-to-4.3.3-pre.patch # preserve xen version, don't change diff --git a/scripts/xen-utils/xen-4.3.2.omit b/scripts/xen-utils/xen-4.3.2.omit new file mode 100644 index 0000000..57870c4 --- /dev/null +++ b/scripts/xen-utils/xen-4.3.2.omit @@ -0,0 +1 @@ +0003-update-Xen-version-to-4.3.3-pre.patch # preserve xen version, don't change diff --git a/scripts/xen-utils/xen-4.4.0.omit b/scripts/xen-utils/xen-4.4.0.omit new file mode 100644 index 0000000..cd6f987 --- /dev/null +++ b/scripts/xen-utils/xen-4.4.0.omit @@ -0,0 +1,3 @@ +0001-Config.mk-switch-QEMU_UPSTREAM_REVISION-back-to-mast.patch +0002-update-Xen-version-to-4.4.1-pre.patch +0003-update-MAINTAINERS-for-stable-branch.patch
