case "$MODE" in
    after-install)
	cat <<EO\F > $ROOT/etc/rc.d/scripts/aufs_remount
#!/bin/sh
remount_aufs() {
	[ -d "$1" ] || return 0
	mkdir -p -- "/tmp/root$1"
	mount -n -taufs -o dirs="/tmp/root$1=rw:$1=ro" "/tmp/root$1" "$1"
}
mount -n -t tmpfs -o nosuid tmpfs /tmp
for mpoint in /etc /media /usr /var /lib /bin /sbin /home /root /mnt; do
	remount_aufs "$mpoint"
done
EOF
	chmod +x $ROOT/etc/rc.d/scripts/aufs_remount
	echo "REMOUNT_ROOTFS_RW_COMMAND=/etc/rc.d/scripts/aufs_remount" >> "$ROOT"/etc/sysconfig/init
	sed -i -e '/^root_write_method=/aroot_write_method="aufs"' $ROOT/etc/default/ltsp-client-setup
	sed -i -e '/127.0.0.1 localhost.*hosts$/c\
		rm -f /etc/hosts\
		touch /etc/hosts\
		echo "127.0.0.1 localhost" >> /etc/hosts' \
	-e '/search $SEARCH_DOMAIN.*resolv.conf$/c\
		echo "search $SEARCH_DOMAIN" >> /etc/resolv.conf' \
	-e '/configure_fstab \+|| \+true/d' \
	-e '/root_write_method.*&& bind_unmounts/a    true' $ROOT/etc/init.d/ltsp-client-setup
	;;
esac