#!/bin/sh
set -eu

# Debian's 14remove-live-packages has dropped the live boot dependencies.
# Keep BusyBox if the target still needs it, e.g. for an encrypted root.
if in-target dpkg --no-act --purge busybox; then
    in-target dpkg --purge busybox
else
    logger -t finish-install "Keeping BusyBox because the target's dpkg purge check failed."
fi
