Github messages for voidlinux
 help / color / mirror / Atom feed
From: voidlinux-github@inbox.vuxu.org
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] [WIP] rpi-kernel: enable build of kernel modules
Date: Sun, 29 Sep 2019 20:50:51 +0200	[thread overview]
Message-ID: <20190929185051.cvK-kxM1-Yp4oi2VHUHe66GaH9hQ3bz0IY5WcFy9TCo@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-14823@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 472 bytes --]

There is an updated pull request by Piraty against master on the void-packages repository

https://github.com/Piraty/void-packages rpi-kernel-fix-dkms
https://github.com/void-linux/void-packages/pull/14823

[WIP] rpi-kernel: enable build of kernel modules
Thanks to @marmeladema (#8480 ,  b5fa1bd9b6ec04c20bc1fe01540295200ef552d9) (and @Hoshpak for making me aware of this commit)

A patch file from https://github.com/void-linux/void-packages/pull/14823.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-rpi-kernel-fix-dkms-14823.patch --]
[-- Type: text/x-diff, Size: 10492 bytes --]

From 1a3e72ef48d24b384804c96a432464b28bba2e51 Mon Sep 17 00:00:00 2001
From: Piraty <piraty1@inbox.ru>
Date: Sun, 29 Sep 2019 13:53:33 +0200
Subject: [PATCH 1/3] xbps-triggers: run `make scripts` with all cores

also, use `yes` to not get stuck on prompts (happened with
CONFIG_GCC_PLUGINGS).
---
 srcpkgs/xbps-triggers/files/dkms | 2 +-
 srcpkgs/xbps-triggers/template   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/xbps-triggers/files/dkms b/srcpkgs/xbps-triggers/files/dkms
index 0f1fbb9ec0a..309f7fa97b5 100755
--- a/srcpkgs/xbps-triggers/files/dkms
+++ b/srcpkgs/xbps-triggers/files/dkms
@@ -72,7 +72,7 @@ add_modules() {
 		fi
 		if [ ! -f ${f}/build/scripts/basic/fixdep ] ; then
 			echo -n "Building scripts for kernel-${_kver}... "
-			make -C ${f}/build scripts &> ${f}/build/make.log
+			yes "" | make -C -j$(nproc) ${f}/build scripts > ${f}/build/make.log 2>&1
 			if [ $? -eq 0 ]; then
 				echo "done."
 			else
diff --git a/srcpkgs/xbps-triggers/template b/srcpkgs/xbps-triggers/template
index 4247352939c..178a2b10fd5 100644
--- a/srcpkgs/xbps-triggers/template
+++ b/srcpkgs/xbps-triggers/template
@@ -1,7 +1,7 @@
 # Template file for 'xbps-triggers'
 pkgname=xbps-triggers
 version=0.113
-revision=1
+revision=2
 archs=noarch
 bootstrap=yes
 short_desc="The XBPS triggers for Void Linux"

From 51bed2a5eac9d085aa8d07e508747f2364de21cc Mon Sep 17 00:00:00 2001
From: Piraty <piraty1@inbox.ru>
Date: Sun, 29 Sep 2019 18:46:41 +0200
Subject: [PATCH 2/3] rpi-kernel: cleanup template

* define kernel arch + cross globally
* fix typo ($arch -> $_arch)
* simplify "Remove unneeded architectures"
---
 srcpkgs/rpi-kernel/template | 107 ++++++++++++++++--------------------
 1 file changed, 48 insertions(+), 59 deletions(-)

diff --git a/srcpkgs/rpi-kernel/template b/srcpkgs/rpi-kernel/template
index fe74326de4b..8cd8ad3b0ad 100644
--- a/srcpkgs/rpi-kernel/template
+++ b/srcpkgs/rpi-kernel/template
@@ -41,76 +41,67 @@ mutable_files="
 	/usr/lib/modules/${_kernver}/modules.alias.bin
 	/usr/lib/modules/${_kernver}/modules.devname"
 
+_arch=
+case "$XBPS_TARGET_MACHINE" in
+	arm*) _arch=arm ;;
+	aarch64*) _arch=arm64 ;;
+esac
+_cross=
+if [ "$CROSS_BUILD" ]; then
+	_cross="CROSS_COMPILE=${XBPS_CROSS_TRIPLET}-"
+fi
+
 pre_configure() {
 	# Remove .git directory, otherwise scripts/setkernelversion.sh
 	# modifies KERNELRELEASE and appends + to it.
 	rm -rf .git
 }
 do_configure() {
-	if [ "$CROSS_BUILD" ]; then
-		_args="CROSS_COMPILE=${XBPS_CROSS_TRIPLET}-"
-	fi
+	local target defconfig
 
-	# Use upstream default configuration, no need to maintain ours.
+	# Use upstream's default configuration, no need to maintain ours.
 	case "$XBPS_TARGET_MACHINE" in
-	aarch64*)
-		echo "CONFIG_CONNECTOR=y" >> arch/arm64/configs/bcmrpi3_defconfig
-		echo "CONFIG_PROC_EVENTS=y" >> arch/arm64/configs/bcmrpi3_defconfig
-		echo "CONFIG_F2FS_FS_SECURITY=y" >> arch/arm64/configs/bcmrpi3_defconfig
-		echo "CONFIG_CGROUP_PIDS=y" >> arch/arm64/configs/bcmrpi3_defconfig
-		make ${makejobs} ${_args} ARCH=arm64 bcmrpi3_defconfig
-		;;
-	armv7l*)
-		echo "CONFIG_USER_NS=y" >> arch/arm/configs/bcm2709_defconfig
-		echo "CONFIG_CONNECTOR=y" >> arch/arm/configs/bcm2709_defconfig
-		echo "CONFIG_PROC_EVENTS=y" >> arch/arm/configs/bcm2709_defconfig
-		echo "CONFIG_F2FS_FS_SECURITY=y" >> arch/arm/configs/bcm2709_defconfig
-		echo "CONFIG_CGROUP_PIDS=y" >> arch/arm/configs/bcm2709_defconfig
-		make ${makejobs} ${_args} ARCH=arm bcm2709_defconfig
-		;;
-	armv6l*)
-		echo "CONFIG_USER_NS=y" >> arch/arm/configs/bcmrpi_defconfig
-		echo "CONFIG_CONNECTOR=y" >> arch/arm/configs/bcmrpi_defconfig
-		echo "CONFIG_PROC_EVENTS=y" >> arch/arm/configs/bcmrpi_defconfig
-		echo "CONFIG_F2FS_FS_SECURITY=y" >> arch/arm/configs/bcmrpi_defconfig
-		echo "CONFIG_CGROUP_PIDS=y" >> arch/arm/configs/bcmrpi_defconfig
-		make ${makejobs} ${_args} ARCH=arm bcmrpi_defconfig
-		;;
+		# RPi3
+		aarch64*)
+			target=bcmrpi3_defconfig
+			;;
+		# RPi2 / RPi3
+		armv7l*)
+			target=bcm2709_defconfig
+			;;
+		# RPi1
+		armv6l*)
+			target=bcmrpi_defconfig
+			;;
 	esac
 
