Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland@arm.com>
To: Akos Denke <akos.denke@arm.com>
Cc: linux-arm-kernel@lists.infradead.org
Subject: Re: [boot-wrapper-aarch64 PATCH] configure: Do not force kernel-dir as a mandatory input
Date: Fri, 19 Jul 2024 10:50:45 +0100	[thread overview]
Message-ID: <Zpo29QdfNC1YK8eX@J2N7QTR9R3> (raw)
In-Reply-To: <ZpURhwfsnYYsP-zq@J2N7QTR9R3>

On Mon, Jul 15, 2024 at 01:09:43PM +0100, Mark Rutland wrote:
> I've tried to fix that up as below; could you please check that this
> works for you?

I've pushed this out now; please shout if anythign explodes.

Mark.

> 
> Mark.
> ---->8----
> >From f9ad9d640a06fdc2c2ca85d977131b8a504d045d Mon Sep 17 00:00:00 2001
> From: Akos Denke <akos.denke@arm.com>
> Date: Thu, 23 May 2024 13:49:31 +0200
> Subject: [PATCH] configure: make --with-kernel-dir optional
> 
> Currently it is mandatory to specify the kernel directory via
> --with-kernel-dir, and this is used to generate default paths for the
> kernel image, dtb, and dtc.
> 
> All of these paths can all be provided by the user, e.g. the kernel
> image path can be provided by --with-kernel-image, and an alternative
> dtc can be added to $PATH. When all of these are provided by the user,
> there's no real need for the kernel directory.
> 
> Drop the requirement for --with-kernel-dir when other paths are provided
> explicitly. This makes it easier to use the boot-wrapper with prebuilt
> kernels, where we do not control the directory structure of the kernel
> artifacts.
> 
> Signed-off-by: Akos Denke <akos.denke@arm.com>
> Reviewed-by: Andre Przywara <andre.przywara@arm.com>
> Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> [Mark: simplify commit message, rework option parsing, always log kernel dir]
> Link: https://lore.kernel.org/r/20240523114931.2093222-1-akos.denke@arm.com
> ---
>  configure.ac | 40 ++++++++++++++++++++++++++--------------
>  1 file changed, 26 insertions(+), 14 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 9e3b722..ce41dae 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -27,18 +27,33 @@ AS_IF([test "x$BOOTWRAPPER_ES" = x32 -a "x$KERNEL_ES" != x32],
>  
>  # Allow a user to pass --with-kernel-dir
>  AC_ARG_WITH([kernel-dir],
> -	AS_HELP_STRING([--with-kernel-dir], [specify the root Linux kernel build directory (required)]),
> +	AS_HELP_STRING([--with-kernel-dir], [specify the root Linux kernel build directory]),
>  	AC_SUBST([KERN_DIR], [$withval]),
> -	AC_MSG_ERROR([No kernel directory specified. Use --with-kernel-dir]))
> -AS_IF([test "x$KERNEL_ES" = x32],
> -	[KERN_IMAGE=$KERN_DIR/arch/arm/boot/zImage],
> -	[KERN_IMAGE=$KERN_DIR/arch/arm64/boot/Image])
> -KERN_DTB=$KERN_DIR/arch/arm64/boot/dts/arm/fvp-base-revc.dtb
> +	AC_MSG_NOTICE([Kernel dir not specified])
> +)
> +
> +# Allow a user to pass a specific kernel image file
> +AC_ARG_WITH([kernel-image],
> +	AS_HELP_STRING([--with-kernel-image], [specify kernel image]),
> +	AC_SUBST([KERN_IMAGE], [$withval]),
> +	AS_IF([test "x$KERN_DIR" != "x"],
> +		AS_IF([test "x$KERNEL_ES" = x32],
> +			[KERN_IMAGE=$KERN_DIR/arch/arm/boot/zImage],
> +			[KERN_IMAGE=$KERN_DIR/arch/arm64/boot/Image]
> +		),
> +		AC_MSG_ERROR([No kernel image specified. Use --with-kernel-image or --with-kernel-dir])
> +	)
> +)
>  
>  # Allow the user to override the default DTB
>  AC_ARG_WITH([dtb],
>  	AS_HELP_STRING([--with-dtb], [Specify a particular DTB to use]),
> -	[KERN_DTB="$withval"])
> +	[KERN_DTB="$withval"],
> +	AS_IF([test "x$KERN_DIR" != "x"],
> +		[KERN_DTB=$KERN_DIR/arch/arm64/boot/dts/arm/fvp-base-revc.dtb],
> +		AC_MSG_ERROR([No DTB specified. Use --with-dtb or --with-kernel-dir])
> +	)
> +)
>  
>  AC_ARG_WITH([xen],
>  	AS_HELP_STRING([--with-xen], [Compile for Xen, and specify a particular Xen to use]),
> @@ -52,11 +67,6 @@ AS_IF([test "x$X_IMAGE" == "x"], [],
>  AC_SUBST([XEN_IMAGE], [$X_IMAGE])
>  AM_CONDITIONAL([XEN], [test "x$X_IMAGE" != "x"])
>  
> -# Ensure that the user has provided us with a sane kernel dir.
> -if ! test -d $KERN_DIR; then
> -	AC_MSG_ERROR([Could not find Linux kernel dir: $KERN_DIR.])
> -fi
> -
>  AC_MSG_CHECKING([whether DTB file exists])
>  if ! test -f $KERN_DTB; then
>  	AC_MSG_RESULT([no])
> @@ -126,7 +136,7 @@ AC_PROG_SED
>  AC_PROG_LN_S
>  AC_PATH_PROG([DTC], dtc, error, [$PATH$PATH_SEPARATOR$KERN_DIR/scripts/dtc])
>  if test "x$DTC" = "xerror"; then
> -	AC_MSG_ERROR([cannot find the device tree compiler (dtc)])
> +	AC_MSG_ERROR([cannot find the device tree compiler (dtc). Use --with-kernel-dir or put dtc on the PATH])
>  fi
>  AC_CHECK_TOOL(LD, ld)
>  
> @@ -139,8 +149,10 @@ echo ""
>  echo "  Boot wrapper configuration"
>  echo "  =========================="
>  echo ""
> -echo "  Linux kernel build dir:            ${KERN_DIR}"
> +echo "  Linux kernel build dir:            ${KERN_DIR:-NONE}"
> +echo "  Linux kernel image:                ${KERN_IMAGE}"
>  echo "  Device tree blob:                  ${KERN_DTB}"
> +echo "  Device tree compiler:              ${DTC}"
>  echo "  Linux kernel command line:         ${CMDLINE}"
>  echo "  Embedded initrd:                   ${FILESYSTEM:-NONE}"
>  echo "  Use PSCI?                          ${USE_PSCI}"
> -- 
> 2.30.2
> 
> 


      reply	other threads:[~2024-07-19  9:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-23 11:49 [boot-wrapper-aarch64 PATCH] configure: Do not force kernel-dir as a mandatory input Akos Denke
2024-06-05 13:16 ` Andre Przywara
2024-07-15 12:09 ` Mark Rutland
2024-07-19  9:50   ` Mark Rutland [this message]

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=Zpo29QdfNC1YK8eX@J2N7QTR9R3 \
    --to=mark.rutland@arm.com \
    --cc=akos.denke@arm.com \
    --cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox