You are not logged in.

#26 2004-04-21 07:37:35

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Kernel Compilation in Wiki(ABS format success)

big_smile Hi pink chick;

Thinking about trying to do that but not today..it might help a lot of users, but too tired to go to it now.

   Thanks for the advice and the clue to the missing line (not needed anymore).  That is, unless u are scsi kernel booting.
   Off to slumberland soon!!

   My system boots to Kde window in 45secs.. Gnite1


Sign of the times: Navajo blanket..made in China
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#27 2004-04-21 16:39:28

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: Kernel Compilation in Wiki(ABS format success)

Hey guys,

I'm planning on recompiling my kernel this week or next. I'll see about whipping up a new PKGBUILD and changing the wiki while I do it. Its always nice to do that sort of thing while you're working on it. smile

Dusty

Offline

#28 2004-04-21 18:25:06

LB06
Member
From: The Netherlands
Registered: 2003-10-29
Posts: 435

Re: Kernel Compilation in Wiki(ABS format success)

I would like to see a kernel-source package, which will extract itself to /usr/src and symlink .config to /var/abs/kernels/kernelxx. Like this it'll be possible to use make x/menu/g/whatever-config AND build the kernel the Arch way, without having to download, extract, configure everything manually and then copy .config to ABS.

Offline

#29 2004-04-22 01:34:04

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Kernel Compilation in Wiki(ABS format success)

big_smile  smile

  Anyone who has interest can check out the entry in WIKI:

                          CUSTOM KERNEL WITH ABS (fOR NOOBIES, TOO)

     It is an addendum to the existing wiki, not a change to it for that one covers two methods.

    You are invited to critique or correct any errors in that addendum.


Sign of the times: Navajo blanket..made in China
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#30 2004-04-22 01:48:05

wdemoss
Member
From: WV - USA
Registered: 2004-01-18
Posts: 222

Re: Kernel Compilation in Wiki(ABS format success)

Just for another reference, here is a post where I did a custom PKGBUILD for a kernel and the mm patch.

http://bbs.archlinux.org/viewtopic.php? … t=pkgbuild


Hobbes : Shouldn't we read the instructions?
Calvin : Do I look like a sissy?

Offline

#31 2004-04-23 00:45:58

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Kernel Compilation in Wiki(ABS format success)

big_smile  smile
  The addendum I added to the wiki for kernel compilation is reprinted below;----------------------------------------------------------------------------------

         *OVERVIEW*
------------------------------------------------------------------------------------


     Command _ABS_ initiates a download into _/var/abs/kernels_ of all up-to-date data (CONFIG and PKGBUILD for example) for all kernels in arch archives (not the full kernels, just the data)
     From the above location, the desired kernel data is derived by opening that directory and copying the _CONFIG_ and _PKGBUILD_ files to the _ /var/abs/local_
directory to permit customizing.
     The two files are edited to your requirem,ents to prepare them for _makepkg_,(_and they are saved_).
     _makepkg PKGBUILD_ generates the new kernel _.pkg.tar.gz_.  (This may entail a download of the kernel _.tar.bz2_ if it is not resident in your computer).
     _Pacman -A kernel-x.x.x.pkg.tar.gz_ installs the new custom kernel.
     _LILO_ or _GRUB_ are then configured. (If _*LILO_*, then _*/SBIN/LILO -v_* to verify correct install and kernel ID).
     Reboot and select the new kernel ID at boot prompt.

