Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 447092 - net-libs/libnetfilter_acct should do kernel version check and NETFILTER_NETLINK_ACCT
Summary: net-libs/libnetfilter_acct should do kernel version check and NETFILTER_NETLI...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Gentoo Netmon project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-13 11:53 UTC by Coacher
Modified: 2012-12-13 18:04 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Coacher 2012-12-13 11:53:23 UTC
libnetfilter_acct requires kernel's netfilter accounting support which was introduced in 3.3 and can be enabled with NETFILTER_NETLINK_ACCT config option.
So we need to check for it in pkg_setup() in a similar way it is done in libnetfilter_conntrack ebuild, smth like:


CONFIG_CHECK="~NETFILTER_NETLINK_ACCT"

pkg_setup() {
	linux-info_pkg_setup
	kernel_is lt 3 3 && die "requires at least 3.3 kernel version"
}


Reproducible: Always
Comment 1 Sergey Popov gentoo-dev 2012-12-13 17:10:32 UTC
+  13 Dec 2012; Sergey Popov <pinkbyte@gentoo.org>
+  libnetfilter_acct-1.0.0.ebuild, libnetfilter_acct-1.0.1.ebuild:
+  Add check for NETFILTER_NETLINK_ACCT kernel option, wrt bug #447092

Is there any reason you want 'die' in pkg_setup? Package builds fine with older kernels, so warning will be enough, i think...
Comment 2 Coacher 2012-12-13 17:27:47 UTC
(In reply to comment #1)
> +  13 Dec 2012; Sergey Popov <pinkbyte@gentoo.org>
> +  libnetfilter_acct-1.0.0.ebuild, libnetfilter_acct-1.0.1.ebuild:
> +  Add check for NETFILTER_NETLINK_ACCT kernel option, wrt bug #447092
> 
> Is there any reason you want 'die' in pkg_setup? Package builds fine with
> older kernels, so warning will be enough, i think...

If it builds fine then it's completely ok for me to print a warning instead of `die`. I merely copied this code snippet from libnetfilter_conntrack ebuild and I'd never tested libnetfilter_acct build process on kernels prior to 3.3. Should've done that, but it seems you've already tested it:)

So, it's up to you whether change that `die` or not. Should I try and build it on smth like 3.2?
Comment 3 Sergey Popov gentoo-dev 2012-12-13 17:36:15 UTC
> (In reply to comment #2)
> Should I try and build it on smth like 3.2?

No, you do not have to - i have already done it with 3.0.35, so warning will be enough.

+  13 Dec 2012; Sergey Popov <pinkbyte@gentoo.org>
+  libnetfilter_acct-1.0.0.ebuild, libnetfilter_acct-1.0.1.ebuild:
+  Add check for kernel version, wrt bug #447092
Comment 4 Coacher 2012-12-13 17:39:17 UTC
Thank you very much!
This one went through really quick:)
Comment 5 Jeroen Roovers (RETIRED) gentoo-dev 2012-12-13 18:02:06 UTC
(In reply to comment #2)
> > Is there any reason you want 'die' in pkg_setup? Package builds fine with
> > older kernels, so warning will be enough, i think...
> 
> If it builds fine then it's completely ok for me to print a warning instead
> of `die`. I merely copied this code snippet from libnetfilter_conntrack
> ebuild and I'd never tested libnetfilter_acct build process on kernels prior
> to 3.3. Should've done that, but it seems you've already tested it:)

Maybe we should also remove that die() in libnetfilter_conntrack, then? And check other similar ebuilds, too?
Comment 6 Sergey Popov gentoo-dev 2012-12-13 18:04:47 UTC
(In reply to comment #5)
> Maybe we should also remove that die() in libnetfilter_conntrack, then? And
> check other similar ebuilds, too?

Well, i though that a policy about it is clear - if it builds with old kernel or headers - then we should only warn user(cause it will not work 	
though)