#! /bin/sh

PATH=/lib/init:/sbin:/bin
. /lib/init/vars.sh

. /lib/lsb/init-functions
. /lib/init/mount-functions.sh

[ -f /etc/default/tmpfs ] && . /etc/default/tmpfs

do_start () {
    echo "remounting root as ro"
    mount -o remount,ro /
    echo "mountig special fs"
    mount /rw
    mount /ram
    echo "unpacking ramdisk"
    cd /ram
    tar xfz /ram.tar.gz
}

case "$1" in
  "")
	echo "Warning: mountkernfs should be called with the 'start' argument." >&2
	do_start
	;;
  start)
	do_start
	;;
  restart|reload|force-reload)
	echo "Error: argument '$1' not supported" >&2
	exit 3
	;;
  stop)
	# No-op
	;;
  *)
	echo "Usage: mountkernfs [start|stop]" >&2
	exit 3
	;;
esac

