On 19.01.11 at 19:40, Jeff Mahoney <jeffm@suse.com> wrote: 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.
Which makes me assume you build only a single config. For obvious(?) reasons I usually build two or three (native, Xen, and on some branches EC2).
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.
Rather than putting generated files in the build tree, I'd recommend allowing to reference them in the source tree (Modules.supported really is a source file from an expanded-source-tree perspective, i.e. from the pov of the actual kernel build). At the risk of repeating myself, this is what I patch into each end every source snapshot I take (and I would love to see this integrated into patches.suse/supported-flag, but I never received an ack to do so on earlier posts): --- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost @@ -84,7 +84,8 @@ modpost = scripts/mod/modpost $(if $(cross_build),-c) \ $(if $(CONFIG_ENTERPRISE_SUPPORT), \ -N $(firstword $(wildcard $(dir $(MODVERDIR))/Module.supported \ - $(objtree)/Module.supported /dev/null))) + $(objtree)/Module.supported \ + $(srctree)/Module.supported /dev/null))) quiet_cmd_modpost = MODPOST $(words $(filter-out vmlinux FORCE, $^)) modules cmd_modpost = $(modpost) -s I'm sure something similar ought to be possible for the reference symsets (which, from a kernel build pov again are source files, and could be generated for all active flavors at once, just like the configs used to be). That would eliminate the need for sequence-patch to have to know the build directory (which I don't want to be read as objection to the change you propose - for those building just a single config that's certainly fine, but if above suggestions are taken, then it'll likely end up just creating an empty directory). Jan
Signed-off-by: Jeff Mahoney <jeffm@suse.com> --- scripts/sequence-patch.sh | 40 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-)
--- a/scripts/sequence-patch.sh +++ b/scripts/sequence-patch.sh @@ -37,7 +37,19 @@ sles9* | sles10* | sle10* | 9.* | 10.* | esac
usage() { - echo "SYNOPSIS: $0 [-qv] [--symbol=...] [--dir=...] [--combine] [--fast] [last-patch-name] [--vanilla] [--fuzz=NUM]" + cat <<END +SYNOPSIS: $0 [-qv] [--symbol=...] [--dir=...] + [--combine] [--fast] [last-patch-name] [--vanilla] [--fuzz=NUM] + [--build-dir=PATH] + + The --build-dir option supports internal shell aliases, like ~, and variable + expansion when the variables are properly escaped. Environment variables + and the following list of internal variables are permitted: + \$PATCH_DIR: The expanded source tree + \$SRCVERSION: The current linux source tarball version + \$TAG: The current tag or branch of this repo + \$EXT: A string expanded from current \$EXTRA_SYMBOLS +END exit 1 }
@@ -49,7 +61,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 +76,7 @@ QUILT=true COMBINE= FAST= VANILLA=false +SP_BUILD_DIR=
while true; do case "$1" in @@ -105,6 +118,10 @@ while true; do fuzz="-F$2" shift ;; + --build-dir) + SP_BUILD_DIR="$2" + shift + ;; --) shift break ;; @@ -217,6 +234,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") +else + SP_BUILD_DIR="$PATCH_DIR" +fi + echo "Creating tree in $PATCH_DIR"
# Clean up from previous run @@ -434,9 +458,19 @@ fi
echo "[ Tree: $PATCH_DIR ]"
+append= +if test "$SP_BUILD_DIR" != "$PATCH_DIR"; then + mkdir -p "$SP_BUILD_DIR" + echo "[ Build Dir: $SP_BUILD_DIR ]" + rm -f "$SP_BUILD_DIR/source" + rm -f "$SP_BUILD_DIR/patches" + ln -sf "$PATCH_DIR" "$SP_BUILD_DIR/source" + ln -sf "source/patches" "$SP_BUILD_DIR/patches" +fi + if test -e supported.conf; then echo "[ Generating Module.supported ]" - scripts/guards base external < supported.conf > $PATCH_DIR/Module.supported + scripts/guards base external < supported.conf > "$SP_BUILD_DIR/Module.supported" fi
[ $# -gt 0 ] && exit $status
-- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-kernel+help@opensuse.org