You are not logged in.

#1 2005-05-29 12:25:48

TobyR
Member
From: Cambridge, UK
Registered: 2004-08-14
Posts: 25

Custom kernel and Pacman

I'm thinking of re-compiling the kernel, so that I can enable one specific custom feature (NetEm, under Networking QoS), and *maybe* disable some unwanted components.
I read elsewhere in this forum that once you compile your own kernel you cannot use Pacman, but rather build everything yourself using ABS.  Is that right or have I misunderstood something?  Pacman is *very* convenient and I'd hate to lose the use of it.


---------------------------
Arch Linux 0.6
Pentium II 266MHz
160MB SDRAM

Offline

#2 2005-05-29 12:42:53

T-Dawg
Forum Fellow
From: Charlotte, NC
Registered: 2005-01-29
Posts: 2,736

Re: Custom kernel and Pacman

I have been working on a custom kernel script that will allow a rebuild, newbuild, and source build of the kernel. It just inserts the right command automactially into a PKGBUILD, executes until it gets to the menu, then completes the build after saving. So it basically uses makepkg to build it and makepkg uses pacman to install. It'll also keep a database of previously built kernels.
Its been working fine for me and rasat so far, if your interested in trying it pm me.

Offline

#3 2005-05-29 13:01:15

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: Custom kernel and Pacman

TobyR wrote:

I read elsewhere in this forum that once you compile your own kernel you cannot use Pacman, but rather build everything yourself using ABS.

No. If you yourself manage your kernel with Pacman + custom pkgbuild or not is your own choice. You can even have both the default Arch kernel and your custom one installed, as long as they don't have the same file names.

Offline

#4 2005-05-29 13:04:27

Cerebral
Forum Fellow
From: Waterloo, ON, CA
Registered: 2005-04-08
Posts: 3,108
Website

Re: Custom kernel and Pacman

I've been using a custom kernel for a while now (so I can use ATI's drivers), and pacman works fine.  You may, though, want to set pacman to ignore the kernel packages after you compile your custom kernel by adding this to /etc/pacman.conf under the [options] heading:

IgnorePkg = kernel kernel26

for example, the beginning of my pacman.conf looks like:

[options]
LogFile     = /var/log/pacman.log
NoUpgrade   = etc/passwd etc/group etc/shadow etc/sudoers
NoUpgrade   = etc/fstab etc/raidtab etc/ld.so.conf
NoUpgrade   = etc/rc.conf etc/rc.local
NoUpgrade   = etc/modprobe.conf etc/modules.conf
NoUpgrade   = etc/lilo.conf boot/grub/menu.lst
HoldPkg     = pacman glibc
IgnorePkg   = kernel kernel26

Offline

#5 2005-05-29 14:59:28

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: Custom kernel and Pacman

Either you want to have the default Arch kernel, and then you probably want it kept up to date too, or you don't have it, in which case the IgnorePkg isn't needed anyway.

Offline

#6 2005-05-29 15:57:52

TobyR
Member
From: Cambridge, UK
Registered: 2004-08-14
Posts: 25

Re: Custom kernel and Pacman

Cerebral wrote:

...You may, though, want to set pacman to ignore the kernel packages after you compile your custom kernel ...

So I guess if I *don't* do this the next time there is a kernel upgrade (that pacman picks up) I would get the default kernel, which would negate all the optins I set in my 'config' file?


---------------------------
Arch Linux 0.6
Pentium II 266MHz
160MB SDRAM

Offline

#7 2005-05-29 18:13:10

TobyR
Member
From: Cambridge, UK
Registered: 2004-08-14
Posts: 25

Re: Custom kernel and Pacman

So as you all have gathered, I compiled a new kernel.  I followed the DibbleTheWrecker's very good Wiki guide to this and everything went smoothly right up to the point I tried to use pacman to add the new package.  At this point I g t loads of messages saying

kernel-261110-ARCH: <file> : already exists 

I'm guessing I made a basic mistake (such as not properly naming something) but I'm not sure where I went wrong.  Here is the top part of PKGBUILD

# Contributor: dibblethewrecker <dibblethewrecker.at.jiwe.org>
pkgname=kernel261110-ARCH
pkgver=2.6.11.10
pkgrel=2
pkgdesc="The Linux Kernel 2.6.11.10 and module (NetEm)"
url="http://www.kernel.org"
depends=('module-init-tools')
install=kernel26.install

