🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.gentoo.user
5 messages
5 total messages Started by Pocket Thu, 12 Nov 2026 02:00
[gentoo-user] custom ebuild issues: tar archive extraction
#126
Author: Pocket
Date: Thu, 12 Nov 2026 02:00
53 lines
2992 bytes
It's me again, I need a bit more help.....

I have the ebuild working up to but not including the prepare phase.

This is the error

gentoo /var/db/repos/pocket/sys-kernel/linux-rpi # ebuild 
linux-rpi-6.18.50.ebuild configure
 >>> Not marked as unpacked; recreating WORKDIR...
  * linux-stable_20260911.tar.gz BLAKE2B SHA512 size ;-) ... 
                                   [ ok ]
 >>> Unpacking source...
 >>> Unpacking 'linux-stable_20260911.tar.gz' to 
/var/tmp/portage/sys-kernel/linux-rpi-6.18.50/work
 >>> Source unpacked in /var/tmp/portage/sys-kernel/linux-rpi-6.18.50/work
  * ERROR: sys-kernel/linux-rpi-6.18.50::pocket failed (prepare phase):
  *   The source directory 
'/var/tmp/portage/sys-kernel/linux-rpi-6.18.50/work/linux-rpi-6.18.50' 
doesn't exist
  *
  * Call stack:
  *            ebuild.sh, line  850:  Called __ebuild_main 'prepare'
  *   phase-functions.sh, line 1164:  Called __dyn_prepare
  *   phase-functions.sh, line  453:  Called die
  * The specific snippet of code:
  *              die "The source directory '${S}' doesn't exist"


The source archive actually extracts to
/var/tmp/portage/sys-kernel/linux-rpi-6.18.50/work/linux-stable_20260911/

It is looking for
  /var/tmp/portage/sys-kernel/linux-rpi-6.18.50/work/linux-rpi-6.18.50

How do I tweak the ebuild to correct the issue above?
IE the tar archive extracts to a directory that is not the same as the 
archives filename.  I know how to do this in an archlinux PKGBUILD but 
not in a ebuild.


Also the symlink
/var/tmp/portage/sys-kernel/linux-rpi-6.18.50/work/ files -> 
/var/db/repos/pocket/sys-kernel/linux-rpi/files is broken

/var/db/repos/pocket/sys-kernel/linux-rpi/files doesn't exist

It is a bit hard to grok this because the wiki information is spread out 
over multiple files so I get lost sometimes.

Once I get this to work I will have a better understanding.

-- 
Hindi madali ang maging ako
Re: [gentoo-user] custom ebuild issues: tar archive extraction
#127
Author: Eli Schwartz
Date: Thu, 12 Nov 2026 03:40
107 lines
5714 bytes
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------bHuaxKZqhurVGw40fVIgBzmi
Content-Type: multipart/mixed; boundary="------------04QWXfossts0mMq9uSRTt40c";
 protected-headers="v1"; hp="clear"
Message-ID: <5b98dc99-72af-4439-9caf-72ada84fdd01@gentoo.org>
Date: Wed, 11 Nov 2026 22:31:28 -0500
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [gentoo-user] custom ebuild issues: tar archive extraction
To: gentoo-user@lists.gentoo.org
References: <6efebe75-8e79-4402-b916-6947d93c7869@oldfart.online>
Content-Language: en-US
From: Eli Schwartz <eschwartz@gentoo.org>
Autocrypt: addr=eschwartz@gentoo.org; keydata=
 xjMEZmeRNBYJKwYBBAHaRw8BAQdAYNZ7pUDWhx1i2f3p6L2ZLu4FcY18UoeGC04Gq/khqwfN
 I0VsaSBTY2h3YXJ0eiA8ZXNjaHdhcnR6QGdlbnRvby5vcmc+wpYEExYKAD4CGwMFCwkIBwMF
 FQoJCAsFFgIDAQACHgUCF4AWIQTvUdMIsc4jCIi+DYTqQj6ToWND8QUCauABDQUJCJCIWQAK
 CRDqQj6ToWND8bXlAQDhi6hUxiss56cdPbsemrWdVQe3CtkpqlQccxV/4a4/QgD/dUCR+SGn
 YxNZj6lir6i/TBr0yfSSrMtKgGO1+lClSwLOOARmZ5E0EgorBgEEAZdVAQUBAQdATT46Z06b
 1X9xjXFCYFxmq/Tj3tSEKZInDWTpoHQp4l8DAQgHwn4EGBYKACYCGwwWIQTvUdMIsc4jCIi+
 DYTqQj6ToWND8QUCauABGAUJCJCIZAAKCRDqQj6ToWND8c4xAQCWj7iWpgEJUM+wf2bZCkgM
 EKEVVdv5aBJrj6Xa22UhIQEA0bIv2t9jUqUeBMHl/6i0L28s5Mrtr0ZSX3Sg/zeyrAM=
