Skip to content

Commit

Permalink
feat: support Allwinner U-Boot build
Browse files Browse the repository at this point in the history
Signed-off-by: ZHANG Yuntian <[email protected]>
  • Loading branch information
RadxaYuntian committed Feb 25, 2025
1 parent 618a830 commit 77daae3
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 223 deletions.
222 changes: 0 additions & 222 deletions src/share/rsdk/infra-package/Makefile.u-boot

This file was deleted.

86 changes: 86 additions & 0 deletions src/share/rsdk/infra-package/Makefile.u-boot.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
function(
target,
) |||
-include .github/local/Makefile.local
PROJECT ?= %(target)s
UBOOT_FORK ?= %(fork)s
ARCH ?= arm
CROSS_COMPILE ?= aarch64-linux-gnu-
CUSTOM_MAKE_DEFINITIONS ?=
CUSTOM_DEBUILD_ENV ?= DEB_BUILD_OPTIONS='parallel=1'
UMAKE ?= $(MAKE) -C "$(SRC-UBOOT)" -j$(shell nproc) \
$(CUSTOM_MAKE_DEFINITIONS) \
ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) \
UBOOTVERSION=$(shell dpkg-parsechangelog -S Version)-$(UBOOT_FORK)
UBOOT_PRODUCTS ?=
.DEFAULT_GOAL := all
.PHONY: all
all: build
#
# Test
#
.PHONY: test
test:
#
# Build
#
DIR-OUTPUT := out
SRC-UBOOT := src
$(DIR-OUTPUT):
mkdir -p $@
.PHONY: build
build: $(DIR-OUTPUT) $(SRC-UBOOT) pre_build $(UBOOT_PRODUCTS) post_build
.PHONY: pre_build
pre_build:
# Fix file permissions when created from template
chmod +x debian/rules
.PHONY: post_build
post_build:
#
# Clean
#
.PHONY: clean_config
clean_config:
rm -f $(SRC-UBOOT)/.config
.PHONY: distclean
distclean: clean
$(UMAKE) distclean
.PHONY: clean
clean: clean-deb
$(UMAKE) clean
.PHONY: clean-deb
clean-deb:
rm -rf $(DIR-OUTPUT) debian/.debhelper debian/${PROJECT}*/ debian/u-boot-*/ debian/tmp/ debian/debhelper-build-stamp debian/files debian/*.debhelper.log debian/*.postrm.debhelper debian/*.substvars
#
# Release
#
.PHONY: dch
dch: debian/changelog
EDITOR=true gbp dch --ignore-branch --multimaint-merge --commit --release --dch-opt=--upstream
.PHONY: deb
deb: debian
$(CUSTOM_DEBUILD_ENV) debuild --no-lintian --lintian-hook "lintian --fail-on error,warning --suppress-tags bad-distribution-in-changes-file -- %%p_%%v_*.changes" --no-sign -b
.PHONY: release
release:
gh workflow run .github/workflows/new_version.yml --ref $(shell git branch --show-current)
||| % {
target: target,
fork: std.splitLimitR(target, "-", 1)[1],
}
6 changes: 6 additions & 0 deletions src/share/rsdk/infra-package/debian/control.u-boot.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ function(
python3-pyelftools,
libncurses-dev,
crossbuild-essential-arm64 [!arm64],
crossbuild-essential-armhf [!armhf],
crossbuild-essential-armel [!armel],
xxd,
bc,
lib32stdc++6 [!i386],
lib32z1 [!i386],
Package: %(target)s
Architecture: all
Expand Down
3 changes: 2 additions & 1 deletion src/share/rsdk/infra-package/template.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ local copyright = import "debian/copyright.jsonnet";
local lintian_overrides = import "debian/source/lintian-overrides.jsonnet";
local README_md = import "README.md.jsonnet";
local Makefile_linux = import "Makefile.linux.jsonnet";
local Makefile_u_boot = import "Makefile.u-boot.jsonnet";
local changelog = import "debian/changelog.jsonnet";
local control_linux = import "debian/control.linux.jsonnet";
local control_u_boot = import "debian/control.u-boot.jsonnet";
Expand Down Expand Up @@ -71,7 +72,7 @@ then
else if std.startsWith(target, "u-boot")
then
{
"Makefile": importstr "Makefile.u-boot",
"Makefile": Makefile_u_boot(target),
} + (if new_repo == true
then
{
Expand Down

0 comments on commit 77daae3

Please sign in to comment.