Skip to content

Arch Linux policy#4273

Open
mawiegand wants to merge 10 commits intososreport:mainfrom
mawiegand:archlinux-policy
Open

Arch Linux policy#4273
mawiegand wants to merge 10 commits intososreport:mainfrom
mawiegand:archlinux-policy

Conversation

@mawiegand
Copy link
Copy Markdown

Hey,

I’d like to see support for Arch Linux, and since there hasn’t been any progress on #1198 for a while, I’ve created a new pull request to introduce a policy for Arch Linux. I’d be thrilled if the policy made it into a release. I look forward to your feedback and/or any next steps I can take to make this happen!

Thanks! 🙂

Resolves #1198


Please place an 'X' inside each '[]' to confirm you adhere to our Contributor Guidelines

  • Is the commit message split over multiple lines and hard-wrapped at 72 characters?
  • Is the subject and message clear and concise?
  • Does the subject start with [plugin_name] if submitting a plugin patch or a [section_name] if part of the core sosreport code?
  • Does the commit contain a Signed-off-by: First Lastname email@example.com?
  • Are any related Issues or existing PRs properly referenced via a Closes (Issue) or Resolved (PR) line?
  • Are all passwords or private data gathered by this PR obfuscated?

@packit-as-a-service
Copy link
Copy Markdown

Congratulations! One of the builds has completed. 🍾

You can install the built RPMs by following these steps:

  • sudo dnf install -y 'dnf*-command(copr)'
  • dnf copr enable packit/sosreport-sos-4273
  • And now you can install the packages.

Please note that the RPMs should be used only in a testing environment.

Copy link
Copy Markdown
Member

@TurboTurtle TurboTurtle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, pretty solid. Just a couple notes, but nothing major.

Comment on lines +35 to +38
@classmethod
def check(cls, remote=""):
"""This method checks to see if we are running on Arch Linux.
It returns True or False."""
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to define this in the subclass, as it is handled in the base LinuxPolicy. Just set the os_release_name class attr.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback. I did this to support ID_LIKE as well. See: https://www.man7.org/linux/man-pages/man5/os-release.5.html#OPTIONS

Or am I missing something, and is this also supported in the base LinuxPolicy? Or should I handle this differently?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So then it is better to extend https://github.com/sosreport/sos/blob/main/sos/policies/distros/__init__.py#L118, rather than having an extra care for one distro..?

Comment thread sos/report/plugins/k3s.py Outdated
Comment on lines +12 to +15
from sos.report.plugins.kubernetes import Kubernetes


class K3s(Kubernetes, ArchPlugin):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have a pattern of subclassing Plugins like this (into new plugin sources).

If there is truly nothing different about the collections except the kube_cmd and a single yaml file, I'd suggest we move this into the base kubernetes plugin. I'm not super familiar with k3s myself, but aren't there a reduced number of features with k3s? If so, we'd probably see a lot of collection failures when just directly subclassing the "normal" plugin, but I definitely get not wanting to re-write a plugin as large as that one just to strip out what may not actually be a lot of collection attempts.

@pmoravec or @arif-ali happy to hear your thoughts here too.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I'm concerned, we're welcome to move this to kubernetes. I haven't noticed any issues with the collection process in the past. However, the plugin from my fork hasn't been used for quite some time. Alternatively, we could just drop it entirely, as far as I'm concerned. It doesn't have any direct connection to Arch Linux, and k3s is only available in the AUR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for moving it under Kubernetes.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved it to kubernetes as suggested.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TurboTurtle can this be resolved?

Comment thread sos/policies/distros/arch.py
@TurboTurtle TurboTurtle added Kind/Enhancement Status/Needs Review This issue still needs a review from project members Kind/New plugin New plugin being added Kind/report Changes to the report component labels Mar 17, 2026
Comment on lines +30 to +32
self.package_manager = PacmanPackageManager(
chroot=self.sysroot, remote_exec=remote_exec
)

Check warning

Code scanning / CodeQL

Overwriting attribute in super-class or sub-class

Assignment overwrites attribute package_manager, which was previously defined in superclass [Policy](1).
@mawiegand
Copy link
Copy Markdown
Author

Overall, pretty solid. Just a couple notes, but nothing major.

Thanks, @TurboTurtle for the fast feedback! Do you have any suggestions on how I can best handle the sos/report/plugins/filesys.py:108:0: R0901: Too many ancestors (8/7) (too-many-ancestors) error from pylint?

Comment thread sos/report/plugins/pacman.py
Signed-off-by: Marcel Wiegand <wiegand@linux.com>
Signed-off-by: Marcel Wiegand <wiegand@linux.com>
@mawiegand mawiegand force-pushed the archlinux-policy branch 2 times, most recently from 817a3ea to 8671eac Compare March 17, 2026 23:03
mawiegand and others added 8 commits March 18, 2026 00:04
Signed-off-by: Marcel Wiegand <wiegand@linux.com>
Signed-off-by: Marcel Wiegand <wiegand@linux.com>
Signed-off-by: Marcel Wiegand <wiegand@linux.com>
Signed-off-by: Marcel Wiegand <wiegand@linux.com>
Signed-off-by: Marcel Wiegand <wiegand@linux.com>
Signed-off-by: Marcel Wiegand <wiegand@linux.com>
Signed-off-by: Marcel Wiegand <wiegand@linux.com>
Signed-off-by: Marcel Wiegand <wiegand@linux.com>
@jcastill
Copy link
Copy Markdown
Member

Do you have any suggestions on how I can best handle the sos/report/plugins/filesys.py:108:0: R0901: Too many ancestors (8/7) (too-many-ancestors) error from pylint?

I think there are two possibilities here, one quick and easy, the other one a bit more complex:

  • Simple solution: disable the check with # pylint: disable=too-many-ancestors on top of the function, i.e.:
# pylint: disable=too-many-ancestors
class RedHatFilesys(Filesys, RedHatPlugin):
  • Bit more complex solution: The RedHatFilesys class has only one capture, a listing of /tmp. This doesn't exist in the Filesys class, but I think it could be useful to capture that as well for the other distros there. So, this approach will mean:
  1. Remove the RedHatFilesys class, and
  2. Add the capture to Filesys, like this:
...
        for dev in self.do_regex_find_all(ext_fs_regex, mounts):
            self.add_cmd_output(f"dumpe2fs {dumpe2fs_opts} {dev}",
                                tags="dumpe2fs_h")

            if self.get_option('frag'):
                self.add_cmd_output(f"e2freefrag {dev}", priority=100)
        self.add_cmd_output(f'ls -ldZ {self.policy.get_tmp_dir("/tmp")}')

    def postproc(self):
...

Note: We may want to change that self.add_cmd_output to:

self.add_dir_listing(f'{self.policy.get_tmp_dir("/tmp")}'

This solution will need that you add the _tmp_dir variable in the Arch policy, but I think that's something you should do anyway so it's consistent with most of the other policies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Kind/Enhancement Kind/New plugin New plugin being added Kind/report Changes to the report component Status/Needs Review This issue still needs a review from project members

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants