Skip to content

Commit

Permalink
initramfs: wait for sdcard device
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilioPeJu committed Sep 12, 2024
1 parent ef47480 commit 0c40b2a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions initramfs/init
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ IMAGEFILE=/boot/imagefile.cpio.gz


# Get our basic working environment up.
mount -t devtmpfs devtmpfs /dev
mount -t proc proc /proc
mount -t sysfs sysfs /sys
mdev -s


# This is called if something goes horribly wrong.
panic()
Expand All @@ -31,6 +30,10 @@ set -x
/sbin/led-daemon &
LED_DAEMON_PID=$!

while [ ! -e /dev/mmcblk0 ]; do
echo "Waiting for /dev/mmcblk0 to appear"
sleep 1
done

# Mounting /boot isn't altogether straightforward as the SD card may or may not
# be partitioned, so we have to try both mmcblk0p1 and mmcblk0
Expand Down Expand Up @@ -276,4 +279,5 @@ sync
umount /boot
umount /sys
umount /proc
umount /dev
exec switch_root -c /dev/console /rootfs /sbin/init

0 comments on commit 0c40b2a

Please sign in to comment.