summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2021-09-25 20:04:47 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2021-09-25 21:16:07 +0200
commit251c207896760c2886b757fc8ef56c518849ecba (patch)
tree0d274af998562168387e4ab4dc693ba749af1b54 /examples
parent7c349e6aed9b34bdbbb1e57b240ba86cbe23f432 (diff)
downloadrebel-251c207896760c2886b757fc8ef56c518849ecba.tar
rebel-251c207896760c2886b757fc8ef56c518849ecba.zip
examples: add ext4 rootfs image, fix basic directory structure
Diffstat (limited to 'examples')
-rw-r--r--examples/e2fsprogs.yml41
-rw-r--r--examples/rootfs.yml30
2 files changed, 70 insertions, 1 deletions
diff --git a/examples/e2fsprogs.yml b/examples/e2fsprogs.yml
new file mode 100644
index 0000000..43c3c74
--- /dev/null
+++ b/examples/e2fsprogs.yml
@@ -0,0 +1,41 @@
+tasks:
+ unpack:
+ fetch:
+ - name: 'e2fsprogs-1.46.4.tar.xz'
+ sha256: 'b11042533c1b1dcf17512f0da48e05b0c573dada1dd8b762864d10f4dc399713'
+ run: |
+ tar xf {{dldir}}/e2fsprogs-1.46.4.tar.xz
+
+ configure:
+ args:
+ host: 'platform'
+ inherit:
+ task: 'unpack'
+ run: |
+ mkdir e2fsprogs-build
+ cd e2fsprogs-build
+ ../e2fsprogs-1.46.4/configure \
+ --build={{build.gnu_triplet}} \
+ --host={{host.gnu_triplet}} \
+ --prefix={{host.prefix}}
+
+ compile:
+ args:
+ host: 'platform'
+ inherit:
+ task: 'configure'
+ run: |
+ cd e2fsprogs-build
+ make -j8
+
+ install:
+ args:
+ host: 'platform'
+ inherit:
+ task: 'compile'
+ output:
+ default: {}
+ run: |
+ cd e2fsprogs-build
+ make DESTDIR={{destdir}} install
+
diff --git a/examples/rootfs.yml b/examples/rootfs.yml
index 15f2bc6..c6ac953 100644
--- a/examples/rootfs.yml
+++ b/examples/rootfs.yml
@@ -8,10 +8,38 @@ tasks:
output:
default: {}
run: |
- mkdir -p {{destdir}}/usr/bin {{destdir}}/usr/lib
+ mkdir -p \
+ {{destdir}}/dev \
+ {{destdir}}/proc \
+ {{destdir}}/sys \
+ {{destdir}}/root \
+ {{destdir}}/run \
+ {{destdir}}/var \
+ {{destdir}}/usr/bin \
+ {{destdir}}/usr/lib
+
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 -aK {{sysroot}}/ {{destdir}}
+
+ image-ext4:
+ args:
+ host: 'platform'
+ build_depends:
+ - recipe: 'e2fsprogs'
+ task: 'install'
+ depends:
+ - task: 'install'
+ output:
+ default: {}
+ run: |
+ mkdir {{destdir}}
+
+ IMAGE={{destdir}}/rootfs.ext4
+ truncate -s 1G "$IMAGE"
+ mkfs.ext4 -d {{sysroot}} "$IMAGE"