[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

make-kpkg: a script for flavours, and several questions



Hi people,

I need some help from the make-kpkg hackers... I learned enough about
make-kpkg to be able to use flavoured version numbers (I'm attaching
the script to do that below, as make-kpkg's docs aren't very clear on
that point) but there's something else that I want to do that may
involve deep Makefile hacking...

I used to do like this in the old days, to index with etags and
glimpse exactly the .c/.h/.S files that were really used in the kernel
compilation:

  # make config, make depend, then:
  sleep 2
  echo -n > .mkzImage-start
  sleep 2
  make bzImage
  make modules
  find * -name '*.[chS]' -and      -anewer .mkzImage-start > .files.chS.used
  find * -name '*.[chS]' -and -not -anewer .mkzImage-start > .files.chS.unused
  etags `cat .files.chS.used`
  glimpseindex -H . -F < .files.chS.used

how can I do something equivalent with make-kpkg? Also, how can I tell
"make" to use CFLAGS=-g (plus the other usual kernel flags) on "make
bzImage", but not on "make modules"? Or what do I need to do to make a
"gdb /usr/src/linux-2.2/vmlinux /proc/kcore" recognize the symbols on
the kernel modules?

  Cheers, TIA, etc,
    Eduardo Ochs
    http://angg.twu.net/
    edrx@inx.com.br
      (please cc to me, I'm not on the list)



==snip==snip== The script to make a flavoured kernel: ==snip==snip==

cd /usr/src/
rm -Rv linux linux-2.2
tar -xvzf ~/tmp/linux-2.2.15.tar.gz
cd /usr/src/
ln -s linux linux-2.2
gzip -cd $S/http/www.kernel.org/pub/linux/kernel/v2.2/patch-2.2.16.gz \
  | patch -p0							|& tee linux/op

# Patch the makefile to make the flavours work
#
cd /usr/src/linux/
patch Makefile <<'%%%'
63c63,74
< KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
---
> # FLAVOUR is like EXTRAVERSION, but it's meant for local use, and the
> # dash between it and the rest of the version is supplied here.  It's used
> # by make-kpkg's --flavour switch, see /usr/share/doc/kernel-package/Flavours.
> #FLAVOUR =
> 
> ifneq ($(strip $(FLAVOUR)),)
> INT_FLAV := -$(FLAVOUR)
> else
> INT_FLAV :=
> endif
> 
> KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)$(INT_FLAV)
%%%

# Now make the .deb:
#
cd /usr/src/linux/
make-kpkg clean							|& tee omkc
cp ~/k22conf .config
make-kpkg --revision=custom.1 --flavour=edrx kernel_image 	|& tee omkki

# This will produce a kernel package in the file
# "/usr/src/kernel-image-2.2.16-edrx_custom.1_i386.deb", with main files
#   /boot/config-2.2.16-edrx     ,
#   /boot/vmlinuz-2.2.16-edrx    ,
#   /boot/System.map-2.2.16-edrx ,
# docs on
#   /usr/share/doc/kernel-image-2.2.16-edrx/ ,
# and modules on
#   /lib/modules/2.2.16-edrx/<section>/<module_name>.o .
# Running "uname -a" after a boot with this kernel gives something like
#   Linux angg 2.2.16-edrx #1 Fri Jul 21 01:23:38 BRT 2000 i686 unknown

==snip==snip== End of the flavoured kernel script ==snip==snip==

--
Recycle your keystrokes - http://angg.twu.net/eev-manifesto.html



Reply to: