mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-05-31 14:50:47 +00:00
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:
commit
097e8bec8a
@ -45,7 +45,7 @@ export const fnSchema = {
|
|||||||
// FIXME: We should be mounting the following file into the supervisor from the
|
// 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
|
// start-resin-supervisor script, changed in meta-resin - but until then, hardcode it
|
||||||
const data = await fs.readFile(
|
const data = await fs.readFile(
|
||||||
`${constants.bootMountPoint}/device-type.json`,
|
`${constants.rootMountPoint}${constants.bootMountPoint}/device-type.json`,
|
||||||
'utf8',
|
'utf8',
|
||||||
);
|
);
|
||||||
const deviceInfo = JSON.parse(data);
|
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
|
// 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
|
// start-resin-supervisor script, changed in meta-resin - but until then, hardcode it
|
||||||
const data = await fs.readFile(
|
const data = await fs.readFile(
|
||||||
`${constants.bootMountPoint}/device-type.json`,
|
`${constants.rootMountPoint}${constants.bootMountPoint}/device-type.json`,
|
||||||
'utf8',
|
'utf8',
|
||||||
);
|
);
|
||||||
const deviceInfo = JSON.parse(data);
|
const deviceInfo = JSON.parse(data);
|
||||||
|
@ -151,7 +151,7 @@ describe('Config', () => {
|
|||||||
expect(deviceArch).to.equal(arch);
|
expect(deviceArch).to.equal(arch);
|
||||||
expect(fs.readFile).to.be.calledOnce;
|
expect(fs.readFile).to.be.calledOnce;
|
||||||
expect(fs.readFile).to.be.calledWith(
|
expect(fs.readFile).to.be.calledWith(
|
||||||
`${constants.bootMountPoint}/device-type.json`,
|
`${constants.rootMountPoint}${constants.bootMountPoint}/device-type.json`,
|
||||||
'utf8',
|
'utf8',
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -171,7 +171,7 @@ describe('Config', () => {
|
|||||||
expect(deviceType).to.equal(slug);
|
expect(deviceType).to.equal(slug);
|
||||||
expect(fs.readFile).to.be.calledOnce;
|
expect(fs.readFile).to.be.calledOnce;
|
||||||
expect(fs.readFile).to.be.calledWith(
|
expect(fs.readFile).to.be.calledWith(
|
||||||
`${constants.bootMountPoint}/device-type.json`,
|
`${constants.rootMountPoint}${constants.bootMountPoint}/device-type.json`,
|
||||||
'utf8',
|
'utf8',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user