Bug 8762

Summary: testimage: make it can run by non root user (without sudo)
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Robert Yang <liezhi.yang>
Component: coreAssignee: Ross Burton <ross.burton>
Status: RESOLVED DUPLICATE QA Contact:
Severity: enhancement    
Priority: Medium CC: liezhi.yang, meta.mr.watcher, meta.watcher, richard.purdie, ross.burton
Version: 2.1   
Target Milestone: 2.1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Yes (doc changes required)

Description Robert Yang 2015-12-04 02:31:08 UTC
We need make testimage can run without sudo or root privilege , a lot of users don't have root privilege when then work on a server.
Comment 1 Ross Burton 2015-12-04 09:39:20 UTC
Isn't the only requirement for root the tap stuff, which you can work around with either static tap nodes created in advance by root, or sudo. For example my /etc/sudoers has:

ross	ALL=NOPASSWD:	/home/ross/Yocto/poky/scripts/runqemu-ifup
ross	ALL=NOPASSWD:	/home/ross/Yocto/poky/scripts/runqemu-ifdown

Now I don't need to enter the root password to run testimage.
Comment 2 Robert Yang 2015-12-07 03:25:58 UTC
(In reply to comment #1)
> Isn't the only requirement for root the tap stuff, which you can work around
> with either static tap nodes created in advance by root, or sudo. For
> example my /etc/sudoers has:
> 
> ross	ALL=NOPASSWD:	/home/ross/Yocto/poky/scripts/runqemu-ifup
> ross	ALL=NOPASSWD:	/home/ross/Yocto/poky/scripts/runqemu-ifdown
> 
> Now I don't need to enter the root password to run testimage.

runqemu nfs can work without root privilege, but testimage hardcode it, and can't  use extra runqemu args ?
Comment 3 Ross Burton 2015-12-10 16:02:32 UTC
The autobuilders run testimage as non-root perfectly fine without using sudo as the tap devices are pre-created by root and the "pokybuild" user given access to them.  Is there something else that needs root that I'm unaware of?
Comment 4 Robert Yang 2016-01-06 07:32:38 UTC
(In reply to comment #3)
> The autobuilders run testimage as non-root perfectly fine without using sudo
> as the tap devices are pre-created by root and the "pokybuild" user given
> access to them.  Is there something else that needs root that I'm unaware of?

Hi Ross,
The problem is that you need config the tap devices before you can run testimage as non-root, but config tap devices requires root privilege, this is not convenience when we work on a server without root privilege.
Comment 5 Stephen K Jolley 2016-01-11 22:59:46 UTC
Ross,

It appears Robert answered your question.  If you still have question please put it back into NEEDINFO.

Thanks,
Comment 6 Ross Burton 2016-02-11 11:59:03 UTC
Right, so you're asking for user-mode networking in runqemu.

There's an open bug for that already: bug 7887.  Conclusion is that the performance and inconvenience are sufficiently annoying that it wasn't worth it.  Feel free to reassign 7887 to yourself and implement it if this is a WR requirement of course!

*** This bug has been marked as a duplicate of bug 7887 ***