Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Other Things Gentoo
  • Search

Create a gpkg for gentoo-sources with built objects

Still need help with Gentoo, and your question doesn't fit in the above forums? Here is your last bastion of hope.
Post Reply
Advanced search
10 posts • Page 1 of 1
Author
Message
sdauth
l33t
l33t
User avatar
Posts: 801
Joined: Wed Sep 19, 2018 2:48 am
Location: Ásgarðr

Create a gpkg for gentoo-sources with built objects

  • Quote

Post by sdauth » Thu May 21, 2026 7:03 am

Hello,
Can it be done ? I tried to play with quickpkg but it only includes the source as expected.
Is there any tool I can I can use to create a valid gpkg of current installed kernel including the built objects ? (So when fetching the binpkg on my laptop from this build host, the compiled source is installed using this gpkg and I just have to run make install)
Right now, I just create a tarball of /usr/src/linux on the build host, this tarball is fetched & extracted once gentoo-sources is installed (using a rule in /etc/portage/env) on each laptop, which doubles the install time. So it would be really nice to directly fetch the compiled gentoo-sources instead.

Thanks.
Top
flexibeast
l33t
l33t
Posts: 791
Joined: Mon Apr 04, 2022 4:15 am
Location: Naarm/Melbourne, Australia
Contact:
Contact flexibeast
Website

Re: Create a gpkg for gentoo-sources with built objects

  • Quote

Post by flexibeast » Thu May 21, 2026 7:45 am

Perhaps you could use emerge(1)'s --binpkgonly / -B option?
My most recent wiki contributions
Common mistakes when writing English
https://wiki.gentoo.org/wiki/User:Flexibeast
Top
sdauth
l33t
l33t
User avatar
Posts: 801
Joined: Wed Sep 19, 2018 2:48 am
Location: Ásgarðr

Re: Create a gpkg for gentoo-sources with built objects

  • Quote

Post by sdauth » Thu May 21, 2026 7:55 am

I already use binpkgonly, but this fetches the gentoo-sources created by portage on the build host (pure source, not compiled)
What I want is replace this gpkg with a new one with the compiled source, with the same name (ex: gentoo-sources-6.18.32-r2.gpkg.tar) in order to be picked up by the laptop using binpkgonly.
Top
sdauth
l33t
l33t
User avatar
Posts: 801
Joined: Wed Sep 19, 2018 2:48 am
Location: Ásgarðr

Re: Create a gpkg for gentoo-sources with built objects

  • Quote

Post by sdauth » Thu May 21, 2026 8:27 am

Or if not possible, maybe trick portage on each laptop to make it look like gentoo-sources was installed correctly (skipping the fetch & extraction to /usr/src/linux) although I'm not sure about the metadata part here.
I remember something similar was posted a long time ago but can't find the thread again.

then a post_pkg_postinst rule in /etc/portage/env/sys-kernel/gentoo-sources

Code: Select all

post_pkg_postinst() {
...
}
to trigger the fetch & extraction of the manually created tar.gz (shared through http on lan) of /usr/src/inux with the built objects.
This is what I already use but as I said in my first post, this involves to fetch & install the full (not compiled) gentoo-sources first.
Usually it is not a big deal but with the higher frequency of kernel updates recently, any optimization is welcomed :mrgreen:

As a last resort, I could also leave portage out of the equation (remove gentoo-sources from @world on my laptop) and manually fetch & extract the compiled sources tarball from the binhost with a simple script.
Top
Goverp
Advocate
Advocate
User avatar
Posts: 2438
Joined: Wed Mar 07, 2007 6:41 pm

Re: Create a gpkg for gentoo-sources with built objects

  • Quote

Post by Goverp » Thu May 21, 2026 10:15 am

As my system was set up long before any of the Gentoo ready-built kernels, as as I build my laptop's kernel on my desktop machine (it would take forever on the laptop), I use scripts. After all, gentoo-sources neither builds nor installs the kernel, that's always been manual make && make modules_install && make install.