Any ideas?

Thanks


---------------------------
Arch Linux 0.6
Pentium II 266MHz
160MB SDRAM

Offline

#8 2005-05-29 22:13:58

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Custom kernel and Pacman

There are two things you can do. If you want to replace your current kernel with your new one, use pacman -Uf to overwrite the existing identically-named files. If you want to have both the current and new kernels available, redo your custom one with a different package name - the easiest way to do this is to change CONFIG_LOCALVERSION to something other than -ARCH.

P.S. PII 266?! Good to know someone out there has crappier gear than me..... lol

Offline

#9 2005-05-29 22:27:46

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: Custom kernel and Pacman

Don't do pacman -Uf. Instead, just uninstall the original kernel package and install yours. Or better yet, avoid the file conflicts at all by using different filenames.

Using a slow pc learns you to have patience. Once you passed the border between "needing to wait for things to happen" and "expecting everything instantly" it's hard to look back, but it isn't that bad. Just don't try to use things like gnome or kde...

Offline

#10 2005-05-30 00:11:13

TobyR
Member
From: Cambridge, UK
Registered: 2004-08-14
Posts: 25

Re: Custom kernel and Pacman

tomk wrote:

P.S. PII 266?! Good to know someone out there has crappier gear than me..... lol

Yeah, I'm waiting for the museum to up their offer ;-) - and in the meantime I just use it to try out Linux command line stuff.  Thanks to you both for the tips.


---------------------------
Arch Linux 0.6
Pentium II 266MHz
160MB SDRAM

Offline

#11 2005-05-30 03:05:21

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

Re: Custom kernel and Pacman

TobyR - your mistake with my pkgbuild was simple, as tomk pointed out.

You have used the default arch config as a basis, which i suggested, but you have left the CONFIG_LOCALVERSION the same i.e. -ARCH, which results in a naming scheme identical to the default kernel pkg -maybe i should clariy that in the wiki?

You can either change the CONFIG_LOCALVERSION in the config file before you being or change it using the config frontend (gconfig, xconfig, etc)

If you rebuild remeber to copy the saved config file from your first build (config-date_and_time) to config to include your previous changes and regen the md5sums with makepkg -g

changing the localversion to -ARCH-netem or -netem might be a good option

Offline

#12 2005-05-30 08:31:51

TobyR
Member
From: Cambridge, UK
Registered: 2004-08-14
Posts: 25

Re: Custom kernel and Pacman

Many thanks DibbleTheWrecker, I appreciate my error now. 

I admit I'm a little hasty, but not outrageously so. In my defence, I thought  I was differentiating between original and new kernels by changing the 'pkgrel' line in PKGBUILD.
May I suggest, a couple of very minor  changes to clarify your Wiki page (for the likes of me anyway!)?

1) In the 'config' section, make "During the config stage remember to set the LOCALVERSION variable if you want to use it." a separate bullet point, and add something like "... i.e. if you do NOT want to invalidate your existing kernel"

2)  To your bullet point "install your new pkg as normal" add a sentence "... If you did NOT change LOCALVERSION in config then you will need to remove the current kernel package (with pacman, as usual)"

The above suggestions might not be technically accurate, but I hope you understand what I mean.

thanks for all the advice and help

Toby


---------------------------
Arch Linux 0.6
Pentium II 266MHz
160MB SDRAM

Offline

#13 2005-06-02 00:38:45

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

Re: Custom kernel and Pacman

i already made the first clarification and i'll think about the second some more smile

It's a shame that "bad" things have to happen to highlight these things smile

Offline

#14 2005-06-02 22:31:30

TobyR
Member
From: Cambridge, UK
Registered: 2004-08-14
Posts: 25

Re: Custom kernel and Pacman

DibbleTheWrecker - Many thanks for all your help.  It it weren't for your Wiki guide I wouldn't have attempted this at all and therefore would not have learned what I have - so I don't consider this "bad" at all! :-)


---------------------------
Arch Linux 0.6
Pentium II 266MHz
160MB SDRAM

Offline

#15 2005-06-03 04:22:31

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

Re: Custom kernel and Pacman

Yeahy!  I love feedback!  Especially when it is good!

Offline

Board footer

Powered by FluxBB