#!/usr/bin/env bash # SPDX-License-Identifier: LGPL-2.1-or-later set -euxo pipefail DM_NAME="integrity_test" DM_NODE="/dev/mapper/${DM_NAME}" DM_SERVICE="systemd-integritysetup@${DM_NAME}.service" FS_UUID="01234567-ffff-eeee-eeee-0123456789ab" TMP_DIR= LOOP= cleanup() ( set +e if [[ -n "${LOOP}" ]]; then losetup -d "${LOOP}" fi if [[ -n "${TMP_DIR}" ]]; then rm -rf "${TMP_DIR}" fi rm -rf /run/udev/rules.d/ udevadm control --reload ) trap cleanup EXIT udevadm settle # Enable debugging logs for loop and dm block devices. mkdir -p /run/udev/rules.d/ cat >/run/udev/rules.d/00-integrity-test.rules </run/udev/rules.d/99-priority.rules <"/etc/integritytab" <