#!/bin/busybox sh
set -e
/bin/busybox echo 'mounting /proc..'
/bin/busybox mount -t proc proc /proc
/bin/busybox echo 'mounting /sys..'
/bin/busybox mount -t sysfs sysfs /sys
/bin/busybox echo 'mounting /dev..'
/bin/busybox mount -t devtmpfs devtmpfs /dev
/bin/busybox echo 'creating root..'
/bin/busybox mkdir -p /newroot
/bin/busybox echo 'mounting root..'
/bin/busybox mount $(/bin/busybox findfs LABEL=ROOT) /newroot
#/bin/busybox echo 'moving /sys..'
#/bin/busybox mount --move /sys /newroot/sys
#/bin/busybox echo 'moving /dev..'
#/bin/busybox mount --move /dev /newroot/dev
#/bin/busybox echo 'moving /proc..'
#/bin/busybox mount --move /proc /newroot/proc
#/bin/busybox modprobe encryptfs
#/bin/busybox modprobe dm-crypt
/bin/busybox echo 'switching root..'
exec switch_root /newroot /lib/systemd/systemd --system

