[OE-core] [PATCH 2/3] runqemu-gen-tapdevs: Allow run --help without sudo

Richard Purdie richard.purdie at linuxfoundation.org
Thu Dec 27 11:32:42 UTC 2018


On Thu, 2018-12-27 at 00:59 -0800, Robert Yang wrote:
> Then we can get user's UID and GID rather than hardcode to 1000,
> e.g.:
> 
> $ sudo ../poky/scripts/runqemu-gen-tapdevs 15220 100 4 tmp/sysroots-
> components/x86_64/qemu-helper-native/usr/bin
> 
> Signed-off-by: Robert Yang <liezhi.yang at windriver.com>
> ---
>  scripts/runqemu-gen-tapdevs | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)

This fixes the help output without sudo but breaks the help output
under sudo. How about we check SUDO_UID and SUDO_GID? Something like:

uid=`id -u`
if [ -n "$SUDO_UID" ]; then
    uid=$SUDO_UID
fi

?

Cheers,

Richard




More information about the Openembedded-core mailing list