diff options
author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2020-12-02 16:12:54 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-12-09 23:49:01 +0000 |
commit | e6cb075cd37b379d97fab60eb0ecd3531523a793 (patch) | |
tree | 3ad96b333310f5e69f4375cdad5cda3d8f78ab1f /meta/recipes-kernel/lttng/lttng-modules/0012-Improve-the-release-script.patch | |
parent | a571272bf17114a40f96b2e553feacb35413e8ad (diff) | |
download | poky-e6cb075cd37b379d97fab60eb0ecd3531523a793.tar.gz |
lttng-modules: add post 2.11.6 patches
To fix building against the latest 5.4.x kernels (and other versions
as well), we import the lttng patches that have been added since the
2.11.6 release.
When 2.11.7 is released, we can drop these patches and go with the
release tarball.
(From OE-Core rev: ea7e3c47af4191e69d54fc519865d125ed61d8eb)
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-kernel/lttng/lttng-modules/0012-Improve-the-release-script.patch')
-rw-r--r-- | meta/recipes-kernel/lttng/lttng-modules/0012-Improve-the-release-script.patch | 173 |
1 files changed, 173 insertions, 0 deletions
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0012-Improve-the-release-script.patch b/meta/recipes-kernel/lttng/lttng-modules/0012-Improve-the-release-script.patch new file mode 100644 index 0000000000..f5e7fb55a2 --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0012-Improve-the-release-script.patch | |||
@@ -0,0 +1,173 @@ | |||
1 | From a241d30fa82ed0be1026f14e36e8bd2b0e65740d Mon Sep 17 00:00:00 2001 | ||
2 | From: Michael Jeanson <mjeanson@efficios.com> | ||
3 | Date: Mon, 23 Nov 2020 12:15:43 -0500 | ||
4 | Subject: [PATCH 12/16] Improve the release script | ||
5 | |||
6 | * Use git-archive, this removes all custom code to cleanup the repo, it | ||
7 | can now be used in an unclean repo as the code will be exported from | ||
8 | a specific tag. | ||
9 | * Add parameters, this will allow using the script on any machine | ||
10 | while keeping the default behavior for the maintainer. | ||
11 | |||
12 | Upstream-Status: Backport | ||
13 | |||
14 | Change-Id: I9f29d0e1afdbf475d0bbaeb9946ca3216f725e86 | ||
15 | Signed-off-by: Michael Jeanson <mjeanson@efficios.com> | ||
16 | Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | ||
17 | --- | ||
18 | .gitattributes | 3 + | ||
19 | scripts/maintainer/do-release.sh | 121 +++++++++++++++++++++++++------ | ||
20 | 2 files changed, 100 insertions(+), 24 deletions(-) | ||
21 | create mode 100644 .gitattributes | ||
22 | |||
23 | diff --git a/.gitattributes b/.gitattributes | ||
24 | new file mode 100644 | ||
25 | index 00000000..7839355a | ||
26 | --- /dev/null | ||
27 | +++ b/.gitattributes | ||
28 | @@ -0,0 +1,3 @@ | ||
29 | +.gitattributes export-ignore | ||
30 | +.gitignore export-ignore | ||
31 | +.gitreview export-ignore | ||
32 | diff --git a/scripts/maintainer/do-release.sh b/scripts/maintainer/do-release.sh | ||
33 | index e0cec167..5e94e136 100755 | ||
34 | --- a/scripts/maintainer/do-release.sh | ||
35 | +++ b/scripts/maintainer/do-release.sh | ||
36 | @@ -1,37 +1,110 @@ | ||
37 | -#!/bin/sh | ||
38 | +#!/bin/bash | ||
39 | + | ||
40 | +set -eu | ||
41 | +set -o pipefail | ||
42 | |||
43 | # invoke with do-release 2.N.M, or 2.N.M-rcXX | ||
44 | |||
45 | -REL=$1 | ||
46 | -SRCDIR=~/git/lttng-modules | ||
47 | +# Default maintainer values | ||
48 | +SRCDIR="${HOME}/git/lttng-modules" | ||
49 | # The output files are created in ${HOME}/stable/ | ||
50 | -OUTPUTDIR=${HOME}/stable | ||
51 | +OUTPUTDIR="${HOME}/stable" | ||
52 | +SIGN="yes" | ||
53 | +VERBOSE="" | ||
54 | + | ||
55 | +usage() { | ||
56 | + echo "Usage: do-release.sh [OPTION]... RELEASE" | ||
57 | + echo | ||
58 | + echo "Mandatory arguments to long options are mandatory for short options too." | ||
59 | + echo " -s, --srcdir DIR source directory" | ||
60 | + echo " -o, --outputdir DIR output directory, must exist" | ||
61 | + echo " -n, --no-sign don't GPG sign the output archive" | ||
62 | + echo " -v, --verbose verbose command output" | ||
63 | +} | ||
64 | + | ||
65 | +POS_ARGS=() | ||
66 | +while [[ $# -gt 0 ]] | ||
67 | +do | ||
68 | + arg="$1" | ||
69 | + | ||
70 | + case $arg in | ||
71 | + -n|--no-sign) | ||
72 | + SIGN="no" | ||
73 | + shift 1 | ||
74 | + ;; | ||
75 | + | ||
76 | + -s|--srcdir) | ||
77 | + SRCDIR="$2" | ||
78 | + shift 2 | ||
79 | + ;; | ||
80 | + | ||
81 | + -o|--outputdir) | ||
82 | + OUTPUTDIR="$2" | ||
83 | + shift 2 | ||
84 | + ;; | ||
85 | + | ||
86 | + -v|--verbose) | ||
87 | + VERBOSE="-v" | ||
88 | + shift 1 | ||
89 | + ;; | ||
90 | + | ||
91 | + # Catch unknown arguments | ||
92 | + -*) | ||
93 | + usage | ||
94 | + exit 1 | ||
95 | + ;; | ||
96 | + | ||
97 | + *) | ||
98 | + POS_ARGS+=("$1") | ||
99 | + shift | ||
100 | + ;; | ||
101 | + esac | ||
102 | +done | ||
103 | +set -- "${POS_ARGS[@]}" | ||
104 | |||
105 | -if [ x"$1" = x"" ]; then | ||
106 | - echo "1 arg : VERSION"; | ||
107 | +REL=${1:-} | ||
108 | + | ||
109 | +if [ x"${REL}" = x"" ]; then | ||
110 | + usage | ||
111 | exit 1; | ||
112 | fi | ||
113 | |||
114 | -cd ${OUTPUTDIR} | ||
115 | +echo "Doing LTTng modules release ${REL}" | ||
116 | +echo " Source dir: ${SRCDIR}" | ||
117 | +echo " Output dir: ${OUTPUTDIR}" | ||
118 | +echo " GPG sign: ${SIGN}" | ||
119 | |||
120 | -echo Doing LTTng modules release ${REL} | ||
121 | +# Make sure the output directory exists | ||
122 | +if [ ! -d "${OUTPUTDIR}" ]; then | ||
123 | + echo "Output directory '${OUTPUTDIR}' doesn't exist." | ||
124 | + exit 1 | ||
125 | +fi | ||
126 | |||
127 | -mkdir lttng-modules-${REL} | ||
128 | -cd lttng-modules-${REL} | ||
129 | -cp -ax ${SRCDIR}/. . | ||
130 | +# Make sure the source directory is a git repository | ||
131 | +if [ ! -r "${SRCDIR}/.git/config" ]; then | ||
132 | + echo "Source directory '${SRCDIR}' isn't a git repository." | ||
133 | + exit 1 | ||
134 | +fi | ||
135 | |||
136 | -#cleanup | ||
137 | -make clean | ||
138 | -git clean -xdf | ||
139 | +# Set the git repo directory for all further git commands | ||
140 | +export GIT_DIR="${SRCDIR}/.git/" | ||
141 | |||
142 | -for a in \*.orig \*.rej Module.markers Module.symvers; do | ||
143 | - find . -name "${a}" -exec rm '{}' \;; | ||
144 | -done | ||
145 | -for a in outgoing .tmp_versions .git .pc; do | ||
146 | - find . -name "${a}" -exec rm -rf '{}' \;; | ||
147 | -done | ||
148 | +# Check if the release tag exists | ||
149 | +if ! git rev-parse "refs/tags/v${REL}" >/dev/null 2>&1; then | ||
150 | + echo "Release tag 'v${REL}' doesn't exist." | ||
151 | + exit 1 | ||
152 | +fi | ||
153 | + | ||
154 | +# Generate the compressed tar archive, the git attributes from the tag will be used. | ||
155 | +git archive $VERBOSE --format=tar --prefix="lttng-modules-${REL}/" "v${REL}" | bzip2 > "${OUTPUTDIR}/lttng-modules-${REL}.tar.bz2" | ||
156 | |||
157 | -cd .. | ||
158 | -tar cvfj lttng-modules-${REL}.tar.bz2 lttng-modules-${REL} | ||
159 | -mksums lttng-modules-${REL}.tar.bz2 | ||
160 | -signpkg lttng-modules-${REL}.tar.bz2 | ||
161 | +pushd "${OUTPUTDIR}" >/dev/null | ||
162 | +# Generate the hashes | ||
163 | +md5sum "lttng-modules-${REL}.tar.bz2" > "lttng-modules-${REL}.tar.bz2.md5" | ||
164 | +sha256sum "lttng-modules-${REL}.tar.bz2" > "lttng-modules-${REL}.tar.bz2.sha256" | ||
165 | + | ||
166 | +if [ "x${SIGN}" = "xyes" ]; then | ||
167 | + # Sign with the default key | ||
168 | + gpg --armor -b "lttng-modules-${REL}.tar.bz2" | ||
169 | +fi | ||
170 | +popd >/dev/null | ||
171 | -- | ||
172 | 2.25.1 | ||
173 | |||