Skip to content

Commit

Permalink
Merge branch 'ci-rename'
Browse files Browse the repository at this point in the history
CI: correct artifacts naming
  • Loading branch information
szszszsz committed Jul 30, 2021
2 parents 6e6319a + 81ec22e commit 6fd0fcd
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ build:
after_script:
- wget $icon_server/checkmark/$CI_COMMIT_REF_NAME/$CI_COMMIT_SHA/$CI_JOB_NAME/$CI_JOB_STATUS/${CI_JOB_URL#*/*/*/}
- mkdir -p artifacts
- cp ./src/*.hex artifacts
- cp ./src/*.hex ./src/*sha256sum artifacts
artifacts:
paths:
- artifacts
30 changes: 22 additions & 8 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,27 @@ include build.mk

GIT=$(shell git describe)
FIRMWARE=nitrokey-storage-$(GIT).hex
FIRMWARE_CLEAN=nitrokey-storage-$(GIT)-reproducible.hex
HASHFN=sha256sum

all: firmware.hex $(FIRMWARE) firmware_info firmware.lss firmware-extended.hex
ls -lh $<
all: $(FIRMWARE_CLEAN) $(FIRMWARE) firmware_info firmware.lss $(HASHFN)
-rm firmware.hex firmware-extended.hex
ls -lh *hex *sha256sum $(HASHFN)
@cat $(HASHFN)

#%.sha256sum: %
# sha256sum $< > $@

$(HASHFN): $(FIRMWARE_CLEAN) $(FIRMWARE)
sha256sum $^ > $@

$(FIRMWARE): firmware-extended.hex
cp $< $@

.PHONY: clean_artifacts
clean_artifacts:
-rm *sha256sum *hex $(HASHFN)

.PHONY: clean
clean:
-rm $(OBJS) $(OBJSASM) $(STATEFILES)
Expand All @@ -34,9 +48,9 @@ USB_MASS.elf: $(OBJS) $(OBJSASM)
@$(RUNASM) -o $@ $<

.PHONY: firmware_info
firmware_info: | pipenv firmware.hex
-cd ../tools && pipenv run ./randomize_empty_space.py status --firmware-file ../src/firmware.hex
-cd ../tools && pipenv run ./randomize_empty_space.py status --firmware-file ../src/firmware-extended.hex
firmware_info: | pipenv $(FIRMWARE_CLEAN) $(FIRMWARE)
-cd ../tools && pipenv run ./randomize_empty_space.py status --firmware-file ../src/$(FIRMWARE_CLEAN)
-cd ../tools && pipenv run ./randomize_empty_space.py status --firmware-file ../src/$(FIRMWARE)

firmware.lss: USB_MASS.elf
$(OBJDUMP) -h -S $< > $@
Expand All @@ -47,10 +61,10 @@ pipenv:
cd ../tools && pipenv install --python `which python3`
touch $@

firmware-extended.hex: | pipenv firmware.hex
cd ../tools && pipenv run ./randomize_empty_space.py fill-empty --random-data random.bin --firmware-file ../src/firmware.hex --output-file-name ../src/firmware-extended
firmware-extended.hex: | pipenv $(FIRMWARE_CLEAN)
cd ../tools && pipenv run ./randomize_empty_space.py fill-empty --random-data random.bin --firmware-file ../src/$(FIRMWARE_CLEAN) --output-file-name ../src/firmware-extended

firmware.hex: USB_MASS.elf
$(FIRMWARE_CLEAN): USB_MASS.elf clean_artifacts
ls -l $<
$(OBJCOPY) -R .eeprom -O ihex $< $@

Expand Down

0 comments on commit 6fd0fcd

Please sign in to comment.