particle-os-modules/modules/files
fiftydinar 189048b119
chore: Remove usage of yq in favor of jq (#369)
* chore: Remove usage of `yq` in favor of `jq`

* fix: Missed bracket in `default-flatpaks`

* fix: `get_json_array` complaining about unpopulated arrays

* fix(files): Forgot to input `-r` flag for some `jq` calls

* fix(gschema-overrides): Use `try` in `get_json_array`

* chore(default-flatpaks): Replace `yq` with `jq` in run-time setup binaries

* chore: Switch to simplified `jq` syntax without brackets

* chore(default-flatpaks): Switch `repo-info` file from `yml` to `json`

* fix(default-flatpaks): Some `yq` calls

* chore: Revert back to bracket syntax for more reliable `jq` parsing

* chore(files): Missed bracket syntax

* chore: Approve bot suggestion about quoting

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update modules/files/files.sh

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix(yafti): Populating custom flatpaks

It's populated in reverse order compared to the format in recipe, but it works

* fix(fonts): Variable substitution is needed

* fix: Typo

* fix(fonts): Forgot to assign FONTS variable

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-12-02 19:02:13 +00:00
..
files.sh chore: Remove usage of yq in favor of jq (#369) 2024-12-02 19:02:13 +00:00
files.tsp docs: Update documentation to reflect change from config/ to files/ (#283) 2024-07-21 19:21:28 +00:00
module.yml chore: remove raw github URLs from module.ymls (unneeded after recent refactor) 2024-07-26 16:02:32 +03:00
README.md chore: Put files in /etc/ instead in /usr/etc (#315) 2024-08-11 17:07:55 +00:00

files

The files module can be used to copy directories from files/ to any location in your image at build-time, as long as the location exists at build-time (e.g. you can't put files in /home/<username>/, because users haven't been created yet prior to first boot).

:::note In run-time, /usr/etc/ is the directory for "system" configuration templates on atomic Fedora distros, whereas /etc/ is meant for manual overrides and editing by the machine's admin after installation.

In build-time, as a custom-image maintainer, you want to copy files to /etc/, as those are automatically moved to system directory /usr/etc/ during atomic Fedora image deployment. Check out this blog post for more details about this:
https://blue-build.org/blog/preferring-system-etc/ :::

:::caution The files module cannot write to directories that will later be symlinked to point to other places (typically /var/) by rpm-ostree.

This is because it doesn't make sense for a directory to be both a symlink and a real directory that has had actual files directly copied to it, so the files module copying files to one of those directories (thereby instantiating it as a real directory) and rpm-ostree's behavior regarding them will necessarily conflict.

For reference, according to the official Fedora documentation, here is a list of the directories that rpm-ostree symlinks to other locations:

  • /home//var/home/
  • /opt//var/opt/
  • /srv//var/srv/
  • /root//var/roothome/
  • /usr/local//var/usrlocal/
  • /mnt//var/mnt/
  • /tmp//sysroot/tmp/

So don't use files to copy any files to any of the directories on the left, because at runtime rpm-ostree will want to link them to the ones on the right, which will cause a conflict as explained above.

:::