All of lore.kernel.org
 help / color / mirror / Atom feed
* NFS rootfs: mount: only root can mount proc on /proc
@ 2016-12-15  1:27 John Rama
  2016-12-15  2:13 ` Khem Raj
  2016-12-15 14:09 ` Anders Darander
  0 siblings, 2 replies; 5+ messages in thread
From: John Rama @ 2016-12-15  1:27 UTC (permalink / raw)
  To: yocto

Dear Yocto specialists

I would like to know how people, who familiar with Yocto, prepare NFS rootfs for target.

When running bitbake with image recipe, the target rootfs is generated at the following directory
{YOCTO_BUILD_DIR}//tmp//work/{TARGET}-poky-linux-gnueabi/{IMAGE}/1.0-r0//rootfs/.
However it's UID and GID is based on the account with which you runs the bitbake.
If you export this rootfs for the target, it will results in the problem reported in following thread.

http://www.linuxquestions.org/questions/linux-software-2/nfs-rootfs-mount-only-root-can-mount-proc-on-proc-4175595326/

I would like to hear how people avoid this problem.

The ideas I can come up with are followings, but those of them are not perfect..
1. Run the bitbake as root account
  - would not run as root since the all of generated files are root permission even for the log files.
2. Change UID and GID whenever generating new image
  - I guess next build would fall into the trouble because of the owner change.
3. Untar the tar ball under  {YOCTO_BUILD_DIR}//tmp//deploy/image/{TARGET}/*rootfs.tar.bz2 to  the export dir
  - takes additional time.. Not good.

So, is there any good idea to workaround this problem ?
Any insights and comments are really appreciated.

Kind Regards,
John Rama


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: NFS rootfs: mount: only root can mount proc on /proc
  2016-12-15  1:27 NFS rootfs: mount: only root can mount proc on /proc John Rama
@ 2016-12-15  2:13 ` Khem Raj
  2016-12-15 14:09 ` Anders Darander
  1 sibling, 0 replies; 5+ messages in thread
From: Khem Raj @ 2016-12-15  2:13 UTC (permalink / raw)
  To: John Rama; +Cc: yocto

On Wed, Dec 14, 2016 at 5:27 PM, John Rama <john.rama01@gmail.com> wrote:
> Dear Yocto specialists
>
> I would like to know how people, who familiar with Yocto, prepare NFS rootfs for target.
>
> When running bitbake with image recipe, the target rootfs is generated at the following directory
> {YOCTO_BUILD_DIR}//tmp//work/{TARGET}-poky-linux-gnueabi/{IMAGE}/1.0-r0//rootfs/.
> However it's UID and GID is based on the account with which you runs the bitbake.
> If you export this rootfs for the target, it will results in the problem reported in following thread.
>
> http://www.linuxquestions.org/questions/linux-software-2/nfs-rootfs-mount-only-root-can-mount-proc-on-proc-4175595326/
>
> I would like to hear how people avoid this problem.
>
> The ideas I can come up with are followings, but those of them are not perfect..
> 1. Run the bitbake as root account
>   - would not run as root since the all of generated files are root permission even for the log files.
> 2. Change UID and GID whenever generating new image
>   - I guess next build would fall into the trouble because of the owner change.
> 3. Untar the tar ball under  {YOCTO_BUILD_DIR}//tmp//deploy/image/{TARGET}/*rootfs.tar.bz2 to  the export dir
>   - takes additional time.. Not good.
>
> So, is there any good idea to workaround this problem ?

Perhaps this will be helpful
http://www.yoctoproject.org/docs/latest/dev-manual/dev-manual.html#qemu-running-under-a-network-file-system-nfs-server
https://wiki.yoctoproject.org/wiki/Poky_NFS_Root


> Any insights and comments are really appreciated.
>
> Kind Regards,
> John Rama
> --
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: NFS rootfs: mount: only root can mount proc on /proc
  2016-12-15  1:27 NFS rootfs: mount: only root can mount proc on /proc John Rama
  2016-12-15  2:13 ` Khem Raj
@ 2016-12-15 14:09 ` Anders Darander
  2016-12-15 15:20   ` Daniel.
  1 sibling, 1 reply; 5+ messages in thread
From: Anders Darander @ 2016-12-15 14:09 UTC (permalink / raw)
  To: yocto

Hi,

* John Rama <john.rama01@gmail.com> [161215 02:58]:

> The ideas I can come up with are followings, but those of them are not perfect..
> 1. Run the bitbake as root account
>   - would not run as root since the all of generated files are root permission even for the log files.

Never do this. You've got no idea what bitbake might do to your
computer...


> 2. Change UID and GID whenever generating new image
>   - I guess next build would fall into the trouble because of the owner change.

Yes, that'll get you problems later on.

> 3. Untar the tar ball under  {YOCTO_BUILD_DIR}//tmp//deploy/image/{TARGET}/*rootfs.tar.bz2 to  the export dir
>   - takes additional time.. Not good.

This is the right way to do it.

If it takes to much time, create a script that runs bitbake and then
untars the rootfs.

Cheers,
Anders

-- 
Anders Darander, Senior System Architect
ChargeStorm AB / eStorm AB


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: NFS rootfs: mount: only root can mount proc on /proc
  2016-12-15 14:09 ` Anders Darander
