Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 276737

Summary: net-firewall/iptables: adding useflag ksource to include kernel source
Product: Gentoo Linux Reporter: cilly <cilly>
Component: New packagesAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED WONTFIX    
Severity: enhancement CC: pva
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: adding useflag ksource to compile with kernel sources
adding useflag ksource to compile with kernel sources
adding useflag ksource to compile with kernel sources
adding useflag ksource to compile with kernel sources
adding useflag ksource to compile with kernel sources
adding useflag ksource to compile with kernel sources
adding useflag ksource to compile with kernel sources
adding useflag ksource to compile with kernel sources

Description cilly 2009-07-06 10:51:54 UTC
iptables ebuild should contain the option for the user to include kernel sources
Comment 1 cilly 2009-07-06 10:53:26 UTC
Created attachment 196894 [details, diff]
adding useflag ksource to compile with kernel sources

adding useflag ksource to compile with kernel sources
Comment 2 cilly 2009-07-07 08:31:32 UTC
Created attachment 196998 [details, diff]
adding useflag ksource to compile with kernel sources

adding useflag ksource to compile with kernel sources
Comment 3 Peter Volkov (RETIRED) gentoo-dev 2009-07-07 11:30:57 UTC
Well, some patches require building against kernel sources although I'm unsure about USE flag. 

@base-system, any suggestions here? Is it sane to detect if we apply any patches and then and build against kernel sources in such case?

cilly, in any case we don't need to detect kernel version/sources location in case ksource USE flag is disabled. So something like this is required in ebuild:

pkg_setup() {
     # Don't call linux-info_pkg_setup in case ksource USE disabled.
     use ksource && linux-info_pkg_setup
}
Comment 4 cilly 2009-07-07 11:47:17 UTC
Created attachment 197040 [details, diff]
adding useflag ksource to compile with kernel sources

adding useflag ksource to compile with kernel sources, including: https://bugs.gentoo.org/276737#c3
Comment 5 cilly 2009-07-07 11:48:31 UTC
Created attachment 197042 [details, diff]
adding useflag ksource to compile with kernel sources

adding useflag ksource to compile with kernel sources, including: https://bugs.gentoo.org/276737#c3
Comment 6 cilly 2009-07-07 11:54:20 UTC
Probably, something like this:

if [[ -d ${EPATCH_SOURCE} ]] ; then
                        
                        EPATCH_SUFFIX="patch"
                        EPATCH_FORCE="yes" \
                        EPATCH_MULTI_MSG="Applying user patches from ${EPATCH_SOURCE} ..." \
                        epatch
                        linux-info_pkg_setup
                        CONFIGKERNEL="kernel ${KERNEL_DIR}"
                        break
                fi

and later in configure:

src_compile() {
        econf \
                --sbindir=/sbin \
                --libexecdir=/$(get_libdir) \
                --enable-devel \
                --enable-libipq \
                --enable-shared \
                --enable-static \
                $(CONFIGEXT)
Comment 7 cilly 2009-07-07 11:55:20 UTC
(In reply to comment #6)
> Probably, something like this:
> 
> if [[ -d ${EPATCH_SOURCE} ]] ; then
> 
>                         EPATCH_SUFFIX="patch"
>                         EPATCH_FORCE="yes" \
>                         EPATCH_MULTI_MSG="Applying user patches from
> ${EPATCH_SOURCE} ..." \
>                         epatch
>                         linux-info_pkg_setup
>                         CONFIGKERNEL="kernel ${KERNEL_DIR}"
>                         break
>                 fi
> 
> and later in configure:
> 
> src_compile() {
>         econf \
>                 --sbindir=/sbin \
>                 --libexecdir=/$(get_libdir) \
>                 --enable-devel \
>                 --enable-libipq \
>                 --enable-shared \
>                 --enable-static \
>                 $(CONFIGEXT)
> 

s/CONFIGEXT/CONFIGKERNEL/
Comment 8 cilly 2009-07-07 11:56:16 UTC
Does iptables need to be compiled against kernel sources in any case, if no patch is added?
Comment 9 cilly 2009-07-08 07:56:34 UTC
Created attachment 197149 [details, diff]
adding useflag ksource to compile with kernel sources

adding useflag ksource to compile with kernel sources, code https://bugs.gentoo.org/276737#c3 not working
Comment 10 cilly 2009-07-08 07:58:07 UTC
Created attachment 197151 [details, diff]
adding useflag ksource to compile with kernel sources

adding useflag ksource to compile with kernel sources, code https://bugs.gentoo.org/276737#c3 not working
Comment 11 SpanKY gentoo-dev 2009-07-12 03:28:19 UTC
those last two attachments are not patches, they're entire files
Comment 12 cilly 2009-07-13 09:40:55 UTC
Created attachment 197762 [details, diff]
adding useflag ksource to compile with kernel sources

adding useflag ksource to compile with kernel sources
Comment 13 cilly 2009-07-13 09:42:17 UTC
Created attachment 197764 [details, diff]
adding useflag ksource to compile with kernel sources

adding useflag ksource to compile with kernel sources
Comment 14 cilly 2009-07-13 09:43:03 UTC
sorry for that many attachments
Comment 15 SpanKY gentoo-dev 2011-02-10 03:54:45 UTC
(In reply to comment #3)
> Well, some patches require building against kernel sources although I'm
> unsure about USE flag. 

really ?  some patches need to go grubbin around internal kernel headers and cant use the sanitized user headers ?  do you examples ?
Comment 16 Peter Volkov (RETIRED) gentoo-dev 2011-04-30 20:38:18 UTC
(In reply to comment #15)
> really ?

Yes.

>  some patches need to go grubbin around internal kernel headers and
> cant use the sanitized user headers ?  do you examples ?

Check IMQ patches. You have to apply both kernel patches and then rebuild patched iptables.
Comment 17 SpanKY gentoo-dev 2011-05-01 05:38:29 UTC
imo, those changes should be propagated to the installed kernel headers
Comment 18 cilly 2011-05-01 08:23:42 UTC
(In reply to comment #17)
> imo, those changes should be propagated to the installed kernel headers

"--with-ksource" is a configure option of iptables which will let iptables to compile against changed and patched kernel-sources. Patches for kernel-sources can be easily applied via /etc/portage/patches and therefor a useflag for iptables to let the users decide is imho the least what gentoo can do to reflect user's choice.

Isn't gentoo's philosophy "let the user decide"?

Of cource, the useflag ksource should be disabled by default and must not be supported. A description could be:

ksource - compile iptables against kernel-sources, don't use it if you don't know what you are doing...
Comment 19 SpanKY gentoo-dev 2013-04-27 17:46:32 UTC
*** Bug 414857 has been marked as a duplicate of this bug. ***