From 48f8720a232febb5c207cbf058bc3add837af102 Mon Sep 17 00:00:00 2001 From: Gabriel Valcazar Date: Wed, 17 Jun 2020 17:18:46 +0200 Subject: [PATCH] recovery-initramfs: register mdev regardless of /proc/sys/kernel/hotplug Busybox's device manager mdev was originally meant to be set up by writing its path to /proc/sys/kernel/hotplug before launching it, but that entry no longer exists in Linux v5.4's procfs and mdev can be launched directly. Since mdev is the element in the recovery initramfs that is in charge of mounting all partitions where .swu packages can be found (update partition on the eMMC/MTD, uSD and USB), checking for the existence of the hotplug entry in the procfs before launching mdev in v5.4 was preventing the partitions from being mounted, and causing all software updates to fail. While at it, move the two second delay to before mdev is launched, so all partitions can be mounted. Otherwise, some devices such as the USB might not be ready when mdev is launched, causing its partition to not be mounted. https://jira.digi.com/browse/DEL-7143 Signed-off-by: Gabriel Valcazar --- .../recovery-initramfs/recovery-initramfs-init | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init b/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init index f3b74bd0e..02c590551 100644 --- a/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init +++ b/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init @@ -374,17 +374,14 @@ mount -t sysfs sysfs /sys mount -t devtmpfs devtmpfs /dev mount -t tmpfs tmpfs /tmp -# Register mdev as device manager -if [ -f /proc/sys/kernel/hotplug ]; then - echo > /dev/mdev.seq - echo > /dev/mdev.log - echo "/sbin/mdev" > /proc/sys/kernel/hotplug - mdev -s -fi - -# Give some time for the devices to settle down +# Give some time for the devices to settle down so mdev can mount all of them sleep 2 +# Register mdev as device manager +echo > /dev/mdev.seq +echo > /dev/mdev.log +mdev -s + # Run all shell scripts in postinstall folder run-parts /etc/*-postinsts