Skip to contentSkip to conversation

NFS rootfs: mount: only root can mount proc on /proc

DISCUSSION John Rama 4 participants 5 messages Dec 15, 2016 – Dec 19, 2016

lore
Share & tools
lore

John Rama

author
#0 lore raw

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

#1 lore raw
Quoted 21 lines · John Rama

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.

Quoted 1 line

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

Quoted 9 lines

Any insights and comments are really appreciated.

Kind Regards,
John Rama
--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

#2 lore raw
In reply to John Rama

Hi,

Quoted 3 lines · John Rama

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...

Quoted 2 lines

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.

Quoted 2 lines

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

Signature · 2 lines
Anders Darander, Senior System Architect
ChargeStorm AB / eStorm AB
#3 lore raw

2016-12-15 12:09 GMT-02:00 Anders Darander <[email protected]>:

Quoted 17 lines

Hi,

Quoted 3 lines · John Rama

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...

Quoted 2 lines

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.

Quoted 7 lines
Quoted 2 lines

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,

Quoted 12 lines

Cheers,
Anders

--
Anders Darander, Senior System Architect
ChargeStorm AB / eStorm AB
--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

Signature · 2 lines
"Do or do not. There is no try"
  Yoda Master
author
#4 lore raw

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

Kind Regards,
John Rama

Quoted 46 lines · Daniel.

2016-12-15 12:09 GMT-02:00 Anders Darander <[email protected]>:

Quoted 17 lines

Hi,

Quoted 3 lines · John Rama

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...

Quoted 2 lines

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.

Quoted 7 lines
Quoted 2 lines

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,

Quoted 12 lines

Cheers,
Anders

--
Anders Darander, Senior System Architect
ChargeStorm AB / eStorm AB
--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto