case "$MODE" in
    commandline)
        add_option "squashfs-image" "`eval_gettext "create squashfs image for use with NBD"`" "advanced" "false"
        add_option "no-squashfs-image" "`eval_gettext "skip squashfs image creation"`" "advanced" "false"
        add_option "nfs-root" "`eval_gettext "use NFS instead of NBD as default"`" "advanced" "false"
        ;;
    configure)
        if [ -n "$option_squashfs_image_value" ]; then
            # set an environment variable we can pick up later
            SQUASHFS_IMAGE="True"
        fi
        if [ -n "$option_no_squashfs_image_value" ]; then
            # set an environment variable we can pick up later
            SQUASHFS_IMAGE="False"
        fi
        if [ -n "$option_nfs_root_value" ]; then
            # set an environment variable we can pick up later
            NFS_ROOT="True"
        fi
        if [ -z "$SQUASHFS_IMAGE" ]; then
            SQUASHFS_IMAGE="True"
        fi
        ;;
    after-install)
        if [ "True" = "$NFS_ROOT" ]; then
            mkdir -p $ROOT/etc/ltsp/update-kernels.conf.d
            echo 'BOOT_METHODS="NFS NBD AOE"' > $ROOT/etc/ltsp/update-kernels.conf.d/nfs
        fi
        ;;
    finalization)
        if [ "True" = "$SQUASHFS_IMAGE" ]; then
            DEBIAN_OLD_FRONTEND=$DEBIAN_FRONTEND

            if [ -n "$CHROOT" ]; then
                UPDATE_IMAGE_OPTIONS="${CHROOT}"
            fi

            DEBIAN_FRONTEND=noninteractive
            export DEBIAN_FRONTEND

            /usr/sbin/ltsp-update-image --config-nbd ${UPDATE_IMAGE_OPTIONS}

            DEBIAN_FRONTEND=$DEBIAN_OLD_FRONTEND
            export DEBIAN_FRONTEND

        fi
        ;;
esac
