Skip to content

Commit

Permalink
ayufan: dev.mk: update version support
Browse files Browse the repository at this point in the history
  • Loading branch information
ayufan committed Nov 10, 2023
1 parent ad1b2d1 commit c2d3f24
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
1 change: 1 addition & 0 deletions arch/arm64/configs/rockchip_linux_defconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_SYSVIPC=y
CONFIG_POSIX_MQUEUE=y
CONFIG_GENERIC_IRQ_DEBUGFS=y
Expand Down
31 changes: 15 additions & 16 deletions dev.mk
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
RELEASE ?=
KERNEL_DEFCONFIG ?= rockchip_linux_defconfig

ifneq (,$(RELEASE))
LOCALVERSION ?= -$(RELEASE)-ayufan-g$$(git rev-parse --short HEAD)
else
LOCALVERSION ?= -dev
endif

KERNEL_VERSION ?= $(shell $(KERNEL_MAKE) -s kernelversion)
KERNEL_RELEASE ?= $(shell $(KERNEL_MAKE) -s kernelrelease)
KDEB_PKGVERSION ?= $(KERNEL_VERSION)-$(RELEASE)-ayufan

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

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

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

version:
@echo "$(KDEB_PKGVERSION)"

.PHONY: info
info: .config .scmversion
info: .config
@echo $(KERNEL_RELEASE)

.PHONY: kernel-menuconfig
Expand All @@ -36,33 +35,33 @@ kernel-menuconfig:
mv defconfig arch/arm64/configs/$(KERNEL_DEFCONFIG)

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

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

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

REMOTE_DIR ?= root@$(REMOTE_HOST):

.PHONY: kernel-update-modules
kernel-update-modules: .config .scmversion
kernel-update-modules: .config
$(KERNEL_MAKE) modules -j$$(nproc)
$(KERNEL_MAKE) modules_install INSTALL_MOD_PATH=$(CURDIR)/out/linux_modules
rsync --partial --checksum -av out/linux_modules/lib/modules/$(KERNEL_RELEASE) $(REMOTE_DIR)/lib/modules

.PHONY: kernel-update-dts
kernel-update-dts: .config .scmversion
kernel-update-dts: .config
$(KERNEL_MAKE) dtbs -j$$(nproc)
rsync --partial --checksum --include="*.dtb" -rv arch/arm64/boot/dts/rockchip $(REMOTE_DIR)/boot/dtbs/$(KERNEL_RELEASE)

.PHONY: kernel-update
kernel-update-image: .scmversion
kernel-update-image:
rsync --partial --checksum -rv arch/arm64/boot/Image $(REMOTE_DIR)/boot/vmlinuz-$(KERNEL_RELEASE)
rsync --partial --checksum --include="*.dtb" -rv arch/arm64/boot/dts/rockchip $(REMOTE_DIR)/boot/dtbs/$(KERNEL_RELEASE)
rsync --partial --checksum -av out/linux_modules/lib/modules/$(KERNEL_RELEASE) $(REMOTE_DIR)/lib/modules

0 comments on commit c2d3f24

Please sign in to comment.