rockpi4.yml 2.13 KB
Newer Older
1
{{- $ubootPath := or .ubootPath "/usr/lib/u-boot/rock-pi-4-rk3399" -}}
Rohan Garg's avatar
Rohan Garg committed
2
{{- $image := or .image "debian-rockpi4.img" -}}
Fabrizio Castro's avatar
Fabrizio Castro committed
3
{{- $nfsImage := or .image "debian-rockpi4.tar.gz" -}}
Rohan Garg's avatar
Rohan Garg committed
4 5 6 7 8 9 10 11

architecture: arm64

actions:
  - action: debootstrap
    suite: testing
    components:
      - main
Rohan Garg's avatar
Rohan Garg committed
12
    mirror: https://deb.debian.org/debian
Rohan Garg's avatar
Rohan Garg committed
13 14 15
    variant: minbase

  - action: apt
16 17 18
    packages: [ libc6, sudo, adduser, systemd-sysv, initramfs-tools,
                u-boot-tools, u-boot-menu, util-linux, unzip, weston,
                policykit-1, kbd, locales, network-manager,
19
                libsensors5, libllvm9, ssh, ssh-import-id, net-tools,
20
                iputils-ping, libgl1-mesa-dri, libglapi-mesa, libegl-mesa0,
Fabrizio Castro's avatar
Fabrizio Castro committed
21
                libgbm1, libgles1, libgles2, libgl1, linux-image-arm64,
22
                libv4l-0, u-boot-rockchip ]
Rohan Garg's avatar
Rohan Garg committed
23 24

  - action: image-partition
Rohan Garg's avatar
Rohan Garg committed
25
    imagename: {{$image}}
26
    imagesize: 7GB
Rohan Garg's avatar
Rohan Garg committed
27 28 29 30 31 32 33
    partitiontype: gpt
    mountpoints:
      - mountpoint: /
        partition: root
    partitions:
      - name: root
        fs: ext4
34
        start: 32768s
Rohan Garg's avatar
Rohan Garg committed
35 36 37 38 39 40 41 42 43 44 45
        end: 100%
        flags: [ boot ]

  # Deploy the filesystem to an image
  - action: filesystem-deploy
    description: Deploying filesystem onto image

  - action: overlay
    source: overlays/
    destination: /

Rohan Garg's avatar
Rohan Garg committed
46 47 48 49
  - action: run
    chroot: true
    script: scripts/setup-user.sh

Rohan Garg's avatar
Rohan Garg committed
50 51
  - action: run
    chroot: true
Fabrizio Castro's avatar
Fabrizio Castro committed
52
    command: systemctl enable weston && systemctl enable serial-getty@ttyS2.service
Rohan Garg's avatar
Rohan Garg committed
53

Rohan Garg's avatar
Rohan Garg committed
54 55 56
  - action: run
    description: Set hostname
    chroot: true
Fabrizio Castro's avatar
Fabrizio Castro committed
57
    command: echo debian > /etc/hostname && echo "127.0.0.1 debian" >> /etc/hosts
Rohan Garg's avatar
Rohan Garg committed
58

Rohan Garg's avatar
Rohan Garg committed
59 60 61 62 63 64 65
  - action: raw
    origin: filesystem
    source: {{$ubootPath}}/idbloader.img
    offset: '{{ sector 64 }}'

  - action: raw
    origin: filesystem
66
    source: {{$ubootPath}}/u-boot.itb
Rohan Garg's avatar
Rohan Garg committed
67 68
    offset: '{{ sector 16384 }}'

69 70 71 72 73
  - action: run
    description: Update U-Boot menu
    chroot: true
    command: u-boot-update

74 75 76 77 78
  - action: run
    description: Generate PXE configuration
    chroot: true
    command: mkdir /pxelinux.cfg && sed "/^#/d; /root=UUID/d" /boot/extlinux/extlinux.conf > /pxelinux.cfg/default

Fabrizio Castro's avatar
Fabrizio Castro committed
79 80 81
  - action: pack
    file: {{$nfsImage}}
    compression: gz