NERDVANA has asked for the wisdom of the Perl Monks concerning the following question:

Once again, I have a difficult-to-name module.

Given a fully installed Linux (or BSD?) file tree, this module lets you select the files, directories, symlinks, device nodes, etc which you want to become part of a reduced system image. The purpose is to generate Linux initrd, or docker images, or portable chroots, or embedded system images. The cool features are:

I'm actually not even sure it belongs on CPAN, because while I keep writing code like this, it's always fairly specialized and I have no idea if my hacks and special cases will be useful for a different environment.

I'm leaning toward "Linux::SystemSlicer" (i.e. like a slice of an array) but other phrases that come to mind are "Filesystem Subset Extractor", "Root Image Collector", "Initrd Builder", or "System Minifier". I'm only planning to ever use it on Linux, but I think it could theoretically be applied to BSD? There are probably a huge number of additional special cases that would be needed for anything other than Linux.

Replies are listed 'Best First'.
Re: Naming a module that extracts subsets of a Linux system
by Discipulus (Canon) on Jan 15, 2025 at 08:09 UTC
    Hello NERDVANA,

    maybe Linux::System::Reduce ? or ::Squeeze or ::Extract or ::Minify or ::Export (all these or needed for the wikisyntax ;)? Instead of System you can use the shorter OS or Sys

    At the end I'd use Linux::OS::Export infact the main feature seems to be this one, then the minifying part is a corollary to be clarified in the sysnopsis of the documentation.

    Sounds interesting anyway :)

    L*

    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
      I like the Export verb. Strong parallels to exporting subs from a module, which is very much like exporting binaries from a system image.

      Combined with Grandfather's 'Sys' observation, I'm liking Sys::Export::Linux or Sys::Exporter::Linux.

        Hmm, for future proofing, it might be interesting to use a base/factory class like Sys::Exporter that then either automatically or manually selects the correct backend like Sys::Exporter::Linux and stuff. That way, it could also support cross-platform builds.

        use Sys::Exporter; # Automatic detection/configuration my $exporter = Sys::Exporter->new(); # Prepare a cross-platform export my $exporter = Sys::Exporter->new( OS => 'FreeBSD', rootdir => '/mnt/freebsd', libtools => '/home/nerdvana/crossplatformldd', );

        I'm not specific about a name, but putting the OS as the last element of the name instead the first makes sense to me.

        PerlMonks XP is useless? Not anymore: XPD - Do more with your PerlMonks XP
        Also check out my sisters artwork and my weekly webcomics
Re: Naming a module that extracts subsets of a Linux system
by GrandFather (Saint) on Jan 15, 2025 at 09:21 UTC

    I'd go for Linux::Sys::Slicer which implies system related but not the whole thing. Sys rather than System because that is part of a system - which seems appropriate, and there is already a Linux::Sys namespace (for Linux::Sys::CPU::Affinity - not that it's related in any way).

    Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond
      Actually, CPAN seems to have a lot more Sys:: prefix, with ::Linux suffix. That would leave room for a ::BSD variant.
Re: Naming a module that extracts subsets of a Linux system
by Danny (Chaplain) on Jan 15, 2025 at 18:51 UTC
    I like Sys::Extractor or Sys::SubsetExtractor.