#!/bin/bash

tgt=""
dev=""
fs_path=""

while true; do
  case "$1" in
    --target*)
      tgt="${1/*=}"
      shift
      ;;
    --device)
      shift
      if [[ "$1" =~ ^-- ]]; then
        continue
      fi
      dev="$1"
      shift
      ;;
    *)
      fs_path="$1"
      break
      ;;
  esac
done

case "$tgt" in
  fs_uuid)
    if [ "$dev" == "/dev/mapper/system-root" ]; then
      echo "57661279-251b-441f-8416-d546f724b42c"
    fi
    if [ "$dev" == "/dev/mapper/system-boot" ]; then
      echo "20424ea7-7a44-4d71-a1c1-72f25c232cea"
    fi
    ;;
  fs)
    exit 0
    ;;
  partuuid)
    exit 0
    ;;
  device)
    if [ "$fs_path" == "/" ]; then
      echo "/dev/mapper/system-root"
    fi
    if [ "$fs_path" == "/boot" ]; then
      echo "/dev/mapper/system-boot"
    fi
    ;;
esac

