summaryrefslogtreecommitdiffstats
path: root/examples/recipes/image.yml
blob: 883fa3b2c3cf3c9c590cec19f33e8cae5242cdfa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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}}/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 -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}}/{{pn}}.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"