+	defconfig="arch/${_arch}/configs/${target}"
+	echo "CONFIG_CONNECTOR=y" >> "$defconfig"
+	echo "CONFIG_PROC_EVENTS=y" >> "$defconfig"
+	echo "CONFIG_F2FS_FS_SECURITY=y" >> "$defconfig"
+	echo "CONFIG_CGROUP_PIDS=y" >> "$defconfig"
+
+	make ${makejobs} ${_cross} ARCH=${_arch} ${target}
+
 	# Always use our revision to CONFIG_LOCALVERSION to match our pkg version.
-	sed -i -e "s|^\(CONFIG_LOCALVERSION=\).*|\1\"_${revision}\"|" .config
+	vsed -i -e "s|^\(CONFIG_LOCALVERSION=\).*|\1\"_${revision}\"|" .config
 }
 do_build() {
-	if [ "$CROSS_BUILD" ]; then
-		_args="CROSS_COMPILE=${XBPS_CROSS_TRIPLET}-"
-	fi
+	local target
 
 	case "$XBPS_TARGET_MACHINE" in
-	arm*)
-		_arch=arm
-		_targets="zImage modules dtbs"
-		;;
-	aarch64*)
-		unset LDFLAGS
-		_arch=arm64
-		_targets="Image modules dtbs"
-		;;
+		arm*)
+			target="zImage modules dtbs"
+			;;
+		aarch64*)
+			target="Image modules dtbs"
+			;;
 	esac
 
