#!/bin/bash
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
# SPDX-FileCopyrightText: 2023-2024 Harald Sitter <sitter@kde.org>

build() {
    map add_binary \
        /usr/lib/systemd/systemd-volatile-root \
        /usr/lib/rootfs-transition \
        /usr/lib/btrfs-migrator \
        /usr/lib/systemd/system-generators/00-kde-linux-os-release \
        /usr/lib/systemd/system-generators/kde-linux-live-generator \
        /usr/lib/systemd/system-generators/kde-linux-mount-generator \
        /usr/lib/systemd/systemd-bootchart \
        /usr/lib/etc-factory \
        /usr/bin/btrfs

    map add_systemd_unit \
        systemd-volatile-root.service \
        systemd-bootchart.service \
        etc-factory.service

    # Make double sure the dissection rule is present. Without it booting doesn't work because we can't find a root.
    # Notably not getting added by the release initcpio combined with aur systemd-git at the time of writing.
    map add_udev_rule \
        90-image-dissect.rules
}
