#!/bin/sh
# SeokYeon Hwang (syeon.hwang@samsung.com)

COLOR='\033[1;34m' # light blue
NO_COLOR='\033[0m'

echo -e "${COLOR}Mount proc filesystem${NO_COLOR}"
mount -t proc proc /proc

echo -e "${COLOR}Mount emulator image${NO_COLOR}"
mount -o rw /dev/vda /new_root

echo -e "${COLOR}Mount dev filesystem${NO_COLOR}"
/bin/mkdir -p /new_root/dev
/bin/mount -t devtmpfs devtmpfs /new_root/dev
/bin/mkdir -p /new_root/sys

echo -e "${COLOR}Switching root${NO_COLOR}"
exec switch_root -c /dev/console /new_root /sbin/init