-------------------------------------------------------------------------------------

     Step by step procedure:

     1. As root, _abs_ enter. (Download of data from arch archives)
     2. _cd /var/abs/kernels_
     3. Open desired kernel and _cp CONFIG and PKGBUILD_ files to _/var/abs/local_ directory.
     4. _cd /var/abs/local_.
     5. Open _CONFIG_ file and edit to your needs. _*SAVE AS CONFIG OVERWRITE_*.
     6. Open _PKGBUILD_ file and edit it as follows;

         a. Comment out _MD5_ entry
         b. Enter at Pkgname...._pkgname=kernel-$pkgver-custom_ ..
                    Note 1: -custom can be your name selection...
         c. Enter at pkgver...pkgver=_X.X.X_ ...(the kernel version numbers)
                   Note 2: If _conflicts= _ is in the entries set the entry as
                           follows: _conflicts= ( )_
     7. Edit the _build _( ){ section as follows;

             entry _yes""|make config_
                   Note3: If system is X based...change to... just _make xconfig_
                   Note4: If system is console based...change to..just....                 
                          _makemenuconfig_
     8. _*SAVE AS_* PKGBUILD and _*OVERWRITE_*
     9. Run _makepkg PKGBUILD_.  (A long process with one break _Xqconf<2>_ which you can skip.
     10. When makepkg completes, open the /var/abs/local/pkg directory and obtain the ID of the new kernel.tar.gz which is needed verbatim in next step.
     11. Run_pacman -A kernel-x.x.x-custom.pkg.tar.gz_
                    Note5: Use the ID from step 10, verbatim!
     12. Its break time while the kernel is installed.
     13. At completion of install, open/var/abs/local/pkg/boot and derive the ID of the vmlinuz file.  If its ID conflicts with your systems present ID's, rename the vmlinuz file, to perhaps: _vmlinuz26a_.  (This file must reside in root/boot if you run things from there, or it must be copied to the /boot file that your system uses, possibly in some usr file.
     14. _cd_ to root.  Edit _*LILO.CONF_* or _*GRUB_* to your new kernel requirements.
                   Note6: If _*LILO_*, after config and _SAVE_, _cd enter_ , then
                          run_*/sbin/lilo -v_* to verify the kernel ID entered and
                          no errors)  _IMPORTANT_
     15. Reboot and at boot prompt, select your new kernel ID.

--------------------------------------------------------------------------------------
         The following is a sample PKGBUILD ready for makepkg which shows the affected entries;






# $Id: PKGBUILD,v 1.14 2004/04/05 08:06:47 judd Exp $

# Maintainer: judd <jvinet@zeroflux.org>

pkgname=kernel-$pkgver-ramfs              ...._CHANGE HERE_

pkgver=2.6.5                              ...._CHANGE HERE

pkgrel=2

pkgdesc="The Linux Kernel and modules (IDE support)"

url="http://www.kernel.org"

backup=('boot/kconfig26')

depends=('module-init-tools')

install=kernel26.install

source=(ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-$pkgver.tar.bz2

config)


build() {

  cd $startdir/src/linux-$pkgver
 
  # get rid of the 'i' in i686
 
  carch=`echo $CARCH | sed 's|i||'`
 
  cat ../config | sed "s|#CARCH#|$carch|g" >./.config
 
  make xconfig                                ...._CHANGE HERE_
 
  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.map26
 
  cp arch/i386/boot/bzImage $startdir/pkg/boot/vmlinuz26
 
  install -D -m644 Makefile $startdir/pkg/usr/src/linux-$pkgver/Makefile
 
  install -D -m644 .config $startdir/pkg/usr/src/linux-$pkgver/.config
 
  install -D -m644 .config $startdir/pkg/boot/kconfig26
 
  mkdir -p $startdir/pkg/usr/src/linux-$pkgver/include
 
  mkdir -p $startdir/pkg/usr/src/linux-$pkgver/arch/i386/kernel
 
  for i in asm-generic asm-i386 config linux math-emu net pcmcia scsi video; do
 
    cp -a include/$i $startdir/pkg/usr/src/linux-$pkgver/include/
   
  done
 
  # copy files necessary for later builds, like nvidia and vmware
 
  cp -a scripts $startdir/pkg/usr/src/linux-$pkgver/
 
  cp arch/i386/Makefile $startdir/pkg/usr/src/linux-$pkgver/arch/i386/
 
  cp arch/i386/kernel/asm-offsets.s $startdir/pkg/usr/src/linux-$pkgver/arch/i386/kernel/
 
  # copy in Kconfig files
 
  for i in `find . -name "Kconfig*"`; do
 
    mkdir -p $startdir/pkg/usr/src/linux-$pkgver/`echo $i | sed 's|/Kconfig.*||'`
   
    cp $i $startdir/pkg/usr/src/linux-$pkgver/$i
   
  done
 
  cd $startdir/pkg/usr/src/linux-$pkgver/include && ln -s asm-i386 asm
 
  chown -R root.root $startdir/pkg/usr/src/linux-$pkgver
 
  cd $startdir/pkg/lib/modules/$pkgver &&
 
    (rm -f build; ln -sf /usr/src/linux-$pkgver build)
   
}


Sign of the times: Navajo blanket..made in China
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#32 2004-04-23 19:27:45

apeiro
Daddy
From: Victoria, BC, Canada
Registered: 2002-08-12
Posts: 771
Website

Re: Kernel Compilation in Wiki(ABS format success)

Just so y'all know, the kernel PKGBUILDs weren't really designed for users to build their own customized kernels with.  Instead, I expected that most users who wanted custom kernels would build them the normal way, by untarring to /usr/src and building bzImage as you would on any distro.

You do not need to have a kernel package installed, as nothing in Arch will require it as a dependency.  It is perfectly safe and acceptable to build the kernel normally with the "make bzImage modules modules_install" method.  You can also keep the stock one around as a failsafe, in case a custom build breaks for some reason.

My 2 cents....

Offline

#33 2004-04-23 19:48:35

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: Kernel Compilation in Wiki(ABS format success)

apeiro wrote:

Just so y'all know, the kernel PKGBUILDs weren't really designed for users to build their own customized kernels with.

I'll mention that on the wiki, but I also think that having a brand new kernel package build (that installs next to the regular kernel package, and does not conflict with it) would be about as clean as installing from /usr/src.

I think people are doing it "The Arch Way" because they think that is "correct". Your opinion may count for a lot to dispell this rumour. smile  If, after I've edited the wiki to contain a more understandable version of "the arch way", there are still a lot of questions about it, I vote we take that out of the wiki entry.

Dusty

Offline

#34 2004-04-23 20:47:28

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Kernel Compilation in Wiki(ABS format success)

big_smile  smile Apeiro and Dusty;

     You mention that the PKGBUILD system wasn't designed for making custom kernels.
The original wiki procedure references custom kernel generation.  The present revised wiki again addresses custom kernel fabrication.

    My addendum addressed the same subject to describe the use of PKGBUILD and CONFIG derived from abs to enable a new kernel to be generated that boots and comes up with every function available, including the  new CONFIG function operating.

    In my case, only two lines of code were necessary...wiki-wiki means quick in Hawaiian..and the upgrade to the CONFIG listing was wiki-wiki.

    The original procedure when some items (Conflicts= ( ) and the .gz were accomodated resulted in the loading of an identical kernel to the one already in the machine..failed to use the CONFIG entries because it had the same vmlinuz ID as the original kernel install boot vmlinuz.
    After performing the procedure I have outlined, the kernel was properly modified and the system booted into kde login.  Subsequently, the ramfs operation verified the coding was correct and the ram useable is now 1500MB, my goal in the whole procedure.

    I see no reason to ignore the abs method using PKGBUILD to generate a custom change to the kernel.....if it ain't broke, use it!!!  This would be true even if the wiki is eliminated.

   I wonder how a person is supposed to advance changes to a wiki without providing an addendum in complete form for comparison?  This I did.

  Has anyone really ran the wiki verbatim (no CONFIG changes indicated)?

  Is it wrong to use PKGBUILD even if it works in an orderly way?

  A noobie is an expert trying out a new procedure verbatim!

----------------------------------------------------------------------------------------------------------

When is a zero always equal to a one?


Sign of the times: Navajo blanket..made in China
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#35 2004-04-23 21:17:16

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: Kernel Compilation in Wiki(ABS format success)

I think what Apeiro is saying is that its probably easier to follow the common way instructions.  Why make an ABS package if its easier to do it by /usr/src? If it ain't broke, don't fix it. wink

I've always preferred the /usr/src way. I'm currently working with your PKGBUILD to make something that will be a good document for those to come.  However, it may be better for the community to agree that /usr/src is the "proper" way. Alternatively, a new PKGBUILD may also become the "proper" way. Two ways to do things is one source of Arch's power... a best way to do things is another source. smile

There is definately nothing wrong with you using your PKGBUILD to compile the kernel; it won't hurt the system in any way, and it basically does exactly the same thing as doing it from /usr/src.  Now that it is working for you, there is no reason to change; the discussion is more about what is best for the wiki.

Dusty

Offline

#36 2004-04-23 21:30:08

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Kernel Compilation in Wiki(ABS format success)

big_smile  smile

  My last words are I tried to use the wiki as invited by arch admin .  I find it not possible.

  The present wiki on this custom subject doesn't seem to cut the mustard.

  If every attempt to improve is met this way............!!!!!


Sign of the times: Navajo blanket..made in China
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#37 2004-04-25 18:18:40

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Kernel Compilation in Wiki(ABS format success)

big_smile T whom it may concern;

   The procedure for custom kernel generation is now found in wiki under "How To's", "Kernel & Hardware Issues", " Kernel Compilation With ABS".

   The OVERVIEW section can be utilized by veteran arch linux users.  The step-by-step details are for "noobies". (A noobie is a linux user employing a procedure for the first time).
   Be aware that the procedure entails much computer download time (to obtain the desired kernel(bz2) and that any errors introduced in performing the steps may cause the need to start over!!  Once the kernel is in your computer, later changes can be made more readily but just for that kernel version.  Nerw packages can be downloaded with pacman BUT NOT NEW KERNEL PACKAGES into this custom kernel--remember which kernel you are using!

I offer my services to anyone desiring to upgrade a kernel in arch archives obtainable through abs.

  Details of these services for generation of a custom kernel to your requirements can be discussed in a private message.

  Be aware that a CD has been generated through this process and successfully boots after entry into the computer.

  CU in private message!!!


Sign of the times: Navajo blanket..made in China
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#38 2004-04-27 08:50:47

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Kernel Compilation in Wiki(ABS format success)

Some one has ran a poll and decided from15 replies that he could cancel the wiki I had entered and enter is version.  I have no quarrel with it except it doesn't fit the term "Edit the Wiki".  It has to stand the test of use which most of the respondents to the poll had no experience with using abs method or perhaps none with the "standard method". 

   Linux is for everyone and their special needs.

  I reprint the material procedure I have used to customize three kernels and generate a CD of one of them which performed correctly:----------------------------------------------------------------------------------

         *OVERVIEW*
------------------------------------------------------------------------------------


     Command _ABS_ initiates a download into _/var/abs/kernels_ of all up-to-date data (CONFIG and PKGBUILD for example) for all kernels in arch archives (not the full kernels, just the data)
     From the above location, the desired kernel data is derived by opening that directory and copying the _CONFIG_ and _PKGBUILD_ files to the _ /var/abs/local_
directory to permit customizing.
     The two files are edited to your requirem,ents to prepare them for _makepkg_,(_and they are saved_).
     _makepkg PKGBUILD_ generates the new kernel _.pkg.tar.gz_.  (This may entail a download of the kernel _.tar.bz2_ if it is not resident in your computer).
     _Pacman -A kernel-x.x.x.pkg.tar.gz_ installs the new custom kernel.
     _LILO_ or _GRUB_ are then configured. (If _*LILO_*, then _*/SBIN/LILO -v_* to verify correct install and kernel ID).
     Reboot and select the new kernel ID at boot prompt.

-------------------------------------------------------------------------------------

     Step by step procedure:

     1. As root, _abs_ enter. (Download of data from arch archives)
     2. _cd /var/abs/kernels_
     3. Open desired kernel and _cp CONFIG and PKGBUILD_ files to _/var/abs/local_ directory.
     4. _cd /var/abs/local_.
     5. Open _CONFIG_ file and edit to your needs. _*SAVE AS CONFIG OVERWRITE_*.
     6. Open _PKGBUILD_ file and edit it as follows;

         a. Comment out _MD5_ entry
         b. Enter at Pkgname...._pkgname=kernel-$pkgver-custom_ ..
                    Note 1: -custom can be your name selection...
         c. Enter at pkgver...pkgver=_X.X.X_ ...(the kernel version numbers)
                   Note 2: If _conflicts= _ is in the entries set the entry as
                           follows: _conflicts= ( )_
     7. Edit the _build _( ){ section as follows;

             entry _yes""|make config_
                   Note3: If system is X based...change to... just _make xconfig_
                   Note4: If system is console based...change to..just....                 
                          _makemenuconfig_
     8. _*SAVE AS_* PKGBUILD and _*OVERWRITE_*
     9. Run _makepkg PKGBUILD_.  (A long process with one break _Xqconf<2>_ which you can skip.
     10. When makepkg completes, open the /var/abs/local/pkg directory and obtain the ID of the new kernel.tar.gz which is needed verbatim in next step.
     11. Run_pacman -A kernel-x.x.x-custom.pkg.tar.gz_
                    Note5: Use the ID from step 10, verbatim!
     12. Its break time while the kernel is installed.
     13. At completion of install, open/var/abs/local/pkg/boot and derive the ID of the vmlinuz file.  If its ID conflicts with your systems present ID's, rename the vmlinuz file, to perhaps: _vmlinuz26a_.  (This file must reside in root/boot if you run things from there, or it must be copied to the /boot file that your system uses, possibly in some usr file.
     14. _cd_ to root.  Edit _*LILO.CONF_* or _*GRUB_* to your new kernel requirements.
                   Note6: If _*LILO_*, after config and _SAVE_, _cd enter_ , then
                          run_*/sbin/lilo -v_* to verify the kernel ID entered and
                          no errors)  _IMPORTANT_
     15. Reboot and at boot prompt, select your new kernel ID.

--------------------------------------------------------------------------------------
         The following is a sample PKGBUILD ready for makepkg which shows the affected entries;


# $Id: PKGBUILD,v 1.14 2004/04/05 08:06:47 judd Exp $

# Maintainer: judd <jvinet@zeroflux.org>

pkgname=kernel-$pkgver-ramfs              ...._CHANGE HERE_

pkgver=2.6.5                              ...._CHANGE HERE

pkgrel=2

pkgdesc="The Linux Kernel and modules (IDE support)"

url="http://www.kernel.org"

backup=('boot/kconfig26')

depends=('module-init-tools')

install=kernel26.install

source=(ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-$pkgver.tar.bz2

config)


build() {

  cd $startdir/src/linux-$pkgver
 
  # get rid of the 'i' in i686
 
  carch=`echo $CARCH | sed 's|i||'`
 
  cat ../config | sed "s|#CARCH#|$carch|g" >./.config
 
  make xconfig                                ...._CHANGE HERE_
 
  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.map26
 
  cp arch/i386/boot/bzImage $startdir/pkg/boot/vmlinuz26
 
  install -D -m644 Makefile $startdir/pkg/usr/src/linux-$pkgver/Makefile
 
  install -D -m644 .config $startdir/pkg/usr/src/linux-$pkgver/.config
 
  install -D -m644 .config $startdir/pkg/boot/kconfig26
 
  mkdir -p $startdir/pkg/usr/src/linux-$pkgver/include
 
  mkdir -p $startdir/pkg/usr/src/linux-$pkgver/arch/i386/kernel
 
  for i in asm-generic asm-i386 config linux math-emu net pcmcia scsi video; do
 
    cp -a include/$i $startdir/pkg/usr/src/linux-$pkgver/include/
   
  done
 
  # copy files necessary for later builds, like nvidia and vmware
 
  cp -a scripts $startdir/pkg/usr/src/linux-$pkgver/
 
  cp arch/i386/Makefile $startdir/pkg/usr/src/linux-$pkgver/arch/i386/
 
  cp arch/i386/kernel/asm-offsets.s $startdir/pkg/usr/src/linux-$pkgver/arch/i386/kernel/
 
  # copy in Kconfig files
 
  for i in `find . -name "Kconfig*"`; do
 
    mkdir -p $startdir/pkg/usr/src/linux-$pkgver/`echo $i | sed 's|/Kconfig.*||'`
   
    cp $i $startdir/pkg/usr/src/linux-$pkgver/$i
   
  done
 
  cd $startdir/pkg/usr/src/linux-$pkgver/include && ln -s asm-i386 asm
 
  chown -R root.root $startdir/pkg/usr/src/linux-$pkgver
 
  cd $startdir/pkg/lib/modules/$pkgver &&
 
    (rm -f build; ln -sf /usr/src/linux-$pkgver build)
   
}
   This procedure should help a noobie do the trick.  Best of luck!!


Sign of the times: Navajo blanket..made in China
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#39 2004-04-27 09:32:09

Moo-Crumpus
Member
From: Hessen / Germany
Registered: 2003-12-01
Posts: 1,441

Re: Kernel Compilation in Wiki(ABS format success)

lilsirecho wrote:

Some one has ran a poll and decided from15 replies that he could cancel the wiki I had entered and enter is version.  I have no quarrel with it except it doesn't fit the term "Edit the Wiki".  It has to stand the test of use which most of the respondents to the poll had no experience with using abs method or perhaps none with the "standard method".

I agree. This is not what I supposed a wiki should be.


Frumpus addict
[mu'.krum.pus], [frum.pus]

Offline

#40 2004-04-27 21:49:47

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Kernel Compilation in Wiki(ABS format success)

A very important reminder to any who use lilo.  If you made a typo error or a format error in editing lilo, you won't know it if you don't run the display of lilo with the full... /sbin/lilo -v.


Sign of the times: Navajo blanket..made in China
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#41 2004-04-30 14:16:46

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Kernel Compilation in Wiki(ABS format success)

I recently upgraded the kernel to the new2.6.5-3 version and experienced a need to change the custom kernel, the subject matter of this post.

I re-ran my procedure and successfully changed the custom kernel to reflect the desired custom features in the new kernel.

I also edited portions of the procedure to better describe requirements:

----------------------------------------------------------------------------------

         *OVERVIEW*
------------------------------------------------------------------------------------


     Command _ABS_ initiates a download into _/var/abs/kernels_ of all up-to-date data (CONFIG and PKGBUILD for example) for all kernels in arch archives (not the full kernels, just the data)
     From the above location, the desired kernel data is derived by opening that directory and copying the _CONFIG_ and _PKGBUILD_ files to the _ /var/abs/local_
directory to permit customizing.
     The two files are edited to your requirements to prepare them for _makepkg_,(_and they are saved_).
     _makepkg PKGBUILD_ generates the new kernel _.pkg.tar.gz_.  (This may entail a download of the kernel _.tar.bz2_ if it is not resident in your computer).
     _Pacman -A kernel-x.x.x.pkg.tar.gz_ installs the new custom kernel.
     _LILO_ or _GRUB_ are then configured. (If _*LILO_*, then _*/SBIN/LILO -v_* to verify correct install and kernel ID).
     Reboot and select the new kernel ID at boot prompt.

-------------------------------------------------------------------------------------

     Step by step procedure:

     1. As root, _abs_ enter. (Download of data from arch archives)
     2. _cd /var/abs/kernels_
     3. Open desired kernel and _cp CONFIG and PKGBUILD_ files to _/var/abs/local_ directory.
     4. _cd /var/abs/local_.
     5. Open _CONFIG_ file and edit to your needs. _*SAVE AS CONFIG OVERWRITE_*.
     6. Open _PKGBUILD_ file and edit it as follows;

         a. Comment out _MD5_ entry
         b. Enter at Pkgname...._pkgname=kernel-$pkgver-custom_ ..
                    Note 1: -custom can be your name selection...
         c. Enter at pkgver...pkgver=_X.X.X_ ...(the kernel version numbers)
                   Note 2: If _conflicts= _ is in the entries set the entry as
                           follows: _conflicts= ( )_
     7. Edit the _build _( ){ section as follows;

             entry _yes""|make config_
                   Note3: If system is X based...change to... just _make xconfig_
                   Note4: If system is console based...change to..just....                 
                          _makemenuconfig_
     8. _*SAVE AS_* PKGBUILD and _*OVERWRITE_*
     9. Run _makepkg PKGBUILD_.  (A long process with one break _Xqconf<2>_ which you can skip:File,Quit,Save Config.
     10. When makepkg completes, open the /var/abs/local directory and obtain the ID of the new kernel.tar.gz which is needed verbatim in next step.
     11. Run_pacman -A kernel-x.x.x-custom.pkg.tar.gz_
                    Note5: Use the ID from step 10, verbatim!
     12. Its break time while the kernel pkg is generated in /var/abs/local directory..
     13. At completion of pkg generation, open/var/abs/local/kernel/pkg/boot and derive the ID of the vmlinuz file.  If its ID conflicts with your systems present ID's, rename the vmlinuz file, to perhaps: _vmlinuz26a_.  (This file must reside in root/boot if you run things from there, or it must be copied to the /boot file that your system uses, possibly in some usr file.
     14. _cd_ to root.  Edit _*LILO.CONF_* or _*GRUB_* to your new kernel requirements.
                   Note6: If _*LILO_*, after config and _SAVE_, _cd enter_ , then
                          run_*/sbin/lilo -v_* to verify the kernel ID entered and
                          no errors)  _IMPORTANT_ (no typo errors)
     15. Reboot and at boot prompt, select your new kernel ID.

--------------------------------------------------------------------------------------
         The following is a sample PKGBUILD ready for makepkg which shows the affected entries;


# $Id: PKGBUILD,v 1.14 2004/04/05 08:06:47 judd Exp $

# Maintainer: judd <jvinet@zeroflux.org>

pkgname=kernel-$pkgver-ramfs              ...._CHANGE HERE_

pkgver=2.6.5                              ...._CHANGE HERE_ Note: no dash numbers!(pkgrel=)

pkgrel=2

pkgdesc="The Linux Kernel and modules (IDE support)"

url="http://www.kernel.org"

backup=('boot/kconfig26')

depends=('module-init-tools')

install=kernel26.install

source=(ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-$pkgver.tar.bz2

config)


build() {

  cd $startdir/src/linux-$pkgver
 
  # get rid of the 'i' in i686
 
  carch=`echo $CARCH | sed 's|i||'`
 
  cat ../config | sed "s|#CARCH#|$carch|g" >./.config
 
  make xconfig                                ...._CHANGE HERE_
 
  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.map26
 
  cp arch/i386/boot/bzImage $startdir/pkg/boot/vmlinuz26
 
  install -D -m644 Makefile $startdir/pkg/usr/src/linux-$pkgver/Makefile
 
  install -D -m644 .config $startdir/pkg/usr/src/linux-$pkgver/.config
 
  install -D -m644 .config $startdir/pkg/boot/kconfig26
 
  mkdir -p $startdir/pkg/usr/src/linux-$pkgver/include
 
  mkdir -p $startdir/pkg/usr/src/linux-$pkgver/arch/i386/kernel
 
  for i in asm-generic asm-i386 config linux math-emu net pcmcia scsi video; do
 
    cp -a include/$i $startdir/pkg/usr/src/linux-$pkgver/include/
   
  done
 
  # copy files necessary for later builds, like nvidia and vmware
 
  cp -a scripts $startdir/pkg/usr/src/linux-$pkgver/
 
  cp arch/i386/Makefile $startdir/pkg/usr/src/linux-$pkgver/arch/i386/
 
  cp arch/i386/kernel/asm-offsets.s $startdir/pkg/usr/src/linux-$pkgver/arch/i386/kernel/
 
  # copy in Kconfig files
 
  for i in `find . -name "Kconfig*"`; do
 
    mkdir -p $startdir/pkg/usr/src/linux-$pkgver/`echo $i | sed 's|/Kconfig.*||'`
   
    cp $i $startdir/pkg/usr/src/linux-$pkgver/$i
   
  done
 
  cd $startdir/pkg/usr/src/linux-$pkgver/include && ln -s asm-i386 asm
 
  chown -R root.root $startdir/pkg/usr/src/linux-$pkgver
 
  cd $startdir/pkg/lib/modules/$pkgver &&
 
    (rm -f build; ln -sf /usr/src/linux-$pkgver build)
   
}


Sign of the times: Navajo blanket..made in China
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#42 2004-05-12 03:04:00

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Kernel Compilation in Wiki(ABS format success)

Reedited a few items to clarify;

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

         *OVERVIEW*
------------------------------------------------------------------------------------


     Command _abs_ initiates a download into _/var/abs/kernels_ of all up-to-date data (CONFIG and PKGBUILD for example) for all kernels in arch archives (not the full kernels, just the data)
     From the above location, the desired kernel data is derived by opening that directory and copying the _CONFIG_ and _PKGBUILD_ files to the _ /var/abs/local_directory to permit customizing.
     The two files are edited to your requirements to prepare them for _makepkg_,(_and they are saved_).
     _makepkg PKGBUILD_ generates the new kernel _.pkg.tar.gz_.  (This may entail a download of the kernel _.tar.bz2_ if it is not resident in your computer).
     _pacman -A kernel-x.x.x.pkg.tar.gz_ installs the new custom kernel.
     _LILO_ or _GRUB_ are then configured. (If _*LILO_*, then _*/SBIN/LILO -v_* to verify correct install and kernel ID).
     Reboot and select the new kernel ID at boot prompt.

-------------------------------------------------------------------------------------

     Step by step procedure:

     1. As root, _abs_ enter. (Download of data from arch archives)
     2. _cd /var/abs/kernels_
     3. Open desired kernel and _cp CONFIG and PKGBUILD_ files to _/var/abs/local_ directory.
     4. _cd /var/abs/local_.
     5. Open _CONFIG_ file and edit to your needs. _*SAVE AS_ CONFIG_and _OVERWRITE_*.
     6. Open _PKGBUILD_ file and edit it as follows;

         a. Comment out _MD5_ entry
         b. Enter at pkgname...._pkgname=kernel-$pkgver-custom_ ..
                    Note 1: -custom can be your name selection...
         c. Enter at pkgver...pkgver=_X.X.X_ ...(the kernel version numbers)
                   Note 2: If _conflicts= _ is in the entries set the entry as
                           follows: _conflicts= ( )_
     7. Edit the _build _( ){ section as follows;

             entry _yes""|make config_
                   Note3: If system is X based...change to... _make xconfig_
                   Note4: If system is console based...change to......                 
                          _make menuconfig_
     8. _*SAVE AS_* PKGBUILD and _*OVERWRITE_*
     9. Run _makepkg PKGBUILD_.  (A long process with one break _Xqconf<2>_ which you can skip:File,Quit,Save Config.
     10. When makepkg completes, open the /var/abs/local directory and obtain the ID of the new kernel.tar.gz which is needed verbatim in next step.
     11. Run_pacman -A kernel-x.x.x-custom.pkg.tar.gz_
                    Note5: Use the ID from step 10, verbatim!
     12. Its break time while the kernel pkg is generated in /var/abs/local directory..
     13. At completion of pkg generation, open/var/abs/local/kernel/pkg/boot and derive the ID of the vmlinuz file.  If its ID conflicts with your systems present ID's, rename the vmlinuz file, to perhaps: _vmlinuz26a_.  (This file must reside in root/boot if you run things from there, or it must be copied to the /boot file that your system uses, possibly in some usr file.)
     14. _cd_ to root.  Edit _*LILO.CONF_* or _*GRUB_* to your new kernel requirements.
                   Note6: If _*LILO_*, after config and _SAVE_, _cd enter_ , then
                          run_*/sbin/lilo -v_* to verify the kernel ID entered and
                          no errors)  _IMPORTANT_ (no typo errors)
     15. Reboot and at boot prompt, select your new kernel ID.

--------------------------------------------------------------------------------------
         The following is a "sample" PKGBUILD ready for makepkg which shows the affected entries;

                    Note: Applies to PKGBUILD for Kernel26 as downloaded and modified.




# $Id: PKGBUILD,v 1.14 2004/04/05 08:06:47 judd Exp $

# Maintainer: judd <jvinet@zeroflux.org>

pkgname=kernel-$pkgver-ramfs              ...._CHANGE HERE_

pkgver=2.6.5                              ...._CHANGE HERE_ Note: no dash numbers!(pkgrel= dash no.)

pkgrel=2

pkgdesc="The Linux Kernel and modules (IDE support)"

url="http://www.kernel.org"

backup=('boot/kconfig26')

depends=('module-init-tools')

install=kernel26.install

source=(ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-$pkgver.tar.bz2

config)


build() {

  cd $startdir/src/linux-$pkgver
 
  # get rid of the 'i' in i686
 
  carch=`echo $CARCH | sed 's|i||'`
 
  cat ../config | sed "s|#CARCH#|$carch|g" >./.config
 
  make xconfig                                ...._CHANGE HERE_
 
  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.map26
 
  cp arch/i386/boot/bzImage $startdir/pkg/boot/vmlinuz26
 
  install -D -m644 Makefile $startdir/pkg/usr/src/linux-$pkgver/Makefile
 
  install -D -m644 .config $startdir/pkg/usr/src/linux-$pkgver/.config
 
  install -D -m644 .config $startdir/pkg/boot/kconfig26
 
  mkdir -p $startdir/pkg/usr/src/linux-$pkgver/include
 
  mkdir -p $startdir/pkg/usr/src/linux-$pkgver/arch/i386/kernel
 
  for i in asm-generic asm-i386 config linux math-emu net pcmcia scsi video; do
 
    cp -a include/$i $startdir/pkg/usr/src/linux-$pkgver/include/
   
  done
 
  # copy files necessary for later builds, like nvidia and vmware
 
  cp -a scripts $startdir/pkg/usr/src/linux-$pkgver/
 
  cp arch/i386/Makefile $startdir/pkg/usr/src/linux-$pkgver/arch/i386/
 
  cp arch/i386/kernel/asm-offsets.s $startdir/pkg/usr/src/linux-$pkgver/arch/i386/kernel/
 
  # copy in Kconfig files
 
  for i in `find . -name "Kconfig*"`; do
 
    mkdir -p $startdir/pkg/usr/src/linux-$pkgver/`echo $i | sed 's|/Kconfig.*||'`
   
    cp $i $startdir/pkg/usr/src/linux-$pkgver/$i
   
  done
 
  cd $startdir/pkg/usr/src/linux-$pkgver/include && ln -s asm-i386 asm
 
  chown -R root.root $startdir/pkg/usr/src/linux-$pkgver
 
  cd $startdir/pkg/lib/modules/$pkgver &&
 
    (rm -f build; ln -sf /usr/src/linux-$pkgver build)
   
}


Sign of the times: Navajo blanket..made in China
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#43 2004-06-13 06:13:37

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Kernel Compilation in Wiki(ABS format success)

This procedure permits the use of abs regardless of the kernel version desired as long as it is included in the download when entering abs.  It is not just for the latest kernel.  When utilized to compile a kernel, it becomes a custom kernel since it is not downloaded through pacman.

The appropriate notation for such a kernel would then be apparent to the user.

Recommended is the study of the configuration file which is voluminous  (32 pages 8.5x11) so that appropriate selection of the desired options can be made more easily (more easily located).
  This procedure has been used by the writer 5 times with good results.


Sign of the times: Navajo blanket..made in China
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

Board footer

Powered by FluxBB