You are not logged in.

#1 2009-12-31 10:39:40

dptkby
Member
Registered: 2009-07-02
Posts: 64

[QUITE SOLVED]Building custom kernel with ABS results in empty package

I'm trying to build a custom kernel (2.6.32) using ABS by commenting out the line

pkgname=('kernel26' 'kernel26-firmware' 'kernel26-headers') # Build stock -ARCH kernel

and uncommenting

pkgname=kernel26-custom # Build kernel with a different name

as well as adding a patch in the PKGBUILD.

makepkg seems to work fine but after the kernel has finished compiling I'm left with a package which only contains a .PKGINFO file. Installing the package doesn't seem to do anything either.

What am I doing wrong? Could this have something to do with the new PKGBUILD structure for the 2.6.32 kernel?

Last edited by dptkby (2010-01-04 13:06:07)

Offline

#2 2010-01-01 00:10:56

dblue
Member
Registered: 2009-12-31
Posts: 2

Re: [QUITE SOLVED]Building custom kernel with ABS results in empty package

I had this problem as well. You're right, it seems like it does have something to do with the new PKGBUILD structure. After trying a few iterations of modifications to the PKGBILD, it worked for me to change pkgbase as well as make an array of names for the split packages to match my desired custom kernel name. Lines 4-6 of my PKGBUILD:

pkgbase=kernel26DB
#pkgname=('kernel26' 'kernel26-firmware' 'kernel26-headers') # Build stock -ARCH kernel
pkgname=('kernel26DB' 'kernel26DB-firmware' 'kernel26DB-headers')       # Build kernel with a different name

and I also had to rename the 3 package_* functions below the build function to match my custom kernel name.

I don't know if this is the right way to have gotten it to work, but at least it worked. Hopefully someone who knows better will weigh in.

Happy new year!

Offline

#3 2010-01-04 13:05:39

dptkby
Member
Registered: 2009-07-02
Posts: 64

Re: [QUITE SOLVED]Building custom kernel with ABS results in empty package

I tried renaming only the first name, 'kernel26', in the pkgname array and then renaming the appropriate package function. This worked perfectly!

I think what went wrong before was that if pkgname isn't an array of names the package functions (which do important things) never run. There's some useful info about what's going on here, under "PACKAGE SPLITTING" in the man page for "PKGBUILD".

I also had problems with makepkg complaining about a missing build function... It took me way too long to notice that I had accidentally put commas between the names in the pkgname array hmm.

Now, I'm not sure you actually need to build custom versions of kernel26-firmware and kernel26-headers as well. If not, the most elegant solution would probably be to keep pkgname as a single string, move everything from package_kernel26() into build() and throw away the other package functions. I don't know where in build() you should put the stuff from the package function, though.

Offline

#4 2010-01-05 22:07:58

dblue
Member
Registered: 2009-12-31
Posts: 2

Re: [QUITE SOLVED]Building custom kernel with ABS results in empty package

I have in my head that it didn't work for me without renaming the pkgbase along with the 1st entry in the pkgname array, but maybe I never tried it that way... I'll try it again and see.

In my case I don't need custom versions of kernel26-firmware and kernel26-headers. But since most of the time building the package is during the compilation step much is lost by building those packages but not installing them. I suppose the trade-off is how hard it is to keep the PKGBUILD in sync with the standard arch kernel's PKGBUILD for future kernels (if you even need to keep them in sync).

Looking at a PKGBUILD from a pre 2.6.32 kernel would probably show you where to put the stuff from the package function into the build function since that's essentially how the kernel PKGBUILDs used to be before this one.

Offline

Board footer

Powered by FluxBB