#!/bin/sh
# MODULES=dep keeps only the drivers of the current boot disk.
# Add the drivers of all usual boot disks. Then a copy of the system
# to another disk (USB to NVMe, SATA, eMMC) can boot.
PREREQ=""
prereqs() { echo "$PREREQ"; }
case "$1" in
prereqs)
	prereqs
	exit 0
	;;
esac

[ "$MODULES" = dep ] || exit 0

. /usr/share/initramfs-tools/hook-functions
# Missing modules are skipped.
# eMMC hosts: sdhci-acpi (x86 Bay Trail, Cherry Trail), and the SoC hosts
# of uefi-arm64 (Rockchip, RK3399 Arasan, Amlogic).
manual_add_modules nvme vmd ahci ahci_platform sd_mod uas usb-storage \
	xhci-pci xhci-plat-hcd mmc_block sdhci-pci sdhci-acpi \
	sdhci-of-arasan sdhci-of-dwcmshc dw_mmc-rockchip meson-gx-mmc
