Skip to content

Commit

Permalink
ayufan: dev.mk: update ci scripts
Browse files Browse the repository at this point in the history
Change-Id: I703cd9d4da334d04f22b56a6d13e33e180550f21
  • Loading branch information
ayufan committed Jun 3, 2018
1 parent 0d82256 commit 5251846
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 13 deletions.
24 changes: 23 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,29 @@ build:
only: [branches]
script:
- rm -f ../*.deb
- export RELEASE=$(date +%Y%m%d%H%M)
- |
set -x
all_pipeline_ids() {
for i in $(seq 1 "${2:-10}"); do
result=$(curl "https://gitlab.com/$1/pipelines.json?page=$i" |
jq -r '.pipelines[].id')
[[ -z "$result" ]] && return 0
echo "$result"
done
echo "all_pipeline_ids: failed to get all ids" 1>&2
return 1
}
get_pipeline_iid() {
all_pipeline_ids "$1" "$3" | jq -r "select(. <= $2)" | wc -l
}
export RELEASE=$((1000+$(get_pipeline_iid "$CI_PROJECT_PATH" "$CI_PIPELINE_ID")))
echo "Current release is $RELEASE."
- ./dev-make kernel-package
- |
set -x
Expand Down
26 changes: 14 additions & 12 deletions dev.mk
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
RELEASE ?= 0.1~dev
KERNEL_EXTRAVERSION ?= -rockchip-ayufan-$(RELEASE)
RELEASE ?= 1
KERNEL_DEFCONFIG ?= rockchip_linux_defconfig

BOARD ?= rk3328-rock64

export KDEB_PKGVERSION=$(RELEASE)~ayufan
KERNEL_RELEASE ?= $(shell $(KERNEL_MAKE) -s kernelversion)

export KDEB_PKGVERSION=$(KERNEL_RELEASE)-$(RELEASE)-ayufan

KERNEL_MAKE ?= make \
EXTRAVERSION=$(KERNEL_EXTRAVERSION) \
ARCH=arm64 \
HOSTCC=aarch64-linux-gnu-gcc \
CROSS_COMPILE="ccache aarch64-linux-gnu-"

KERNEL_RELEASE ?= $(shell $(KERNEL_MAKE) -s kernelversion)

.config: arch/arm64/configs/$(KERNEL_DEFCONFIG)
$(KERNEL_MAKE) $(KERNEL_DEFCONFIG)

.PHONY: .scmversion
.scmversion:
@echo "-$(RELEASE)-ayufan-g$$(git rev-parse --short HEAD)" > .scmversion

version:
@$(KERNEL_MAKE) -s kernelversion
@echo "$(KDEB_PKGVERSION)"

.PHONY: info
info: .config
info: .config .scmversion
@$(KERNEL_MAKE) -s kernelrelease

.PHONY: kernel-menuconfig
Expand All @@ -32,20 +34,20 @@ kernel-menuconfig:
mv defconfig arch/arm64/configs/$(KERNEL_DEFCONFIG)

.PHONY: kernel-image
kernel-image: .config
kernel-image: .config .scmversion
$(KERNEL_MAKE) Image dtbs -j$$(nproc)

.PHONY: kernel-modules
kernel-image-and-modules: .config
kernel-image-and-modules: .config .scmversion
$(KERNEL_MAKE) Image modules dtbs -j$$(nproc)
$(KERNEL_MAKE) modules_install INSTALL_MOD_PATH=$(CURDIR)/out/linux_modules

.PHONY: kernel-package
kernel-package: .config
kernel-package: .config .scmversion
$(KERNEL_MAKE) bindeb-pkg -j$$(nproc)

.PHONY: kernel-update-dts
kernel-update-dts: .config
kernel-update-dts: .config .scmversion
$(KERNEL_MAKE) dtbs -j$$(nproc)
rsync --partial --checksum -rv arch/arm64/boot/dts/rockchip/$(BOARD).dtb root@$(REMOTE_HOST):$(REMOTE_DIR)/boot/efi/dtb

Expand Down

0 comments on commit 5251846

Please sign in to comment.