Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 698812 - sys-apps/debianutils: add ischroot USE flag
Summary: sys-apps/debianutils: add ischroot USE flag
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2019-10-28 23:33 UTC by Justin Keogh
Modified: 2020-05-23 22:37 UTC (History)
0 users

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


Attachments
add "ischroot" USE flag (debianutils-4.9.ebuild.ischroot.patch,793 bytes, patch)
2019-10-28 23:35 UTC, Justin Keogh
Details | Diff
add "ischroot" USE flag (fixed) (debianutils-4.9.ebuild.ischroot.patch,793 bytes, patch)
2019-10-29 00:34 UTC, Justin Keogh
Details | Diff
add "ischroot" description to metadata.xml (metadata.xml.patch,318 bytes, patch)
2019-10-29 05:40 UTC, Justin Keogh
Details | Diff
add "ischroot" USE flag (fixed... really) (debianutils-4.9.ebuild.ischroot.patch,793 bytes, patch)
2019-10-31 12:04 UTC, Justin Keogh
Details | Diff
install ischroot unconditionally (0001-sys-apps-debianutils-install-ischroot-binary.patch,1.72 KB, patch)
2020-05-22 18:18 UTC, Georgy Yakovlev
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Keogh 2019-10-28 23:33:29 UTC
Adds ischroot USE flag to sys-apps/debianutils to install /sbin/ischroot and it's associated manpage. The new flag is off by default.

Tested:
$ mkdir /mnt/gentoo_chroot_test
$ cp stage3-amd64-hardened+nomultilib-20191002T214502Z.tar.xz /mnt/gentoo_chroot_test
$ cd /mnt/gentoo_chroot_test
$ pwd
/mnt/gentoo_chroot_test
$ tar --xz -xpf stage3-amd64-hardened+nomultilib-20191002T214502Z.tar.xz
$ mount -t proc none /mnt/gentoo_chroot_test/proc
$ mount --rbind /sys /mnt/gentoo_chroot_test/sys
$ mount --rbind /dev /mnt/gentoo_chroot_test/dev
$ cp /sbin/ischroot /mnt/gentoo_chroot_test/sbin/
$ ischroot ; echo $?
1
$ chroot /mnt/gentoo_chroot_test/ /bin/bash
client / # ischroot ; echo $?
0

Patch attached.

Reproducible: Always
Comment 1 Justin Keogh 2019-10-28 23:35:15 UTC
Created attachment 594326 [details, diff]
add "ischroot" USE flag
Comment 2 Brian Evans (RETIRED) gentoo-dev 2019-10-29 00:14:14 UTC
Note: patch is reversed
Comment 3 Justin Keogh 2019-10-29 00:34:37 UTC
Created attachment 594330 [details, diff]
add "ischroot" USE flag (fixed)
Comment 4 Justin Keogh 2019-10-29 05:40:43 UTC
Created attachment 594334 [details, diff]
add "ischroot" description to metadata.xml
Comment 5 Mike Gilbert gentoo-dev 2019-10-29 16:01:00 UTC
Comment on attachment 594330 [details, diff]
add "ischroot" USE flag (fixed)

Patch is still reversed.

Regardless, why do we need a USE flag for this? Is there some reason not to install this unconditionally?
Comment 6 Justin Keogh 2019-10-31 12:04:34 UTC
Created attachment 594670 [details, diff]
add "ischroot" USE flag (fixed... really)

I don't see a reason to not install it unconditionally. If that is what is decided, I assume it would end up in the stage3 (I checked the hardended stage3 and it includes debianutils) which would be fine for my use case.

debianutils has two other programs we don't install:

add-shell:
https://manpages.debian.org/stretch/debianutils/add-shell.8.en.html

remove-shell:
https://manpages.debian.org/stretch/debianutils/remove-shell.8.en.html

and a sh version of which which collides with sys-apps/which.
Comment 7 Georgy Yakovlev archtester gentoo-dev 2020-05-22 18:08:28 UTC
I also think it should be just installed unconditionally. It's a useful utility.
not sure about sbin path though.

I use the following hook for now, placed to 

> /etc/portage/env/sys-apps/debianutils


> post_src_install() {
>         ebegin "hooked by ${BASH_SOURCE[0]} in ${FUNCNAME[0]}"
>         pushd "${S}" >/dev/null || die
>         dobin ischroot
>         doman ischroot.1
>         popd >/dev/null || die
>         eend ${?}
> }


that way no ebuild forking required.
Comment 8 Georgy Yakovlev archtester gentoo-dev 2020-05-22 18:18:27 UTC
Created attachment 640916 [details, diff]
install ischroot unconditionally
Comment 9 Larry the Git Cow gentoo-dev 2020-05-23 22:36:00 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=24f43ba09c1bb9a670bf5c21d3b09af20853cf39

commit 24f43ba09c1bb9a670bf5c21d3b09af20853cf39
Author:     Thomas Deutschmann <whissi@gentoo.org>
AuthorDate: 2020-05-23 22:34:06 +0000
Commit:     Thomas Deutschmann <whissi@gentoo.org>
CommitDate: 2020-05-23 22:34:06 +0000

    sys-apps/debianutils: bump to v4.9.3
    
    Ebuild changes to previous version:
    
    - Install ischroot
    
    Closes: https://bugs.gentoo.org/698812
    Package-Manager: Portage-2.3.99, Repoman-2.3.22
    Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>

 sys-apps/debianutils/Manifest                 |  1 +
 sys-apps/debianutils/debianutils-4.9.3.ebuild | 43 +++++++++++++++++++++++++++
 2 files changed, 44 insertions(+)
Comment 10 Thomas Deutschmann (RETIRED) gentoo-dev 2020-05-23 22:37:01 UTC
I picked same path a Debian (/usr/bin). I skipped the add-shell helper for now which I think we don't need.