@ 2016-12-15 15:20   ` Daniel.
  2016-12-19 10:50     ` John Rama
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel. @ 2016-12-15 15:20 UTC (permalink / raw)
  To: yocto

2016-12-15 12:09 GMT-02:00 Anders Darander <anders@chargestorm.se>:
> Hi,
>
> * John Rama <john.rama01@gmail.com> [161215 02:58]:
>
>> The ideas I can come up with are followings, but those of them are not perfect..
>> 1. Run the bitbake as root account
>>   - would not run as root since the all of generated files are root permission even for the log files.
>
> Never do this. You've got no idea what bitbake might do to your
> computer...
>
>
>> 2. Change UID and GID whenever generating new image
>>   - I guess next build would fall into the trouble because of the owner change.
>
> Yes, that'll get you problems later on.
>
>> 3. Untar the tar ball under  {YOCTO_BUILD_DIR}//tmp//deploy/image/{TARGET}/*rootfs.tar.bz2 to  the export dir
>>   - takes additional time.. Not good.
>
> This is the right way to do it.
>
> If it takes to much time, create a script that runs bitbake and then
> untars the rootfs.

I do this all the time and have faced no problems regarding exploding
the tar. You may want to generate a .tar instead of a .tar.bz2. This
will safe the CPU from decrompressing so it should be faster...

Regards,
>
> Cheers,
> Anders
>
> --
> Anders Darander, Senior System Architect
> ChargeStorm AB / eStorm AB
> --
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto



-- 
"Do or do not. There is no try"
  Yoda Master


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: NFS rootfs: mount: only root can mount proc on /proc
  2016-12-15 15:20   ` Daniel.
@ 2016-12-19 10:50     ` John Rama
  0 siblings, 0 replies; 5+ messages in thread
From: John Rama @ 2016-12-19 10:50 UTC (permalink / raw)
  To: yocto

Thanks everyone for the feedback.
I got #3 would be the best way. 

Kind Regards,
John Rama

On 2016/12/16 0:20, Daniel. wrote:
> 2016-12-15 12:09 GMT-02:00 Anders Darander <anders@chargestorm.se>:
>> Hi,
>>
>> * John Rama <john.rama01@gmail.com> [161215 02:58]:
>>
>>> The ideas I can come up with are followings, but those of them are not perfect..
>>> 1. Run the bitbake as root account
>>>   - would not run as root since the all of generated files are root permission even for the log files.
>>
>> Never do this. You've got no idea what bitbake might do to your
>> computer...
>>
>>
>>> 2. Change UID and GID whenever generating new image
>>>   - I guess next build would fall into the trouble because of the owner change.
>>
>> Yes, that'll get you problems later on.
>>
>>> 3. Untar the tar ball under  {YOCTO_BUILD_DIR}//tmp//deploy/image/{TARGET}/*rootfs.tar.bz2 to  the export dir
>>>   - takes additional time.. Not good.
>>
>> This is the right way to do it.
>>
>> If it takes to much time, create a script that runs bitbake and then
>> untars the rootfs.
> 
> I do this all the time and have faced no problems regarding exploding
> the tar. You may want to generate a .tar instead of a .tar.bz2. This
> will safe the CPU from decrompressing so it should be faster...
> 
> Regards,
>>
>> Cheers,
>> Anders
>>
>> --
>> Anders Darander, Senior System Architect
>> ChargeStorm AB / eStorm AB
>> --
>> _______________________________________________
>> yocto mailing list
>> yocto@yoctoproject.org
>> https://lists.yoctoproject.org/listinfo/yocto
> 
> 
> 



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-12-19 10:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-15  1:27 NFS rootfs: mount: only root can mount proc on /proc John Rama
2016-12-15  2:13 ` Khem Raj
2016-12-15 14:09 ` Anders Darander
2016-12-15 15:20   ` Daniel.
2016-12-19 10:50     ` John Rama

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.