You are not logged in.

#1 2007-10-26 15:27:34

Eradest
Member
From: Germany
Registered: 2007-07-18
Posts: 56

Kernel PKGBUILD naming

Hi archers!
I finally managed building a working kernel config and building the kernel with this PKGBUILD and it works fine so far.

The only thing that disturbs me, is that the custom kernel's "name" (uname -r) and the /lib/modules dir are named "kernel26-custom-custom-custom" (note the three "-custom"s).
In the PKGBUILD I only set "_pkg_base" to "kernel26" and "_cfgname" to "custom".
During kernel configuration, I set "LOCALVERSION" to "-custom" as well.
/boot files and everything is named just fine, but as I said, the kernel name is always screwed up with the triple "-custom".

I'm not really good in bash but I think it's caused by these lines in the PKBGUILD:

  # set EXTRAVERSION to help use unique /lib/modules/ subdirectories
  _ker_make_ver=$(getvar "VERSION").$(getvar "PATCHLEVEL").$(getvar "SUBLEVEL")
  _ker_extraver=`echo $_idstr | sed "s|^$_ker_make_ver||"`

  # update EXTRAVERSION in the Makefile by adding our (for modules location)
  _oldline=$(cat Makefile | grep "^EXTRAVERSION")
  cat Makefile | sed "s|$_oldline|EXTRAVERSION\ =\ $_ker_extraver$_patchset$_cfgname|" > tmpMake
  mv tmpMake Makefile

now, is this behaviour intended, did I just make some input mistake or is there an error in the pkgbuild?

Thanks very much in advance!

Offline

#2 2007-10-27 14:56:28

Eradest
Member
From: Germany
Registered: 2007-07-18
Posts: 56

Re: Kernel PKGBUILD naming

All right, I figured out that the first two "-custom"s are caused by this line in the PKGBUILD:

cat Makefile | sed "s|$_oldline|EXTRAVERSION\ =\ $_ker_extraver$_patchset$_cfgname|" > tmpMake

( $_ker_extraver contains one and $_cfgname, of course, the other)

The third one seems to be appended by the LOCALVERSION config setting, which should actually be the only one to be added I think.

So would it be possible to just omit all of the PKGBUILD code quoted in the post above and let the -LOCALVERSION do the work for a unique name?

EDIT: This actually works quite well, but I suppose problems might occur in other places then. No bash expert here?

EDIT 2: When trying to compile the nvidia module afterwards, I also found out that

  # copy files necessary for later builds, like nvidia and vmware
cp arch/i386/Makefile.cpu $startdir/pkg/usr/src/linux-$_idstr/arch/i386/

was missing, but exists in the stock kernel PKGBUILD.

Is this one acutally somehow out-dated or am I just too stupid to make it work correctly?

Last edited by Eradest (2007-10-27 15:45:21)

Offline

Board footer

Powered by FluxBB