You are not logged in.

#1 2005-05-30 01:36:26

thunderwolf318
Member
Registered: 2005-05-30
Posts: 54

So im trying to compile the kernel......

I'm trying to compile the kernel so i can use the ati drivers.
i have the PKGBUILD.custom_kernel file in a /var/abs/local/kernal/.

# Contributor: dibblethewrecker <dibblethewrecker.at.jiwe.org>
pkgname=kernel26
pkgver=2.6.11.10
pkgrel=1
pkgdesc="I likes the Chicken!"
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

  # 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

  # 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${_kernboot}
  cp arch/i386/boot/bzImage $startdir/pkg/boot/vmlinuz26${_kernboot}
  install -D -m644 Makefile 
    $startdir/pkg/usr/src/linux-${_kernrel}/Makefile
  install -D -m644 .config 
    $startdir/pkg/usr/src/linux-${_kernrel}/.config
  install -D -m644 .config $startdir/pkg/boot/kconfig26${_kernboot}
  mkdir -p $startdir/pkg/usr/src/linux-${_kernrel}/include
  mkdir -p $startdir/pkg/usr/src/linux-${_kernrel}/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-${_kernrel}/include/
  done
  # copy files necessary for later builds, like nvidia and vmware
  cp -a scripts $startdir/pkg/usr/src/linux-${_kernrel}
  mkdir -p $startdir/pkg/usr/src/linux-${_kernrel}/.tmp_versions
  cp arch/i386/Makefile $startdir/pkg/usr/src/linux-${_kernrel}/arch/i386/
  cp arch/i386/kernel/asm-offsets.s 
    $startdir/pkg/usr/src/linux-${_kernrel}/arch/i386/kernel/
  # copy in Kconfig files
  for i in `find . -name "Kconfig*"`; do
    mkdir -p $startdir/pkg/usr/src/linux-${_kernrel}/`echo $i | sed 's|/Kconfig.*||'`
    cp $i $startdir/pkg/usr/src/linux-${_kernrel}/$i
  done
  cd $startdir/pkg/usr/src/linux-${_kernrel}/include && ln -s asm-i386 asm
  chown -R root.root $startdir/pkg/usr/src/linux-${_kernrel}
  cd $startdir/pkg/lib/modules/${_kernrel} && 
    (rm -f source build; ln -sf /usr/src/linux-${_kernrel} 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


and when i try makepkg i get

==> Making package:   (Sun May 29 20:38:10 UTC 2005)
==> Checking Runtime Dependencies...
==> Checking Buildtime Dependencies...
==> Retrieving Sources...
==> Validating source files with MD5sums
==> Extracting Sources...
==> Removing existing pkg/ directory...
==> Starting build()...
/usr/bin/makepkg: line 557: build: command not found
==> ERROR: Build Failed.  Aborting...

Offline

#2 2005-05-30 02:59:11

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

Re: So im trying to compile the kernel......

first the PKGBUILD needs to be called PKGBUILD not PKGBUILD.custom_kernel - don't know if you have that?

second, if you copied and pasted the file rather than using the actual file check that you have no non-printing MS formating chars at the end of the lines which can screw the pkgbuild up

Offline

#3 2005-05-30 03:44:23

thunderwolf318
Member
Registered: 2005-05-30
Posts: 54

Re: So im trying to compile the kernel......

i think i downloaded it but ill download it again to be shure

Offline

#4 2005-05-30 05:22:18

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

Re: So im trying to compile the kernel......

is it called just PKGBUILD when you try to makepkg?

Offline

#5 2005-05-30 19:27:21

thunderwolf318
Member
Registered: 2005-05-30
Posts: 54

Re: So im trying to compile the kernel......

i got it to compile but there was a few warnings..... unfortionatly i dont have anyof them to post.

but i need to configer it before i try to build it next time.

Offline

#6 2005-05-30 20:35:50

thunderwolf318
Member
Registered: 2005-05-30
Posts: 54

Re: So im trying to compile the kernel......

i got it to compile and when i try to use pacman -U kernel261110-ARCH-2.6.11.10-1.pkg.tar.gz
i got a bunch of errors like this

kernel261110-ARCH: /usr/src/linux-2.6.11.10-ARCH/sound/usb/Kconfig: exists in filesystem

and it dosent install

Offline

#7 2005-05-31 05:31:53

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

Re: So im trying to compile the kernel......

yup - you need to customize the CONFIG_LOCALVERSION variable in you config file or during the configure stage otherwise it produces a name identical to the stock arch kernel - you are the second person this happened to - i will change the wiki

Offline

Board footer

Powered by FluxBB