summaryrefslogtreecommitdiffstats
path: root/examples/recipes/image/build.yml
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2024-04-04 01:13:09 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2024-04-04 01:16:43 +0200
commit1896ea04204b8086a4f25e257dc5605e5505d768 (patch)
tree694b5298958c0152ce4fe58c42f864980fd6b9df /examples/recipes/image/build.yml
parentaa914e75251af3f9691be621a8c266320158bace (diff)
downloadrebel-1896ea04204b8086a4f25e257dc5605e5505d768.tar
rebel-1896ea04204b8086a4f25e257dc5605e5505d768.zip
driver: recipe: move each recipe into a separate directory
Diffstat (limited to 'examples/recipes/image/build.yml')
-rw-r--r--examples/recipes/image/build.yml57
1 files changed, 57 insertions, 0 deletions
diff --git a/examples/recipes/image/build.yml b/examples/recipes/image/build.yml
new file mode 100644
index 0000000..3f6d8f3
--- /dev/null
+++ b/examples/recipes/image/build.yml
@@ -0,0 +1,57 @@
+tasks:
+ rootfs:
+ args:
+ host: 'platform'
+ depends:
+ - recipe: 'busybox'
+ task: 'install'
+ - recipe: 'toolchain'
+ task: 'build_depends'
+ args:
+ target: 'host'
+ output:
+ default: {}
+ run: |
+ mkdir -p \
+ {{destdir}}/dev \
+ {{destdir}}/proc \
+ {{destdir}}/root \
+ {{destdir}}/run \
+ {{destdir}}/sys \
+ {{destdir}}/tmp \
+ {{destdir}}/usr/bin \
+ {{destdir}}/usr/lib \
+ {{destdir}}/var
+
+ ln -s bin {{destdir}}/usr/sbin
+ ln -s usr/bin {{destdir}}/bin
+ ln -s usr/bin {{destdir}}/sbin
+ ln -s usr/lib {{destdir}}/lib
+ ln -s ../run {{destdir}}/var/run
+
+ rsync -aHAXK {{sysroot}}/ {{destdir}}
+
+
+ ext4:
+ args:
+ host: 'platform'
+ build_depends:
+ - recipe: 'e2fsprogs'
+ task: 'install'
+ - recipe: 'make_ext4fs'
+ task: 'install'
+ depends:
+ - task: 'rootfs'
+ output:
+ default: {}
+ run: |
+ IMAGE={{destdir}}/{{basename}}.ext4
+ UUID="$(
+ python3 \
+ -c 'import sys; import uuid; print(uuid.UUID(hex=sys.argv[1][:32], version=4))' \
+ "$INPUT_HASH"
+ )"
+
+ mkdir {{destdir}}
+ make_ext4fs -l 2G -T "$SOURCE_DATE_EPOCH" -L root "$IMAGE" {{sysroot}}
+ E2FSPROGS_FAKE_TIME="$SOURCE_DATE_EPOCH" tune2fs -U "$UUID" "$IMAGE"