[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 2/3] Update to use a .config file



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@xxxxxxxxxx>
> ---
>  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@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.