# Replacement for the Debian/099-mount-cdrom script in the official ltsp
# package.  Having the file here is a workaround for #606313,
# triggered when using USB sticks with CD isos.
case "$MODE" in
    commandline)
        add_option "mount-cdrom" "`eval_gettext "mounts CDROM before installation"`" "advanced" "false"
        ;;
    configure)
        if [ -n "$option_mount_cdrom_value" ]; then
            MOUNT_CDROM="true"
        fi
        ;;
    before-install)
        if [ "$MOUNT_CDROM" = "true" ]; then
            if mount /media/cdrom ; then
                :
            else
                echo "unble to mount cdrom, trying to continue"
                MOUNT_CDROM=false
            fi
        fi
        ;;
    finalization)
        if [ "$MOUNT_CDROM" = "true" ]; then
            umount /media/cdrom
        fi
        ;;
esac
