diff --git a/.github/workflows/debos.yml b/.github/workflows/debos.yml index 426ca302..231902be 100644 --- a/.github/workflows/debos.yml +++ b/.github/workflows/debos.yml @@ -62,23 +62,22 @@ jobs: # operating system from the github runner one; install debos - name: Setup build environment run: | - set -x - # privileged container as debos will use mounts - sudo incus init "${INCUS_IMAGE}" "${INCUS_NAME}" \ - -c security.privileged=true -c security.nesting=true - sudo incus start "${INCUS_NAME}" - # wait for network to be up (prior to running apt) - sudo incus exec "${INCUS_NAME}" \ + set -x + # privileged container as debos will use mounts + sudo incus init "${INCUS_IMAGE}" "${INCUS_NAME}" \ + -c security.privileged=true -c security.nesting=true + sudo incus start "${INCUS_NAME}" + # wait for network to be up (prior to running apt) + sudo incus exec "${INCUS_NAME}" \ /usr/lib/systemd/systemd-networkd-wait-online - ( - # these commands are run inside the container - cat < diff --git a/debos-recipes/qualcomm-linux-debian-image.yaml b/debos-recipes/qualcomm-linux-debian-image.yaml new file mode 100644 index 00000000..73f96c60 --- /dev/null +++ b/debos-recipes/qualcomm-linux-debian-image.yaml @@ -0,0 +1,101 @@ +{{- $dtb := or .dtb "firmware" }} +{{- $imagesize := or .imagesize "4GiB" }} +{{- $imagetype := or .imagetype "ufs" }} +{{- $image := or .image (printf "disk-%s.img" $imagetype) }} + +architecture: arm64 +sectorsize: {{if eq $imagetype "ufs"}} 4096 {{else}} 512 {{end}} + +actions: + - action: unpack + description: Unpack root filesystem + compression: gz + file: rootfs.tar.gz + +{{- if ne $dtb "firmware" }} + - action: run + description: Use OS device tree override (board specific) + chroot: true + command: | + set -eu + mkdir -p /etc/kernel + echo {{ $dtb }} >/etc/kernel/devicetree +{{- end }} + + # parttype values are from: + # https://www.freedesktop.org/wiki/Specifications/DiscoverablePartitionsSpec/ + - action: image-partition + description: Create an image file + imagename: {{ $image }} + imagesize: {{ $imagesize }} + partitiontype: gpt + partitions: + - name: esp + partlabel: ESP + flags: [ boot, esp ] + # EFI System Partition + parttype: c12a7328-f81f-11d2-ba4b-00a0c93ec93b + fs: vfat + start: 4MiB + # size of 512MiB + end: 516MiB + fsck: true + - name: root + # Root Partition (64-bit ARM/AArch64) + parttype: b921b045-1df0-41c3-af44-4c6f280d3fae + fs: ext4 + # 4MiB after ESP + start: 520MiB + end: 100% + fsck: true + mountpoints: + - mountpoint: /boot/efi/ + partition: esp + - mountpoint: / + partition: root + + # XXX these kernel options might be specific to a kernel version or board + - action: filesystem-deploy + setup-fstab: true + append-kernel-cmdline: clk_ignore_unused pd_ignore_unused audit=0 deferred_probe_timeout=30 + + - action: apt + recommends: true + description: Make system bootable with systemd-boot + packages: + - systemd-boot + # TODO investigate why systemd-boot Recommends: shim-signed which + # Depends on grub packages + - shim-signed- + + - action: run + description: Create task to grow root filesystem on first boot + chroot: true + command: | + set -eu + # for growpart + apt -y install cloud-guest-utils + # extract the dev of the root filesystem from fstab; change UUID=id into + # /dev/disk/by-uuid/id + ROOTFS_DEV=$( + awk '$2 == "/" {gsub("UUID=", "/dev/disk/by-uuid/"); print $1}' \ + /etc/fstab + ) + # generate systemd unit to grow the second partition with above UUID + cat >/etc/systemd/system/debos-grow-rootfs.service </etc/kernel/devicetree -{{- end }} - - action: apt description: Install kernel and firmware packages recommends: true @@ -197,76 +184,7 @@ actions: /etc/apt/sources.list.d/debian-experimental.sources {{- end }} - # parttype values are from: - # https://www.freedesktop.org/wiki/Specifications/DiscoverablePartitionsSpec/ - - action: image-partition - description: Create an image file - imagename: {{ $image }} - imagesize: {{ $imagesize }} - partitiontype: gpt - partitions: - - name: esp - partlabel: ESP - flags: [ boot, esp ] - # EFI System Partition - parttype: c12a7328-f81f-11d2-ba4b-00a0c93ec93b - fs: vfat - start: 4MiB - # size of 512MiB - end: 516MiB - fsck: true - - name: root - # Root Partition (64-bit ARM/AArch64) - parttype: b921b045-1df0-41c3-af44-4c6f280d3fae - fs: ext4 - # 4MiB after ESP - start: 520MiB - end: 100% - fsck: true - mountpoints: - - mountpoint: /boot/efi/ - partition: esp - - mountpoint: / - partition: root - - # XXX these kernel options might be specific to a kernel version or board - - action: filesystem-deploy - setup-fstab: true - append-kernel-cmdline: clk_ignore_unused pd_ignore_unused audit=0 deferred_probe_timeout=30 - - - action: apt - recommends: true - description: Make system bootable with systemd-boot - packages: - - systemd-boot - # TODO investigate why systemd-boot Recommends: shim-signed which - # Depends on grub packages - - shim-signed- - - - action: run - description: Create task to grow root filesystem on first boot - chroot: true - command: | - set -eu - # for growpart - apt -y install cloud-guest-utils - # extract the dev of the root filesystem from fstab; change UUID=id into - # /dev/disk/by-uuid/id - ROOTFS_DEV=$( - awk '$2 == "/" {gsub("UUID=", "/dev/disk/by-uuid/"); print $1}' \ - /etc/fstab - ) - # generate systemd unit to grow the second partition with above UUID - cat >/etc/systemd/system/debos-grow-rootfs.service <