Skip to content

Commit

Permalink
Implementing Taskfile buildsystem
Browse files Browse the repository at this point in the history
Initial commit to utilize the Taskfile
buildsystem instead of GNU Make
In addition:

- Rebase kernel configs
- Update License date
- Reorder directory structure
- Update gitignores accordingly
- Update documentation accordingly
- Update CircleCI accordingly

Signed-off-by: Marvin Drees <[email protected]>
  • Loading branch information
MDr164 committed Sep 7, 2021
1 parent 94ad219 commit 9e3565d
Show file tree
Hide file tree
Showing 57 changed files with 1,484 additions and 5,338 deletions.
109 changes: 49 additions & 60 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,83 +27,89 @@ workflows:
jobs:
- compile
- image
#TODO: Utilize CircleCI caching for at least the kernel tarball
jobs:
clean-code:
docker:
- image: cimg/go:1.16.5
- image: cimg/go:1.16.7
working_directory: ~/go/src/github.com/u-root/u-bmc
environment:
- CGO_ENABLED: 0
steps:
- checkout
- run:
name: Install dep
command: |
wget https://github.com/golang/dep/releases/download/v0.5.1/dep-linux-amd64
mv dep-linux-amd64 dep
chmod +x dep
- run:
name: Install ineffassign
command: go get github.com/gordonklaus/ineffassign
- run:
name: Install Task
command: sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b ~/.local/bin
- run:
name: Create test key
command: |
ssh-keygen -t rsa -b 4096 -C "testkey" -N "testpass" -f ./ssh_keys
touch config/i_agree_to_the_acme_terms
go generate ./config/
ssh-keygen -t rsa -b 4096 -C "testkey" -N "testpass" -f config/ssh_keys
touch i_agree_to_the_acme_terms
echo quanta-f06-leopard-ddr3 > TARGET
task config:generate
- run:
name: vendor
command: go mod vendor
- run:
name: vet
command: |
make get
go vet $(go list ./... | grep -v /vendor/)
command: go vet $(go list ./... | grep -v vendor/)
- run:
name: gofmt
command: test -z "$(gofmt -s -l $(go list ./... | grep -v /vendor/ | cut -f 4- -d '/'))"
command: test -z "$(gofmt -s -l $(go list ./... | grep -v vendor/ | cut -f 4- -d '/'))"
- run:
name: ineffassign
command: ineffassign .
test:
docker:
- image: cimg/go:1.16.5
- image: cimg/go:1.16.7
working_directory: ~/go/src/github.com/u-root/u-bmc
environment:
- CGO_ENABLED: 0
steps:
- checkout
- run:
name: Install Task
command: sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b ~/.local/bin
- run:
name: Create test key
command: |
ssh-keygen -t rsa -b 4096 -C "testkey" -N "testpass" -f ./ssh_keys
touch config/i_agree_to_the_acme_terms
go generate ./config/
ssh-keygen -t rsa -b 4096 -C "testkey" -N "testpass" -f config/ssh_keys
touch i_agree_to_the_acme_terms
echo quanta-f06-leopard-ddr3 > TARGET
task config:generate
- run:
name: Test all
command: |
make get
make test
command: task test
- run:
name: Test coverage
command: make test TESTFLAGS=-cover
command: task coverage
race:
docker:
- image: cimg/go:1.16.5
- image: cimg/go:1.16.7
working_directory: ~/go/src/github.com/u-root/u-bmc
environment:
- CGO_ENABLED: 1
steps:
- checkout
- run:
name: Install Task
command: sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b ~/.local/bin
- run:
name: Create test key
command: |
ssh-keygen -t rsa -b 4096 -C "testkey" -N "testpass" -f ./ssh_keys
touch config/i_agree_to_the_acme_terms
go generate ./config/
ssh-keygen -t rsa -b 4096 -C "testkey" -N "testpass" -f config/ssh_keys
touch i_agree_to_the_acme_terms
echo quanta-f06-leopard-ddr3 > TARGET
task config:generate
- run:
name: Race detector
command: |
make get
make test TESTFLAGS=-race
command: task race
compile:
docker:
- image: cimg/go:1.16.5
- image: cimg/go:1.16.7
working_directory: ~/go/src/github.com/u-root/u-bmc
environment:
- CGO_ENABLED: 0
Expand All @@ -112,65 +118,48 @@ jobs:
- run:
name: Create test key
command: |
ssh-keygen -t rsa -b 4096 -C "testkey" -N "testpass" -f ./ssh_keys
touch config/i_agree_to_the_acme_terms
go generate ./config/
ssh-keygen -t rsa -b 4096 -C "testkey" -N "testpass" -f config/ssh_keys
touch i_agree_to_the_acme_terms
echo quanta-f06-leopard-ddr3 > TARGET
task config:generate
- run:
name: build all commands
command: |
make get
cd cmd
go install -a ./...
cd ../
go install -a ./platform/quanta-f06-leopard-ddr3/cmd/uinit
image:
docker:
- image: cimg/go:1.16.5
- image: cimg/go:1.16.7
working_directory: ~/go/src/github.com/u-root/u-bmc
environment:
- CGO_ENABLED: 0
- GO111MODULE: "on"
steps:
- checkout
- run:
name: Install dependencies
# Workaround for u-root only needed until proper modules support is in place
command: |
sudo apt-get update
sudo apt-get install gcc-arm-none-eabi mtd-utils fakeroot flex bison device-tree-compiler bc libssl-dev zlib1g-dev libglib2.0-dev libpixman-1-dev unzip cpio patch libelf-dev qemu-kvm
go mod download
go mod verify
GO111MODULE=off go get github.com/u-root/u-root
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b ~/.local/bin
- run:
name: Create test key
command: |
ssh-keygen -t rsa -b 4096 -C "testkey" -N "testpass" -f ./ssh_keys
touch config/i_agree_to_the_acme_terms
# TODO(bluecmd): This step should probably be cached somehow
- run:
name: Update submodules
command: |
# Since linux is huge it would be good to cache the tar file
# from somewhere. No submodules necessary anymore.
ssh-keygen -t rsa -b 4096 -C "testkey" -N "testpass" -f config/ssh_keys
touch i_agree_to_the_acme_terms
echo quanta-f06-leopard-ddr3 > TARGET
- run:
name: Build image
command: |
go generate ./config/
make get
make
command: task build
- store_artifacts:
path: flash.img
path: build/flash.img
destination: flash.img
- run:
name: Prepare integration tests
command: |
make integration/bzImage
export UBMC_QEMU=qemu-system-arm
export UBMC_NATIVE_QEMU=qemu-system-x86_64
- run:
name: Run integration tests
command: |
cd integration/
go test
command: task integration
- store_artifacts:
path: integration/serial
- run:
Expand Down
45 changes: 13 additions & 32 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,32 +1,13 @@
boot/out
boot/keys
boot/loader.cpio.gz
boot/loader/loader
boot/signer/signer
boot/*.dtb.*
boot/zImage*
boot/modules
boot/boot.bin
boot/boot-config.auto.h
boot/kexec
*.img
.*.sw*
root/
integration/bzImage
integration/serial/
initramfs.cpio
initramfs.cpio.tmp
ssh_keys.pub
u-bmc
linux.config.old
module/.*.cmd
module/.tmp_versions
module/*.ko
module/*.mod.c
module/*.mod
module/*.o
module/modules.*
module/Module.symvers
vendor/**/.bb
*.tar.gz
linux-*
vendor/*
build/*
.task/*
i_agree_to_the_acme_terms
TARGET
config/ssh_keys.pub
config/ssh_keys.go
config/version.go
config/acme.go
config/sim_pebble.go
config/sim-pebble.crt
config/sim-pebble.key
**/.bb
1 change: 0 additions & 1 deletion .gitmodules

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2012-2017, u-root Authors
Copyright (c) 2012-2021, u-root Authors
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
Loading

0 comments on commit 9e3565d

Please sign in to comment.