Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/design/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ tine//box/ box bootstrap and sandbox command construction
tine//rootfs/ bind/overlay mounting and stored-delta translation
tine//image/ layers, compositions, archive, directory, disk and boot artifact rules and
drivers, and VM runners
tine//uapi16/ UAPI.16 manifests
tine//archive/ tar writer, cpio reader and writer
tine//git/ pinned Git repositories with local checkout overrides
tine//cargo/ vendored crate trees and offline Rust source builds
tine//go/ go.sum-verified module fetches and offline Go source builds
Expand Down
16 changes: 9 additions & 7 deletions examples/image-secureboot/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -314,13 +314,15 @@ box.sh_test(
name = "disk-manifest-test",
labels = ["image"],
box = "@tine//tools:dev.box",
test = "@tine//tests:contains.sh",
args = [
"$(location :image[disk-manifest])",
'"name":"usr/bin/bash"',
'"name":"boot/tine-tmpfiles","type":"dir","mode":448',
'"name":"boot/EFI/Linux',
],
args = ["$(location :image[disk-manifest])"],
script = """
# Authored tmpfiles must set the boot directory mode in the disk's filesystem listing.
jq --seq -es '
any(.[]; .name == "usr/bin/bash") and
any(.[]; .name == "boot/tine-tmpfiles" and .type == "dir" and .mode == 448) and
any(.[]; .name | strings | startswith("boot/EFI/Linux"))
' "$1"
""",
)

# The kernel install hook is bypassed, it didn't generate its own initrd.
Expand Down
12 changes: 6 additions & 6 deletions examples/image/expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
"sha256": "64b78fbe92ff5fcaefb77ef10923c964e402304a54b0a776a8ca11c9b43c85f7"
},
"boot-demo.fedora[disk-manifest]": {
"sha256": "c95655cea99dc0f17d5d4c6211595a8ba18728f94c3513a1695220de04c14e89"
"sha256": "b4f4144aed4ede4dec269912df3de2f1b93d8259eb293c8558822f8853e8f10f"
},
"boot-demo.fedora[manifests][esp]": {
"sha256": "f81e7f963bbe9cfaf07ac4495a0d8e47392206e9ddb561943304bbb0ae3aa38a"
"sha256": "1894ce1b990d880e6dff777433eeb282359225199b853ee16431485de0321906"
},
"boot-demo.fedora[manifests][usr]": {
"sha256": "0c28ac6ca9ee9ded432b4385ed5ce5400ea349324bcbff17323b61fd48a9f841"
"sha256": "b5d0bc2a053559673d2bbc5fd4262d5f2086c44bc1786a72bce76a8b086e6720"
},
"boot-demo.fedora[partitions][usr-verity]": {
"sha256": "bdff57265eca86d1a93ef53c19d88681e715bed6385ddca2a2f13cfff8766175"
Expand Down Expand Up @@ -54,13 +54,13 @@
"sha256": "84ab38be46148a1d40243767cdc749b0dffa32bd789814b160339efd2d3d8046"
},
"boot-demo.fedora[disk-manifest]": {
"sha256": "7fbf96d7c1c343d54d0e1ef6b8c7fd4209fb6ea8656f72639fd699808ae79780"
"sha256": "eaa180ad12781b3ec5bb94a47595443191c7bcb19842b549e120200ee12a1976"
},
"boot-demo.fedora[manifests][esp]": {
"sha256": "549e4e6ccd6e57b8b553dc7d7fabbee1be80b89889f9d65edbb50cdb91c806d3"
"sha256": "9e413eccc8894a4f9c30ac16d690b577156c703b9a87c5b4ca664e912493a2ba"
},
"boot-demo.fedora[manifests][usr]": {
"sha256": "f6450f8f8a1e832c420e7409809a7b2ff924be69e0eb0155ed7fe4233d437cc7"
"sha256": "d43c2e1f98613d48a86dbf412ed8c051ed434890ca7fa73d1ae8dd9dbff4aeff"
},
"boot-demo.fedora[partitions][usr-verity]": {
"sha256": "6636ed1748dfdf35d0692b9c8d4ab0c50e5112e41bc91de3ba0950230f4fee41"
Expand Down
3 changes: 2 additions & 1 deletion examples/image/manifest_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ def decode(data: bytes) -> list[dict[str, Any]]:


objects = decode(Path(sys.argv[1]).read_bytes())
root, files = objects[0], objects[1:]
assert objects[-1] == {"mediaType": "application/vnd.uapi.16.trailer"}, "missing trailer"
root, files = objects[0], objects[1:-1]
assert root == {"mediaType": "application/vnd.uapi.16.manifest"}, f"bad root object: {root}"
assert files, "the manifest lists no files at all"

Expand Down
17 changes: 3 additions & 14 deletions image/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ python.binary(
main = "ddi.py",
deps = [
":finalize",
":manifest-lib",
"//:specs",
"//:util",
"//rootfs:rootfs",
"//uapi16:uapi16",
],
visibility = ["PUBLIC"],
)
Expand Down Expand Up @@ -124,8 +124,6 @@ python.test(
"finalize_test.py",
"layer.py",
"layer_test.py",
"manifest.py",
"manifest_test.py",
"preload.py",
"preload_test.py",
"substitute.py",
Expand All @@ -145,6 +143,7 @@ python.test(
"//kmod:kmod",
"//package:installer",
"//rootfs:rootfs",
"//uapi16:uapi16",
],
)

Expand All @@ -165,21 +164,11 @@ python.binary(
":finalize",
"//:specs",
"//:util",
"//uapi16:uapi16",
],
visibility = ["PUBLIC"],
)

# A driver that packages a tree lists it from inside its own action, where the tree is final.
python.library(
name = "manifest-lib",
srcs = ["manifest.py"],
deps = [
":finalize",
"//:specs",
"//:util",
],
)

python.library(
name = "finalize",
srcs = ["finalize.py"],
Expand Down
6 changes: 3 additions & 3 deletions image/ddi.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
import util

import finalize
import manifest
import rootfs
import uapi16

_SEED_NAMESPACE = uuid.UUID("5af2de99-4f9f-4e0b-a04b-bde36b068c4f")

Expand Down Expand Up @@ -511,15 +511,15 @@ def main(argv: list[str] | None = None) -> None:
listings = []
for partition in written:
if partition.manifest is not None:
manifest.write(tree, partition.manifest, epoch, roots=partition.definition.sources)
uapi16.write(tree, partition.manifest, epoch, roots=partition.definition.sources)
listings.append(partition.manifest)

# An imported partition was listed by the invocation that filled it, and this one holds
# what it copies itself, so between them they list the whole disk. Imported first: a
# partition this invocation mounts over a directory another one holds is the one on top.
if spec["manifest"]:
imported = [it.manifest for it in partitions if it.manifest is not None]
manifest.merge(imported + listings, Path(spec["manifest"]))
uapi16.merge(imported + listings, Path(spec["manifest"]))

scratch = Path(scratch_dir)
repart_definitions = scratch / "repart.d"
Expand Down
Loading
Loading