Skip to content
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

[WIP] kernel-libc-headers: update to 5.10. #27145

Merged
merged 1 commit into from Jan 5, 2021

Conversation

ericonr
Copy link
Member

@ericonr ericonr commented Dec 14, 2020

  • haven't rebased patches
  • requires rsync for install step! BAD

Haven't tried building anything with them yet. Also, this requires a revbump to all the cross toolchains. And the rsync part breaks bootstrap, afaik. So gotta turn that into some nice cp $(find ...)

https://github.com/torvalds/linux/blob/v5.10/Makefile#L1280

Comment on lines 1 to 14
diff --git Makefile Makefile
index e30cf02..d023d8a 100644
--- Makefile
+++ Makefile
@@ -1277,8 +1277,7 @@ export INSTALL_HDR_PATH = $(objtree)/usr
quiet_cmd_headers_install = INSTALL $(INSTALL_HDR_PATH)/include
cmd_headers_install = \
mkdir -p $(INSTALL_HDR_PATH); \
- rsync -mrl --include='*/' --include='*\.h' --exclude='*' \
- usr/include $(INSTALL_HDR_PATH)
+ find usr/include -type f -name '*.h' -exec sh -c 'set -e; f="$${1\#usr/}"; dd="$(INSTALL_HDR_PATH)/$${f%/*}"; [ -d "$$dd" ] || mkdir -p "$$dd"; cp "usr/$$f" $(INSTALL_HDR_PATH)/"$$f"' -- '{}' ';'

PHONY += headers_install
headers_install: headers
Copy link
Member

@sgn sgn Dec 15, 2020

Choose a reason for hiding this comment

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

I don't think we need this patch, just follow what LFS do:

diff --git a/srcpkgs/kernel-libc-headers/template b/srcpkgs/kernel-libc-headers/template
index 715e0be817..358197d26c 100644
--- a/srcpkgs/kernel-libc-headers/template
+++ b/srcpkgs/kernel-libc-headers/template
@@ -26,12 +26,13 @@ esac
 
 do_build() {
 	make mrproper
-	make ARCH=${_arch} headers_check
+	make ARCH=${_arch} headers
 }
 do_install() {
-	make ARCH=${_arch} INSTALL_HDR_PATH=${DESTDIR}/usr headers_install
-	# Remove unused files.
-	rm -f $(find ${DESTDIR}/usr/include -name .install -or -name ..install.cmd)
+	vmkdir usr/include
+	vcopy usr/include usr
+	find $DESTDIR/usr/include -name '.*' -delete
+	rm $DESTDIR/usr/include/Makefile
 	# Remove drm headers, use libdrm.
 	rm -rf ${DESTDIR}/usr/include/drm
 }

Notes that headers_check is nop, now.

http://www.linuxfromscratch.org/lfs/view/stable/chapter05/linux-headers.html

Copy link
Contributor

Choose a reason for hiding this comment

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

While this template patch could break more easily IMO this is muchhhh much cleaner so i think we should go @sgn 's route.

Copy link
Member Author

Choose a reason for hiding this comment

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

That works for us since we have a package destdir, so I'm okay with it. However, ideally I'd like to have this patch into upstream, if I can get it there.

Copy link
Member

Choose a reason for hiding this comment

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

Good luck on sending this patch :-p Meanwhile, I'm inclined to not patch the build system with that long command.

Copy link
Member

@pullmoll pullmoll Dec 15, 2020

Choose a reason for hiding this comment

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

FWIW if you want to copy a tree w/o rsync you can achieve similar results with find and a {bsd,}tar pipe like:

find usr/include \! -type d -iname "*.h" | tar cf - -T - | tar xpf - -C $(INSTALL_HDR_PATH)

This is untested and may need find -print0 and tar --null in case of blanks in path or filenames.

@sgn
Copy link
Member

sgn commented Dec 24, 2020

Any news?

@ericonr
Copy link
Member Author

ericonr commented Dec 24, 2020

@sgn or someone else, feel free to take over. I haven't had the mind space to look at our patches to the headers, so I don't know which, if any, are still required, nor if we need new ones.

@leahneukirchen
Copy link
Member

Taking this over. I have adopted it to use the LFS install snippet, and I only kept patch 1-4 which Alpine still has. Alpine also has another patch that I included.

I tried building a few packages that need these headers, no issues.

@ericonr ericonr merged commit cc78fb4 into void-linux:master Jan 5, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants