mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-05-31 14:50:47 +00:00
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>
This commit is contained in:
parent
b096cb6328
commit
bc1d251e66
@ -7,14 +7,15 @@ testfs:
|
|||||||
# in the `testfs` configuration.
|
# in the `testfs` configuration.
|
||||||
filesystem:
|
filesystem:
|
||||||
/mnt/boot:
|
/mnt/boot:
|
||||||
os-release:
|
|
||||||
from: test/data/etc/os-release
|
|
||||||
config.json:
|
config.json:
|
||||||
from: test/data/testconfig.json
|
from: test/data/testconfig.json
|
||||||
config.txt:
|
config.txt:
|
||||||
from: test/data/mnt/boot/config.txt
|
from: test/data/mnt/boot/config.txt
|
||||||
device-type.json:
|
device-type.json:
|
||||||
from: test/data/mnt/boot/device-type.json
|
from: test/data/mnt/boot/device-type.json
|
||||||
|
/mnt/root/etc:
|
||||||
|
os-release:
|
||||||
|
from: test/data/etc/os-release
|
||||||
# The `keep` list defines files that already exist in the
|
# The `keep` list defines files that already exist in the
|
||||||
# filesystem and need to be backed up before setting up the test environment
|
# filesystem and need to be backed up before setting up the test environment
|
||||||
keep: []
|
keep: []
|
||||||
|
@ -81,7 +81,7 @@ services:
|
|||||||
# Required to set mountpoints normally set in entry.sh
|
# Required to set mountpoints normally set in entry.sh
|
||||||
ROOT_MOUNTPOINT: /mnt/root
|
ROOT_MOUNTPOINT: /mnt/root
|
||||||
BOOT_MOUNTPOINT: /mnt/boot
|
BOOT_MOUNTPOINT: /mnt/boot
|
||||||
HOST_OS_VERSION_PATH: /mnt/boot/os-release
|
HOST_OS_VERSION_PATH: /mnt/root/etc/os-release
|
||||||
STATE_MOUNTPOINT: /mnt/state
|
STATE_MOUNTPOINT: /mnt/state
|
||||||
DATA_MOUNTPOINT: /mnt/data
|
DATA_MOUNTPOINT: /mnt/data
|
||||||
DATABASE_PATH: /data/database.sqlite
|
DATABASE_PATH: /data/database.sqlite
|
||||||
|
@ -103,7 +103,11 @@ setup_then_mount "boot" "${BOOT_MOUNTPOINT}"
|
|||||||
export BOOT_MOUNTPOINT
|
export BOOT_MOUNTPOINT
|
||||||
|
|
||||||
# Read from the os-release of boot partition instead of overlay
|
# Read from the os-release of boot partition instead of overlay
|
||||||
export HOST_OS_VERSION_PATH="${BOOT_MOUNTPOINT}/os-release"
|
#
|
||||||
|
# TODO: We need to remove the dependence on /mnt/root for this particular file.
|
||||||
|
# Reading from /mnt/boot/os-release is not always accurate, so we need to work
|
||||||
|
# with the OS team to find a better way to get the OS version.
|
||||||
|
export HOST_OS_VERSION_PATH="/mnt/root/etc/os-release"
|
||||||
|
|
||||||
# CONFIG_MOUNT_POINT is set to /boot/config.json in Dockerfile.template,
|
# CONFIG_MOUNT_POINT is set to /boot/config.json in Dockerfile.template,
|
||||||
# but that's a legacy mount provided by host and we should override it.
|
# but that's a legacy mount provided by host and we should override it.
|
||||||
|
11
test/data/root/etc/os-release
Normal file
11
test/data/root/etc/os-release
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
ID="balena-os"
|
||||||
|
NAME="balenaOS"
|
||||||
|
VERSION="4.0.11+rev1"
|
||||||
|
VERSION_ID="4.0.11+rev1"
|
||||||
|
PRETTY_NAME="balenaOS 4.0.11+rev1"
|
||||||
|
DISTRO_CODENAME="kirkstone"
|
||||||
|
MACHINE="genericx86-64"
|
||||||
|
META_BALENA_VERSION="4.0.11"
|
||||||
|
BALENA_BOARD_REV="9c804eb"
|
||||||
|
META_BALENA_REV="2afff0f8"
|
||||||
|
SLUG="intel-nuc"
|
@ -425,7 +425,7 @@ describe('manages application lifecycle', () => {
|
|||||||
// Versions match semver versioning scheme: major.minor.patch(+rev)?
|
// Versions match semver versioning scheme: major.minor.patch(+rev)?
|
||||||
expect(body)
|
expect(body)
|
||||||
.to.have.property('os_version')
|
.to.have.property('os_version')
|
||||||
.that.matches(/balenaOS\s[1-2]\.[0-9]{1,3}\.[0-9]{1,3}(?:\+rev[0-9])?/);
|
.that.matches(/balenaOS\s[1-4]\.[0-9]{1,3}\.[0-9]{1,3}(?:\+rev[0-9])?/);
|
||||||
expect(body)
|
expect(body)
|
||||||
.to.have.property('supervisor_version')
|
.to.have.property('supervisor_version')
|
||||||
.that.matches(/(?:[0-9]+\.?){3}/);
|
.that.matches(/(?:[0-9]+\.?){3}/);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user