RexOps / RexOps/Rex

Rex::Hardware::VirtInfo does not handle stuff properly outside of Linux

Open
#1,603 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

triage needed
Dominant language
Perl
Stars
737
Forks
214
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

Rex::Hardware::VirtInfo assumes that it is being ran on Linux and does not properly use Rex::Inventory::Bios::get, which is the proper cross platform manner to the non kernel module info this module uses.

That said Rex::Inventory::Bios::get does not work as non-root so grabbing when it can via the relevent items under /sys on Linux works.

See https://github.com/RexOps/Rex/pull/1599/files for a fix for this.

Similarly $modules is fetched in a Linux specific manner. Should be /sbin/kldstat on FreeBSD.

The module check for kvm should only work on Linux.

Expected behavior

Works in a cross platform manner via dmidecode via Rex::Inventory::Bios::get.

How to reproduce it

Using on something other than Linux such as FreeBSD.

Code example
use Rex; use Rex::Commands::Gather; dump_system_information;
Additional context

No response

Rex version

1.14.2

Perl version

5.32.1

Operating system running rex

FreeBSD

Operating system managed by rex

FreeBSD and Linux

How rex was installed?

package manager

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in Rex::Hardware::VirtInfo and compare its Linux-specific handling with Rex::Inventory::Bios::get and the referenced pull request 1599. Check the module and module-list behavior on Linux and FreeBSD, including /sbin/kldstat and the Linux-only kvm check. Done means dump_system_information works correctly on both operating systems without requiring root for available /sys data.

Written by the indexing model from the issue text.

Assessment

Tech stack
perl
Domain
devops, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.