From f4a36b2df7886c3977665b34b3e04b3e1e07452d Mon Sep 17 00:00:00 2001 From: Christopher Young Date: Fri, 24 Jun 2016 16:10:34 -0400 Subject: [PATCH] Throw webUI error prompting user to update image if /etc/debian_version <8.0. #448. --- main/gen_gdl90.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/main/gen_gdl90.go b/main/gen_gdl90.go index cd677868..7d3236be 100644 --- a/main/gen_gdl90.go +++ b/main/gen_gdl90.go @@ -1208,6 +1208,21 @@ func main() { debugLogf = debugLog dataLogFilef = dataLogFile } + // Check if Raspbian version is <8.0. Throw a warning if so. + vt, err := ioutil.ReadFile("/etc/debian_version") + if err == nil { + vtS := strings.Trim(string(vt), "\n") + vtF, err := strconv.ParseFloat(vtS, 32) + if err == nil && vtF < 8.0 { + var err_os error + if globalStatus.HardwareBuild == "FlightBox" { + err_os = fmt.Errorf("You are running an old Stratux image that can't be updated fully and is now deprecated. Visit https://www.openflightsolutions.com/flightbox/image-update-required for further information.") + } else { + err_os = fmt.Errorf("You are running an old Stratux image that can't be updated fully and is now deprecated. Visit http://stratux.me/ to update using the latest release image.") + } + addSystemError(err_os) + } + } // replayESFilename := flag.String("eslog", "none", "ES Log filename") replayUATFilename := flag.String("uatlog", "none", "UAT Log filename")