Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 623736 - sys-power/bbswitch-0.8 patch for >=linux 4.12
Summary: sys-power/bbswitch-0.8 patch for >=linux 4.12
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Adam Feldman
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2017-07-03 19:27 UTC by Niranjan
Modified: 2018-03-25 20:01 UTC (History)
8 users (show)

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


Attachments
sys-power/bbswitch-0.8 patch for >=linux 4.12 (bbswitch_uaccess.patch,430 bytes, patch)
2017-07-03 19:27 UTC, Niranjan
Details | Diff
sys-power/bbswitch-0.8 build.log (build.log,3.02 KB, text/x-log)
2017-07-03 19:29 UTC, Niranjan
Details
emerge --info (emerge-info,20.00 KB, text/plain)
2017-07-03 19:29 UTC, Niranjan
Details
sys-power/bbswitch-0.8 patch for >=linux 4.12 (uaccess.patch,527 bytes, patch)
2017-07-07 17:20 UTC, Niranjan
Details | Diff
sys-power/bbswitch-0.8 patch for >=linux 4.12 (uaccess.patch,528 bytes, patch)
2017-07-08 05:13 UTC, Niranjan
Details | Diff
sys-power/bbswitch-0.8 patch for >=linux 4.12 (uaccess.patch,528 bytes, patch)
2017-07-08 05:15 UTC, Niranjan
Details | Diff
bbswitch ebuild with EAPI bumped to 6 and epatch_user added to src_prepare (bbswitch-0.8.ebuild,883 bytes, text/plain)
2017-07-23 05:40 UTC, Niranjan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Niranjan 2017-07-03 19:27:29 UTC
Created attachment 480590 [details, diff]
sys-power/bbswitch-0.8 patch for >=linux 4.12

sys-power/bbswitch-0.8 needs to be patched for 4.12 and higher kernels due to uaccess.h changes.  Also, the current bbswitch ebuild is EAPI 5 and doesn't call epatch_user making this bug a little more of a hassle to deal with.
Comment 1 Niranjan 2017-07-03 19:29:04 UTC
Created attachment 480592 [details]
sys-power/bbswitch-0.8 build.log
Comment 2 Niranjan 2017-07-03 19:29:48 UTC
Created attachment 480594 [details]
emerge --info
Comment 3 Silvio 2017-07-04 06:58:59 UTC
same here
Comment 4 tman 2017-07-06 23:11:35 UTC
i put this patch in: 
/etc/portage/patches/sys-power 


but i still get: 

> Emerging (1 of 1) sys-power/bbswitch-0.8::gentoo
 * bbswitch-0.8.tar.gz SHA256 SHA512 WHIRLPOOL size ;-) ...                                                     [ ok ]
 * Determining the location of the kernel source code
 * Found kernel source directory:
 *     /usr/src/linux
 * Found kernel object directory:
 *     /lib/modules/4.12.0-gentoo/build
 * Found sources for kernel version:
 *     4.12.0-gentoo
 * Checking for suitable kernel configuration options...                                                        [ ok ]
>>> Unpacking source...
>>> Unpacking bbswitch-0.8.tar.gz to /var/tmp/portage/sys-power/bbswitch-0.8/work
>>> Source unpacked in /var/tmp/portage/sys-power/bbswitch-0.8/work
>>> Preparing source in /var/tmp/portage/sys-power/bbswitch-0.8/work/bbswitch-0.8 ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/sys-power/bbswitch-0.8/work/bbswitch-0.8 ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/sys-power/bbswitch-0.8/work/bbswitch-0.8 ...
ln: failed to create symbolic link 'Module.symvers': File exists
 * Preparing bbswitch module
make -j9 HOSTCC=x86_64-pc-linux-gnu-gcc CROSS_COMPILE=x86_64-pc-linux-gnu- 'LDFLAGS=-m elf_x86_64' KVERSION=4.12.0-gentoo default 
make -C /usr/src/linux M="$(pwd)" modules
make[1]: Entering directory '/usr/src/linux-4.12.0-gentoo'
  CC [M]  /var/tmp/portage/sys-power/bbswitch-0.8/work/bbswitch-0.8/bbswitch.o
/var/tmp/portage/sys-power/bbswitch-0.8/work/bbswitch-0.8/bbswitch.c: In function ‘bbswitch_proc_write’:
/var/tmp/portage/sys-power/bbswitch-0.8/work/bbswitch-0.8/bbswitch.c:317:9: error: implicit declaration of function ‘copy_from_user’ [-Werror=implicit-function-declaration]
     if (copy_from_user(cmd, buff, len))
         ^~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:309: /var/tmp/portage/sys-power/bbswitch-0.8/work/bbswitch-0.8/bbswitch.o] Error 1
