Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

meta-lxatac-software: containers: pass through /var/cache/labgrid #210

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

a3f
Copy link
Member

@a3f a3f commented Nov 12, 2024

Labgrid's ManagedFile class handles synchronisation of files to remote hosts.
When a path is not accessible on the TAC, it will be transferred into
/var/cache/labgrid and then that path is passed to locally installed tools.

To allow transparently using these paths from within a container, add it
to the volumes passed through when running container-start.

This was tested as follows:

  • On the development host, create rkdeveloptool-rk3399pro.yaml with:
    targets:
      main:
        resources:
          RemotePlace:
            name: !template '$LG_PLACE'
        drivers:
          RKUSBDriver:
            usb_loader: usb_loader
    tools:
      rk-usb-loader: /bin/rkdeveloptool
    images:
      usb_loader: /home/a3f/Downloads/rk3399pro_loader_v1.20.115.bin
  • On the TAC, install rkdeveloptool inside the Debian container

  • On the TAC, add /bin/rkdeveloptool with:

    #!/bin/sh

    podman start debian >/dev/null
    podman exec debian rkdeveloptool "$@"
    podman stop -i -t 0 debian >/dev/null
  • On the TAC, add into Labgrid System config for each USB port:
    RKUSBLoader:
      match:
        'ID_PATH': '{{sysfs}}'

This allowed using of labgrid-client bootstrap to call rkdeveloptool on
the remote target without having to have a recipe for rkdeveloptool.

@a3f a3f force-pushed the container-var-cache-labgrid branch from 07c700d to 176e874 Compare November 12, 2024 09:24
@a3f
Copy link
Member Author

a3f commented Nov 12, 2024

Eventually, we'll want a rkdeveloptool bitbake recipe, but given that Debian packages it and the OE layer index doesn't know about it, I took the easy route for now.

Labgrid's ManagedFile class handles synchronisation of files to remote hosts.
When a path is not accessible on the TAC, it will be transferred into
/var/cache/labgrid and then that path is passed to locally installed tools.

To allow transparently using these paths from within a container, add it
to the volumes passed through when running container-start.

This was tested as follows:

  - On the development host, create rkdeveloptool-rk3399pro.yaml with:
    targets:
      main:
        resources:
          RemotePlace:
            name: !template '$LG_PLACE'
        drivers:
          RKUSBDriver:
            usb_loader: usb_loader
    tools:
      rk-usb-loader: /bin/rkdeveloptool
    images:
      usb_loader: /home/a3f/Downloads/rk3399pro_loader_v1.20.115.bin

  - On the TAC, install rkdeveloptool inside the Debian container

  - On the TAC, add /bin/rkdeveloptool with:
    #!/bin/sh

    podman start debian >/dev/null
    podman exec debian rkdeveloptool "$@"
    podman stop -i -t 0 debian >/dev/null

  - On the TAC, add into Labgrid System config for each USB port:
    RKUSBLoader:
      match:
        'ID_PATH': '{{sysfs}}'

This allowed using of labgrid-client bootstrap to call rkdeveloptool on
the remote target without having to have a recipe for rkdeveloptool.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
@hnez
Copy link
Member

hnez commented Nov 12, 2024

I am not a huge fan of this PR, to be honest. It feels like a hack.

I've opened #213, which should solve the underlying problem of not having rkdeveloptool on the TAC.

@a3f
Copy link
Member Author

a3f commented Nov 12, 2024

Ye, the testing how-to is a hack. I still think it makes the container more useful in general.

Copy link
Member

@jluebbe jluebbe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find adding tools for labgrid via the container a valuable use-case. For that, the relevant locations in the FS should be accessible to the container.

@hnez hnez merged commit 8244ddd into linux-automation:scarthgap Nov 13, 2024
5 checks passed
@a3f a3f deleted the container-var-cache-labgrid branch November 13, 2024 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants