#!/bin/sh

export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

# Configure everything before running GCS
# Set up mounts

mount -t proc proc /proc
mount -t sysfs sysfs /sys
mount -t devtmpfs udev /dev
mount -t tmpfs tmpfs /run
mount -t cgroup cgroup /sys/fs/cgroup

mkdir /dev/mqueue
mount -t mqueue mqueue /dev/mqueue
mkdir /dev/pts
mount -t devpts devpts /dev/pts
mkdir /dev/shm
mount -t tmpfs shm /dev/shm

# Run gcs in the background
cd /bin
./gcs  -loglevel=debug -logfile=/tmp/gcs.log &
cd -
sh
