GRUB bundles a support library for its `grub-install` command, including:
* A utility branching over a given "key" to concatenate on the appropriate subpath onto the given directory-path.
* Copy a file into place a bufferfull at a time with extreme care.
* A wrapper which might alternatively invoke a configured compression function with debug logging.
* Check a for filepath separator, handling Windows specially.
* Carefully create a directory & any parents if necessary.
1/5?
* Check whether a filename ends with a certain extension.
* Flag that a backup should be created upon exit, at which point (via a repeatedly-called helper) it renames various files into place.
* Invokes that same helper twice & (via another helper) registers that `atexit()` callback with some globals set.
* Check module list against an allow-list.
* Push, pop, & normalize an array of modules to load.
* Handle commandline flags, primarily to set the compression function.
2/5?