FS#48989 - [arch-install-scripts] would be handy with "--userspec=USER:GROUP" in arch-chroot.

Attached to Project: Arch Linux
Opened by Que Quotion (quequotion) - Sunday, 17 April 2016, 09:18 GMT
Last edited by Dave Reisner (falconindy) - Saturday, 11 June 2016, 17:20 GMT
Task Type Feature Request
Category Arch Projects
Status Closed
Assigned To Dave Reisner (falconindy)
Architecture All
Severity Very Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
arch-chroot always logs in as root; but sometimes I want to log into a chroot as an unprivileged user, while still making use of arch-chroot's handy macros.

For now, I edit the bash script (/usr/bin/arch-chroot) and hard-code the user I need into the command line, but an implementation that made use of a command-line variable would be superior.

Steps to reproduce:
None, this is a feature request.
This task depends upon

Closed by  Dave Reisner (falconindy)
Saturday, 11 June 2016, 17:20 GMT
Reason for closing:  Implemented
Additional comments about closing:  v16 now has a -u switch to implement chroot's --userspec flag.
Comment by Dave Reisner (falconindy) - Sunday, 17 April 2016, 12:31 GMT
Is this anything more than a shortcut for su after chrooting?
Comment by Que Quotion (quequotion) - Monday, 18 April 2016, 08:29 GMT
does that work? that doesn't crash the chroot?
if so, yeah nvrmnd.
Comment by Dave Reisner (falconindy) - Monday, 18 April 2016, 11:12 GMT
su doesn't actually work (because it sucks hard), but sudo works just fine:

# arch-chroot /build/extra-x86_64/noclaf sudo -u builduser -s
$ id
uid=1000(builduser) gid=100(users) groups=100(users)

Loading...