asahi-opensuse/kiwi/root/usr/lib/dracut/modules.d/99asahi-firmware/module-setup.sh

37 lines
889 B
Bash
Raw Permalink Normal View History

2023-01-04 12:53:18 +03:00
#!/bin/sh
# SPDX-License-Identifier: MIT
# called by dracut
check() {
if [ -n "$hostonly" ] && [ ! -e /proc/device-tree/chosen/asahi,efi-system-partition ]; then
return 0
elif [ -z "$hostonly" ]; then
return 0
else
return 255
fi
}
# called by dracut
depends() {
echo fs-lib
return 0
}
# called by dracut
installkernel() {
instmods apple-mailbox nvme-apple
}
# called by dracut
install() {
inst_dir "/lib/firmware"
ln_r "/vendorfw" "/lib/firmware/vendor"
asahiscriptsdir="/usr/share/asahi-scripts"
inst_dir $asahiscriptsdir
$DRACUT_CP -R -L -t "${initdir}/${asahiscriptsdir}" "${dracutsysrootdir}${asahiscriptsdir}"/*
inst_multiple cpio cut dirname grep modprobe mount seq sleep umount
inst_hook pre-udev 10 "${moddir}/load-asahi-firmware.sh"
inst_hook cleanup 99 "${moddir}/install-asahi-firmware.sh"
}