From 072a4972cb746442632e052812b613a9334e0cac Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 2 May 2024 07:38:42 -0400 Subject: [PATCH] disk: Actually use losetup wrapper Chris noticed that the argument passing code didn't work, even though the end effect did work because we were injecting `--direct-io=off`. Signed-off-by: Colin Walters --- pkg/bootc/bootc_disk.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/bootc/bootc_disk.go b/pkg/bootc/bootc_disk.go index 9f38a75a..c8bd313c 100644 --- a/pkg/bootc/bootc_disk.go +++ b/pkg/bootc/bootc_disk.go @@ -38,14 +38,14 @@ const imageMetaXattr = "user.bootc.meta" // tempLosetupWrapperContents is a workaround for https://github.com/containers/bootc/pull/487/commits/89d34c7dbcb8a1fa161f812c6ba0a8b49ccbe00f const tempLosetupWrapperContents = `#!/bin/bash set -euo pipefail -args=() +args=(/usr/sbin/losetup --direct-io=off) for arg in "$@"; do case $arg in --direct-io=*) echo "ignoring: $arg" 1>&2;; - *) args+="$arg" ;; + *) args+=("$arg") ;; esac done -exec /usr/sbin/losetup "$@" --direct-io=off +exec "${args[@]}" ` // DiskImageConfig defines configuration for the