Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 640658 - portage: Prefixify shebangs of init scripts
Summary: portage: Prefixify shebangs of init scripts
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Ebuild Support (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS, PATCH
: 911564 (view as bug list)
Depends on: 908971
Blocks: 640656
  Show dependency tree
 
Reported: 2017-12-11 08:53 UTC by Benda Xu
Modified: 2023-09-19 08:53 UTC (History)
3 users (show)

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


Attachments
prefix-initd-shebang.patch (prefix-initd-shebang.patch,667 bytes, patch)
2017-12-11 08:54 UTC, Benda Xu
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benda Xu gentoo-dev 2017-12-11 08:53:52 UTC
For OpenRC to run on Prefix, the shebang of init scripts should also be prefixified. The feature has been in the prefix branch of portage for while, and is well tested.

Reproducible: Always
Comment 1 Benda Xu gentoo-dev 2017-12-11 08:54:49 UTC
Created attachment 509328 [details, diff]
prefix-initd-shebang.patch

output of

git diff master prefix -- bin/install-qa-check.d/05prefix
Comment 2 Fabian Groffen gentoo-dev 2021-01-07 20:16:36 UTC
Benda do you still want to persue this change in isolation from the rest of the Portage changes?
Comment 3 Benda Xu gentoo-dev 2023-06-25 07:34:21 UTC
(In reply to Fabian Groffen from comment #2)
> Benda do you still want to persue this change in isolation from the rest of
> the Portage changes?

Yeah, it it useful on its own right for OpenRC.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-06-25 07:40:02 UTC
Please submit this as a PR to the github.com/gentoo/portage repo or attach a git am-able patch w/ signoff to this bug.
Comment 5 Larry the Git Cow gentoo-dev 2023-06-29 08:22:56 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=ffba5c4c48d8b937927ee67ac7c3dfc226827ddc

commit ffba5c4c48d8b937927ee67ac7c3dfc226827ddc
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-06-25 07:56:41 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-06-29 08:22:53 +0000

    NEWS: update
    
    Bug: https://bugs.gentoo.org/640658
    Bug: https://bugs.gentoo.org/909067
    Signed-off-by: Sam James <sam@gentoo.org>

 NEWS | 9 +++++++++
 1 file changed, 9 insertions(+)

https://gitweb.gentoo.org/proj/portage.git/commit/?id=6066bb766f43ca06a5b0f08baa5946ff678f0c29

commit 6066bb766f43ca06a5b0f08baa5946ff678f0c29
Author:     Benda Xu <orv@debian.org>
AuthorDate: 2023-06-25 09:03:00 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-06-29 08:22:53 +0000

    bin/install-qa-check.d/05prefix: prefixify init-script shebangs.
    
    Init scripts in /etc/init.d have OpenRC shebangs "#!/sbin/openrc-run".
    They should be prefixified like a executable script in a Prefix.
    
    Signed-off-by: Benda Xu <heroxbd@gentoo.org>
    Bug: https://bugs.gentoo.org/640658
    Closes: https://github.com/gentoo/portage/pull/1061
    Signed-off-by: Sam James <sam@gentoo.org>

 bin/install-qa-check.d/05prefix | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-06-29 08:23:40 UTC
Thanks!
Comment 7 Benda Xu gentoo-dev 2023-06-29 10:41:47 UTC
(In reply to Sam James from comment #6)
> Thanks!

Thank you, Sam!
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-07-29 11:30:41 UTC
grobian: could you backport this to the prefix portage version we have? some bootstraps seem to fail with this without the patch when emerging Python
Comment 9 Fabian Groffen gentoo-dev 2023-07-29 20:12:29 UTC
@sam: Don't get it.  Benda backported this fix from Prefix branch to main?  We already have it, in fact I wrote it myself when we were trying to use init scripts on Mac OS X Leopard, IIRC.  There was a guy particularly interested in it, back then.
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-07-29 21:10:39 UTC
I got it the wrong way around - it's normal portage which needs it backported to, let me do that later (it was a bootstrap on centos, I forgot which stuff uses ::prefix)
Comment 11 Fabian Groffen gentoo-dev 2023-07-30 07:30:37 UTC
Ah, only Prefix Guest uses the Portage prefix branch (USE="prefix prefix-guest").  RAP (USE="prefix") uses gx86 tree, and thus Portage main branch.
Comment 12 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-07-30 13:07:55 UTC
Thanks grobian and apologies for the error - I wasn't thinking straight. I'll backport that now.
Comment 13 Larry the Git Cow gentoo-dev 2023-07-30 13:10:32 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=477f52c4394e89e894be8665d1fcfd263a3c9f06

commit 477f52c4394e89e894be8665d1fcfd263a3c9f06
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-07-30 13:10:12 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-07-30 13:10:22 +0000

    sys-apps/portage: backport prefix init script shebang fix
    
    Bug: https://bugs.gentoo.org/640658
    Signed-off-by: Sam James <sam@gentoo.org>

 ...age-3.0.49-prefixify-init-script-shebangs.patch |  29 ++
 sys-apps/portage/portage-3.0.49-r2.ebuild          | 303 +++++++++++++++++++++
 2 files changed, 332 insertions(+)
Comment 14 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-07-30 13:13:23 UTC
Not sure if we'll need a new snapshot bump after this to get all the fixes or not, but hopefully we're all set now.
Comment 15 Fabian Groffen gentoo-dev 2023-07-30 13:15:06 UTC
RAP takes a MAIN snapshot (IIRC latest by default) so this should be fine once your commit hits a snapshot.
Thanks!
Comment 16 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-08-01 16:29:25 UTC
*** Bug 911564 has been marked as a duplicate of this bug. ***
Comment 17 Larry the Git Cow gentoo-dev 2023-08-09 02:57:33 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=858dfd771ac4c6c9315ac5851f4aeeb233fc21d5

commit 858dfd771ac4c6c9315ac5851f4aeeb233fc21d5
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-08-09 02:54:12 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-08-09 02:54:12 +0000

    sys-apps/portage: add 3.0.50
    
    Closes: https://bugs.gentoo.org/908971
    Closes: https://bugs.gentoo.org/640658
    Closes: https://bugs.gentoo.org/894398
    Closes: https://bugs.gentoo.org/895908
    Closes: https://bugs.gentoo.org/909067
    Closes: https://bugs.gentoo.org/909148
    Closes: https://bugs.gentoo.org/909853
    Closes: https://bugs.gentoo.org/910035
    Closes: https://bugs.gentoo.org/910376
    Closes: https://bugs.gentoo.org/911594
    Closes: https://bugs.gentoo.org/911574
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-apps/portage/Manifest              |   1 +
 sys-apps/portage/portage-3.0.50.ebuild | 229 +++++++++++++++++++++++++++++++++
 2 files changed, 230 insertions(+)