[opensuse-kernel] [patch 0/5] scripts/sequence-patch.sh: Add some useful options
Hi all - There are a few things I do every time I expand the source tree with sequence-patch.sh. Or, rather, things I should do and forget to do a lot. The first I always remember to do: Copy the config I want to test with to my build directory. The second I forget more often than not: Expand the kABI references into my build directory. One of the things that bites me occasionally is when there are kABI changes that go un-noticed until the automated build checker flags them and sends me an email yelling at me for my carelessness. This patch adds three options to scripts/sequence-patch.sh to take care of these automatically. --build-dir=PATH allows you to specify the build directory you'll be using. It will create the directory if it doesn't exist. It defaults to $PATCH_DIR. --config=ARCH-FLAVOR allows you to specify the config you'll use. It will copy the config to your build directory. It is not a fatal error if the config does not exist. It will just not copy one. --kabi allows you to direct sequence-patch to expand the kABI references into your build directory. Since the references are arch/flavor specific, it depends on --config=ARCH-FLAVOR. It is not a fatal error if the kABI reference doesn't exist since this is always the case in the master branch. The --build-dir PATH is subject to shell expansion. It is expanded late enough in the script that most variables should be available. There are also three new variables available when --config is used: $CONFIG contains the --config contents. $CONFIG_ARCH contains the arch part of the config. $CONFIG_FLAVOR contains the flavor part. For reference, I have this in my .bashrc: export SEQUENCE_PATCH_ARGS="--config=x86_64-desktop --build-dir=~/src/scratch/build/\$CONFIG_ARCH/linux-\$SRCVERSION-\$TAG-\$CONFIG_FLAVOR --kabi" I've also added patches for --ctags and --cscope which will automatically generate the databases for either of those tools in the build directory after the source tree is expanded. -Jeff -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-kernel+help@opensuse.org
I use a separate build directory from the tree in which I expand the source
tree. Some files, such as Module.supported are generated automatically and
placed in the source tree.
This patch adds a --build-dir=PATH option and uses that directory for
generated files. If it doesn't exist, it will create it. If it does exist,
it will not clean it. Except to re-set the source and patches links it
will create.
Signed-off-by: Jeff Mahoney
Dne 19.1.2011 18:29, Jeff Mahoney napsal(a):
I use a separate build directory from the tree in which I expand the source tree. Some files, such as Module.supported are generated automatically and placed in the source tree.
This patch adds a --build-dir=PATH option and uses that directory for generated files. If it doesn't exist, it will create it. If it does exist, it will not clean it. Except to re-set the source and patches links it will create.
Signed-off-by: Jeff Mahoney
--- scripts/sequence-patch.sh | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) --- a/scripts/sequence-patch.sh +++ b/scripts/sequence-patch.sh @@ -37,7 +37,7 @@ sles9* | sles10* | sle10* | 9.* | 10.* | esac
usage() { - echo "SYNOPSIS: $0 [-qv] [--symbol=...] [--dir=...] [--combine] [--fast] [last-patch-name] [--vanilla] [--fuzz=NUM]" + echo "SYNOPSIS: $0 [-qv] [--symbol=...] [--dir=...] [--combine] [--fast] [last-patch-name] [--vanilla] [--fuzz=NUM] [--build-dir=PATH]" exit 1 }
@@ -49,7 +49,7 @@ if $have_arch_patches; then else arch_opt="" fi -options=`getopt -o qvd:F: --long quilt,no-quilt,$arch_opt,symbol:,dir:,combine,fast,vanilla,fuzz -- "$@"` +options=`getopt -o qvd:F: --long quilt,no-quilt,$arch_opt,symbol:,dir:,combine,fast,vanilla,fuzz,build-dir: -- "$@"`
if [ $? -ne 0 ] then @@ -64,6 +64,7 @@ QUILT=true COMBINE= FAST= VANILLA=false +SP_BUILD_DIR=
while true; do case "$1" in @@ -105,6 +106,10 @@ while true; do fuzz="-F$2" shift ;; + --build-dir) + SP_BUILD_DIR="$2" + shift + ;; --) shift break ;; @@ -214,6 +219,13 @@ EXT=${EXTRA_SYMBOLS// /-} EXT=${EXT//\//} PATCH_DIR=${PATCH_DIR}${EXT:+-}$EXT
+if [ -n "$SP_BUILD_DIR" ]; then + # This allows alias (~) and variable expansion + SP_BUILD_DIR=$(eval echo "$SP_BUILD_DIR")
I would document in the help text which variables are supposed to be used in the string, so that we do not have to worry about changing or removing truly internal variables in the future. Michal -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-kernel+help@opensuse.org
One of the things I need to do every time I set up a new build directory
or update the source tree is copy the config file over from the git repo.
This patchs adds a --config=ARCH-FLAVOR option that copies it automatically.
If the config does not exist, it is not considered a fatal error.
Signed-off-by: Jeff Mahoney
Now that we have arch and flavor information via the --config option,
we can do things like automatically expand the kABI references.
This patch uses that information to expand the references into the build
directory. Missing kABI references are not considered a fatal error.
Signed-off-by: Jeff Mahoney
Dne 19.1.2011 18:29, Jeff Mahoney napsal(a):
Now that we have arch and flavor information via the --config option, we can do things like automatically expand the kABI references.
This patch uses that information to expand the references into the build directory. Missing kABI references are not considered a fatal error.
Signed-off-by: Jeff Mahoney
--- [...] + + if test -n "$KABI"; then
If you set the variable to true/false, then you can simply write 'if $KABI; then', like in other places in the script.
+ echo "[ Expanding kABI references for $CONFIG ]" + rpm/modversions --unpack "$SP_BUILD_DIR"< \ + "kabi/$CONFIG_ARCH/symtypes-$CONFIG_FLAVOR"
Contrary to the changelog, there is no check if the symtypes file is actually present. Also, old branches do not have the modversions script.
+ else + echo "[ No kABI references for $CONFIG ]" + fi fi
Michal -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-kernel+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 01/19/2011 12:53 PM, Michal Marek wrote:
Dne 19.1.2011 18:29, Jeff Mahoney napsal(a):
Now that we have arch and flavor information via the --config option, we can do things like automatically expand the kABI references.
This patch uses that information to expand the references into the build directory. Missing kABI references are not considered a fatal error.
Signed-off-by: Jeff Mahoney
--- [...] + + if test -n "$KABI"; then If you set the variable to true/false, then you can simply write 'if $KABI; then', like in other places in the script.
+ echo "[ Expanding kABI references for $CONFIG ]" + rpm/modversions --unpack "$SP_BUILD_DIR"< \ + "kabi/$CONFIG_ARCH/symtypes-$CONFIG_FLAVOR"
Contrary to the changelog, there is no check if the symtypes file is actually present. Also, old branches do not have the modversions script.
Ah, you're right. I had broken these out of one big patch and missed that check. - -Jeff
+ else + echo "[ No kABI references for $CONFIG ]" + fi fi
Michal
- -- Jeff Mahoney SUSE Labs -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/ iEYEARECAAYFAk03JFEACgkQLPWxlyuTD7IVkACdEUv+Mb2uh97zjlcNaxxVHgcy MhQAniVmn8s/bdXrgYRi+LHT6OiQHZcK =fU1R -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-kernel+help@opensuse.org
This patch adds a --ctags option which automatically invokes
"make tags" in the build directory.
Signed-off-by: Jeff Mahoney
This patch adds a --cscope option which automatically invokes
"make cscope" in the build directory.
Signed-off-by: Jeff Mahoney
participants (2)
-
Jeff Mahoney
-
Michal Marek