You are not logged in.

#1 2009-05-30 06:50:08

Hei
Member
Registered: 2009-05-30
Posts: 4

Kernel-libre PKGBUILD - SOLVED

Grettings All

i'm trying to make a package for the kernel26-libre, to install with pacman. I looked at AUR and found one for x86_64, using that PKGBUILD as example i made this one for i686

pkgname=kernel26-libre
pkgver=2.6.29.1
pkgrel=1
pkgdesc="Free (Libre) version of Linux Kernel"
arch=('i686')
url="http://www.fsfla.org/svnwiki/selibre/linux-libre/"
license=('GPL2')
groups=()
depends=('coreutils' 'module-init-tools' 'mkinitcpio>=0.5.15')
makedepends=()
optdepends=()
provides=()
conflicts=()
replaces=()
backup=()
options=()
install=
source=(http://www.linux-libre.fsfla.org/pub/linux-libre/releases/2.6.29.1-libre/linux-2.6.29.1-libre.tar.bz2 config.i686)
noextract=()
md5sums=('8fa3d3fc1a9c3c1e8965b9fc44b8fb80'
         '6fb8deaa8c3c30ac4c9bd39a53359517')

build() {

  # Old School Build!
  cd $srcdir/linux-$pkgver
  cp ../config.$arch ./.config

  make dep
  make clean
  make modules
  make modules_install
  make bzImage

  cp -v arch/x86/boot/bzImage /boot/vmlinuz-$pkgver-libre
  mkinitcpio -k $pkgver-libre -g /boot/kernel26-libre.img

 

}

after makepkg,  there was a pkg.tar.gz but inside of that file there was only the PKGINFO and nothing more.

error: failed retrieving file 'kernel26-libre-2.6.29.1-1-i686.pkg.tar.gz' from disk : No such file or directory
warning: failed to retrieve some files from repo
error: failed to commit transaction (unexpected error)
Errors occurred, no packages were upgraded.

i get this when trying to install with pacman. I think the "build()" section on the PKGBUILD is installing the package instead of only create it. i have a  "kernel26-libre.img" and a "vmlinuz-2.6.29.1-libre" on /boot.

any ideas on how to change the PKGBUILD to make the package ready to install with pacman?

thanks

Last edited by Hei (2009-06-11 02:31:58)

Offline

#2 2009-05-30 10:15:38

Peanut
Member
From: Norway
Registered: 2009-05-24
Posts: 99

Re: Kernel-libre PKGBUILD - SOLVED

I believe this section is the troublemaker:

cp -v arch/x86/boot/bzImage /boot/vmlinuz-$pkgver-libre
mkinitcpio -k $pkgver-libre -g /boot/kernel26-libre.img

That code snippet is installing the compiled kernel directly to /boot, rather than packaging it so that pacman may handle the files.

In the PKGBUILD of the official kernel, the kernel itself is copied like this:

cp arch/$KARCH/boot/bzImage ${pkgdir}/boot/vmlinuz26${_kernelname}

Note the ${pkgdir}-prefix, which actually makes the file go into a temporary directory used to create the binary package.

Offline

#3 2009-05-31 04:34:57

Hei
Member
Registered: 2009-05-30
Posts: 4

Re: Kernel-libre PKGBUILD - SOLVED

thxs for the quick replay

after some PKGBUILD tweaking i got a kernel package that i could install using pacman, i borrowed some files from the arch kernel, including the kernel26.install and the ones for mkinitcpio, changing the version and kernel name.

the instalation went well but when mkinitcpio ran i got these

:: Begin dry run
ERROR: module 'pata[-_]acpi' not found
ERROR: module 'pata[-_]pdc2027x' not found
ERROR: module 'pata[-_]via' not found
ERROR: module 'ata[-_]generic' not found
ERROR: module 'scsi[-_]mod' not found
:: Parsing hook [base]
:: Parsing hook [udev]
:: Parsing hook [autodetect]
:: Parsing hook [pata]
:: Parsing hook [scsi]
ERROR: module 'sd[-_]mod' not found
:: Parsing hook [sata]
:: Parsing hook [usb]
:: Parsing hook [keymap]
:: Parsing hook [filesystems]
:: Generating module dependencies
:: Generating image '/boot/kernel26-libre.img'...SUCCESS

the final result is a unbootable kernel,it will prompt a recovery terminal, i also tried to boot it without the initrd line,  i got a kernel panic

kernel panic: non syncing: VFS unable to mount root

after checking the kernel configuration i found some of the modules, but i'm not sure if these should be added to the kernel, or if i'm suppose to let mkinitcpio handle them.

this is my first time trying to compile a custom kernel, any pointers on what should i do to add those modules or to boot the kernel without mkinitcpio??

Hei.

Offline

#4 2009-05-31 13:18:38

Peanut
Member
From: Norway
Registered: 2009-05-24
Posts: 99

Re: Kernel-libre PKGBUILD - SOLVED

There are two ways to setup a custom kernel:
1) You can compile your device drivers, support for your filesystems, etc directly into you kernel. This method doesn't require the use of mkinitrd or mkinitcpio,
2) You can compile a very minimal kernel with device drivers, etc compiled as kernel modules. These modules then have to be loaded during boot. Since the kernel can't access the harddrive before the device drivers for that kind of hardware is loaded, you need to provide the kernel with an "initial ramdisk" that contains these kernel modules.

