You are not logged in.

#1 2005-12-27 16:53:32

whargoul
Member
From: Odense, Denmark
Registered: 2005-04-04
Posts: 546

Custum kernel with ABS

All right, so I'm trying to compile my own kernel with ABS, but It just doesn't work. I am getting this error message:

WARNING: /var/abs/local/kernel-costum/pkg/lib/modules/2.6.14.4-ARCH/kernel/net/ieee80211/ieee80211_crypt_tkip.ko needs unknown symbol wireless_send_event
./PKGBUILD: line 114: cd: /var/abs/local/kernel-costum/pkg/lib/modules/{2.6.14.4}-whar: No such file or directory
==> ERROR: Build Failed.  Aborting...


My PKGBUILD looks like this:

# Contributor: dibblethewrecker <dibblethewrecker.at.jiwe.org>
pkgname=kernel26144-ARCH
pkgver=2.6.14.4
pkgrel=1
pkgdesc="The Linux Kernel 2.6.x.y and modules (IDE support)"
url="http://www.kernel.org"
depends=('module-init-tools')
install=kernel26.install

##### add any patch sources to this section
source=(config ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-$pkgver.tar.bz2 )

# Function to grab var from src
getvar() {
  old=$(cat Makefile | grep "^$1")
  echo $(echo ${old/"$1 ="/} | sed -e "s/[ ]*(.*)[ ]*/1/g")
  return 0
}

build() {
  cd $startdir/src/linux-$pkgver

  ##### Uncomment and apply any patches here
  #patch -Np1 -i ../patchname || return 1
  
  # Arch logo !
  cp ../../archbannerglass3.ppm drivers/video/logo
  # get rid of the 'i' in i686
  carch=`echo $CARCH | sed 's|i||'`
  cat ../config | sed "s|#CARCH#|$carch|g" >./.config

  ##### Load config - uncomment your preferred config method
  yes "" | make config
  #make oldconfig || return 1
  #make menuconfig
  #make xconfig
  #make gconfig

  ##### NO USER CHANGES BELOW HERE #####

  # save the current pkgname
  old_pkgname=$pkgname

  # set pkgname for build purposes - DO NOT alter!
  #pkgname=kernel26
  #
  # save the updated config to build with today's date
  cp ./.config $startdir/config-$(date +%b%d-%Hh)

  # get EXTRAVERSION from Makefile to create a unique pkgname and /usr/src directory
  #_kernextra=$(getvar "EXTRAVERSION")
  # grab the 2.6.x.y version suffix from pkgver
  #_y="`echo $pkgver | cut --delim "." --fields 4`"
  # remove .y version suffix from _kernextra
  #_kernextra="`echo $_kernextra | sed "s|.$_y||g"`"

  # Read the full kernel version info from new config to use in pathnames and pkgname
  . ./.config
  _kernver="{$pkgver}-whar"
  # Kernel custom - to create a unique pkgname (see below)
  #_kerncust="${_kernextra}${CONFIG_LOCALVERSION}"
  # Kernel release - will be the same as Makefile
  #_kernrel="${pkgver}${_kerncust}"
  # Get the pkgver suffix for unique pkgname and /boot file suffices
  #_pkgversuf="`echo $pkgver | sed "s|2.6.||g" | sed "s|.||g"`"
  # Set /boot file suffices from kernel release and pkgver suffix
  #_kernboot="${_pkgversuf}${_kerncust}"
  #
  # Set a new pkgname from  kernel release and pkgver suffix
  #pkgname="${pkgname}${_pkgversuf}${_kerncust}"

  # build!
  echo
  echo -n "Do you want to make clean (default YES)? (YES/NO): "
  read choice
  echo
  echo -n "Press any key to start make or CTRL+C to quit"
  read anykey

  if [ "${choice}" = "NO" ] ; then
  make bzImage modules || return 1
  else
  make clean bzImage modules || return 1
  fi

  mkdir -p $startdir/pkg/{lib/modules,boot}
  make INSTALL_MOD_PATH=$startdir/pkg modules_install || return 1
  cp System.map $startdir/pkg/boot/System.map26${_kernver}
  cp arch/i386/boot/bzImage $startdir/pkg/boot/vmlinuz26${_kernver}
  install -D -m644 Makefile 
    $startdir/pkg/usr/src/linux-${_kernver}/Makefile
  install -D -m644 .config 
    $startdir/pkg/usr/src/linux-${_kernver}/.config
  install -D -m644 .config $startdir/pkg/boot/kconfig26${_kernver}
  mkdir -p $startdir/pkg/usr/src/linux-${_kernver}/include
  mkdir -p $startdir/pkg/usr/src/linux-${_kernver}/arch/i386/kernel
  for i in acpi asm-generic asm-i386 config linux math-emu net pcmcia scsi video; do
    cp -a include/$i $startdir/pkg/usr/src/linux-${_kernver}/include/
  done
  # copy files necessary for later builds, like nvidia and vmware
  cp Module.symvers $startdir/pkg/usr/src/linux-${_kernver}
  cp -a scripts $startdir/pkg/usr/src/linux-${_kernver}
  mkdir -p $startdir/pkg/usr/src/linux-${_kernver}/.tmp_versions
  cp arch/i386/Makefile $startdir/pkg/usr/src/linux-${_kernver}/arch/i386/
  cp arch/i386/kernel/asm-offsets.s 
    $startdir/pkg/usr/src/linux-${_kernver}/arch/i386/kernel/
  # copy in Kconfig files
  for i in `find . -name "Kconfig*"`; do
    mkdir -p $startdir/pkg/usr/src/linux-${_kernver}/`echo $i | sed 's|/Kconfig.*||'`
    cp $i $startdir/pkg/usr/src/linux-${_kernver}/$i
  done
  cd $startdir/pkg/usr/src/linux-${_kernver}/include && ln -s asm-i386 asm
  chown -R root.root $startdir/pkg/usr/src/linux-${_kernver}
  cd $startdir/pkg/lib/modules/${_kernver} && 
    (rm -f source build; ln -sf /usr/src/linux-${_kernver} build)

  # Correct the pkgname in our PKGBUILD - this allows correct gensync operation
  # NOTE: pkgname variable must be declared with first 10 lines of PKGBUILD!
  #cd $startdir
  #sed -i "1,11 s|pkgname=$old_pkgname|pkgname=$pkgname|" ./PKGBUILD
}
# vim:syntax=sh

