#

XtremeVirtualRam(){
    if [ -f "$mountpoint/media/XtremeVirtualRam.swap" ]; then 
        [ -f "$rootfs/bin/swapwatch" ] && chmod +x "$rootfs/bin/swapwatch"
        echo "Xtreme Virtual Ram Mode Activate!  88 MPH!..." > /dev/tty0 
        swapon "$mountpoint/media/XtremeVirtualRam.swap" &> /dev/tty0
    else

        ok=1 

        #Configuration Variables
        swapSize="512MB" #512 MB page swap file specified for Installation 

        # TTY0 Color Codes
        Red="\e[33;0;31m"          # Red
        Green="\e[33;0;32m"        # Green
        Yellow="\e[33;0;33m"       # Yellow
        Cyan="\e[33;0;36m"         # Cyan
        White="\e[33;0;37m"        # White

        echo -e "${Green}***************************************" > /dev/tty0
        echo -e "${Green}*** Xtreme Virtual Ram Mode Activate!  88 MPH! ***" > /dev/tty0
        echo -e "${Green}***************************************" > /dev/tty0
        echo -e "${Yellow}  Execution: Swingflip/Xorloser; Concept: KMFDManic/madmonkey; Testing: bslenul/CaptSNES   " > /dev/tty0

        #echo -e "${Cyan}--DEBUG--${Green}" > /dev/tty0
        #ls -la $mountpoint/media > /dev/tty0 
        #lsblk > /dev/tty0
        #echo -e "${Cyan}--DEBUG--" > /dev/tty0
        
        [ -f "$rootfs/bin/swapwatch" ] && chmod +x "$rootfs/bin/swapwatch"

        echo -e "${Cyan}Checking USB/SD for conflicts!..." > /dev/tty0

        touch "$mountpoint/media/test" || ok=0
        rm "$mountpoint/media/test" || ok=0

        if [ "$ok" == "0" ]; then
            echo -e "${Green}[${Red}FAILED${Green}] The Borg have assimilated the USB/SD!  Failure to create the swap file! Rinse and repeat!" > /dev/tty0
            sleep 2 #Failure is not an option, Resistance is not futile.  Let's try again!
        else
            echo -e "${Cyan}Xtreme Virtual Ram Mode Activate!  88 MPH! (XtremeVirtualRam.swap)..." > /dev/tty0
            echo -e "${Yellow}512MB page swap file creation! Patience Daniel-San! Do not turn off Mini!${Green}" > /dev/tty0

            #Wanna see a magic trick!...
            fallocate -l $swapSize "$mountpoint/media/XtremeVirtualRam.swap" &> /dev/tty0 #512 MB page swap file specified for Installation
            dd if=/dev/zero of="$mountpoint/media/XtremeVirtualRam.swap" bs=1M count=512 &> /dev/tty0
            chmod 600 "$mountpoint/media/XtremeVirtualRam.swap" &> /dev/tty0
            mkswap "$mountpoint/media/XtremeVirtualRam.swap" &> /dev/tty0
            sync &> /dev/tty0

            if [ ! -f "$mountpoint/media/XtremeVirtualRam.swap" ]; then
                echo -e "${Green}[${Red}FAILED${Green}] The Borg have assimilated the USB/SD!  Failure to create the swap file! Rinse and repeat!" > /dev/tty0
                sleep 3 #Failure is not an option, Resistance is not futile.  Let's try again!
                return 99
            else
                echo -e "${Green}***************************************" > /dev/tty0
                echo -e "${Green}*** Xtreme Virtual Ram Mode Activate!  88 MPH! ***" > /dev/tty0
                echo -e "${Green}***************************************" > /dev/tty0
                echo -e "${Green}       Magic in 2 seconds...        " > /dev/tty0

                sleep 2
                echo "Xtreme Virtual Ram Mode Activate!  88 MPH!..." > /dev/tty0 
                swapon "$mountpoint/media/XtremeVirtualRam.swap" &> /dev/tty0
            fi
        fi
    fi
}
[ -d "$mountpoint/media/$modname" ] && XtremeVirtualRam