I package the kernel for my laptop using the procedure on the wiki page I wrote about building kernels from userspace. (You can replace "kmake" with "make" in the procedure if you don't want the full userspace build stuff.)
Greybeard
Top
sdauth
l33t
l33t
User avatar
Posts: 801
Joined: Wed Sep 19, 2018 2:48 am
Location: Ásgarðr

Re: Create a gpkg for gentoo-sources with built objects

  • Quote

Post by sdauth » Thu May 21, 2026 10:58 am

Yes, I'm aware of make dir-pkg (or tarxz-pkg), this indeed allows to fetch the built kernel (vmlinuz & modules) in a convenient small archive but doesn't include the full source with built objects.
The reason I want the source is that sometimes I want to add a module or make a small config change and it allows me to quickly rebuild using the existing built objects. It is very handy with this core2 era laptop because otherwise, it's 1h30 build time with a clean source. :mrgreen:
From what I read so far, quickpkg is unable to include the built objects of gentoo-sources.
I admit I have a particular use case so I won't complain too much about it of course :mrgreen: Maybe just handle it outside of portage with a simple script is the way.
Top
sam_
Developer
Developer
User avatar
Posts: 2974
Joined: Fri Aug 14, 2020 12:33 am

Re: Create a gpkg for gentoo-sources with built objects

  • Quote

Post by sam_ » Thu May 21, 2026 3:55 pm

What you describe is precisely the use case for gentoo-kernel with your own built binpkg from that. The whole point of gentoo-sources is Portage doesn't know anything except the source files.
Top
pingtoo
Advocate
Advocate
User avatar
Posts: 2234
Joined: Fri Sep 10, 2021 8:37 pm
Location: Richmond Hill, Canada

Re: Create a gpkg for gentoo-sources with built objects

  • Quote

Post by pingtoo » Thu May 21, 2026 4:19 pm

I interpreter this question as is there a existing tool(s) or know how on how to create gpkg for any package with .ebuild file or not.

As for this specific gentoo-sources case, I wonder if one can use the "ebuild" command to do something.

will "ebuild /path/to/modified-gentoo-source.ebuild qmerge" or "ebuild /path/to/modified-gentoo-source.ebuild postinst" give that opportunity to create the gpkg?
Top
sam_
Developer
Developer
User avatar
Posts: 2974
Joined: Fri Aug 14, 2020 12:33 am

Re: Create a gpkg for gentoo-sources with built objects

  • Quote

Post by sam_ » Thu May 21, 2026 4:25 pm

pingtoo wrote: Thu May 21, 2026 4:19 pm I interpreter this question as is there a existing tool(s) or know how on how to create gpkg for any package with .ebuild file or not.

As for this specific gentoo-sources case, I wonder if one can use the "ebuild" command to do something.

will "ebuild /path/to/modified-gentoo-source.ebuild qmerge" or "ebuild /path/to/modified-gentoo-source.ebuild postinst" give that opportunity to create the gpkg?
qmerge will create a binpkg from the files in the image directory. quickpkg will take files installed by the ebuild listed in CONTENTS in /var/db/pkg from the live filesystem. Nothing will make it pick up compiled objects in /usr/src/linux.

Really, this is precisely what gentoo-kernel is for. Build it, enable FEATURES=buildpkg or use quickpkg, and deploy it.
Top
pingtoo
Advocate
Advocate
User avatar
Posts: 2234
Joined: Fri Sep 10, 2021 8:37 pm
Location: Richmond Hill, Canada

Re: Create a gpkg for gentoo-sources with built objects

  • Quote

Post by pingtoo » Thu May 21, 2026 5:22 pm

sam_,

Thanks for respond. I realize my question is dumb question after some thinking. To create gpkg for anything is to write a .ebuild, that is gentoo way.
Top
Post Reply

10 posts • Page 1 of 1

Return to “Other Things Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Authors
Gentoo is a trademark of the Gentoo Foundation, Inc. and of Förderverein Gentoo e.V.
The contents of this document, unless otherwise expressly stated, are licensed under the CC-BY-SA-4.0 license.
The Gentoo Name and Logo Usage Guidelines apply.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy