Commit Graph

7 Commits

Author SHA1 Message Date
Christina Ying Wang
bc1d251e66 Revert os-release path to /mnt/root
/mnt/boot/os-release isn't always accurate so /mnt/root should be the source of truth.

Change-type: patch
Signed-off-by: Christina Ying Wang <christina@balena.io>
2023-10-09 14:02:02 -07:00
Alex Gonzalez
cc2ca84448 mount-partitions: do not hardcode partition types
Query instead the device for its filesystem type before mounting.

Change-type: patch
Signed-off-by: Alex Gonzalez <alexg@balena.io>
2023-07-18 11:53:38 +02:00
Christina Ying Wang
e6662f664c Specify fs type when mounting partitions to prevent "Can't open blockdev" warnings
Change-type: patch
Signed-off-by: Christina Ying Wang <christina@balena.io>
2023-06-16 13:46:41 -07:00
Michal Toman
0045928944 mount-partitions.sh: Add support for encrypted partitions
After a recent change enforcing all the partitions to be on the same
block device, encrypted partitions are no longer being detected
correctly. This is because the assumption that the parent block device
is a substring of the actually mounted block device does not work
for LUKS devices - the mount will either be /dev/mapper/luks-XXX
or /dev/dm-X while the parent device is still e.g. /dev/sda.

The usual balenaOS boot partition is also split in two - boot and efi.
The boot partition (mounted under /mnt/boot) is encrypted and the efi
partition (mounted under /mnt/efi) is not.

This patch generalizes the detection of the parent device so that
it works with both encrypted and unencrypted partitions.

Change-type: patch
Signed-off-by: Michal Toman <michalt@balena.io>
2023-05-03 16:29:16 +02:00
Christina Ying Wang
4ab8250c97 Use dbus-send to get current boot block device instead of fdisk
Closes: #2150
Change-type: patch
Signed-off-by: Christina Ying Wang <christina@balena.io>
2023-04-06 12:34:00 -07:00
Christina Ying Wang
4c948c8854 Mount data and state partitions on container startup
Signed-off-by: Christina Ying Wang <christina@balena.io>
2023-03-27 12:07:01 -07:00
Christina Ying Wang
49ee1042a8 Mount boot partition into container on Supervisor start
As the Supervisor is a privileged container, it has access to host /dev, and therefore has access
to boot, data, and state balenaOS partitions. This commit sets up the framework for the following:

- Finds the /dev partition that corresponds to each partition based on partition label
- Mounts the partitions into set mountpoints in the device
- Removes reliance on env vars and mountpoints provided by host's start-balena-supervisor script
- Simplifies host path querying by centralizing these queries through methods in lib/host-utils.ts

This particular changes env vars for and mounts the boot partition.

Since the Supervisor would no longer rely on container `run` arguments provided by a host script,
this change moves Supervisor closer to being able to start itself (Supervisor-as-an-app).

Change-type: minor
Signed-off-by: Christina Ying Wang <christina@balena.io>
2023-03-27 12:07:01 -07:00