I want to name the package like this "kernel26whar-2.6.x.y-z". And all the modules should be put in "/lib/modules/2.6.x.y-whar". But I just can't figure out how.


Arch - It's something refreshing

Offline

#2 2005-12-27 17:11:23

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

Re: Custum kernel with ABS

Line 114 is almost at the end of the PKGBUILD, so you should have stuff in $startdir/pkg. Have a look in $startdir/pkg/lib/modules and see what's there.

What did you put for CONFIG_LOCALVERSION in your kernel config?

Offline

#3 2005-12-27 17:49:59

whargoul
Member
From: Odense, Denmark
Registered: 2005-04-04
Posts: 546

Re: Custum kernel with ABS

I'm sorry, but what is that used for? I just based some if it on a old "kernel26archck PKGBUILD".

# Contributor: dibblethewrecker <dibblethewrecker.at.jiwe.org>

pkgname=kernel26archck
_origver=2.6.13
_patchver=archck8
pkgver=${_origver}.${_patchver}
pkgrel=3
pkgdesc="The Linux Kernel 2.6.13 and modules (IDE support) with -archck8 patchset"
url="http://www.kernel.org"
backup=('boot/kconfig26archck')
depends=('module-init-tools')
install=kernel26.install
source=(ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-$_origver.tar.bz2 cdburning.patch http://iphitus.loudas.com/arch/ck/2.6.13/patch-$_origver-$_patchver.bz2 config)
md5sums=('560f5fadf59f172973e67939868a4cae' '66b87662e6dd54b6324f874739fa1b99'
         '34473117092ac6363dfe4cee20fd8571')

build() {
  cd $startdir/src/linux-$_origver
  
  patch -Np1 -i ../patch-$_origver-$_patchver || return 1
  patch -Np1 -i ../cdburning.patch || return 1

  # remove the extraversion version from Makefile
  sed -i 's|^EXTRAVERSION = -archck.*|EXTRAVERSION = -archck|g' Makefile 

  # get rid of the 'i' in i686
  carch=`echo $CARCH | sed 's|i||'`
  cat ../config | sed "s|#CARCH#|$carch|g" >./.config
  
  # load configuration
  yes "" | make config

  # build the full kernel version to use in pathnames
  . ./.config
  _kernver="${_origver}-archck${CONFIG_LOCALVERSION}"
  
  # build!
  make clean bzImage modules || return 1
  mkdir -p $startdir/pkg/{lib/modules,boot}
  make INSTALL_MOD_PATH=$startdir/pkg modules_install || return 1
  cp System.map $startdir/pkg/boot/System.map26archck
  cp arch/i386/boot/bzImage $startdir/pkg/boot/vmlinuz26archck
  install -D -m644 Makefile 
    $startdir/pkg/usr/src/linux-${_kernver}/Makefile
  install -D -m644 .config 
    $startdir/pkg/usr/src/linux-${_kernver}/.config
  install -D -m644 .config $startdir/pkg/boot/kconfig26archck
  mkdir -p $startdir/pkg/usr/src/linux-${_kernver}/include
  mkdir -p $startdir/pkg/usr/src/linux-${_kernver}/arch/i386/kernel
  for i in acpi asm-generic asm-i386 config linux math-emu net pcmcia scsi video; do
    cp -a include/$i $startdir/pkg/usr/src/linux-${_kernver}/include/
  done
  # copy files necessary for later builds, like nvidia and vmware
  cp Module.symvers $startdir/pkg/usr/src/linux-${_kernver}
  cp -a scripts $startdir/pkg/usr/src/linux-${_kernver}
  mkdir -p $startdir/pkg/usr/src/linux-${_kernver}/.tmp_versions
  cp arch/i386/Makefile $startdir/pkg/usr/src/linux-${_kernver}/arch/i386/
  cp arch/i386/kernel/asm-offsets.s 
    $startdir/pkg/usr/src/linux-${_kernver}/arch/i386/kernel/
  # copy in Kconfig files
  for i in `find . -name "Kconfig*"`; do 
    mkdir -p $startdir/pkg/usr/src/linux-${_kernver}/`echo $i | sed 's|/Kconfig.*||'`
    cp $i $startdir/pkg/usr/src/linux-${_kernver}/$i
  done
  cd $startdir/pkg/usr/src/linux-${_kernver}/include && ln -s asm-i386 asm
  chown -R root.root $startdir/pkg/usr/src/linux-${_kernver}
  cd $startdir/pkg/lib/modules/${_kernver} && 
    (rm -f source build; ln -sf /usr/src/linux-${_kernver} build)

Arch - It's something refreshing

Offline

#4 2005-12-27 21:54:09

whargoul
Member
From: Odense, Denmark
Registered: 2005-04-04
Posts: 546

Re: Custum kernel with ABS

I just made some minor correctnes, and it works allright now.


Arch - It's something refreshing

Offline

#5 2005-12-27 23:05:26

whargoul
Member
From: Odense, Denmark
Registered: 2005-04-04
Posts: 546

Re: Custum kernel with ABS

And yet not solved... I got an Kernel panic when I tried to boot the kernel. I am not very good at this kernel compilation.  :?

Here is the kernel config.


Arch - It's something refreshing

Offline

#6 2005-12-28 00:14:56

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

Re: Custum kernel with ABS

Posting your config may be useful - the exact error message(s) leading up to the kernel panic would be more informative.

If you haven't already done so, you should read this wiki page - I always use that PKGBUILD for my kernels, and I haven't had any problems. You still need to know how to solve kernel panics though - ABS can only do so much. wink

Offline

#7 2005-12-29 19:21:35

whargoul
Member
From: Odense, Denmark
Registered: 2005-04-04
Posts: 546

Re: Custum kernel with ABS

tomk wrote:

Posting your config may be useful - the exact error message(s) leading up to the kernel panic would be more informative.

Well, if you look at the last post, you will find the config there. About the error messages, it says this:

VFS: Cannot open root device "hda1" or unknown-block(0,0)
Please append a correct "root=" boot option
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

I seems to me, that it don't understand my filesystem (ReiserFS). But that doesn't make any sence, since I haven't touch the filesystem section in the kernel config.


Arch - It's something refreshing

Offline

#8 2005-12-29 22:33:00

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

Re: Custum kernel with ABS

What I was trying to say was "your config doesn't help very much here - please post the error message". Sorry I wasn't clearer. smile

That pastebin link isn't working anymore, so I can't check the following theory, but now that I've seen the error messages, I think you have not included the drivers for your disk controller and/or root file system in your kernel i.e. not as modules. Does that help at all?

If you can fix the link, I'll have a closer look.

Offline

#9 2005-12-29 22:37:15

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

Re: Custum kernel with ABS

One more thing:

whargoul wrote:

I haven't touch the filesystem section in the kernel config.

Which kernel config did you use as your starting point?

Offline

#10 2005-12-30 00:05:21

whargoul
Member
From: Odense, Denmark
Registered: 2005-04-04
Posts: 546

Re: Custum kernel with ABS

tomk wrote:

One more thing:

whargoul wrote:

I haven't touch the filesystem section in the kernel config.

Which kernel config did you use as your starting point?

I used the one from the newest kernel. Could that really be the problem?

And here you go.


Arch - It's something refreshing

Offline

#11 2005-12-30 01:08:27

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

Re: Custum kernel with ABS

Oh yeah - that could really be the problem. This brings me back to my old Debian days......

Question for you (although I think I know the answer smile ) - have you created an initrd image to go with your new custom kernel? Here's what I'm getting at - the current kernel only works if it has an initrd to load the required modules at boot time. Have a look at your config again - reiserfs is a module, all the IDE controllers are modules, for example. So if you're trying to boot a reiser root file system on an IDE disk, you need initrd.

You have two choices - build the required support into your kernel, or create an initrd.

Offline

#12 2005-12-30 01:21:41

whargoul
Member
From: Odense, Denmark
Registered: 2005-04-04
Posts: 546

Re: Custum kernel with ABS

Ohh, okay. I'll try that. And if I run into any trouble I just yell.   tongue

Thanks tomk. smile


Arch - It's something refreshing

Offline

#13 2005-12-30 08:45:03

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,914
Website

Re: Custum kernel with ABS

I'm interested if you get archck built using wiki pkgbuild ..... wink

I did try wiki build but I was trying to add initrd stuff (bad idea!!)

I used ABS pkgbuild to get archck7 built ... seems ok,, although config is old (I'll get round to fixing that!!!)

If you don't mind I'll hang around this thread  & maybe I'll be able to help...


Mr Green

Offline

#14 2005-12-30 09:27:49

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

Re: Custum kernel with ABS

I'm taking the lazy way myself - waiting for iphitus to release the next archck kernel package with initramfs, then shamelessly rippng it off!

Offline

#15 2005-12-30 10:41:54

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,914
Website

Re: Custum kernel with ABS

lol ... /me waits. ....


Mr Green

Offline

#16 2005-12-30 15:56:03

whargoul
Member
From: Odense, Denmark
Registered: 2005-04-04
Posts: 546

Re: Custum kernel with ABS

Allright, I can boot and all that. I just had problems with ethernet cards. But I don't think it will be very hard.

I let you know if I run into any problems.


Arch - It's something refreshing

Offline

#17 2005-12-30 15:58:41

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

Re: Custum kernel with ABS

I'll update the custom PKGBUILD to work with initrd soon too smile

Offline

#18 2005-12-30 17:42:53

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

Re: Custum kernel with ABS

whargoul - glad it worked out for you. It gets easier the more you do it.

Offline

#19 2005-12-30 17:43:51

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

Re: Custum kernel with ABS

dibblethewrecker wrote:

I'll update the custom PKGBUILD to work with initrd soon too smile

Nice one dibble - I look forward to it.

Offline

Board footer

Powered by FluxBB