Uboot NetBoot IMX8


Trevor
 

Hello Yocto Community,


I am trying to get an IMX8 board from TechNexion to boot using the netboot command from within uboot.  (IE mounting the filesystem remotely)


I have configured tftp and the NFS server and initially things seem to be working: the board boots, starts the kernel that was grabbed using tftp, and then starts using the remote filesystem.


Then the following kernel error messages are produced:




...
.....
[  OK  ] Started udev Wait for Complete Device Initialization.
[  OK  ] Listening on Load/Save RF Kill Switch Status /dev/rfkill Watch.
         Mounting Kernel Debug File System...
         Mounting FUSE Control File System...
         Mounting Kernel Configuration File System...
         Starting Remount Root and Kernel File Systems...
         Mounting Temporary Directory (/tmp)...
         Mounting POSIX Message Queue File System...
         Mounting Huge Pages File System...
[  OK  ] Created slice system-systemd\x2dbacklight.slice.
[FAILED] Failed to mount Kernel Debug File System.
See 'systemctl status sys-kernel-debug.mount' for details.
[FAILED] Failed to mount FUSE Control File System.
See 'systemctl status sys-fs-fuse-connections.mount' for details.
[FAILED] Failed to mount Kernel Configuration File System.
See 'systemctl status sys-kernel-config.mount' for details.
[FAILED] Failed to start Remount Root and Kernel File Systems.
See 'systemctl status systemd-remount-fs.service' for details.
[FAILED] Failed to mount Temporary Directory (/tmp).
.....
...


systemctl status sys-kernel-debug.mount gives:




..
[[0;1;31m●[[0m sys-kernel-debug.mount - Kernel Debug File System
   Loaded: loaded (/lib/systemd/system/sys-kernel-debug.mount; static; vendor pr
eset: enabled)
   Active: [[0;1;31mfailed[[0m (Result: exit-code) since Wed 2020-03-11 00:21:16
 UTC; 12min ago
    Where: /sys/kernel/debug
     What: debugfs
     Docs: https://www.kernel.org/doc/Documentation/filesystems/debugfs.txt
           https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
  Process: 2611 ExecMount=/bin/mount debugfs /sys/kernel/debug -t debugfs [[0;1;
31m(code=exited, status=1/FAILURE)[[0m

Mar 11 00:21:16 b2qt-b9-imx8mq systemd[1]: Mounting Kernel Debug File System...
Mar 11 00:21:16 b2qt-b9-imx8mq mount[2611]: mount: only root can use "--types" o
ption (effective UID is 1000)
Mar 11 00:21:16 b2qt-b9-imx8mq systemd[1]: [[0;1;39m[[0;1;31m[[0;1;39msys-kernel
-debug.mount: Mount process exited, code=exited status=1[[0m
Mar 11 00:21:16 b2qt-b9-imx8mq systemd[1]: [[0;1;39m[[0;1;31m[[0;1;39msys-kernel
-debug.mount: Failed with result 'exit-code'.[[0m
Mar 11 00:21:16 b2qt-b9-imx8mq systemd[1]: [[0;1;31m[[0;1;39m[[0;1;31mFailed to
mount Kernel Debug File System.
..




The mount error seems prevalent across all the errors.  somehow UID is 1000 when it should be 0 during boot?



On the Host side, here are the /etc/exports options for NFS:
 *(rw,sync,insecure,no_subtree_check,no_root_squash)




Any help would be greatly appreciated, 


Thanks,

Trevor



Nicolas Jeker
 

On Wed, 2020-03-11 at 00:39 +0000, Trevor wrote:
Mar 11 00:21:16 b2qt-b9-imx8mq mount[2611]: mount: only root can
use "--types" option (effective UID is 1000)

The mount error seems prevalent across all the errors. somehow UID
is 1000 when it should be 0 during boot?
By googling the error message I found a thread where somebody has the
same question, but I wouldn't recommend following the advice there
(running the yocto build as root). How do you extract the root
filesystem to your NFS directory? Maybe something is wrong there and
the files get extracted with UID 1000 as owner. For reference, I use
this command which seems to work fine:

sudo tar --strip-components=1 -C /srv/nfs/rootfs -xf images/apalis-
imx6-mainline/Apalis-iMX6-Mainline_Image.rootfs.tar.xz

Also check that there are no setuid/setgid bits set.

On the Host side, here are the /etc/exports options for NFS:
*(rw,sync,insecure,no_subtree_check,no_root_squash)
I'm using pretty much the same NFS options, the only difference I could
spot is an additional 'fsid=root' in my exports which is NFSv4
specific.


Laurent Gauthier
 

Hi all,

I would second what Nicolas pointed out:

* on the server side you want to make sure that you extract the rootfs tar file as user root.

Kind Regards, Laurent.


On Wed, Mar 11, 2020 at 8:43 AM Nicolas Jeker <n.jeker@...> wrote:
On Wed, 2020-03-11 at 00:39 +0000, Trevor wrote:
> > Mar 11 00:21:16 b2qt-b9-imx8mq mount[2611]: mount: only root can
> > use "--types" option (effective UID is 1000)
>
>
> The mount error seems prevalent across all the errors.  somehow UID
> is 1000 when it should be 0 during boot?

By googling the error message I found a thread where somebody has the
same question, but I wouldn't recommend following the advice there
(running the yocto build as root). How do you extract the root
filesystem to your NFS directory? Maybe something is wrong there and
the files get extracted with UID 1000 as owner. For reference, I use
this command which seems to work fine:

sudo tar --strip-components=1 -C /srv/nfs/rootfs -xf images/apalis-
imx6-mainline/Apalis-iMX6-Mainline_Image.rootfs.tar.xz

Also check that there are no setuid/setgid bits set.

> On the Host side, here are the /etc/exports options for NFS:
>  *(rw,sync,insecure,no_subtree_check,no_root_squash)

I'm using pretty much the same NFS options, the only difference I could
spot is an additional 'fsid=root' in my exports which is NFSv4
specific.




--
Laurent Gauthier
Phone: +33 630 483 429
http://soccasys.com


Trevor
 

Hi Nicolas,


Thanks!

Extracting as root did the trick, I was extracting using the desktop extracter before.

I didnt end up adding fsid=root option because that caused it not to mount at all for some reason.

Thanks,
Trevor





From: yocto@... <yocto@...> on behalf of Nicolas Jeker <n.jeker@...>
Sent: Wednesday, March 11, 2020, 1:43 AM
To: yocto@...
Subject: Re: [yocto] Uboot NetBoot IMX8

On Wed, 2020-03-11 at 00:39 +0000, Trevor wrote:
> > Mar 11 00:21:16 b2qt-b9-imx8mq mount[2611]: mount: only root can
> > use "--types" option (effective UID is 1000)
>
>
> The mount error seems prevalent across all the errors.  somehow UID
> is 1000 when it should be 0 during boot?

By googling the error message I found a thread where somebody has the
same question, but I wouldn't recommend following the advice there
(running the yocto build as root). How do you extract the root
filesystem to your NFS directory? Maybe something is wrong there and
the files get extracted with UID 1000 as owner. For reference, I use
this command which seems to work fine:

sudo tar --strip-components=1 -C /srv/nfs/rootfs -xf images/apalis-
imx6-mainline/Apalis-iMX6-Mainline_Image.rootfs.tar.xz

Also check that there are no setuid/setgid bits set.

> On the Host side, here are the /etc/exports options for NFS:
>  *(rw,sync,insecure,no_subtree_check,no_root_squash)

I'm using pretty much the same NFS options, the only difference I could
spot is an additional 'fsid=root' in my exports which is NFSv4
specific.