You are not logged in.

#1 2010-02-02 05:44:42

santodelaespada
Member
Registered: 2009-04-15
Posts: 50

[SOLVED] Can't build modules for custom kernel package

hello, I've successfully compilled a tight custom kernel for my "HP mininote 110-1020LA" netbook. All the crap has been removed, it works like I intended, but that I've done in the "traditional way". When I wanted to post it as an AUR package, I found it does not includes the capability to compile new modules, fatal to the project since broadcom-wl is to be compiled in order to use wifi. The final package created by my PKGBUILD is done with the same .config file, so that is not the problem. I've noticed the lack of /lib/modules/CUSTOMKERNELVER/build;source and /usr/src/linux-CUSTOMKERNELVER directories.

this is the PKGBUILD file content, I tried to fix the problem adding lines to copy the missing directories to the $pkg folder, with no lucky results.
I'm really lost now, and it takes 1 hour to compile and find out, please assist me with this one.


pkgname=kernel26-hpmini1020
pkgver=2.6.32.6
pkgrel=2
pkgdesc="Kernel 2.6 customized for HP mini 110-1020 netbooks"
arch=(i686)
license=('GPL2')
groups=('base')
url="http://www.kernel.org"
depends=('coreutils' 'module-init-tools')
install=kernel26-hpmini1020.install
source=('http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.32.6.tar.bz2'
    'kernel26-hpmini1020.install'
    'dot_config')
md5sums=('5ad2ea7b6aed2d857dd9bb5ae03588e4'
         'cb98f740d730d429fa7f55c186db8742'
         '754f09f110925ae0aa5df4270db921df')

build() {

# prepare
    cd ${srcdir}/linux-${pkgver}
    make mrproper
# copy config file
    cp ${startdir}/dot_config ${srcdir}/linux-${pkgver}/.config
# updating config file to custom kernel version
# optionaly, you can "make menuconfig" or so, to change config options.
make oldconfig
#make menuconfig


# build the kernel

  make || return 1

# install our modules
  mkdir -p ${pkgdir}/{lib/modules,boot,usr/src}
  make INSTALL_MOD_PATH=$pkgdir modules_install || return 1

  cd ${srcdir}/linux-${pkgver}

# install the kernel
  install -D -m644 System.map ${startdir}/pkg/boot/System.map26-hpmini
  install -D -m644 arch/x86/boot/bzImage ${pkgdir}/boot/vmlinuz26-hpmini
  mv ${srcdir}/linux-${pkgver}-hpmini ${pkgdir}/usr/src/kernel26-hpmini
  ln ${pkgdir}/lib/modules/source /usr/src/kernel26-hpmini 
  ln ${pkgdir}/lib/modules/build /usr/src/kernel26-hpmini 

# set correct depmod command for install
  sed -i -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${pkgver}-hpmini/g" $startdir/kernel26-hpmini1020.install
}

In case it helps, this is the .install file

KERNEL_VERSION=2.6.32.6-hpmini

post_install() {
  echo -e ""
  echo -e "$_B >$_W Updating module dependencies$_n"
  depmod -a -v $KERNEL_VERSION > /dev/null 2>&1
  echo -e ""
  echo -e "$_B >$_W Creating initramfs$_n"
  mkinitcpio -k $KERNEL_VERSION -g /boot/kernel26-hpmini.img
  echo ""
  echo "==> NOTE:"
  echo "==> Do not forget to add your new kernel to /boot/grub/menu.lst"
  echo "==> ext3 compiled in, support for ext2, ext4 and xfs are compiled as modules"
  echo "==> so you only need the initramfs for such root filesystems."
  echo ""
  echo "==> NOTA:"
  echo "==> No olvide agregar la entrada para su nuevo kernel en /boot/grub/menu.lst"
  echo "==> No es necesario en initramfs si usas ext3 como root filesystem."
  echo "==> ext2, ext4 y xfs estan compilados como modulos, para esos si, usalo."
  echo ""
  echo "==> /boot/grub/menu.lst:"
  echo "==> title  Arch Linux hpmini"
  echo "==> root   (hd0,0)"
  echo "==> kernel /boot/vmlinuz26-hpmini root=/dev/sda1 ro quiet fastboot"
  echo "==> initrd /boot/kernel26-hpmini.img"
  echo ""
}

post_upgrade() {
  post_install
}

thanks in advance smile

Last edited by santodelaespada (2010-02-03 06:23:13)

Offline

#2 2010-02-02 07:02:56

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

Re: [SOLVED] Can't build modules for custom kernel package

santodelaespada wrote:

I tried to fix the problem adding lines to copy the missing directories to the $pkg folder, with no lucky results.

Have a look at the official kernel26 PKGBUILD, specifically the package_kernel26-headers() function - that has everything you need.

If you're still stuck, post your "unlucky" results i.e. the output of makepkg, so others can see what's going on.

Offline

#3 2010-02-02 17:31:21

santodelaespada
Member
Registered: 2009-04-15
Posts: 50

Re: [SOLVED] Can't build modules for custom kernel package

tomk wrote:
santodelaespada wrote:

I tried to fix the problem adding lines to copy the missing directories to the $pkg folder, with no lucky results.

Have a look at the official kernel26 PKGBUILD, specifically the package_kernel26-headers() function - that has everything you need.

If you're still stuck, post your "unlucky" results i.e. the output of makepkg, so others can see what's going on.

the makepkg works out fine, the kernel boots, and does everything right. When I try to compile the broadcom-wl drivers the output says something like "can't find /lib/modules/2.6.32.6-hpmini/sources" or build. Which I noticed to be symlinks to the directory were the kernel was built.
I'll look at the kernel26 PKGBUILD as you suggest, thanks for the heads-up. smile

Offline

#4 2010-02-03 06:22:30

santodelaespada
Member
Registered: 2009-04-15
Posts: 50

Re: [SOLVED] Can't build modules for custom kernel package

tomk wrote:
santodelaespada wrote:

I tried to fix the problem adding lines to copy the missing directories to the $pkg folder, with no lucky results.

Have a look at the official kernel26 PKGBUILD, specifically the package_kernel26-headers() function - that has everything you need.

If you're still stuck, post your "unlucky" results i.e. the output of makepkg, so others can see what's going on.

Thanks a lot tomk !, that just did the trick, I'll mark this as solved and post my new pkgbuild in the aur.

Offline

Board footer

Powered by FluxBB