make[1]: *** [Makefile:1512: _module_/var/tmp/portage/sys-power/bbswitch-0.8/work/bbswitch-0.8] Error 2
make[1]: Leaving directory '/usr/src/linux-4.12.0-gentoo'
make: *** [Makefile:13: default] Error 2
 * ERROR: sys-power/bbswitch-0.8::gentoo failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=sys-power/bbswitch-0.8::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-power/bbswitch-0.8::gentoo'`.
 * The complete build log is located at '/mnt/portage/logs/sys-power:bbswitch-0.8:20170706-230712.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-power/bbswitch-0.8/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-power/bbswitch-0.8/work/bbswitch-0.8'
 * S: '/var/tmp/portage/sys-power/bbswitch-0.8/work/bbswitch-0.8'

>>> Failed to emerge sys-power/bbswitch-0.8, Log file:
Comment 5 tman 2017-07-07 13:13:00 UTC
could someone put this as soon as in portage please?

this is a sys package and the patches is  there...

thanks
Comment 6 Adam Feldman gentoo-dev 2017-07-07 16:34:32 UTC
Can you update the patch to include within a conditional macro for linux version?  I don't want to apply this patch unconditionally, and conditional logic in the ebuild is not the place for it.  Conditional preprocessor directives is the way to go.
Comment 7 Niranjan 2017-07-07 17:20:25 UTC
Created attachment 481732 [details, diff]
sys-power/bbswitch-0.8 patch for >=linux 4.12

