summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2024-06-14 11:02:12 +0200
committerSimon Rettberg2024-06-14 11:02:12 +0200
commit652efeae7824cb2d6b559800290f70ea5809c678 (patch)
tree4ce0b3660edde0e7e5bbf6251949ef1985eceb3c
parent[slx-addons] find: Use "\!" instead of "-not" for busybox compat (diff)
downloadsystemd-init-652efeae7824cb2d6b559800290f70ea5809c678.tar.gz
systemd-init-652efeae7824cb2d6b559800290f70ea5809c678.tar.xz
systemd-init-652efeae7824cb2d6b559800290f70ea5809c678.zip
[slx-dmsetup] busybox mktemp needs AT LEAST 6 X -.-
-rwxr-xr-xmodules.d/slx-dmsetup/hooks/dmsetup-slx-device10
1 files changed, 6 insertions, 4 deletions
diff --git a/modules.d/slx-dmsetup/hooks/dmsetup-slx-device b/modules.d/slx-dmsetup/hooks/dmsetup-slx-device
index cf220f8d..9fde7e3e 100755
--- a/modules.d/slx-dmsetup/hooks/dmsetup-slx-device
+++ b/modules.d/slx-dmsetup/hooks/dmsetup-slx-device
@@ -247,8 +247,8 @@ ramdisk_fallback() {
# create sparse file there
local file="$cow_tmpfs/thinpool.meta"
if ! truncate -s "$(( read_only_device_sz * 512 ))" "$file" \
- && ! dd if=/dev/null of="$file" seek="$read_only_device_sz" bs=512 2> /dev/null; then
- emergency_shell "Failed to allocate CoW file $file."
+ && ! dd if=/dev/null of="$file" seek="$read_only_device_sz" bs=512; then
+ emergency_shell "Failed to allocate RAMdisk CoW file $file."
fi
declare -rg writable_device="$( losetup --show --find "$file" )"
local cow_device_candidate="root"
@@ -387,9 +387,11 @@ create_pool() {
fi
if [ -z "$metadata_dev" ]; then
# create RAMdisk in /run for metadata device
- metadata_dev="$( mktemp /run/openslx/.pool-metadata.XXXXX )"
+ mkdir -p /run/openslx
+ metadata_dev="$( mktemp /run/openslx/.pool-metadata.XXXXXX )"
# Create sparse file of required size
- dd if=/dev/null of="$metadata_dev" bs=512 seek="$metadata_dev_sz" 2> /dev/null
+ truncate -s "$(( metadata_dev_sz * 512 ))" "$metadata_dev" \
+ || dd if=/dev/null of="$metadata_dev" bs=512 seek="$metadata_dev_sz"
declare -r metadata_dev="$( losetup --show --find "$metadata_dev" )"
fi
if [ -z "$metadata_dev" ]; then