eudev: fix

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium 2024-08-17 15:14:03 +02:00
parent 3cd76ed68e
commit f3ab0c3398

View File

@ -9,7 +9,9 @@
if [ "${1}" = "early" ]; then
echo "Installing addon eudev - ${1}"
tar -zxf /addons/eudev-7.1.tgz -C /
[ ! -L "/usr/sbin/modprobe" ] && ln -vsf /usr/bin/kmod /usr/sbin/modprobe
[ ! -L "/usr/sbin/modinfo" ] && ln -vsf /usr/bin/kmod /usr/sbin/modinfo
[ ! -L "/usr/sbin/depmod" ] && ln -vsf /usr/bin/kmod /usr/sbin/depmod
elif [ "${1}" = "modules" ]; then
echo "Installing addon eudev - ${1}"
@ -33,30 +35,12 @@ elif [ "${1}" = "modules" ]; then
# Remove from memory to not conflict with RAID mount scripts
/usr/bin/killall udevd
# Remove kvm module
/usr/sbin/lsmod 2>/dev/null | grep -q ^kvm_intel && /usr/sbin/rmmod kvm_intel || true # kvm-intel.ko
/usr/sbin/lsmod 2>/dev/null | grep -q ^kvm_amd && /usr/sbin/rmmod kvm_amd || true # kvm-amd.ko
/usr/sbin/lsmod 2>/dev/null | grep -q ^kvm && /usr/sbin/rmmod kvm || true
/usr/sbin/lsmod 2>/dev/null | grep -q ^irqbypass && /usr/sbin/rmmod irqbypass || true
# getty
# Find the getty setting in cmdline
for I in $(cat /proc/cmdline 2>/dev/null | grep -oE 'getty=[^ ]+' | sed 's/getty=//'); do
TTYN="$(echo "${I}" | cut -d',' -f1)"
BAUD="$(echo "${I}" | cut -d',' -f2 | cut -d'n' -f1)"
echo "ttyS0 ttyS1 ttyS2" | grep -qw "${TTYN}" && continue
if [ -n "${TTYN}" ] && [ -e "/dev/${TTYN}" ]; then
echo "Starting getty on ${TTYN}"
if [ -n "${BAUD}" ]; then
/usr/sbin/getty -L "${TTYN}" "${BAUD}" linux &
else
/usr/sbin/getty -L "${TTYN}" linux &
fi
fi
done
/usr/sbin/lsmod 2>/dev/null | grep -q ^kvm_intel && /usr/sbin/modprobe -r kvm_intel || true # kvm-intel.ko
/usr/sbin/lsmod 2>/dev/null | grep -q ^kvm_amd && /usr/sbin/modprobe -r kvm_amd || true # kvm-amd.ko
elif [ "${1}" = "late" ]; then
echo "Installing addon eudev - ${1}"
# [ ! -L "/tmpRoot/usr/sbin/modprobe" ] && ln -vsf /usr/bin/kmod /tmpRoot/usr/sbin/modprobe
[ ! -L "/tmpRoot/usr/sbin/modinfo" ] && ln -vsf /usr/bin/kmod /tmpRoot/usr/sbin/modinfo
[ ! -L "/tmpRoot/usr/sbin/depmod" ] && ln -vsf /usr/bin/kmod /tmpRoot/usr/sbin/depmod
@ -100,15 +84,11 @@ elif [ "${1}" = "late" ]; then
[ "${isChange}" = "true" ] && /usr/sbin/depmod -a -b /tmpRoot
# Restore kvm module
/usr/sbin/insmod /usr/lib/modules/irqbypass.ko || true
/usr/sbin/insmod /usr/lib/modules/kvm.ko || true
/usr/sbin/insmod /usr/lib/modules/kvm-intel.ko || true # kvm-intel.ko
/usr/sbin/insmod /usr/lib/modules/kvm-amd.ko || true # kvm-amd.ko
/usr/sbin/modprobe kvm_intel || true # kvm-intel.ko
/usr/sbin/modprobe kvm_amd || true # kvm-amd.ko
echo "Copy rules"
cp -vf /usr/lib/udev/rules.d/* /tmpRoot/usr/lib/udev/rules.d/
echo "Copy hwdb"
cp -vf /etc/udev/hwdb.d/* /tmpRoot/usr/lib/udev/hwdb.d/
mkdir -p "/tmpRoot/usr/lib/systemd/system"
DEST="/tmpRoot/usr/lib/systemd/system/udevrules.service"