X-Clacks-Overhead: GNU Terry Pratchett
In-Reply-To: <6efebe75-8e79-4402-b916-6947d93c7869@oldfart.online>

--------------04QWXfossts0mMq9uSRTt40c
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On 11/11/26 8:52 PM, Pocket wrote:

> The source archive actually extracts to
> /var/tmp/portage/sys-kernel/linux-rpi-6.18.50/work/linux-stable_2026091=
1/
>=20
> It is looking for
> =C2=A0/var/tmp/portage/sys-kernel/linux-rpi-6.18.50/work/linux-rpi-6.18=
=2E50
>=20
> How do I tweak the ebuild to correct the issue above?
> IE the tar archive extracts to a directory that is not the same as the
> archives filename.=C2=A0 I know how to do this in an archlinux PKGBUILD=
 but
> not in a ebuild.

For an archlinux PKGBUILD, you would normally include

```
cd "${srcdir}"/${pkgname}-${pkgver}
```

at the top of each function.

For Gentoo:

- ${srcdir} is ${WORKDIR}

- ${pkgname} is ${PN}
- ${pkgver} is ${PV}
- ${pkgname}-${pkgver} is ${P}


See the various descriptions at:
https://devmanual.gentoo.org/ebuild-writing/variables/index.html

Gentoo also does not use manual `cd`, and instead has an ${S} variable,
and prepare/configure/compile/install will automatically `cd "${S}"` for
you. The default value of ${S} is, unsurprisingly I suppose :)
${WORKDIR}/${P} (so basically exactly the same pattern as a PKGBUILD)
and per the link I provided, you are expected to define

S=3D${WORKDIR}/linux-stable_20260911

so that it can `cd` automatically for you.


> Also the symlink
> /var/tmp/portage/sys-kernel/linux-rpi-6.18.50/work/ files -> /var/db/
> repos/pocket/sys-kernel/linux-rpi/files is broken
>=20
> /var/db/repos/pocket/sys-kernel/linux-rpi/files doesn't exist


The symlink is automatically created for internal reasons. An ebuild
that doesn't have a files/ directory, cannot reference any files via
${FILESDIR} and the symlink will be broken. That is normal and expected.


--=20
Eli Schwartz

--------------04QWXfossts0mMq9uSRTt40c--

--------------bHuaxKZqhurVGw40fVIgBzmi
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature.asc"

-----BEGIN PGP SIGNATURE-----

wnsEABYIACMWIQTnFNnmK0TPZHnXm3qEp9ErcA0vVwUCavUzEAUDAAAAAAAKCRCEp9ErcA0vV3Ja
AP4ssL7U5K1zi9/opd/Ath5P0mfnlxXKCh6mJtM4z3S32QD/ZQAcwOCCFQKiLXaSMlRufB1XPDhy
jH4H5VMzdSGEQgs=
=Csew
-----END PGP SIGNATURE-----

--------------bHuaxKZqhurVGw40fVIgBzmi--
Re: [gentoo-user] custom ebuild issues: tar archive extraction
#128
Author: Pocket
Date: Thu, 12 Nov 2026 11:10
128 lines
5445 bytes

On 11/11/26 22:31, Eli Schwartz wrote:
> On 11/11/26 8:52 PM, Pocket wrote:
> 
>> The source archive actually extracts to
>> /var/tmp/portage/sys-kernel/linux-rpi-6.18.50/work/linux-stable_20260911/
>>
>> It is looking for
>>   /var/tmp/portage/sys-kernel/linux-rpi-6.18.50/work/linux-rpi-6.18.50
>>
>> How do I tweak the ebuild to correct the issue above?
>> IE the tar archive extracts to a directory that is not the same as the
>> archives filename.  I know how to do this in an archlinux PKGBUILD but
>> not in a ebuild.
> 
> For an archlinux PKGBUILD, you would normally include
> 
> ```
> cd "${srcdir}"/${pkgname}-${pkgver}
> ```
> 
> at the top of each function.

Yes that is what is in my PKGBUILD script I use on archlinux.
BTW cd ${pkgname}-${pkgver} works also as the "${srcdir}" is automatic.

> 
> For Gentoo:
> 
> - ${srcdir} is ${WORKDIR}
> 
> - ${pkgname} is ${PN}
> - ${pkgver} is ${PV}
> - ${pkgname}-${pkgver} is ${P}
> 
> 
> See the various descriptions at:
> https://devmanual.gentoo.org/ebuild-writing/variables/index.html
> 
> Gentoo also does not use manual `cd`, and instead has an ${S} variable,
> and prepare/configure/compile/install will automatically `cd "${S}"` for
> you. The default value of ${S} is, unsurprisingly I suppose :)
> ${WORKDIR}/${P} (so basically exactly the same pattern as a PKGBUILD)
> and per the link I provided, you are expected to define
> 
> S=${WORKDIR}/linux-stable_20260911
> 
> so that it can `cd` automatically for you.

