Skip to content

Container can't mount host's /mnt/boot #2371

Open
@shaunco

Description

@shaunco

Our balena devices are deployed in customer environments, and often the customer needs to reconfigure network settings, proxies, udev entries (and associated sh scripts), and other stuff that is in the boot partition. Given that this is all on internal flash memory, it is nearly impossible for the customer to do. This means configuring a new image, sending it to the customer to use balena Etcher, and having them reflash the box - an all around terrible experience. When I first brought this up, the Balena team pointed me at https://github.com/balena-os/wifi-connect , but it is incredibly limited in its abilities. We looked at the Supervisor API, but it can't configure Network Manager settings and can't put shell scripts into the boot partition for udev rules to run.

To work around all this, we've created an SSH hosted shell app that allows for configuration of all of these items, but can't run it as a container on balenaOS because it needs a bind mount to /mnt/boot (in order to edit those files), but unfortunately "Bind mounts are not allowed" gets thrown during balena push, and based on this from @alexgg:

We don't plan to allow the mounting or arbitrary host directories in containers, and to date there is no validated use case that requires this.

I see that the supervisor can inject specific mounts at

export async function addFeaturesFromLabels(
... but there is no support for something like io.balena.features.bootfs. Maybe I could do this in the docker-compose:

    devices:
      - "/dev/sda1:/dev/sda1"

but that seems gross, and I'm not even sure every possible Balena image has /mnt/boot at /dev/sda1.

Am I missing something here or would the Balena team be open to a PR that provides an io.balena.features.bootfs entry to mount /mnt/boot into a container?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions