Skip to content

Commit e68f766

Browse files
committed
OS (Linux): improve RPIOS detection
Ref: #1816 (comment)
1 parent 29d7a1a commit e68f766

File tree

1 file changed

+23
-24
lines changed

1 file changed

+23
-24
lines changed

src/detection/os/os_linux.c

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -231,31 +231,30 @@ FF_MAYBE_UNUSED static bool detectDebianDerived(FFOSResult* result)
231231
ffStrbufSetF(&result->prettyName, "Proxmox VE %s", result->versionID.chars);
232232
return true;
233233
}
234-
else if (ffStrbufContainS(&instance.state.platform.sysinfo.release, "+rpt-rpi-"))
234+
else if (ffPathExists("/etc/rpi-issue", FF_PATHTYPE_FILE))
235235
{
236-
ffStrbufSetS(&result->idLike, "debian");
237-
if (ffPathExists("/boot/dietpi/.version", FF_PATHTYPE_FILE))
238-
{
239-
// DietPi
240-
ffStrbufSetStatic(&result->id, "dietpi");
241-
ffStrbufSetStatic(&result->name, "DietPi");
242-
ffStrbufSetStatic(&result->prettyName, "DietPi");
243-
FF_STRBUF_AUTO_DESTROY core = ffStrbufCreate();
244-
FF_STRBUF_AUTO_DESTROY sub = ffStrbufCreate();
245-
FF_STRBUF_AUTO_DESTROY rc = ffStrbufCreate();
246-
if (ffParsePropFileValues("/boot/dietpi/.version", 3, (FFpropquery[]) {
247-
{"G_DIETPI_VERSION_CORE=", &core},
248-
{"G_DIETPI_VERSION_SUB=", &sub},
249-
{"G_DIETPI_VERSION_RC=", &rc},
250-
})) ffStrbufAppendF(&result->prettyName, " %s.%s.%s", core.chars, sub.chars, rc.chars);
251-
}
252-
else
253-
{
254-
// Raspberry Pi OS
255-
ffStrbufSetStatic(&result->id, "raspbian");
256-
ffStrbufSetStatic(&result->name, "Raspberry Pi OS");
257-
ffStrbufSetStatic(&result->prettyName, "Raspberry Pi OS");
258-
}
236+
// Raspberry Pi OS
237+
ffStrbufSetStatic(&result->id, "raspbian");
238+
ffStrbufSetStatic(&result->idLike, "debian");
239+
ffStrbufSetStatic(&result->name, "Raspberry Pi OS");
240+
ffStrbufSetStatic(&result->prettyName, "Raspberry Pi OS");
241+
return true;
242+
}
243+
else if (ffPathExists("/boot/dietpi/.version", FF_PATHTYPE_FILE))
244+
{
245+
// DietPi
246+
ffStrbufSetStatic(&result->id, "dietpi");
247+
ffStrbufSetStatic(&result->name, "DietPi");
248+
ffStrbufSetStatic(&result->prettyName, "DietPi");
249+
ffStrbufSetStatic(&result->idLike, "debian");
250+
FF_STRBUF_AUTO_DESTROY core = ffStrbufCreate();
251+
FF_STRBUF_AUTO_DESTROY sub = ffStrbufCreate();
252+
FF_STRBUF_AUTO_DESTROY rc = ffStrbufCreate();
253+
if (ffParsePropFileValues("/boot/dietpi/.version", 3, (FFpropquery[]) {
254+
{"G_DIETPI_VERSION_CORE=", &core},
255+
{"G_DIETPI_VERSION_SUB=", &sub},
256+
{"G_DIETPI_VERSION_RC=", &rc},
257+
})) ffStrbufAppendF(&result->prettyName, " %s.%s.%s", core.chars, sub.chars, rc.chars);
259258
return true;
260259
}
261260
else if (ffStrbufEndsWithS(&instance.state.platform.sysinfo.release, "+truenas"))

0 commit comments

Comments
 (0)