#!/bin/sh

source ${CONF_DIR}/config;

if [ "X${CONFIG_ROOTFS_DEVICE_NFS}" == "Xy" ]; then
	/bin/mount /rootfs -o remount,rw
	if [ "X$?" != "X0" ]; then
		echo "ERROR: failed to remount rootfs read-write.";
	fi
	if [ -r /etc/resolv.conf ]; then
		cp /etc/resolv.conf /rootfs/etc/resolv.conf;
		if [ "X$?" != "X0" ]; then
			echo -ne "ERROR\nFailed to copy DNS configuration onto rootfs.\n";
		fi
	fi
	echo -ne "done\n";
	/bin/mount /rootfs -o remount,ro
	if [ "X$?" != "X0" ]; then
		echo "ERROR: failed to remount rootfs read-only.";
	fi
fi
