Skip to content

Commit

Permalink
chore: simplify the Taskfile
Browse files Browse the repository at this point in the history
Signed-off-by: AtomicFS <[email protected]>
  • Loading branch information
AtomicFS committed Dec 4, 2024
1 parent ef81b06 commit c7cb5d6
Showing 1 changed file with 22 additions and 69 deletions.
91 changes: 22 additions & 69 deletions Taskfile.yml
Original file line number Diff line number Diff line change
@@ -1,109 +1,62 @@
---
version: '3'
vars:
FIRMWARE_ACTION_CONFIG_FILE: 'coreboot-linuxboot-example.json'

tasks:
build-template:
internal: true
cmds:
- firmware-action build --config='{{.CONFIG}}' --target='{{.TARGET}}' {{.CLI_ARGS}}
- firmware-action build --config='{{.CONFIG}}' --target='{{.TARGET}}' --recursive {{.CLI_ARGS}}
requires:
vars: [CONFIG, TARGET]

#==================
# coreboot example
#==================

build:coreboot:
build:coreboot-plain:
desc: Build coreboot hello world example
cmds:
- firmware-action build --config=coreboot-example.json --target=coreboot-example {{.CLI_ARGS}}
- task: build-template
vars:
CONFIG: coreboot-example.json
TARGET: coreboot-example
status:
- test -d output-coreboot-example

#=============================================
# Run coreboot with LinuxBoot example in QEMU
#=============================================

qemu:run-coreboot:
desc: Run the coreboot in QEMU
interactive: true
cmds:
- qemu-system-x86_64 -bios output-linuxboot-coreboot/coreboot.rom -serial stdio -M q35

#================================================
# coreboot with LinuxBoot example with recursion
#================================================

build:coreboot-linuxboot:recursive:
desc: Build coreboot with linux and uroot with recursion
cmds:
- firmware-action build --config='{{.CONFIG}}' --target='{{.TARGET}}' --recursive {{.CLI_ARGS}}
vars:
CONFIG: coreboot-linuxboot-example.json
TARGET: coreboot-example-with-linuxboot
requires:
vars: [CONFIG, TARGET]

#============================================
# coreboot with LinuxBoot example one by one
#============================================
#=======================================
# coreboot with Linux and uroot example
#=======================================

build:coreboot-linuxboot:
desc: Build coreboot with linux and uroot
deps:
- task: build:linux-with-uroot
build:coreboot-linux:
desc: Build coreboot hello world example
cmds:
- if [ -d "{{.OUTPUT}}" ]; then trash "{{.OUTPUT}}"; fi
- task: build-template
vars:
CONFIG: coreboot-linuxboot-example.json
CONFIG: '{{.FIRMWARE_ACTION_CONFIG_FILE}}'
TARGET: coreboot-example-with-linuxboot
vars:
OUTPUT: 'output-linuxboot-coreboot'
sources:
- coreboot-linuxboot-example.json
- coreboot-linuxboot-example/coreboot
- coreboot-linuxboot-example/coreboot_linuxboot_defconfig
- output-linuxboot-linux/bzImage
generates:
- output-linuxboot-coreboot/coreboot.rom

build:linux-with-uroot:
desc: Build linux with uroot
deps:
- task: build:uroot
cmds:
- if [ -d "{{.OUTPUT}}" ]; then trash "{{.OUTPUT}}"; fi
- task: build-template
vars:
CONFIG: coreboot-linuxboot-example.json
CONFIG: '{{.FIRMWARE_ACTION_CONFIG_FILE}}'
TARGET: linux-example-with-uroot
vars:
OUTPUT: 'output-linuxboot-linux'
sources:
- coreboot-linuxboot-example.json
- coreboot-linuxboot-example/linux
- coreboot-linuxboot-example/linux_defconfig
- output-linuxboot-uroot/initramfs.linux_amd64.cpio
generates:
- output-linuxboot-linux/bzImage

build:uroot:
desc: Build uroot
cmds:
- if [ -d "{{.OUTPUT}}" ]; then trash "{{.OUTPUT}}"; fi
- task: build-template
vars:
CONFIG: coreboot-linuxboot-example.json
CONFIG: '{{.FIRMWARE_ACTION_CONFIG_FILE}}'
TARGET: uroot-example
vars:
OUTPUT: 'output-linuxboot-uroot'
sources:
- coreboot-linuxboot-example.json
- coreboot-linuxboot-example/u-root
generates:
- output-linuxboot-uroot/initramfs.linux_amd64.cpio

#=============================================
# Run coreboot with LinuxBoot example in QEMU
#=============================================

qemu:run-coreboot:
desc: Run the coreboot in QEMU
interactive: true
cmds:
- qemu-system-x86_64 -bios output-linuxboot-coreboot/coreboot.rom -serial stdio -M q35

0 comments on commit c7cb5d6

Please sign in to comment.