Sorry about that, for some reason I thought that the patch logic was better suited for the ebuild.  I've adjusted the patch with what I think is a working conditional to check the kernel version.  If this isn't the right way to do it, I'm open to comments and suggestions to do it properly.
Comment 8 Adam Feldman gentoo-dev 2017-07-08 02:50:32 UTC
(In reply to Niranjan from comment #7)
> Created attachment 481732 [details, diff] [details, diff]
> sys-power/bbswitch-0.8 patch for >=linux 4.12
> 
> Sorry about that, for some reason I thought that the patch logic was better
> suited for the ebuild.  I've adjusted the patch with what I think is a
> working conditional to check the kernel version.  If this isn't the right
> way to do it, I'm open to comments and suggestions to do it properly.

Yeah, conditional patching in ebuilds is pretty frowned upon.  Patch looks pretty good.  Would you mind switching the conditional logic to >= 4.12 instead of < 4.12?  Otherwise, LGTM.  I'll give it a test when you update the patch and will commit ASAP.
Comment 9 Niranjan 2017-07-08 05:13:35 UTC
Created attachment 481802 [details, diff]
sys-power/bbswitch-0.8 patch for >=linux 4.12

Changed the logic to >= 4.12 as requested.
Comment 10 Niranjan 2017-07-08 05:15:47 UTC
Created attachment 481804 [details, diff]
sys-power/bbswitch-0.8 patch for >=linux 4.12

Ugh, sorry for the dupe, I didn't obsolete the patch properly.
Comment 11 tman 2017-07-08 05:41:26 UTC
(In reply to NP-Hardass from comment #8)
> (In reply to Niranjan from comment #7)
> > Created attachment 481732 [details, diff] [details, diff] [details, diff]
> > sys-power/bbswitch-0.8 patch for >=linux 4.12
> > 
> > Sorry about that, for some reason I thought that the patch logic was better
> > suited for the ebuild.  I've adjusted the patch with what I think is a
> > working conditional to check the kernel version.  If this isn't the right
> > way to do it, I'm open to comments and suggestions to do it properly.
> 
> Yeah, conditional patching in ebuilds is pretty frowned upon.  Patch looks
> pretty good.  Would you mind switching the conditional logic to >= 4.12
> instead of < 4.12?  Otherwise, LGTM.  I'll give it a test when you update
> the patch and will commit ASAP.

please make this ebuild  also with epatch_user available.
Comment 12 tman 2017-07-13 16:15:06 UTC
how far are u with testing?

would be nice if we could have a solution for this broken ebuild.

thanks
Comment 13 Silvio 2017-07-20 11:16:10 UTC
(In reply to tman from comment #12)
> how far are u with testing?
> 
> would be nice if we could have a solution for this broken ebuild.
> 
> thanks

No news? The problem still persists.
Comment 14 tman 2017-07-20 13:48:13 UTC
(In reply to Silvio from comment #13)
> (In reply to tman from comment #12)
> > how far are u with testing?
> > 
> > would be nice if we could have a solution for this broken ebuild.
> > 
> > thanks
> 
> No news? The problem still persists.


>>> Emerging (1 of 1) sys-power/bbswitch-0.8::gentoo
 * bbswitch-0.8.tar.gz SHA256 SHA512 WHIRLPOOL size ;-) ...                                                      [ ok ]
 * Determining the location of the kernel source code
 * Found kernel source directory:
 *     /usr/src/linux
 * Found kernel object directory:
 *     /lib/modules/4.12.2-gentoo/build
 * Found sources for kernel version:
 *     4.12.2-gentoo
 * Checking for suitable kernel configuration options...                                                         [ ok ]
>>> Unpacking source...
>>> Unpacking bbswitch-0.8.tar.gz to /var/tmp/portage/sys-power/bbswitch-0.8/work
>>> Source unpacked in /var/tmp/portage/sys-power/bbswitch-0.8/work
>>> Preparing source in /var/tmp/portage/sys-power/bbswitch-0.8/work/bbswitch-0.8 ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/sys-power/bbswitch-0.8/work/bbswitch-0.8 ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/sys-power/bbswitch-0.8/work/bbswitch-0.8 ...
ln: failed to create symbolic link 'Module.symvers': File exists
 * Preparing bbswitch module
make -j9 HOSTCC=x86_64-pc-linux-gnu-gcc CROSS_COMPILE=x86_64-pc-linux-gnu- 'LDFLAGS=-m elf_x86_64' KVERSION=4.12.2-gentoo default 
make -C /usr/src/linux M="$(pwd)" modules
make[1]: Entering directory '/usr/src/linux-4.12.2-gentoo'
  CC [M]  /var/tmp/portage/sys-power/bbswitch-0.8/work/bbswitch-0.8/bbswitch.o
/var/tmp/portage/sys-power/bbswitch-0.8/work/bbswitch-0.8/bbswitch.c: In function ‘bbswitch_proc_write’:
/var/tmp/portage/sys-power/bbswitch-0.8/work/bbswitch-0.8/bbswitch.c:317:9: error: implicit declaration of function ‘copy_from_user’ [-Werror=implicit-function-declaration]
     if (copy_from_user(cmd, buff, len))
         ^~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:309: /var/tmp/portage/sys-power/bbswitch-0.8/work/bbswitch-0.8/bbswitch.o] Error 1
make[1]: *** [Makefile:1512: _module_/var/tmp/portage/sys-power/bbswitch-0.8/work/bbswitch-0.8] Error 2
make[1]: Leaving directory '/usr/src/linux-4.12.2-gentoo'
make: *** [Makefile:13: default] Error 2
 * ERROR: sys-power/bbswitch-0.8::gentoo failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=sys-power/bbswitch-0.8::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-power/bbswitch-0.8::gentoo'`.
 * The complete build log is located at '/mnt/portage/logs/sys-power:bbswitch-0.8:20170720-134647.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-power/bbswitch-0.8/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-power/bbswitch-0.8/work/bbswitch-0.8'
 * S: '/var/tmp/portage/sys-power/bbswitch-0.8/work/bbswitch-0.8'

>>> Failed to emerge sys-power/bbswitch-0.8, Log file:



YES still having problem, still nothing from maintainer :(
Comment 15 Matt Turner gentoo-dev 2017-07-23 05:33:34 UTC
Patch works for me and sees to address the changes requested in comment #8. Please commit (and bump the ebuild to EAPI=6 so we can use /etc/portage/patches in the future)
Comment 16 Niranjan 2017-07-23 05:40:02 UTC
Created attachment 486488 [details]
bbswitch ebuild with EAPI bumped to 6 and epatch_user added to src_prepare
Comment 17 Adam Feldman gentoo-dev 2017-07-24 20:45:14 UTC
(In reply to Niranjan from comment #16)
> Created attachment 486488 [details]
> bbswitch ebuild with EAPI bumped to 6 and epatch_user added to src_prepare

Thanks for all of your help.  Resolved in 1b0fc3aa8f51619ce45cf39ed1c27910bba3c1ac
Comment 18 Christophe PEREZ 2018-03-25 19:30:47 UTC
8 months after, couldn't sys-power/bbswitch-0.8-r1 be in stable portage tree ?
Comment 19 Matt Turner gentoo-dev 2018-03-25 20:01:17 UTC
(In reply to Christophe PEREZ from comment #18)
> 8 months after, couldn't sys-power/bbswitch-0.8-r1 be in stable portage tree
> ?

Yes. I'll open a stablereq.