The second approach is used in the official archlinux kernel. This is probably because Archlinux has to run on a wide range of hardware, and compiling all the drivers that Linux supports directly into the official kernel would result in a massive kernel. But if you know what device drivers and other kernel modules your system needs, I can't see any reason not to compile these drivers directly into the kernel.

To sum it up: personally, I would investigate what kernel modules my system needs, and then compile these directly into the kernel (you configure the kernel by running make menuconfig in the directory of the source before you compile it). The ramdisk would then be superfluous.

Offline

#5 2009-05-31 13:57:09

byte
Member
From: Düsseldorf (DE)
Registered: 2006-05-01
Posts: 2,046

Re: Kernel-libre PKGBUILD - SOLVED

ata_generic, sd_mod and scsi_mod are quite essential, I wonder why you didn't build them.


1000

Offline

#6 2009-06-05 03:27:01

Hei
Member
Registered: 2009-05-30
Posts: 4

Re: Kernel-libre PKGBUILD - SOLVED

i made a new .config file and compile again, then i created the img with

# mkinitcpio -k 2.6.29.1-libre -g /boot/kernel26-libre.img

it all went ok, but when i try to boot in the new kernel i get the following error

ERROR: Failed to parse block device name for ''
ERROR: root fs cannot be detected: try using  the rootfstype kernel parameter
.
.
.
try adding 'rootdelay=8' or higher to the kernel command line

i have tried those two suggestion with no success, i also try changing the grub command line from the UUID to 'dev/sda3' my root partition.

my menu.lst

# (0) Arch Linux
title  Arch Linux
root   (hd0,0)
kernel /vmlinuz26 root=/dev/disk/by-uuid/2c2513a0-4e97-4169-9606-774903f07f08 ro vga=775 nopat
initrd /kernel26.img

# (1) Arch Linux
title  Arch Linux Fallback
root   (hd0,0)
kernel /vmlinuz26 root=/dev/disk/by-uuid/2c2513a0-4e97-4169-9606-774903f07f08 ro
initrd /kernel26-fallback.img

# (1) Arch Linux Libre                                                                
title  Arch Linux Libre
root   (hd0,0)
#kernel /vmlinuz26-libre root=/dev/disk/by-uuid/2c2513a0-4e97-4169-9606-774903f07f08 ro
kernel /vmlinuz26-libre root=/dev/sda3 ro
initrd /kernel26-libre.img

mkinitcpio.conf

HOOKS="base udev autodetect pata scsi sata usb keymap filesystems"

i compiled the kernel with the "allmodules" .config, this option acording to the readme creates as many modules as possible, could it be that the kernel is trying to load some module but it can't find it ?

after instaling the kernel i did a

/sbin/depmod -A -v 2.26.9.1-libre > /dev/null 2>&1

no errors were show. thank you for your help and patience.


.... It's done, it worked finally, i would like to upload the PKGBUILD to AUR but it says "i'm not authorized to overwrite the package". i changed the name of the package and still get the same message, there is a kernel-libre package in AUR already but is flaged as "out of date".

grettings

Hei.

Last edited by Hei (2009-06-11 02:30:41)

Offline

#7 2009-06-11 02:45:40

Hei
Member
Registered: 2009-05-30
Posts: 4

Re: Kernel-libre PKGBUILD - SOLVED

Offline

Board footer

Powered by FluxBB