From 456757b85f2588017c5c3e4f04bc2ee9260eabe6 Mon Sep 17 00:00:00 2001 From: Sebastian Krzyszkowiak Date: Sun, 24 Jan 2021 06:21:44 +0100 Subject: [PATCH] init: Add optional sleep before creating device nodes Some devices may need a bit of time to initialize their peripherals (like the SD card on the Librem 5). --- initramfs/init | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/initramfs/init b/initramfs/init index f538243..3b2e1f8 100755 --- a/initramfs/init +++ b/initramfs/init @@ -40,6 +40,11 @@ if [ -n "$LED" ]; then echo $TRIGGER > /sys/class/leds/$LED/trigger fi +if [ -n "$SLEEP" ]; then + echo "Waiting for hardware to initialize..." + sleep $SLEEP +fi + # Create device nodes echo "Creating device nodes..." mknod /dev/null c 1 3