summaryrefslogtreecommitdiffstats
path: root/builder
diff options
context:
space:
mode:
Diffstat (limited to 'builder')
-rwxr-xr-xbuilder/modules.d/dnbd3-rootfs/hooks/prepare-root-partition.sh23
1 files changed, 16 insertions, 7 deletions
diff --git a/builder/modules.d/dnbd3-rootfs/hooks/prepare-root-partition.sh b/builder/modules.d/dnbd3-rootfs/hooks/prepare-root-partition.sh
index 3e93253f..fc8ee828 100755
--- a/builder/modules.d/dnbd3-rootfs/hooks/prepare-root-partition.sh
+++ b/builder/modules.d/dnbd3-rootfs/hooks/prepare-root-partition.sh
@@ -16,16 +16,25 @@ logging.set_level debug
logging.set_log_file "$SLX_LOG_FILE_PATH"
# region find writable partition
-if [[ "$SLX_WRITABLE_DEVICE_IDENTIFIER" != '' ]] &&
- ! persistent_device="$(
- tools.find_block_device "$SLX_WRITABLE_DEVICE_IDENTIFIER" '' \
- "$SLX_WRITABLE_DEVICE_IDENTIFIER_TIMEOUT_IN_SECONDS"
- )"
-then
- logging.warn "Failed to find unique device with identifier" \
+# support comma-separated list of identifiers
+IFS_backup="$IFS"
+IFS=','
+for identifier in $SLX_WRITABLE_DEVICE_IDENTIFIER; do
+ if [[ "$identifier" != '' ]] &&
+ persistent_device="$(
+ tools.find_block_device "$identifier" '' \
+ "$SLX_WRITABLE_DEVICE_IDENTIFIER_TIMEOUT_IN_SECONDS")"; then
+ break
+ fi
+ persistent_device=
+done
+IFS="$IFS_backup"
+if [ -z "$persistent_device" ]; then
+ logging.warn "Failed to find unique device with identifiers" \
"\"${SLX_WRITABLE_DEVICE_IDENTIFIER}\"; matched devices:" \
"\"${persistent_device}\""
fi
+
if [ -n "$SLX_WRITABLE_DEVICE_STORAGE_FILE_PATH" ] && [ -n "$persistent_device" ]
then
persistent_mountpoint=/mnt/slx_writable_device