#!/bin/sh
if [ -d /usr/lib/x86_64-linux-gnu ]; then # Debian style
	IMPLIBDIR=lib/x86_64-linux-gnu
else
	IMPLIBDIR=lib64
fi
dracut_install mktemp
dracut_install /$IMPLIBDIR/libtss2-tcti-device.so.0
dracut_install tpm2_create tpm2_pcrread tpm2_createpolicy tpm2_createprimary
dracut_install tpm2_load tpm2_unseal tpm2_getcap tpm2_evictcontrol
dracut_install tpm2_pcrextend tpm2_policypcr tpm2_flushcontext tpm2_startauthsession
dracut_install openssl tar ipmitool cpio zstd xz gzip lsmod ethtool
dracut_install modprobe touch echo cut wc bash uniq grep ip hostname
dracut_install awk egrep dirname bc expr sort
dracut_install ssh sshd vi reboot lspci parted tmux mkfs mkfs.ext4 mkfs.xfs xfs_db mkswap
if [ -x /usr/libexec/openssh/sftp-server ]; then
    dracut_install /usr/libexec/openssh/sftp-server
else
    dracut_install /usr/lib/sftp-server
fi
dracut_install efibootmgr
dracut_install du df ssh-keygen scp clear dhclient lldpd lldpcli tee
dracut_install /$IMPLIBDIR/libnss_dns.so.2 /$IMPLIBDIR/libnss_dns.so.2 /$IMPLIBDIR/libnss_myhostname.so.2
dracut_install ldd uptime /usr/$IMPLIBDIR/libnl-3.so.200
dracut_install poweroff date /etc/nsswitch.conf /etc/services /etc/protocols
dracut_install  /usr/share/terminfo/x/xterm /usr/share/terminfo/l/linux /usr/share/terminfo/v/vt100 /usr/share/terminfo/x/xterm-color /usr/share/terminfo/s/screen /usr/share/terminfo/x/xterm-256color /usr/share/terminfo/p/putty-256color /usr/share/terminfo/p/putty /usr/share/terminfo/d/dumb
dracut_install chmod whoami head tail basename ping tr /usr/share/hwdata/usb.ids
if [ -e /etc/redhat-release ]; then
	dracut_install /etc/redhat-release
fi
dracut_install dmidecode /usr/$IMPLIBDIR/libstdc++.so.6
dracut_install ps free find
inst /bin/bash /bin/sh
#inst_hook cmdline 10 $moddir/cmdline.sh # moved to addons.cpio
dracut_install killall chown chroot dd expr kill parted rsync shutdown sort blockdev findfs insmod lvm
if [ -e /etc/udev/hwdb.bin ]; then
	dracut_install /etc/udev/hwdb.bin
else
	dracut_install /usr/lib/udev/hwdb.bin
fi

dracut_install /usr/share/hwdata/pci.ids
dracut_install ibstat ibstatus
dracut_install /usr/lib/udev/rules.d/*-dm.rules /usr/sbin/dmsetup /usr/lib/udev/rules.d/95-dm-notify.rules
#dracut_install opainfo
#dracut_install /usr/lib/opa-fm/bin/opafmd
#dracut_install /usr/sbin/opensm /usr/libexec/opensm-launch
dracut_install /usr/$IMPLIBDIR/libibverbs/libhfi1verbs-rdmav34.so /etc/libibverbs.d/hfi1verbs.driver /etc/libibverbs.d/mlx4.driver /etc/libibverbs.d/mlx5.driver /usr/$IMPLIBDIR/libibverbs/libmlx4-rdmav34.so /usr/$IMPLIBDIR/libibverbs/libmlx5-rdmav34.so
if [ -x /usr/libexec/openssh/sshd-session ]; then
    dracut_install /usr/libexec/openssh/sshd-session
fi
if [ -e /usr/lib/dracut/modules.d/40network/net-lib.sh ]; then
    inst /usr/lib/dracut/modules.d/40network/net-lib.sh /lib/net-lib.sh
else
    inst /usr/lib/dracut/modules.d/45net-lib/net-lib.sh /lib/net-lib.sh
fi
if [ -e /etc/crypto-policies/back-ends/opensslcnf.config ]; then
    dracut_install /etc/crypto-policies/back-ends/opensslcnf.config
fi

#dracut_install mstflint This would have mlx update support, but it incurs gigantic dependencies, libicudata
