1
0

fix: match kernel release correctly

This commit is contained in:
dump_stack() 2023-05-13 17:42:25 +00:00
parent 143e54984d
commit 2cc84ac962
Signed by: dump_stack
GPG Key ID: BE44DA8C062D87DC

View File

@ -104,19 +104,40 @@ func kernelRelease(deb string) (r Release, err error) {
return return
} }
// Wheezy 3.2
// Jessie 3.16
// Stretch 4.9
// Buster 4.19
// Bullseye 5.10
if major < 3 { if major < 3 {
err = errors.New("not supported") err = errors.New("not supported")
return return
} else if major <= 3 && minor < 16 { }
r = Wheezy // 3.2
} else if major <= 4 && minor < 9 { switch major {
r = Jessie // 3.16 case 3:
} else if major <= 4 && minor < 19 { if minor < 16 {
r = Stretch // 4.9 r = Wheezy
} else if major <= 5 && minor < 10 { } else {
r = Buster // 4.19 r = Jessie
} else { }
r = Bullseye // 5.10 case 4:
if minor < 9 {
r = Jessie
} else if minor < 19 {
r = Stretch
} else {
r = Buster
}
case 5:
if minor < 10 {
r = Buster
} else {
r = Bullseye
}
default:
r = Bullseye // latest release
} }
return return