Skip to content

Commit

Permalink
Fix VolumeRoster on thinstation
Browse files Browse the repository at this point in the history
  • Loading branch information
jackburton79 committed Apr 2, 2024
1 parent cf53f19 commit b5b7ea4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
4 changes: 1 addition & 3 deletions Inventory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -738,9 +738,7 @@ Inventory::_AddMemoriesInfo()
void
Inventory::_AddDrivesInfo()
{
// "-l" to list only local fs
// and exclude tmpfs, efivarfs and overlay
VolumeRoster reader("-l -x tmpfs -x efivarfs -x overlay");
VolumeRoster reader;
volume_info info;
while (reader.GetNext(info)) {
tinyxml2::XMLElement* drive = fDocument->NewElement("DRIVES");
Expand Down
11 changes: 8 additions & 3 deletions VolumeRoster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@

VolumeRoster::VolumeRoster(const char* options)
{
// TODO:
std::string string("export LC_ALL=C; ");
string.append("df -T ").append(options);
string.append("df -T -l").append(options);
CommandStreamBuffer df(string.c_str(), "r");
std::istream stream(&df);

Expand All @@ -36,7 +35,13 @@ VolumeRoster::VolumeRoster(const char* options)
iss >> info.type;

info.label = info.name;
fItems.push_back(info);
// TODO: we could use -x to exclude these filesystems,
// but some "df" version doesn't support it (i.e. busybox)
if (info.filesystem != "tmpfs" &&
info.filesystem != "efivarfs" &&
info.filesystem != "overlay") {
fItems.push_back(info);
}
}

Rewind();
Expand Down

0 comments on commit b5b7ea4

Please sign in to comment.