Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make hotp-verification hashes same across two CIs (WIP) #5

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ jobs:
- store-artifacts:
path: build/qemu-coreboot/hashes.txt

- run:
name: clear old cache for libremkey-hotp-verification*
command: |
rm -rf build/libremkey-hotp-verification* -v

- run:
name: x230-hotp_verification
command: |
Expand All @@ -77,6 +82,10 @@ jobs:
name: Archiving build logs to bundle in artifacts
command: |
tar zcvf logs.tar.gz ./build/log/*
- run:
name: Archiving hotp verification build files
command: |
tar zcvf libremkey-hotp.tar.gz ./build/libremkey-hotp-verification*


- store-artifacts:
Expand All @@ -89,6 +98,8 @@ jobs:
path: build/x230-hotp_verification/initrd.cpio.xz
- store-artifacts:
path: logs.tar.gz
- store-artifacts:
path: libremkey-hotp.tar.gz

- save_cache:
key: heads-{{ .Branch }}
Expand Down
16 changes: 13 additions & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ image: fedora:30

variables:
DOCKER_DRIVER: overlay2
V: "1"
CACHE_VERSION: "1"

stages:
- build
Expand All @@ -11,16 +13,23 @@ build:
retry: 2
cache:
paths:
- ./
key: "$CI_COMMIT_REF_SLUG"
- packages
- crossgcc
- build
key: "$CI_COMMIT_REF_SLUG-$CACHE_VERSION"
script:
- dnf install -y @development-tools gcc-c++ gcc-gnat zlib-devel perl-Digest-MD5 perl-Digest-SHA uuid-devel pcsc-tools ncurses-devel lbzip2 libuuid-devel lzma elfutils-libelf-devel bc bzip2 bison flex git gnupg iasl m4 nasm patch python wget libusb-devel cmake automake pv bsdiff autoconf libtool expat-devel boost-devel libaio-devel cpio texinfo diceware
- git fetch origin
# below should not be needed anymore once the cache paths are corrected # TODO remove
# - git clone https://gitlab.com/szszszsz/heads.git && rm .git -rf && mv heads/.git . && rm heads -rf
- git fetch origin
- git reset --hard origin/$CI_COMMIT_REF_NAME
- rm -rf build/libremkey-hotp-verification* -v
- make BOARD=x230-hotp_verification || (find ./build/log/ -cmin 1|xargs tail; exit 1)
- echo "x230-hotp_verification hashes:"
- cat ./build/x230-hotp_verification/hashes.txt
- tar zcvf logs.tar.gz ./build/log/*
- tar zcvf libremkey-hotp.tar.gz ./build/libremkey-hotp-verification*

artifacts:
paths:
- ./build/x230-hotp_verification/coreboot.rom
Expand All @@ -29,3 +38,4 @@ build:
- ./build/x230-hotp_verification/hashes.txt
- ./build/x230-hotp_verification/initrd.cpio.xz
- ./logs.tar.gz
- ./libremkey-hotp.tar.gz
8 changes: 5 additions & 3 deletions modules/libremkey-hotp-verification
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ modules-$(CONFIG_LIBREMKEY) += libremkey-hotp-verification

libremkey-hotp-verification_depends := libusb $(musl_dep)

libremkey-hotp-verification_version := d4948fddd617022635129f9b00db3f98de01016f
libremkey-hotp-verification_version := 809953b9b4bef97a4cffaa20d675bd7fe9d8da53
libremkey-hotp-verification_dir := libremkey-hotp-verification-$(libremkey-hotp-verification_version)
libremkey-hotp-verification_tar := nitrokey-hotp-verification-$(libremkey-hotp-verification_version).tar.gz
libremkey-hotp-verification_url := https://github.com/Nitrokey/nitrokey-hotp-verification/archive/$(libremkey-hotp-verification_version).tar.gz
libremkey-hotp-verification_hash := 36125fc7986afdfc309e963f767fe8f10de109da022d222b0bd9ac26bf18eb52
libremkey-hotp-verification_hash := 251e5cef74e4e45eeddc49e4a1da1e22d1de774cd32cb0451a9030579ae958ba

libremkey-hotp-verification_target := \
$(MAKE_JOBS) \
Expand All @@ -16,10 +16,12 @@ libremkey-hotp-verification_output := \
libremkey_hotp_verification \
libremkey_hotp_initialize

FLAGS=-fdebug-prefix-map=$PWD=heads -gno-record-gcc-switches -DNDEBUG -fno-guess-branch-probability -Wdate-time -frandom-seed=0x42 -O0

libremkey-hotp-verification_configure := \
INSTALL="$(INSTALL)" \
CROSS="$(CROSS)" \
cmake -DADD_GIT_INFO=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=./Toolchain-heads.cmake -DCMAKE_AR="$(CROSS)ar" .
$(CROSS_TOOLS) $(MAKE) LDFLAGS="$(INSTALL)/lib/libusb-1.0.so" && $(MAKE) install INSTALL="$(INSTALL)"

libremkey-hotp-verification_depends += hidapi
modules-y += hidapi
Expand Down