beclab / Terminus

Terminus - Your Self-Hosted Home Cloud, Powered by Kubernetes
https://www.jointerminus.com/
Other
582 stars 14 forks source link

False "unsupported os version" error on Raspberry Pi #297

Open nilstzh opened 2 months ago

nilstzh commented 2 months ago

During an installation attempt on Raspberry Pi 4B with Raspbian 12 I'm getting the following error:

$ curl -fsSL https://terminus.sh |  bash -

...

2024-08-06 08:01:38.026062993 +0100 [INFO] Precheck and Installing dependencies ...

2024-08-06 08:01:38.123529580 +0100 [FATAL] unsupported os version 'Raspberry Pi OS' 

2024-08-06 08:01:38.127421071 +0100 [FATAL] command error occurs, exit with '1' directly 

After inspecting install_cmd.sh I found out that is_raspbian() calls lsb_release with -d (for 'description') flag instead of -r (for 'release'), which is then compared to '11' and '12'.

Code in question:

is_raspbian(){
    rasp=$(uname -a)
    lsb_release=$(lsb_release -d 2>&1 | awk -F'\t' '{print $2}')
    if [ -z "$lsb_release" ]; then
        echo 0
        return
    fi
    if [[ ${lsb_release} == *Raspbian* || ${rasp} == *raspberry* ]];then 
        case "$lsb_release" in
            *11* | *12*)
                echo 1
                ;;
            *)
                echo 0
                ;;
        esac
    else
        echo 0
    fi
}
pengpeng commented 2 months ago

@nilstzh thank you. We will release this fix in version 1.7.0.rc.2