Merge pull request #1502 from balena-io/fix-device-type-json-file

Use root mount point to find device-type.json
This commit is contained in:
bulldozer-balena[bot] 2020-10-28 13:35:12 +00:00 committed by GitHub
commit 097e8bec8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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',
);