#!/bin/busybox sh
/bin/busybox mkdir /proc /sys /flash /sysroot
/bin/busybox --install -s
PATH="/bin"
mount -t devtmpfs none /dev
mount -t proc none /proc
mount -t sysfs none /sys
mkdir /dev/pts && mount -t devpts devpts /dev/pts

mount -t ext4 /dev/hdb1 /flash || sh
. /flash/bootconfig.txt

mount -t squashfs /flash/"$ROOTIMG" /sysroot || sh

mount --move /flash /sysroot/flash
mount --bind /sysroot/flash/rw /sysroot/rw
mount --bind /sysroot/flash/extensions /sysroot/extensions
exec switch_root /sysroot /sbin/init
sh
