You are not logged in.

#1 2003-10-25 16:10:40

janwil
Member
From: Tartu, Estonia
Registered: 2003-08-15
Posts: 88

How to create several custom packaged kernels?

Hi all,

Yesterday I created my own kernel with makepkg and obtained a kernel-*.tar.gz package. After

pacman -U kernel-*.tar.gz

it replaced my old kernel image and (probably) libraries. I realize that this kind of action is a bit dangerous and it is preferrable to have several kernel images living happily next to each other, having lilo or grub for selecting between them.

What should one do in order to get several packages with different kernel images so that they would not conflict?

Thanks,
Jan

Offline

#2 2003-10-25 18:59:34

hApy
Member
From: Victoria, BC
Registered: 2003-04-13
Posts: 194
Website

Re: How to create several custom packaged kernels?

danger? I scoff at danger!

err.. smile I mean.. well if the kernel doesn't work all it takes to fix it is the ftp/boot disks, and when it lets you give the kernel on the disc options type:

arch root=/dev/discs/disc0/part0

or whatever the correct partition is, log in, and then either pacman -S kernel or pacman -A mykernel.pkg.tar.gz

Hapy.

Offline

#3 2003-10-26 01:37:15

Xentac
Forum Fellow
From: Victoria, BC
Registered: 2003-01-17
Posts: 1,797
Website

Re: How to create several custom packaged kernels?

This was posted by orelien a little while ago.  I've adjusted it for my needs but here's the original.  It probably has to be modified to fit more of what the arch kernel looks like now.

# $Id: PKGBUILD,v 1.20 2003/03/20 00:19:48 judd Exp $
pkgextraver=-custom
pkgname=kernel$pkgextraver
pkgver=2.4.20
pkgrel=1
pkgdesc="The Linux Kernel"
backup=('boot/kconfig-'$pkgver$pkgextraver)
source=(ftp://ftp.kernel.org/pub/linux/kernel/v2.4/linux-$pkgver.tar.bz2 
  config mkinitrd mkinitrd.conf linux-2.4.20-ptrace.patch)

build() {
  kernel_version=$pkgver$pkgextraver
  rm -rf $startdir/pkg/*
  cd $startdir/src/linux-$pkgver
        patch -Np1 -i ../linux-2.4.20-ptrace.patch
  cp Makefile Makefile.backup
  sed "s/EXTRAVERSION =/EXTRAVERSION=$pkgextraver/" Makefile.backup > Makefile
  cp ../config ./.config
  yes "" | make config
  make dep clean bzImage modules || return 1
  mkdir -p $startdir/pkg/{lib/modules,boot,bin}

  make INSTALL_MOD_PATH=$startdir/pkg modules_install || return 1
  cp System.map $startdir/pkg/boot/System.map-$kernel_version
  cp arch/i386/boot/bzImage $startdir/pkg/boot/vmlinuz-$kernel_version
#  cp $startdir/src/nash $startdir/pkg/bin
  mkdir -p $startdir/pkg/usr/src/linux-$kernel_version/include
  cp -a include/linux $startdir/pkg/usr/src/linux-$kernel_version/include/
  cp -a include/asm-i386 $startdir/pkg/usr/src/linux-$kernel_version/include/
  cd $startdir/pkg/usr/src/linux-$kernel_version/include && ln -s asm-i386 asm
  chown -R root.root $startdir/pkg/usr/src/linux-$kernel_version
  cd $startdir/pkg/lib/modules/$kernel_version && 
    (rm -f build; ln -sf /usr/src/linux-$kernel_version build)
  cd $startdir
#  ./mkinitrd -k "$pkgver" -o image
  install -D -m644 src/config $startdir/pkg/usr/src/linux-$kernel_version/.config
  install -D -m644 src/config $startdir/pkg/boot/kconfig-$kernel_version
}

I have discovered that all of mans unhappiness derives from only one source, not being able to sit quietly in a room
- Blaise Pascal

Offline

Board footer

Powered by FluxBB