Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 517104 - sys-power/cpupower - use partial unpack to reduce writes during build
Summary: sys-power/cpupower - use partial unpack to reduce writes during build
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Kernel Miscellaneous
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-14 15:19 UTC by Ben Kohler
Modified: 2014-07-15 05:34 UTC (History)
4 users (show)

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


Attachments
cpupower-partial-unpack.patch (cpupower-partial-unpack.patch,771 bytes, patch)
2014-07-14 15:19 UTC, Ben Kohler
Details | Diff
cpupower-partial-unpack.patch (cpupower-partial-unpack.patch,425 bytes, patch)
2014-07-14 17:58 UTC, Ben Kohler
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Kohler gentoo-dev 2014-07-14 15:19:40 UTC
Created attachment 380712 [details, diff]
cpupower-partial-unpack.patch

Currently cpupower unpacks a full linux kernel source tarball (500-600MB on disk), to get to the ~500kB of souces it needs.  A simple ebuild patch like this will make it unpack only what's actually used.

Of course any comments/tweaks/rejection are welcome.
Comment 1 Mike Gilbert gentoo-dev 2014-07-14 15:28:57 UTC
A couple of notes:

1. Using ${A} like that is a bit ugly, and will break if another file is added to SRC_URI. I would specify the actual file name: linux-${PV}.tar.xz.

2. Needs || die.
Comment 2 Mike Gilbert gentoo-dev 2014-07-14 15:30:44 UTC
Also, we should either depend on a new-enough tar that understands the .xz extension, or use an explicit pipeline, like this:

xz -cd "${DISTDIR}/linux-${PV}.tar.xz" | tar -xf - ...
Comment 3 Ben Kohler gentoo-dev 2014-07-14 15:40:59 UTC
Thanks for the feedback.  I considered the ugliness of $A and that should be fixed.

WRT tar versions, xz (-J) is supported in 1.22 or later, and 1.23 was stabilized 4 years ago.  All versions older than 1.22 were removed >3 years ago.  Is an explicit tar dep still warranted?
Comment 4 Mike Gilbert gentoo-dev 2014-07-14 15:42:08 UTC
Has it really been that long? I guess that's probably ok then.
Comment 5 Samuli Suominen (RETIRED) gentoo-dev 2014-07-14 17:45:59 UTC
How about replacing the attached patch with the corrected version after the feedback?
Comment 6 Ben Kohler gentoo-dev 2014-07-14 17:58:36 UTC
Created attachment 380720 [details, diff]
cpupower-partial-unpack.patch

Revised patch here
Comment 7 Rick Farina (Zero_Chaos) gentoo-dev 2014-07-14 20:53:34 UTC
Please note, this fixes one problem but completely ignore another.  Yes it's nice to speed things up and not waste IO for fun, however, on arches like arm we may not even have a generic kernel sources installed, and this will force >100MB to be downloaded.

Wouldn't a better solution be for the maintainer to extract what is needed and make a nice tiny tarball?
Comment 8 Mike Gilbert gentoo-dev 2014-07-14 21:01:27 UTC
(In reply to Rick Farina (Zero_Chaos) from comment #7)
> Wouldn't a better solution be for the maintainer to extract what is needed
> and make a nice tiny tarball?

Maybe, but that would mean more work for version bumps. I would consider that a separate enhancement request.
Comment 9 Samuli Suominen (RETIRED) gentoo-dev 2014-07-14 21:03:16 UTC
(In reply to Mike Gilbert from comment #8)
> (In reply to Rick Farina (Zero_Chaos) from comment #7)
> > Wouldn't a better solution be for the maintainer to extract what is needed
> > and make a nice tiny tarball?
> 
> Maybe, but that would mean more work for version bumps. I would consider
> that a separate enhancement request.

It has been asked before, and I have absolutely no plans in doing anything like that
That's why I'm only bumping major versions, 3.14 to 3.15 to 3.16, so I can reuse the linux-X.X.tar.xz you have to download anyway for {vanilla,gentoo}-sources
Comment 10 Samuli Suominen (RETIRED) gentoo-dev 2014-07-14 21:07:23 UTC
in fact I'll propably drop whole separate cpupower package at some point, and help robbat2 wrt bug 507118, and migrate cpupower back to there, adding USE flags to the ebuild, or possible create a -meta package of somekind
the point of separate cpupower was to get quick up-to-date replacement with init script for the obsolete cpufreq-utils and cpufreqd
but this bug is not for that, so lets keep it away from here
Comment 11 Samuli Suominen (RETIRED) gentoo-dev 2014-07-15 05:34:21 UTC
patch in tree, also ran `diff` of `strings` output of libcpupower.so.x.x.x to verify they match, and they do, and diff on cpufreq.h and they match also

because Makefile has some 'include's, this is not necessarily full proof safe