-	make ${makejobs} ${_args} ARCH=${_arch} prepare
-	make ${makejobs} ${_args} ARCH=${_arch} ${_targets}
+	make ${makejobs} ${_cross} ARCH=${_arch} prepare
+	make ${makejobs} ${_cross} ARCH=${_arch} ${target}
 }
 do_install() {
-	case "$XBPS_TARGET_MACHINE" in
-	arm*)
-		_arch="arm"
-	;;
-	aarch64*)
-		_arch="arm64"
-	;;
-	esac
-
 	local hdrdest
 
 	# Run depmod after compressing modules.
@@ -173,14 +164,11 @@ do_install() {
 	cp Module.symvers ${hdrdest}
 	cp -a scripts ${hdrdest}
 
-	# fix permissions on scripts dir
-	chmod og-w -R ${hdrdest}/scripts
-
 	# copy arch includes for external modules
 	mkdir -p ${hdrdest}/arch/${_arch}
 	cp -a arch/${_arch}/include ${hdrdest}/arch/${_arch}
 
-	mkdir -p ${hdrdest}/arch/${arch}/kernel
+	mkdir -p ${hdrdest}/arch/${_arch}/kernel
 	cp arch/${_arch}/Makefile ${hdrdest}/arch/${_arch}
 	cp arch/${_arch}/kernel/asm-offsets.s ${hdrdest}/arch/${_arch}/kernel
 
@@ -207,10 +195,11 @@ do_install() {
 	done
 
 	# Remove unneeded architectures
-	for arch in alpha arc avr32 blackfin c6x cris frv h8300 \
-		hexagon ia64 m* n* p* s* um v850 x86 xtensa; do
-		rm -rf ${hdrdest}/arch/${arch}
-	done
+	# (save the correct one + Kconfig and delete all others)
+	mkdir -p arch-backup
+	cp ${hdrdest}/arch/${_arch} ${hdrdest}/arch/Kconfig arch-backup/
+	rm -rf ${hdrdest}/arch
+	mv arch-backup ${hdrdest}/arch
 
 	# Compress all modules with xz to save a few MBs.
 	msg_normal "$pkgver: compressing kernel modules with gzip, please wait...\n"

From b80934cb6fc226cea6eca48759b7ac5e3295a95f Mon Sep 17 00:00:00 2001
From: Piraty <piraty1@inbox.ru>
Date: Sun, 25 Aug 2019 22:49:06 +0200
Subject: [PATCH 3/3] rpi-kernel-header: enable build of kernel modules

In order to get dkms to build on our beloved rpi...

* port b5fa1bd9b6ec04c20bc1fe01540295200ef552d9 from mainline template
    * remove host built scripts and tools
    * add missing includes
    * install missing arch/arm64/kernel/vdso in linux-headers
    * keep arch/x86/ras/Kconfig for all architectures
* add "clocksource" includes

[ci skip]
---
 srcpkgs/rpi-kernel/template | 38 +++++++++++++++++++++++++++----------
 1 file changed, 28 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/rpi-kernel/template b/srcpkgs/rpi-kernel/template
index 8cd8ad3b0ad..44cc9dbe44b 100644
--- a/srcpkgs/rpi-kernel/template
+++ b/srcpkgs/rpi-kernel/template
@@ -10,7 +10,7 @@ _gitshort="${_githash:0:7}"
 
 pkgname=rpi-kernel
 version=4.19.75
-revision=1
+revision=2
 wrksrc="linux-${_githash}"
 maintainer="Peter Bui <pbui@github.bx612.space>"
 homepage="http://www.kernel.org"
@@ -149,20 +149,39 @@ do_install() {
 	install -Dm644 Makefile ${hdrdest}/Makefile
 	install -Dm644 kernel/Makefile ${hdrdest}/kernel/Makefile
 	install -Dm644 .config ${hdrdest}/.config
+	for file in $(find . -name Kconfig\*); do
+		mkdir -p ${hdrdest}/$(dirname $file)
+		install -Dm644 $file ${hdrdest}/${file}
+	done
+	for file in $(find arch/${_arch} -name module.lds -o -name Kbuild.platforms -o -name Platform); do
+		mkdir -p ${hdrdest}/$(dirname $file)
+		install -Dm644 $file ${hdrdest}/${file}
+	done
 	mkdir -p ${hdrdest}/include
 
 	# Remove firmware stuff provided by the "linux-firmware" pkg.
 	rm -rf ${DESTDIR}/usr/lib/firmware
 
-	for i in acpi asm-generic config crypto drm generated linux math-emu \
-		media net pcmcia scsi sound trace uapi video xen; do
+	for i in acpi asm-generic clocksource config crypto drm generated linux \
+		math-emu media net pcmcia scsi sound trace uapi video xen; do
 		[ -d include/$i ] && cp -a include/$i ${hdrdest}/include
 	done
 
 	cd ${wrksrc}
+	# Remove helper binaries built for host,
+	# if generated files from the scripts/ directory need to be included,
+	# they need to be copied to ${hdrdest} before this step
+	if [ "$CROSS_BUILD" ]; then
+		make ${makejobs} ARCH=${_arch} _mrproper_scripts
+	fi
+
 	# Copy files necessary for later builds.
 	cp Module.symvers ${hdrdest}
 	cp -a scripts ${hdrdest}
+	mkdir -p ${hdrdest}/security/selinux
+	cp -a security/selinux/include ${hdrdest}/security/selinux
+	mkdir -p ${hdrdest}/tools/include
+	cp -a tools/include/tools ${hdrdest}/tools/include
 
 	# copy arch includes for external modules
 	mkdir -p ${hdrdest}/arch/${_arch}
@@ -171,6 +190,8 @@ do_install() {
 	mkdir -p ${hdrdest}/arch/${_arch}/kernel
 	cp arch/${_arch}/Makefile ${hdrdest}/arch/${_arch}
 	cp arch/${_arch}/kernel/asm-offsets.s ${hdrdest}/arch/${_arch}/kernel
+	#FIXME: vdso for all arm*? if not, why not?
+	cp -a arch/${_arch}/kernel/vdso ${hdrdest}/arch/${_arch}/kernel/
 
 	# Add md headers
 	mkdir -p ${hdrdest}/drivers/md
@@ -188,18 +209,15 @@ do_install() {
 	mkdir -p ${hdrdest}/include/config/dvb/
 	cp include/config/dvb/*.h ${hdrdest}/include/config/dvb/
 
-	# Copy in Kconfig files
-	for i in $(find . -name "Kconfig*"); do
-		mkdir -p ${hdrdest}/$(echo $i | sed 's|/Kconfig.*||')
-		cp $i ${hdrdest}/$i
-	done
-
 	# Remove unneeded architectures
 	# (save the correct one + Kconfig and delete all others)
 	mkdir -p arch-backup
-	cp ${hdrdest}/arch/${_arch} ${hdrdest}/arch/Kconfig arch-backup/
+	cp -r ${hdrdest}/arch/${_arch} ${hdrdest}/arch/Kconfig arch-backup/
 	rm -rf ${hdrdest}/arch
 	mv arch-backup ${hdrdest}/arch
+	# Keep arch/x86/ras/Kconfig as it is needed by drivers/ras/Kconfig
+	mkdir -p ${hdrdest}/arch/x86/ras
+	cp -a arch/x86/ras/Kconfig ${hdrdest}/arch/x86/ras/Kconfig
 
 	# Compress all modules with xz to save a few MBs.
 	msg_normal "$pkgver: compressing kernel modules with gzip, please wait...\n"

  parent reply	other threads:[~2019-09-29 18:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-29 18:40 [PR PATCH] " voidlinux-github
2019-09-29 18:50 ` [PR PATCH] [Updated] " voidlinux-github
2019-09-29 18:50 ` voidlinux-github [this message]
2019-09-29 18:53 ` voidlinux-github
2019-09-29 18:53 ` voidlinux-github
2019-09-30 13:54 ` voidlinux-github
2019-09-30 13:54 ` voidlinux-github
2019-09-30 13:55 ` voidlinux-github
2019-09-30 13:55 ` voidlinux-github
2019-10-02 12:52 ` voidlinux-github
2019-10-04 23:16 ` [PR PATCH] [Merged]: " voidlinux-github

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190929185051.cvK-kxM1-Yp4oi2VHUHe66GaH9hQ3bz0IY5WcFy9TCo@z \
    --to=voidlinux-github@inbox.vuxu.org \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).