Skip to content

fix kernel compile problem for arm64 #137

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

Merged
merged 2 commits into from
May 30, 2020
Merged
Changes from 1 commit
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
32 changes: 24 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@ DSC_FILE_URL = "http://security.debian.org/debian-security/pool/updates/main/l/l
DEBIAN_FILE_URL = "http://security.debian.org/debian-security/pool/updates/main/l/linux/linux_4.19.67-2+deb10u2.debian.tar.xz"
ORIG_FILE_URL = "http://security.debian.org/debian-security/pool/updates/main/l/linux/linux_4.19.67.orig.tar.xz"

define dpkg-architecture-armhf
$(shell dpkg-architecture -aarmhf) CROSS_COMPILE=arm-linux-gnueabihf-
Copy link
Contributor

@antony-rheneus antony-rheneus May 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need of cross compilation, as multi arch is enabled

endef
define dpkg-architecture-arm64
$(shell dpkg-architecture -aarm64) CROSS_COMPILE=aarch64-linux-gnu-
endef
define dpkg-architecture-amd64
$(shell dpkg-architecture -aamd64) CROSS_COMPILE=
endef

$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# Obtaining the Debian kernel source
rm -rf $(BUILD_DIR)
Expand All @@ -74,13 +84,13 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
debian/bin/gencontrol.py

# generate linux build file for amd64_none_amd64
# fakeroot make -f debian/rules.gen setup_armhf_none_armmp
# fakeroot make -f debian/rules.gen setup_arm64_none
fakeroot make -f debian/rules.gen setup_amd64_none_amd64
$(call dpkg-architecture-armhf) fakeroot make -f debian/rules.gen setup_armhf_none_armmp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The one mentioned in this comment also does the job
#121 (comment)

$(call dpkg-architecture-arm64) fakeroot make -f debian/rules.gen setup_arm64_none
$(call dpkg-architecture-amd64) fakeroot make -f debian/rules.gen setup_amd64_none_amd64

# Applying patches and configuration changes
# git add debian/build/build_armhf_none_armmp/.config -f
# git add debian/build/build_arm64_none_arm64/.config -f
git add debian/build/build_armhf_none_armmp/.config -f
git add debian/build/build_arm64_none_arm64/.config -f
git add debian/build/build_amd64_none_amd64/.config -f
git add debian/config.defines.dump -f
git add debian/control -f
Expand All @@ -93,11 +103,17 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
stg import -s ../patch/series

# Building a custom kernel from Debian kernel source
DO_DOCS=False fakeroot make -f debian/rules -j $(shell nproc) binary-indep
ifeq ($(CONFIGURED_ARCH), armhf)
fakeroot make -f debian/rules.gen -j $(shell nproc) binary-arch_$(CONFIGURED_ARCH)_none_armmp
$(call dpkg-architecture-armhf) DO_DOCS=False fakeroot make -f debian/rules -j $(shell nproc) binary-indep
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can reduce multiple/else by.

  •   DO_DOCS=False ARCH=$(CONFIGURED_ARCH) DEB_HOST_ARCH=$(CONFIGURED_ARCH)  fakeroot make -f debian/rules -j $(shell nproc) binary-indep
    

$(call dpkg-architecture-armhf) fakeroot make -f debian/rules.gen -j $(shell nproc) binary-arch_$(CONFIGURED_ARCH)_none_armmp
else
ifeq ($(CONFIGURED_ARCH), arm64)
$(call dpkg-architecture-arm64) DO_DOCS=False fakeroot make -f debian/rules -j $(shell nproc) binary-indep
$(call dpkg-architecture-arm64) fakeroot make -f debian/rules.gen -j $(shell nproc) binary-arch_$(CONFIGURED_ARCH)_none
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can reduce arch check if else by,
ARCH=$(CONFIGURED_ARCH) DEB_HOST_ARCH=$(CONFIGURED_ARCH) fakeroot make -f debian/rules.gen -j $(shell nproc) binary-arch_$(CONFIGURED_ARCH)_none

else
fakeroot make -f debian/rules.gen -j $(shell nproc) binary-arch_$(CONFIGURED_ARCH)_none
$(call dpkg-architecture-amd64) DO_DOCS=False fakeroot make -f debian/rules -j $(shell nproc) binary-indep
$(call dpkg-architecture-amd64) fakeroot make -f debian/rules.gen -j $(shell nproc) binary-arch_$(CONFIGURED_ARCH)_none
endif
endif
popd

Expand Down