about install shell script privilege problem


Ke, Liping <liping.ke@...>
 

Hi, Jessica
When testing the script, we found some privilege problems if using normal user to install the sdk.

Now all those packages must be installed to /opt, which acquire root privilege.
So when running opkg-cl, the installation root must be pointed to "/", so opkg-cl needs root privilege too.
Since the installation root is "/", the opkg lib dir must be under "/var/lib/opkg" which needs root privilege too.

And also, when extract rootfs, we need to use pseudo, since pseudo is installed under /opt/poky/, when running, it needs to create lock file which also needs root privilege.

If user don't use sudo, there're several problems which can't be solved well enough currently (for example, yes, we can change owner of /opt/poky to current user, but what if user another username b to install another architecture under the /opt/poky?)

So after discussion, we decide to use sudo to run the script.

Any other suggestions?

Thanks& Regards,
criping


Zhang, Jessica
 

Ke, Liping wrote:
Hi, Jessica
When testing the script, we found some privilege problems if using
normal user to install the sdk.

Now all those packages must be installed to /opt, which acquire root
privilege.
So when running opkg-cl, the installation root must be pointed to
"/", so opkg-cl needs root privilege too.
Since the installation root is "/", the opkg lib dir must be under
"/var/lib/opkg" which needs root privilege too.

And also, when extract rootfs, we need to use pseudo, since pseudo is
installed under /opt/poky/, when running, it needs to create lock
file which also needs root privilege.

If user don't use sudo, there're several problems which can't be
solved well enough currently (for example, yes, we can change owner
of /opt/poky to current user, but what if user another username b to
install another architecture under the /opt/poky?)

So after discussion, we decide to use sudo to run the script.

Any other suggestions?

Thanks& Regards,
criping
Liping,

I think this is consistent with the current SDK tarball installation that by
default going under /opt/poky. Since our installer script will install
things under /opt/poky as well, using sudo to run the script should be fine
till we can install the host cross toolchain under user directory.

Thanks,
Jessica


Ke, Liping <liping.ke@...>
 

Liping,

I think this is consistent with the current SDK tarball installation
that by
default going under /opt/poky. Since our installer script will install
things under /opt/poky as well, using sudo to run the script should be
fine
till we can install the host cross toolchain under user directory.
Ok, then there's no problem.
I will later split the shell script into two parts. The outer wrapper will
be called by user with normal user. And the outer wrapper script will call
the main part with sudo so that user need not type sudo.

Thanks,
Jessica