-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is the initial implementation of the Proof of Concept for the Omnifest Toolkit (`otk`). `otk` is implemented in Python as it's the shared language of choice between the creators and the users of `osbuild-mpp` which `otk` aims to improve upon. The `otk` binary is laid out as follows: - `otk compile` compiles an omnifest into its targets. The `otk` package is laid out as follows: - `otk/parse` contains parsing code for full schemas and single primitives such as names or variables, it also contains wrapping types for internal types. - `otk/help` contains helper functions. - `otk/transform` contains the logic for transforming trees including the directive implementations in the directive submodule. - `otk/error.py` contains `otk` error types, all errors inherit from the `OTKError` type. - `otk/tree.py` contains types and functions to deal with the tree transformations that are at the core of `otk`. - `otk/command.py` contains the subcommands as supported by the `otk` entry point. Other than the above the repository also contains: - `test/` contains unittests for `otk`. - `doc/` contains Sphinx documentation for `otk`. - `example/` contains YAML example files for `otk`. Signed-off-by: Simon de Vlieger <[email protected]>
- Loading branch information
Showing
43 changed files
with
1,221 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
venv | ||
*.egg-info | ||
__pycache__ | ||
.coverage | ||
htmlcov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,15 @@ | ||
.PHONY: lint | ||
lint: | ||
@find . -name '*.yaml' | xargs yamllint | ||
|
||
.PHONY: lint | ||
.PHONY: type | ||
type: | ||
@mypy src/ test/ | ||
|
||
.PHONY: format | ||
format: | ||
@ruff format src/ test/ | ||
|
||
.PHONY: test | ||
test: | ||
@pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
otk.version: 1 | ||
|
||
otk.define: | ||
version: 40 | ||
architecture: "aarch64" | ||
packages: | ||
# These packages are used in the buildroot | ||
root: | ||
docs: false | ||
weak: false | ||
packages: | ||
include: | ||
- "@core" | ||
# TODO We can't merge nonexistent vars | ||
exclude: | ||
- "nonexistent" | ||
# These packages are used for the operating system tree which is what ends | ||
# up in the outputs. | ||
tree: | ||
docs: false | ||
weak: false | ||
packages: | ||
include: | ||
- "@core" | ||
- "initial-setup" | ||
- "libxkbcommon" | ||
- "NetworkManager-wifi" | ||
- "brcmfmac-firmware" | ||
- "realtek-firmware" | ||
- "iwlwifi-mvm-firmware" | ||
# TODO We can't merge nonexistent vars | ||
exclude: | ||
- "nonexistent" | ||
todo: | ||
packages: | ||
include: | ||
- "@bar" | ||
- "@baz" | ||
# TODO We can't merge nonexistent vars | ||
exclude: | ||
- "nonexistent" | ||
# Repositories to fetch packages from | ||
repositories: | ||
otk.include: repository/${version}.yaml | ||
# GPG keys to verify packages with | ||
keys: | ||
otk.include: repository/${version}-gpg.yaml | ||
filesystem: | ||
root: | ||
uuid: 6e4ff95f-f662-45ee-a82a-bdf44a2d0b75 | ||
vfs_type: ext4 | ||
path: / | ||
options: defaults | ||
boot: | ||
uuid: 0194fdc2-fa2f-4cc0-81d3-ff12045b73c8 | ||
vfs_type: ext4 | ||
path: /boot | ||
options: defaults | ||
boot-efi: | ||
uuid: 7B77-95E7 | ||
vfs_type: vfat | ||
path: /boot/efi | ||
options: defaults,uid=0,gid=0,umask=077,shortname=winnt | ||
passno: 2 | ||
|
||
otk.target.osbuild: | ||
pipelines: | ||
- otk.include: "osbuild/root.yaml" | ||
- otk.include: "osbuild/pipeline/tree.yaml" | ||
- otk.include: "osbuild/pipeline/raw.yaml" | ||
- otk.include: "osbuild/pipeline/xz.yaml" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
foo: | ||
bar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: raw | ||
source-epoch: 1659397331 | ||
stages: | ||
# - otk.external.osbuild.depsolve-dnf4: | ||
# architecture: ${architecture} | ||
# module_platform_id: f${version} | ||
# repositories: ${repositories} | ||
# gpgkeys: ${gpgkeys} | ||
# exclude: | ||
# docs: true | ||
# packages: ${packages.default.root} | ||
- type: org.osbuild.selinux | ||
options: | ||
file_contexts: etc/selinux/targeted/contexts/files/file_contexts | ||
labels: | ||
/usr/bin/cp: system_u:object_r:install_exec_t:s0 | ||
/usr/bin/tar: system_u:object_r:install_exec_t:s0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: tree | ||
build: name:root | ||
stages: | ||
- otk.external.osbuild.depsolve-dnf4: | ||
architecture: ${architecture} | ||
module_platform_id: f${version} | ||
repositories: ${packages.repositories} | ||
gpgkeys: ${packages.keys} | ||
docs: ${packages.tree.docs} | ||
weak: ${packages.tree.weak} | ||
packages: ${packages.tree.packages} | ||
- type: org.osbuild.kernel-cmdline | ||
options: | ||
root_fs_uuid: ${filesystem.root.uuid} | ||
kernel_opts: ro no_timer_check console=ttyS0,115200n8 biosdevname=0 net.ifnames=0 | ||
- type: org.osbuild.fix-bls | ||
options: | ||
prefix: '' | ||
- type: org.osbuild.locale | ||
options: | ||
language: | ||
otk.customization.locale: | ||
scope: tree | ||
default: | ||
language: en_US | ||
defined: | ||
language: en_US | ||
- type: org.osbuild.hostname | ||
options: | ||
language: | ||
otk.customization.hostname: | ||
scope: tree | ||
default: | ||
hostname: localhost.localdomain | ||
defined: | ||
language: localhost.localdomain | ||
- type: org.osbuild.timezone | ||
options: | ||
language: | ||
otk.customization.language: | ||
scope: tree | ||
default: | ||
zone: UTC | ||
defined: | ||
zone: UTC | ||
- type: org.osbuild.fstab | ||
options: | ||
filesystems: | ||
- ${filesystem.boot} | ||
- ${filesystem.boot-efi} | ||
- ${filesystem.root} | ||
- type: org.osbuild.grub2 | ||
options: | ||
root_fs_uuid: ${filesystem.root.uuid} | ||
boot_fs_uuid: ${filesystem.boot.uuid} | ||
kernel_opts: ro no_timer_check console=ttyS0,115200n8 biosdevname=0 net.ifnames=0 | ||
legacy: i386-pc | ||
uefi: | ||
vendor: fedora | ||
unified: true | ||
# TODO: expose this somehow from the depsolve | ||
saved_entry: "ffffffffffffffffffffffffffffffff-${version}" | ||
write_cmdline: false | ||
config: | ||
default: saved | ||
- type: org.osbuild.selinux | ||
options: | ||
file_contexts: etc/selinux/targeted/contexts/files/file_contexts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
foo: | ||
bar |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.