#!/bb/ash
/bb/mount proc
/bb/grep -qw multivt /proc/cmdline && /bb/sed -i s/^#tty/tty/ /etc/inittab
if ! /bb/grep -qw noembed /proc/cmdline; then
  /bb/mount / -o remount,size=90%
  /bb/umount proc
  exec /bb/init
fi
/bb/umount proc
if /bb/mount -t tmpfs -o size=90% tmpfs /mnt; then
  if /bb/tar -C / --exclude=mnt -cf - . | /bb/tar -C /mnt/ -xf - ; then
    /bb/mkdir /mnt/mnt
    exec /bb/switch_root mnt /bb/init
  fi
fi
exec /bb/init