I did read the variables list doc (found that on the wiki earlier) and I 
still need to fully understand what is there.

> 
> 
>> Also the symlink
>> /var/tmp/portage/sys-kernel/linux-rpi-6.18.50/work/ files -> /var/db/
>> repos/pocket/sys-kernel/linux-rpi/files is broken
>>
>> /var/db/repos/pocket/sys-kernel/linux-rpi/files doesn't exist
> 
> 
> The symlink is automatically created for internal reasons. An ebuild
> that doesn't have a files/ directory, cannot reference any files via
> ${FILESDIR} and the symlink will be broken. That is normal and expected.
> 
> 

What I did was this and it seemed to work

src_unpack() {
	if [[ -n ${A} ]]; then
		unpack ${A}
		ln -vs linux-stable_20260911 linux-rpi-6.18.50
	fi
}

That seens to work But.....

I see that that the proper way would be
S=${WORKDIR}/linux-stable_20260911
I will try that.
I am gonna have a look at the emerge script to see what makes it tick 
but that is gonna be bit later.

Also I had to do ebuild linux-rpi-6.18.50.ebuild clean which must have 
cleaned up some errors as it is now working thru the compile phase.

I am now working on the converting the PKGBUILD package() to the ebuild 
src_install()


Then I am gonna do

ebuild linux-rpi-6.18.50.ebuild package
ebuild linux-rpi-6.18.50.ebuild install

and compare the ebuild generated archive with the one I have from a 
PKGBUILD.  The files (list/type/number etc) should be the same but the 
files themselves may not match due to the differences in the compile phase.

After words I will create a new USB drive with the stage3 file, add the 
kernel and boot loader and see if it will boot using btrfs as the root 
filesystem.  Which by the way was/is my goal.

I will post the ebuild when I get to the point I think I am done so I 
can get some feed back on what else I haven't done correctly.
I am sure I have made other errors ;).

I did find that when I did an update which portage had an update it 
complained/had issues with /usr/src.  I created a symlink per the docs. 
It still complained and I had to copy in the .config.
I am looking to why that is but I have not form anything that explains 
that.  I could have missed it as I have read many docs while getting 
this to this point.

I am looking at the gentoo kernel requirements and I think I will need 
this ebuild plus a linux sources ebuild and a linux-api-headers ebuild 
to fully complete this. Correct?

Since gentoo doesn't have an ebuild that emerges and compiles a kernel 
maybe I should then share/submit it to gentoo?

Thanks


-- 
Hindi madali ang maging ako
Re: [gentoo-user] custom ebuild issues: tar archive extraction
#134
Author: Ben Knoble
Date: Thu, 12 Nov 2026 19:20
21 lines
3033 bytes
> Le 12 nov. 2026 à 06:05, Pocket <pocket@oldfart.online> a écrit :
> 
> 
> Since gentoo doesn't have an ebuild that emerges and compiles a kernel maybe I should then share/submit it to gentoo?

The sys-kernel/gentoo-kernel ebuild compiles a Linux kernel 
configured for Gentoo (with user configuration applied on top)
[I’m omitting the installkernel stuff, like hooking in to dracut/grub].

For folks that need more control over the process, there are
(all sys-kernel/) gentoo-sources, vanilla-kernel, and vanilla-sources.

The *-sources kernel get you sources, which you configure, compile, install
on your own. Portage does the main work for the other ebuilds.

(Just to clear up any misconceptions about Gentoo not having
kernel ebuilds…)
Re: [gentoo-user] custom ebuild issues: tar archive extraction
#135
Author: Pocket
Date: Thu, 12 Nov 2026 20:50
29 lines
2237 bytes

On 11/12/26 14:13, Ben Knoble wrote:
> 
>> Le 12 nov. 2026 à 06:05, Pocket <pocket@oldfart.online> a écrit :
>>
>>
>> Since gentoo doesn't have an ebuild that emerges and compiles a kernel maybe I should then share/submit it to gentoo?
> 
> The sys-kernel/gentoo-kernel ebuild compiles a Linux kernel
> configured for Gentoo (with user configuration applied on top)
> [I’m omitting the installkernel stuff, like hooking in to dracut/grub].
> 
> For folks that need more control over the process, there are
> (all sys-kernel/) gentoo-sources, vanilla-kernel, and vanilla-sources.
> 
> The *-sources kernel get you sources, which you configure, compile, install
> on your own. Portage does the main work for the other ebuilds.
> 
> (Just to clear up any misconceptions about Gentoo not having
> kernel ebuilds…)

Gentoo does not have an ebuild that compiles a kernel for raspberry pi 
any version.  That is why I am working on one as all my systems are 
raspberry pi's.


-- 
Hindi madali ang maging ako
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads