You are not logged in.

#1 2011-02-07 07:11:07

gemon
Member
Registered: 2010-11-23
Posts: 20

[solved] custom kernel compilation with ABS

Hi all,
I'm trying to rebuild a custom kernel with ABS, since it looks pretty easy to setup, and indeed it is.
I'm just experiencing something weird, so I'd like to ask you how to solve it...
Now I have a custom config file, which eliminates tons of unneeded drivers (for example IRDA, or ISDN, or WIMAX and so on). Saving the config file, I can manually cat it to check that unneeded config options are not set up.
When I start building, after having modified the PKGBUILD though, I see unwanted drivers being compiled. Checking what is being compiled, I can see in htop that the line being executed refers to autoconf.h file. Editing that file shows that it has tons of #DEFINE of CONFIG options I've decided to skip...how come? In this way my compilation lasts forever, I'm compiling on an old Pentium II...

My PKGBUILD is very easy, I've just chosen (and uncommented)

make menuconfig

Then when I finished I saved the file and, just to be sure, manually copied from another terminal the saved config to the config file which is in the build directory.
When I issue makepkg -s it start building, runs the make menuconfig, then when I quit it starts building but with all the options!
What I'm finding suspect, though, is the following lines in the default PKGBUILD, which I've not modified at all:

  ####################
  # stop here
  # this is useful to configure the kernel
  #msg "Stopping build"
  #return 1
  ####################
  yes "" | make config
  # build!
  make ${MAKEFLAGS} bzImage modules

Now: why should one run make config after make menuconfig? I suspect that line creates a default config file with all options set in...Am I wrong?
What else can I check?

thanks in advance
Gemon

Last edited by gemon (2011-02-16 15:47:06)

Offline

#2 2011-02-07 07:25:40

archman-cro
Member
From: Croatia
Registered: 2010-04-04
Posts: 943
Website

Re: [solved] custom kernel compilation with ABS

Erase everything and have just a PKGBUILD you edited, config file, and *.install and *.preset files.
Put 'make oldconfig' instead of 'make config'. This way it'll take a provided config and build with only those options enabled in that file.
Sorry if it doesn't work that way.

Offline

#3 2011-02-07 08:42:00

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,354

Re: [solved] custom kernel compilation with ABS

Just replace 'make config' in the PKGBUILD with 'make menuconfig'. 'make oldconfig' may work as well.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#4 2011-02-07 15:30:52

gemon
Member
Registered: 2010-11-23
Posts: 20

Re: [solved] custom kernel compilation with ABS

mmm,
let me see if I understood correctly.
Can I change the build() by just commenting the following line?

yes "" | make config

This is how it should look like:

build() {
  cd ${srcdir}/linux-$_basekernel
  # Add -ARCH patches
  # See http://projects.archlinux.org/linux-2.6-ARCH.git/
  patch -Np1 -i ${srcdir}/${_patchname}

  if [ "$CARCH" = "x86_64" ]; then
    cat ../config.x86_64 >./.config
  else
    cat ../config >./.config
  fi
  if [ "${_kernelname}" != "" ]; then
    sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
  fi
  # get kernel version
  make prepare
  # load configuration
  # Configure the kernel. Replace the line below with one of your choice.
  make menuconfig # CLI menu for configuration ### <--- this is preferred method for editing the config file
  #make nconfig # new CLI menu for configuration
  #make xconfig # X-based configuration
  #make oldconfig # using old config from previous kernel version
  # ... or manually edit .config
  ####################
  # stop here
  # this is useful to configure the kernel
  #msg "Stopping build"
  #return 1
  ####################
  #yes "" | make config #### <--- commentend line!!!!
  # build!
  make ${MAKEFLAGS} bzImage modules
}

Offline

#5 2011-02-07 17:01:03

archman-cro
Member
From: Croatia
Registered: 2010-04-04
Posts: 943
Website

Re: [solved] custom kernel compilation with ABS

No, change

#yes "" | make config #### <--- commentend line!!!!

to

yes "" | make oldconfig

Or substitute 'make oldconfig' with 'make menuconfig' if you want to make some changes to config on-the-fly.

Have fun! smile

Offline

#6 2011-02-12 14:39:53

gemon
Member
Registered: 2010-11-23
Posts: 20

Re: [solved] custom kernel compilation with ABS

mmm, is it normal that I see isdn being compiled if my config has not isdn support?

...
drivers/isdn/hardware/eicon/os_bri.o
...

and

[gemon@myhost src]$ grep -i isdn config
# CONFIG_ISDN is not set

a question I still have is that apparently the auto.conf contains everything, even what I have switched off:

[gemon@myhost linux-2.6.37]$ grep -i isdn src/linux-2.6.37/include/config/auto.conf                                   CONFIG_ISDN_AUDIO=y
CONFIG_ISDN_DRV_AVMB1_T1ISA=m
CONFIG_ISDN_DRV_ACT2000=m
CONFIG_ISDN_TTY_FAX=y
CONFIG_ISDN_DRV_AVMB1_C4=m
CONFIG_ISDN_DRV_PCBIT=m
CONFIG_ISDN_PPP=y
CONFIG_MISDN=m
CONFIG_MISDN_IPAC=m
CONFIG_ISDN_DIVERSION=m
CONFIG_MISDN_NETJET=m
CONFIG_ISDN_DIVAS_MAINT=m
CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON=y
CONFIG_ISDN_DRV_GIGASET=m
CONFIG_MISDN_INFINEON=m
CONFIG_ISDN=y
CONFIG_MISDN_DSP=m
CONFIG_MISDN_W6692=m
CONFIG_ISDN_MPP=y
CONFIG_ISDN_DRV_AVMB1_AVM_CS=m
CONFIG_ISDN_DRV_AVMB1_B1ISA=m
CONFIG_MISDN_HFCMULTI=m
CONFIG_MISDN_HFCUSB=m
CONFIG_ISDN_CAPI_CAPIDRV=m
CONFIG_ISDN_DIVAS_PRIPCI=y
CONFIG_ISDN_CAPI_CAPIFS=m
CONFIG_ISDN_CAPI_CAPIFS_BOOL=y
CONFIG_ISDN_DRV_AVMB1_T1PCI=m
CONFIG_ISDN_PPP_VJ=y
CONFIG_ISDN_DRV_AVMB1_B1PCMCIA=m
CONFIG_MISDN_L1OIP=m
CONFIG_ISDN_DRV_AVMB1_B1PCI=m
CONFIG_ISDN_CAPI_CAPI20=m
CONFIG_MISDN_ISAR=m
CONFIG_ISDN_DIVAS_DIVACAPI=m
CONFIG_ISDN_DIVAS_USERIDI=m
CONFIG_MISDN_AVMFRITZ=m
CONFIG_ISDN_DRV_HISAX=m
CONFIG_ISDN_DRV_SC=m
CONFIG_ISDN_CAPI_MIDDLEWARE=y
CONFIG_ISDN_I4L=m
CONFIG_ISDN_CAPI=m
CONFIG_MISDN_HFCPCI=m
CONFIG_ISDN_DRV_ICN=m
CONFIG_ISDN_PPP_BSDCOMP=m
CONFIG_MISDN_SPEEDFAX=m
CONFIG_ISDN_HDLC=m
CONFIG_ISDN_DIVAS_BRIPCI=y
CONFIG_ISDN_DIVAS=m
CONFIG_ISDN_DRV_AVMB1_B1PCIV4=y

should I care about this file? Is it normal that if I deselect isdn all drivers are compiled same way?
Thanks in advance
Gemon

Offline

#7 2011-02-16 15:46:37

gemon
Member
Registered: 2010-11-23
Posts: 20

Re: [solved] custom kernel compilation with ABS

Now, the only way to solve my problem was to:
1) edit PKGBUILD by allowing only the make oldconfig after I manually run a make menuconfig
2) manually copy my .config to config (this implies rerunning the md5sum on that file or the makepkg will fail and exit) and copy it to <path_where_PKGBUILD_is>/src/linux-2.6.37/config file. This was needed to me otherwise the make will regerenate a default config file and auto.conf in the include/config folder will have all default options, ignoring my custom ones
3) in my case, having low ram (192 mb) I had to export a XZ limit otherwise the make will fail: export XZ_DEFAULTS=--memlimit=40%

I guess I can mark it as solved
Gemon

Offline

Board footer

Powered by FluxBB