utils: update-kernel-headers: Support relative path to kernel git tree
diff mbox series

Message ID 20240826212245.18922-1-laurent.pinchart@ideasonboard.com
State Accepted
Commit 67b87ccb8796c5bd2a724f869db7fd948070146d
Headers show
Series
  • utils: update-kernel-headers: Support relative path to kernel git tree
Related show

Commit Message

Laurent Pinchart Aug. 26, 2024, 9:22 p.m. UTC
When given a relative path to the kernel git tree,
update-kernel-headers.sh fails to execute the headers_install.sh script
from the kernel sources. Fix it by turning the kernel directory into an
absolute path.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 utils/update-kernel-headers.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Umang Jain Aug. 27, 2024, 8:27 a.m. UTC | #1
Hi Laurent

Thank you for the patch.

On 27/08/24 2:52 am, Laurent Pinchart wrote:
> When given a relative path to the kernel git tree,
> update-kernel-headers.sh fails to execute the headers_install.sh script
> from the kernel sources. Fix it by turning the kernel directory into an
> absolute path.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
> ---
>   utils/update-kernel-headers.sh | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/utils/update-kernel-headers.sh b/utils/update-kernel-headers.sh
> index 8405be0ac923..9a64dfb5698c 100755
> --- a/utils/update-kernel-headers.sh
> +++ b/utils/update-kernel-headers.sh
> @@ -9,7 +9,7 @@ if [ $# != 1 ] ; then
>   fi
>   
>   header_dir="$(dirname "$(realpath "$0")")/../include/linux"
> -kernel_dir="$1"
> +kernel_dir="$(realpath "$1")"
>   
>   # Bail out if the directory doesn't contain kernel sources
>   line=$(head -3 "${kernel_dir}/Kbuild" 2>/dev/null | tail -1)
Jacopo Mondi Aug. 27, 2024, 9:13 a.m. UTC | #2
On Tue, Aug 27, 2024 at 01:57:31PM GMT, Umang Jain wrote:
> Hi Laurent
>
> Thank you for the patch.
>
> On 27/08/24 2:52 am, Laurent Pinchart wrote:
> > When given a relative path to the kernel git tree,
> > update-kernel-headers.sh fails to execute the headers_install.sh script
> > from the kernel sources. Fix it by turning the kernel directory into an
> > absolute path.
> >
> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>
> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>

Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>

Thanks
  j

> > ---
> >   utils/update-kernel-headers.sh | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/utils/update-kernel-headers.sh b/utils/update-kernel-headers.sh
> > index 8405be0ac923..9a64dfb5698c 100755
> > --- a/utils/update-kernel-headers.sh
> > +++ b/utils/update-kernel-headers.sh
> > @@ -9,7 +9,7 @@ if [ $# != 1 ] ; then
> >   fi
> >   header_dir="$(dirname "$(realpath "$0")")/../include/linux"
> > -kernel_dir="$1"
> > +kernel_dir="$(realpath "$1")"
> >   # Bail out if the directory doesn't contain kernel sources
> >   line=$(head -3 "${kernel_dir}/Kbuild" 2>/dev/null | tail -1)
>

Patch
diff mbox series

diff --git a/utils/update-kernel-headers.sh b/utils/update-kernel-headers.sh
index 8405be0ac923..9a64dfb5698c 100755
--- a/utils/update-kernel-headers.sh
+++ b/utils/update-kernel-headers.sh
@@ -9,7 +9,7 @@  if [ $# != 1 ] ; then
 fi
 
 header_dir="$(dirname "$(realpath "$0")")/../include/linux"
-kernel_dir="$1"
+kernel_dir="$(realpath "$1")"
 
 # Bail out if the directory doesn't contain kernel sources
 line=$(head -3 "${kernel_dir}/Kbuild" 2>/dev/null | tail -1)