All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Ross Lagerwall <ross.lagerwall@citrix.com>
Cc: xen-devel@lists.xen.org
Subject: Re: [PATCH 2/3] Update to use a .config file
Date: Tue, 14 Jun 2016 11:35:57 -0400	[thread overview]
Message-ID: <20160614153557.GE9456@char.us.oracle.com> (raw)
In-Reply-To: <1465556565-26403-2-git-send-email-ross.lagerwall@citrix.com>

On Fri, Jun 10, 2016 at 12:02:44PM +0100, Ross Lagerwall wrote:
> Remove the old --xen-debug option, and instead, require the user to pass
> a .config file matching the original build's .config.

Hm, that throws this off a bit for the older hypervisors (to which
I had backported livepatch). Perhaps we could add some logic to
check if common/Kconfig exist? 

And I also wonder if the --xen-debug option removal should be a seperate
patch?

> 
> Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
> ---
>  livepatch-build | 24 ++++++++++++++++--------
>  1 file changed, 16 insertions(+), 8 deletions(-)
> 
> diff --git a/livepatch-build b/livepatch-build
> index 8dc8889..e9d1e8d 100755
> --- a/livepatch-build
> +++ b/livepatch-build
> @@ -66,7 +66,7 @@ function build_full()
>  {
>      cd "${SRCDIR}/xen" || die
>      make "-j$CPUS" clean &> "${OUTPUT}/build_full_clean.log" || die
> -    make "-j$CPUS" debug="$XEN_DEBUG" &> "${OUTPUT}/build_full_compile.log" || die
> +    make "-j$CPUS" &> "${OUTPUT}/build_full_compile.log" || die
>      cp xen-syms "$OUTPUT"
>  }
>  
> @@ -86,7 +86,7 @@ function build_special()
>      # Build with special GCC flags
>      cd "${SRCDIR}/xen" || die
>      sed -i 's/CFLAGS += -nostdinc/CFLAGS += -nostdinc -ffunction-sections -fdata-sections/' Rules.mk
> -    make "-j$CPUS" debug="$XEN_DEBUG" &> "${OUTPUT}/build_${name}_compile.log" || die
> +    make "-j$CPUS" &> "${OUTPUT}/build_${name}_compile.log" || die
>      sed -i 's/CFLAGS += -nostdinc -ffunction-sections -fdata-sections/CFLAGS += -nostdinc/' Rules.mk
>  
>      unset LIVEPATCH_BUILD_DIR
> @@ -158,17 +158,17 @@ usage() {
>      echo "        -h, --help         Show this help message" >&2
>      echo "        -s, --srcdir       Xen source directory" >&2
>      echo "        -p, --patch        Patch file" >&2
> +    echo "        -c, --config       .config file" >&2
>      echo "        -o, --output       Output directory" >&2
>      echo "        -j, --cpus         Number of CPUs to use" >&2
>      echo "        -k, --skip         Skip build or diff phase" >&2
>      echo "        -d, --debug        Enable debug logging" >&2
> -    echo "        --xen-debug        Build debug Xen" >&2
>      echo "        --xen-syms         Build against a xen-syms" >&2
>      echo "        --depends          Required build-id" >&2
>      echo "        --prelink          Prelink" >&2
>  }
>  
> -options=$(getopt -o hs:p:o:j:k:d -l "help,srcdir:patch:output:cpus:,skip:,debug,xen-debug,xen-syms:,depends:,prelink" -- "$@") || die "getopt failed"
> +options=$(getopt -o hs:p:c:o:j:k:d -l "help,srcdir:patch:config:output:cpus:,skip:,debug,xen-syms:,depends:,prelink" -- "$@") || die "getopt failed"
>  
>  eval set -- "$options"
>  
> @@ -192,10 +192,6 @@ while [[ $# -gt 0 ]]; do
>              DEBUG=1
>              shift
>              ;;
> -        --xen-debug)
> -            XEN_DEBUG=y
> -            shift
> -            ;;
>          -s|--srcdir)
>              shift
>              srcarg="$1"
> @@ -206,6 +202,11 @@ while [[ $# -gt 0 ]]; do
>              patcharg="$1"
>              shift
>              ;;
> +        -c|--config)
> +            shift
> +            configarg="$1"
> +            shift
> +            ;;
>          -o|--output)
>              shift
>              outputarg="$1"
> @@ -235,15 +236,18 @@ done
>  
>  [ -z "$srcarg" ] && die "Xen directory not given"
>  [ -z "$patcharg" ] && die "Patchfile not given"
> +[ -z "$configarg" ] && die ".config not given"
>  [ -z "$outputarg" ] && die "Output directory not given"
>  [ -z "$DEPENDS" ] && die "Build-id dependency not given"
>  
>  SRCDIR="$(readlink -m -- "$srcarg")"
>  PATCHFILE="$(readlink -m -- "$patcharg")"
> +CONFIGFILE="$(readlink -m -- "$configarg")"
>  OUTPUT="$(readlink -m -- "$outputarg")"
>  
>  [ -d "${SRCDIR}" ] || die "Xen directory does not exist"
>  [ -f "${PATCHFILE}" ] || die "Patchfile does not exist"
> +[ -f "${CONFIGFILE}" ] || die ".config does not exist"
>  
>  PATCHNAME=$(make_patch_name "${PATCHFILE}")
>  
> @@ -251,16 +255,20 @@ echo "Building LivePatch patch: ${PATCHNAME}"
>  echo
>  echo "Xen directory: ${SRCDIR}"
>  echo "Patch file: ${PATCHFILE}"
> +echo ".config file: ${CONFIGFILE}"
>  echo "Output directory: ${OUTPUT}"
>  echo "================================================"
>  echo
>  
>  if [ "${SKIP}" != "build" ]; then
>      [ -e "${OUTPUT}" ] && die "Output directory exists"
> +    grep -q 'CONFIG_LIVEPATCH=y' "${CONFIGFILE}" || die "CONFIG_LIVEPATCH must be enabled"
>      cd "$SRCDIR" || die
>      patch -s -N -p1 -f --fuzz=0 --dry-run < "$PATCHFILE" || die "Source patch file failed to apply"
>  
>      mkdir -p "${OUTPUT}" || die
> +    cp -f "${CONFIGFILE}" "${OUTPUT}/.config"
> +    cp -f "${OUTPUT}/.config" "xen/.config"
>  
>      echo "Perform full initial build with ${CPUS} CPU(s)..."
>      build_full
> -- 
> 2.4.11
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2016-06-14 15:35 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-10 11:02 [PATCH 1/3] Don't accept fuzz when patching Ross Lagerwall
2016-06-10 11:02 ` [PATCH 2/3] Update to use a .config file Ross Lagerwall
2016-06-14 15:35   ` Konrad Rzeszutek Wilk [this message]
2016-06-15  8:08     ` Ross Lagerwall
2016-06-15 14:00       ` Konrad Rzeszutek Wilk
2016-07-14  8:05         ` Ross Lagerwall
2016-07-15 13:36           ` Konrad Rzeszutek Wilk
2016-07-16  1:55             ` Konrad Rzeszutek Wilk
2016-07-18  9:33               ` Ross Lagerwall
2016-07-18 10:28                 ` Konrad Rzeszutek Wilk
2016-06-10 11:02 ` [PATCH 3/3] Update README.md Ross Lagerwall
2016-06-14 15:36   ` Konrad Rzeszutek Wilk
2016-06-13 10:08 ` [PATCH 1/3] Don't accept fuzz when patching George Dunlap
2016-06-13 10:16   ` Andrew Cooper
2016-06-13 10:57     ` George Dunlap
2016-06-13 10:23   ` Ross Lagerwall
2016-06-14 15:33 ` Konrad Rzeszutek Wilk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160614153557.GE9456@char.us.oracle.com \
    --to=konrad.wilk@oracle.com \
    --cc=ross.lagerwall@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.