deal with that stinkin cdist marker thinggy

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
Steven Armstrong 2015-07-10 16:39:27 +02:00
parent 9ad203c744
commit d05f11b0b8
1 changed files with 5 additions and 2 deletions

View File

@ -20,7 +20,7 @@
get_type_from_mkfs() {
_device="$1"
for mkfs_object in $(find "$__global/object/__install_mkfs" -path "*.cdist"); do
for mkfs_object in $(find "$__global/object/__install_mkfs" -type d -name "$__cdist_object_marker"); do
mkfs_device="$(cat "$mkfs_object/parameter/device")"
if [ "$_device" = "$mkfs_device" ]; then
cat "$mkfs_object/parameter/type"
@ -42,7 +42,10 @@ else
# store for later use by others
echo "$type" > "$__object/parameter/type"
fi
[ -n "$type" ] || die "Can't determine type for $__object"
[ -n "$type" ] || {
echo "Can't determine type for $__object" >&2
exit 1
}
if [ "$type" = "swap" ]; then
echo "swapon \"$device\""
else