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:
- It inspects the 'ldd' output on ELF binaries to determine which libs need added
- It preserves permissions and mtimes of files and the directories that contain them (unlike mkdir -p)
- It can move executables to new locations (like moving them to /newprefix/bin/)
- It can rewrite interpreter paths of scripts to match their new location
- It can rewrite the lib paths of ELF files so that they can live alongside an incompatible libc ecosystem
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.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
|
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.