Commit Graph

29 Commits

Author SHA1 Message Date
Arcitec
63a5e3583b feat: refactor build.sh to use the new yafti launcher
This implements the new "yafti" launcher and ties everything together:

- The "/etc/profile.d" script is now a symlink to an immutable location, instead of an actual plaintext file, to prevent risk of user systems breaking due to ostree thinking that the script had been modified. We can now be certain that systems always work properly when switching between distros or uBlue flavors.

- Yafti is only installed if the "yafti" flag is enabled.

- If the user disables the "yafti" flag, we completely wipe out the entire yafti.yml configuration, all of our new "yafti autostart" components, and the "profile.d" symlink, so that nothing remains on the system image. If an upstream image installed yafti itself in `/usr/bin`, then we leave that component alone though (because "pip uninstall" and the potential errors it might throw seems like a pointless hassle just for a tiny, unused binary).
2023-05-14 18:18:18 +03:00
Arcitec
8ee996722f fix!: move yafti.yml to standardized location 2023-05-10 21:44:01 +03:00
Arcitec
077e7243f2 fix!: move recipe.yml to standardized location 2023-05-10 21:44:01 +03:00
Arcitec
55ff6363be feat: implement a very flexible runner for "pre" and "post" scripts
This new functionality now makes it possible to execute scripts at the start or end of the build process, while also being super simple to expand to add further script stages in the future.

It also supports effortless reuse of scripts for multiple stages, since the scripts are now executed with the "current stage" as their 1st argument, to allow them to easily determine which stage they're running in.
2023-05-10 18:44:25 +03:00
Arcitec
946f3d82ee fix: automatically determine current fedora version during build
This fixes the issue where someone specifies `fedora-version: latest`, which won't be known until build-time.

I also added a small "welcome" banner to the build log. It's really just there to retain a somewhat contrived use-case example for how to use `get_yaml_string()`, for other programmers who want to extend this in the future.
2023-05-10 18:44:25 +03:00
Arcitec
4ca33a3fe3 feat: streamlined YAML configuration for RPM-related settings
All RPM-related settings are now within their own YAML sub-category, to improve readability.
2023-05-10 18:44:25 +03:00
Arcitec
baa8c47ffa feat: automatic repo version selection via YAML configuration
You can now define your custom repos with the `%FEDORA_VERSION%` variable, to automatically use the correct repo version, so that you never have to maintain their custom URLs again in the future.
2023-05-10 18:44:25 +03:00
Arcitec
33ab88f794 feat: add function for reading individual YAML strings
The recipe file is now also moved to a separate variable, and we use `--` to ensure that yq never misinterprets any custom arguments as `-flags`.
2023-05-10 18:44:25 +03:00
Arcitec
bf19fa5eca feat: implement effortless RPM removal via YAML configuration
You can now easily remove RPMs from your custom image, without having to edit the build.sh script.

This also changes the old "rpms" config key, to "rpm-install", for consistency with the new setting.
2023-05-10 18:44:25 +03:00
Arcitec
5f072b8b67 fix: faster installation of custom RPMs
Thanks to leveraging Bash arrays, we are now able to use parameter expansion to perform every package installation as one rpm-ostree operation instead of individual ones. This will give us a huge build speedup.

Bash properly expands every array element as safely quoted arguments, complete with support for spaces and special characters.
2023-05-10 18:44:25 +03:00
Arcitec
07cbe2cc08 fix: extremely robust handling for YAML data fetching
This new technique is way easier to use, more maintainable, and safely handles special characters and spaces in the YAML data. It will also enable other features, such as the rpm-ostree improvement coming in the next commit.

The function name is `get_yaml_array()` because it literally reads it into a Bash array, by the way. Don't change the function name in the future. We may need other functions to read values into strings, etc.
2023-05-10 18:44:25 +03:00
Arcitec
20e0a06588 fix: remove extremely verbose "x" flag
The debug "x" flag that prints every command is really excessive.
2023-05-10 18:44:25 +03:00
Arcitec
d09dd76243 feat: install repos first, so that they're available for scripting
This ensures that custom scripts have the flexibility to work with the repos that have been added.
2023-05-10 18:44:25 +03:00
Arcitec
f24c4072fd fix: use proper shebang line
This is the most portable shebang line and should always be used.
2023-05-10 18:44:25 +03:00
Arcitec
44660085eb chore: clean up sentences to make them easier to expand
Lowercase, run-on sentences are a nightmare to expand later, because the lack of sentence structure means you can't just add more lines and have a nice flow anymore.

Let's add some punctuation and grammar.
2023-05-10 18:44:25 +03:00
Arcitec
4b9fe0b05b fix: add flags to ensure that build aborts if there are errors 2023-05-10 18:44:25 +03:00
Eino Rauhala
c537104ba2 feat: add extra repos field to recipe (#52)
* feat: add extra repos field to recipe

* fix: semicolon before "done" keyword in shell

* fix: don't put repos in /usr/etc/
2023-04-28 13:55:37 +00:00
Eino Rauhala
b3f7f07d6c fix: only create yafti grp when flatpaks defined (#46) 2023-04-26 16:49:26 +00:00
Eino Rauhala
95ff830b49 fix: moving recipe back to a directory available on the host (#47)
* fix: mv recipe to a dir available on the host

* docs: add notice for recipe editing on host

* fix: replace /tmp/ublue-recipe.yml with /usr/etc/.
2023-04-26 16:19:31 +00:00
Eino Rauhala
085d26aa1a fix: prevent /etc/ merge issues (#43)
* fix: prevent /etc/ merge issues
discussed at length in #28
also including tons of comments about the issue

* fix: change references of /etc/ to /usr/etc
2023-04-26 15:23:43 +00:00
Emmett Wasik (Viv)
37143b0e23 feat: add per-recipe shell script support (#38) 2023-04-24 18:40:51 +00:00
ER
e9c31aba83 chore: put ublue-recipe in /tmp
-> there's no reason to send the recipe to the client
as it is only used in the build stages
2023-04-02 15:51:18 +03:00
ER
773fc23804 fix: loop over lines, functional var substitution 2023-04-02 15:31:01 +03:00
ER
97ee7169f4 fix: add shebang 2023-04-02 12:48:14 +03:00
ER
616c59c90b fix: remove unneeded escape 2023-04-02 12:48:03 +03:00
ER
5a98ef6532 fix: remove -y flag from yq; not in go version 2023-04-02 12:38:06 +03:00
ER
0cf6b13b6c feat: yafti package group for recipe.yml
read .flatpaks[] in recipe.yml
and add declared packages to their own
package group in yafti
2023-04-02 12:24:32 +03:00
ER
0b669f5bb5 feat: switch to yafti for first boot
based on what's done in bluefin
& https://github.com/ublue-os/yafti#running-from-a-containerfile
2023-04-02 12:00:58 +03:00
ER
68122c87ca feat: switch to separate build script 2023-04-02 11:44:44 +03:00