Use root mount point to find device-type.json

Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
This commit is contained in:
Cameron Diver 2020-10-28 11:56:59 +00:00
parent 8ae2b4a5cd
commit 9d19a45701
2 changed files with 4 additions and 4 deletions

View File

@ -45,7 +45,7 @@ export const fnSchema = {
// FIXME: We should be mounting the following file into the supervisor from the
// start-resin-supervisor script, changed in meta-resin - but until then, hardcode it
const data = await fs.readFile(
`${constants.bootMountPoint}/device-type.json`,
`${constants.rootMountPoint}${constants.bootMountPoint}/device-type.json`,
'utf8',
);
const deviceInfo = JSON.parse(data);
@ -64,7 +64,7 @@ export const fnSchema = {
// FIXME: We should be mounting the following file into the supervisor from the
// start-resin-supervisor script, changed in meta-resin - but until then, hardcode it
const data = await fs.readFile(
`${constants.bootMountPoint}/device-type.json`,
`${constants.rootMountPoint}${constants.bootMountPoint}/device-type.json`,
'utf8',
);
const deviceInfo = JSON.parse(data);

View File

@ -151,7 +151,7 @@ describe('Config', () => {
expect(deviceArch).to.equal(arch);
expect(fs.readFile).to.be.calledOnce;
expect(fs.readFile).to.be.calledWith(
`${constants.bootMountPoint}/device-type.json`,
`${constants.rootMountPoint}${constants.bootMountPoint}/device-type.json`,
'utf8',
);
@ -171,7 +171,7 @@ describe('Config', () => {
expect(deviceType).to.equal(slug);
expect(fs.readFile).to.be.calledOnce;
expect(fs.readFile).to.be.calledWith(
`${constants.bootMountPoint}/device-type.json`,
`${constants.rootMountPoint}${constants.bootMountPoint}/device-type.json`,
'utf8',
);