Bug 149197 - openswan-2.4.4 does not cope with suspend2-sources-2.6.18
Bug#: 149197 Product:  Gentoo Linux Version: 2006.0 Platform: All
OS/Version: Linux Status: RESOLVED Severity: normal Priority: P2
Resolution: FIXED Assigned To: maintainer-needed@gentoo.org Reported By: dominik.buerkle@web.de
Component: Ebuilds
URL: 
Summary: openswan-2.4.4 does not cope with suspend2-sources-2.6.18
Keywords:  
Status Whiteboard: 
Opened: 2006-09-26 10:51 0000
Description:   Opened: 2006-09-26 10:51 0000
Hi,

openswan-2.4.4 complains about "kernel version not supported", because the
ebuild depends on UTS_RELEASE in linux/include/linux/version.h.

That line is missing in suspend2-sources-2.6.18.

UTS_RELEASE comes before LINUX_VERSION_CODE in suspend2-sources-2.6.17-r5, the
following patch is depending on this order. I can write another patch, if this
can not be guaranteed.

Works for me. :-)

------- Comment #1 From DominikBuerkle 2006-09-26 10:52:37 0000 -------
Created an attachment (id=98152) [details]
patch with modified awk command, to accept 2.6.18 (+?) kernel versions

------- Comment #2 From DominikBuerkle 2006-09-26 10:56:23 0000 -------
Please check if the awk command is sufficient. Can be adapted to "accept
UTS_RELEASE, if anywhere in the file, else use LINUX_VERSION_CODE".

------- Comment #3 From DominikBuerkle 2006-09-26 10:58:55 0000 -------
KV_major/minor/micro (or whatever) should be inherited from sth. like
kernel-dependencies.eclass, imho.

------- Comment #4 From Jakub Moc (RETIRED) 2006-09-26 10:59:09 0000 -------
Please, don't resolve bugs that are not fixed in portage.

------- Comment #5 From DominikBuerkle 2006-09-26 12:37:24 0000 -------
Created an attachment (id=98165) [details]
new awk command

copes with any "version.h" that has either UTS_RELEASE or LINUX_VERSION_CODE.
Prefers UTS_RELEASE over LINUX_VERSION_CODE (which includes EXTRAVERSION, in my
case "-suspend2-r5" with 2.6.17-suspend2-r5) - quite like before.

Though EXTRAVERSION is cut off in this specific ebuild, it might be used in
other places, if that code was copied from somewhere else.

However, EXTRAVERSION cannot be recovered from version.h if UTS_RELEASE is not
included, so ebuilds that use this string have to choose some other method of
determining EXTRAVERSION... e.g.

$ cd /usr/src/linux; make kernelrelease
2.6.18-suspend2
$ 

$ cd /usr/src/; for d in linux-*; do (echo $d:; cd $d; make kernelrelease);
done
linux-2.6.16-suspend2-r8:
2.6.16-suspend2-r8
linux-2.6.17-suspend2-r4:
2.6.17-suspend2-r4
linux-2.6.17-suspend2-r5:
2.6.17-suspend2-r5
linux-2.6.18-suspend2:
2.6.18-suspend2
$

...

------- Comment #6 From DominikBuerkle 2006-09-26 12:42:19 0000 -------
Consider this Makefile snippet:


kernelrelease:
        $(if $(wildcard include/config/kernel.release), $(Q)echo
$(KERNELRELEASE), \
        $(error kernelrelease not valid - run 'make prepare' to update it))
kernelversion:
        @echo $(KERNELVERSION)


so something like

KV_full="$(cd /usr/src/linux && make kernelrelease)"
eerror $? "kernel not configured"

would be possible, wouldn't it?

------- Comment #7 From Jakub Moc (RETIRED) 2006-10-01 23:50:28 0000 -------
*** Bug 149786 has been marked as a duplicate of this bug. ***

------- Comment #8 From Daniel Drake 2006-10-15 18:56:28 0000 -------
This package should be fixed to use linux-info or linux-mod

------- Comment #9 From Daniel Drake 2006-10-15 19:46:54 0000 -------
now uses linux-info