Files
Arch-R/packages/sysutils/busybox/scripts/init.initramfs
2009-03-23 03:13:41 +01:00

29 lines
881 B
Bash
Executable File

#!/bin/sh
/bin/busybox mount -t proc none /proc
/bin/busybox mount -t sysfs none /sys
BOOT=`/bin/busybox cat /proc/cmdline | /bin/busybox sed 's/.*boot=// ; s/ .*//'`
DISK=`/bin/busybox cat /proc/cmdline | /bin/busybox sed 's/.*disk=// ; s/ .*//'`
/bin/busybox mdev -s
/bin/busybox mount -t ext3 -o ro,noatime $BOOT /flash
/bin/busybox mount -t ext3 -o rw,noatime $DISK /storage
if [ -f "/flash/openelec.system" ]; then
/bin/busybox mount /flash/openelec.system /sysroot
if [ $? -ne 0 ] ; then
echo Could not mount system on /sysroot. Starting debugging shell....
/bin/busybox sh </dev/tty1 >/dev/tty1 2>&1
fi
fi
/bin/busybox mount --bind /flash /sysroot/flash
/bin/busybox mount --bind /storage /sysroot/storage
/bin/busybox umount /proc
/bin/busybox umount /sys
exec /bin/busybox switch_root /sysroot /sbin/init.system