This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
lsts_glued/systems/lauv-aux/files/initramfs_init.sh
2015-02-12 15:10:35 +00:00

24 lines
450 B
Bash
Executable File

#!/bin/sh
export PATH=/bin
mount -t proc proc /proc
mount -t sysfs sysfs /sys
mount -t devtmpfs devtmpfs /dev
while [ 1 ]; do
dev="$(ls /sys/devices/ocp.3/481d8000.mmc/mmc_host/mmc?/mmc?:*/block 2> /dev/null)"
if [ -n "$dev" ]; then
mount -o ro -t ext2,relatime "/dev/${dev}p2" /mnt && break
fi
usleep 100000
done
umount /sys /proc /dev
exec switch_root /mnt /sbin/init
echo "ERROR: failed to switch root"
exec /bin/sh