mirror of
https://github.com/AuxXxilium/arc-addons.git
synced 2024-11-23 21:50:52 +07:00
eudev: fix
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
parent
f93c32a20e
commit
870f77f05e
@ -9,34 +9,15 @@
|
|||||||
if [ "${1}" = "early" ]; then
|
if [ "${1}" = "early" ]; then
|
||||||
echo "Installing addon eudev - ${1}"
|
echo "Installing addon eudev - ${1}"
|
||||||
tar -zxf /addons/eudev-7.1.tgz -C /
|
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/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
|
elif [ "${1}" = "modules" ]; then
|
||||||
echo "Installing addon eudev - ${1}"
|
echo "Installing addon eudev - ${1}"
|
||||||
|
|
||||||
# mv -f /usr/lib/udev/rules.d/60-persistent-storage.rules /usr/lib/udev/rules.d/60-persistent-storage.rules.bak
|
/usr/sbin/lsmod 2>/dev/null | grep -q ^kvm_intel && /usr/sbin/modprobe -r kvm_intel || true # kvm-intel.ko
|
||||||
# mv -f /usr/lib/udev/rules.d/60-persistent-storage-tape.rules /usr/lib/udev/rules.d/60-persistent-storage-tape.rules.bak
|
/usr/sbin/lsmod 2>/dev/null | grep -q ^kvm_amd && /usr/sbin/modprobe -r kvm_amd || true # kvm-amd.ko
|
||||||
# mv -f /usr/lib/udev/rules.d/80-net-name-slot.rules /usr/lib/udev/rules.d/80-net-name-slot.rules.bak
|
|
||||||
[ -e /proc/sys/kernel/hotplug ] && printf '\000\000\000\000' >/proc/sys/kernel/hotplug
|
|
||||||
/usr/sbin/depmod -a
|
|
||||||
/usr/sbin/udevd -d || {
|
|
||||||
echo "FAIL"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
echo "Triggering add events to udev"
|
|
||||||
udevadm trigger --type=subsystems --action=add
|
|
||||||
udevadm trigger --type=devices --action=add
|
|
||||||
udevadm trigger --type=devices --action=change
|
|
||||||
udevadm settle --timeout=30 || echo "udevadm settle failed"
|
|
||||||
# Give more time
|
|
||||||
sleep 10
|
|
||||||
# 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
|
# getty
|
||||||
# Find the getty setting in cmdline
|
# Find the getty setting in cmdline
|
||||||
@ -57,6 +38,7 @@ elif [ "${1}" = "modules" ]; then
|
|||||||
elif [ "${1}" = "late" ]; then
|
elif [ "${1}" = "late" ]; then
|
||||||
echo "Installing addon eudev - ${1}"
|
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/modinfo" ] && ln -vsf /usr/bin/kmod /tmpRoot/usr/sbin/modinfo
|
||||||
[ ! -L "/tmpRoot/usr/sbin/depmod" ] && ln -vsf /usr/bin/kmod /tmpRoot/usr/sbin/depmod
|
[ ! -L "/tmpRoot/usr/sbin/depmod" ] && ln -vsf /usr/bin/kmod /tmpRoot/usr/sbin/depmod
|
||||||
|
|
||||||
@ -100,10 +82,8 @@ elif [ "${1}" = "late" ]; then
|
|||||||
[ "${isChange}" = "true" ] && /usr/sbin/depmod -a -b /tmpRoot
|
[ "${isChange}" = "true" ] && /usr/sbin/depmod -a -b /tmpRoot
|
||||||
|
|
||||||
# Restore kvm module
|
# Restore kvm module
|
||||||
/usr/sbin/insmod /usr/lib/modules/irqbypass.ko || true
|
/usr/sbin/modprobe kvm_intel || true # kvm-intel.ko
|
||||||
/usr/sbin/insmod /usr/lib/modules/kvm.ko || true
|
/usr/sbin/modprobe kvm_amd || true # kvm-amd.ko
|
||||||
/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
|
|
||||||
|
|
||||||
echo "Copy rules"
|
echo "Copy rules"
|
||||||
cp -vf /usr/lib/udev/rules.d/* /tmpRoot/usr/lib/udev/rules.d/
|
cp -vf /usr/lib/udev/rules.d/* /tmpRoot/usr/lib/udev/rules.d/
|
||||||
|
Loading…
Reference in New Issue
Block a user