[2/6] utils: update-kernel-headers: Create destination directory
diff mbox series

Message ID 20260504000431.1340150-3-laurent.pinchart@ideasonboard.com
State New
Headers show
Series
  • libcamera: kernel headers update
Related show

Commit Message

Laurent Pinchart May 4, 2026, 12:04 a.m. UTC
Before copying headers, create the destination directory if it does not
exist.

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

Comments

Kieran Bingham May 4, 2026, 8:43 a.m. UTC | #1
Quoting Laurent Pinchart (2026-05-04 01:04:27)
> Before copying headers, create the destination directory if it does not
> exist.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  utils/update-kernel-headers.sh | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/utils/update-kernel-headers.sh b/utils/update-kernel-headers.sh
> index f9baa66d00b4..93599dfe5d52 100755
> --- a/utils/update-kernel-headers.sh
> +++ b/utils/update-kernel-headers.sh
> @@ -65,7 +65,9 @@ headers="
>  
>  for header in $headers ; do
>         name="${header#*/}"
> -       cp "${install_dir}/usr/include/${header}" "${header_dir}/${name}"
> +       dest="${header_dir}/${name}"
> +       mkdir -p "$(dirname "$dest")"
> +       cp "${install_dir}/usr/include/${header}" "${dest}"

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

>  done
>  
>  # The IPU3 header is a special case, as it's stored in staging. Handle it
> -- 
> Regards,
> 
> Laurent Pinchart
>
Barnabás Pőcze May 4, 2026, 9:12 a.m. UTC | #2
2026. 05. 04. 2:04 keltezéssel, Laurent Pinchart írta:
> Before copying headers, create the destination directory if it does not
> exist.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---

Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>


>   utils/update-kernel-headers.sh | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/utils/update-kernel-headers.sh b/utils/update-kernel-headers.sh
> index f9baa66d00b4..93599dfe5d52 100755
> --- a/utils/update-kernel-headers.sh
> +++ b/utils/update-kernel-headers.sh
> @@ -65,7 +65,9 @@ headers="
>   
>   for header in $headers ; do
>   	name="${header#*/}"
> -	cp "${install_dir}/usr/include/${header}" "${header_dir}/${name}"
> +	dest="${header_dir}/${name}"
> +	mkdir -p "$(dirname "$dest")"
> +	cp "${install_dir}/usr/include/${header}" "${dest}"
>   done
>   
>   # The IPU3 header is a special case, as it's stored in staging. Handle it

Patch
diff mbox series

diff --git a/utils/update-kernel-headers.sh b/utils/update-kernel-headers.sh
index f9baa66d00b4..93599dfe5d52 100755
--- a/utils/update-kernel-headers.sh
+++ b/utils/update-kernel-headers.sh
@@ -65,7 +65,9 @@  headers="
 
 for header in $headers ; do
 	name="${header#*/}"
-	cp "${install_dir}/usr/include/${header}" "${header_dir}/${name}"
+	dest="${header_dir}/${name}"
+	mkdir -p "$(dirname "$dest")"
+	cp "${install_dir}/usr/include/${header}" "${dest}"
 done
 
 # The IPU3 header is a special case, as it's stored in staging. Handle it