#!/usr/bin/env bash set -ex # Check if repart is installed, and if it isn't bail out early instead of failing if ! test -x /usr/bin/systemd-repart ; then echo OK > /testok exit 0 fi systemd-analyze log-level debug truncate -s 1G /tmp/zzz SEED=e2a40bf9-73f1-4278-9160-49c031e7aef8 systemd-repart /tmp/zzz --empty=force --dry-run=no --seed=$SEED sfdisk -d /tmp/zzz | grep -v -e 'sector-size' -e '^$' > /tmp/empty cmp /tmp/empty - < /tmp/definitions/root.conf < /tmp/definitions/home.conf < /tmp/definitions/swap.conf < /tmp/populated cmp /tmp/populated - < /tmp/definitions/swap.conf < /tmp/definitions/extra.conf < /tmp/populated2 cmp /tmp/populated2 - < /tmp/populated3 cmp /tmp/populated3 - < /testok exit 0