case "$MODE" in
    after-install)
    	    mkdir $ROOT/image
            cat <<EO\F >> $ROOT/etc/rc.d/rc.sysinit
SQUASH_ROOT=`grep " / squashfs " /proc/mounts`
if [ -n "$SQUASH_ROOT" ]; then
        #echo "squash root detecting"
        LOOP_DEV_ROOT=`echo $SQUASH_ROOT |cut -f1 -d' '`
        if [ -n "$LOOP_DEV_ROOT" ] && echo $LOOP_DEV_ROOT |grep -q '/loop'; then
                #echo "loop device: $LOOP_DEV_ROOT"
                LOOP_INFO=`losetup $LOOP_DEV_ROOT`
                if [ -n "$LOOP_INFO" ]; then
                        SQUASH_IMG=`echo $LOOP_INFO |sed -r -e 's/.* \((.*)\)/\1/'`
                        if [ -n "$SQUASH_IMG" -a -e "$SQUASH_IMG" ]; then
                                #echo "found squash root image: $SQUASH_IMG"
                                if [ -e "$SQUASH_IMG.lts.conf" ]; then
                                        #echo "found lts.conf for squash root image"
                                        action "Use external lts.conf" ln -sf "$SQUASH_IMG.lts.conf" /etc/lts.conf
                                fi
                        fi
                fi
        fi
fi
EOF
		sed -i -e '/export SERVER=/i\
    [ -z "$server" ] && server=$(grep " /image nfs " /proc/mounts | cut -d: -f1)' \
    			$ROOT/usr/share/ltsp/ltsp_config
	;;
esac