#!/bin/sh

MINOR_NUM="$1"

LOOPDIR="/sys/block/loop${MINOR_NUM}/loop"

if [ -d "$LOOPDIR" ]; then
  printf "disk/by-backingfile/"
  systemd-escape --path "$(cat "$LOOPDIR"/backing_file)"
fi
