diff mbox series

[1/5] initramfs-crypt-hook: make sure that mount path exists

Message ID 20250226095921.168962-2-ch@denx.de (mailing list archive)
State New
Headers show
Series Initramfs-crypt-hook patches, encryption on update | expand

Commit Message

Claudius Heine Feb. 26, 2025, 9:59 a.m. UTC
In case the mount path does not exist, try to create it instead of
failing.

Signed-off-by: Claudius Heine <ch@denx.de>
---
 .../initramfs-crypt-hook/files/local-bottom-complete             | 1 +
 1 file changed, 1 insertion(+)

Comments

Jan Kiszka Feb. 27, 2025, 9:13 a.m. UTC | #1
On 26.02.25 10:59, Claudius Heine wrote:
> In case the mount path does not exist, try to create it instead of
> failing.
> 

Please specify the "why" here. As you know, (almost) every commit
message should cover that, and obvious ones do not even have to talk
about how they do that.

Jan

> Signed-off-by: Claudius Heine <ch@denx.de>
> ---
>  .../initramfs-crypt-hook/files/local-bottom-complete             | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/recipes-initramfs/initramfs-crypt-hook/files/local-bottom-complete b/recipes-initramfs/initramfs-crypt-hook/files/local-bottom-complete
> index b991cb4..80553d1 100644
> --- a/recipes-initramfs/initramfs-crypt-hook/files/local-bottom-complete
> +++ b/recipes-initramfs/initramfs-crypt-hook/files/local-bottom-complete
> @@ -41,6 +41,7 @@ mount_partition() {
>  	partition_mountpoint=$2
>  	[ "$debug" = "y" ] && echo "mount device: '$partition_dev_path' to '$partition_mountpoint'"
>  	if ! mountpoint -q "${partition_mountpoint}"; then
> +		mkdir -p "${partition_mountpoint}"
>  		if ! mount -t "$(get_fstype "${partition_dev_path}")" "${partition_dev_path}" \
>  			 "${partition_mountpoint}"; then
>  			panic "Can't mount partition '${partition_dev_path}'!"
diff mbox series

Patch

diff --git a/recipes-initramfs/initramfs-crypt-hook/files/local-bottom-complete b/recipes-initramfs/initramfs-crypt-hook/files/local-bottom-complete
index b991cb4..80553d1 100644
--- a/recipes-initramfs/initramfs-crypt-hook/files/local-bottom-complete
+++ b/recipes-initramfs/initramfs-crypt-hook/files/local-bottom-complete
@@ -41,6 +41,7 @@  mount_partition() {
 	partition_mountpoint=$2
 	[ "$debug" = "y" ] && echo "mount device: '$partition_dev_path' to '$partition_mountpoint'"
 	if ! mountpoint -q "${partition_mountpoint}"; then
+		mkdir -p "${partition_mountpoint}"
 		if ! mount -t "$(get_fstype "${partition_dev_path}")" "${partition_dev_path}" \
 			 "${partition_mountpoint}"; then
 			panic "Can't mount partition '${partition_dev_path}'!"