Skip to content

Commit

Permalink
os configure: Locate the boot partition w/o using the device-type.jso…
Browse files Browse the repository at this point in the history
…n's partition field

Update balena-device-init from 8.0.0 to 8.1.0

Change-type: minor
  • Loading branch information
thgreasi committed Dec 19, 2024
1 parent abd85fb commit 5ca8c6c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
9 changes: 5 additions & 4 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@
"@oclif/core": "^4.0.31",
"@sentry/node": "^6.16.1",
"balena-config-json": "^4.2.0",
"balena-device-init": "^8.0.0",
"balena-device-init": "^8.1.0-build-detect-boot-partition-46090d3acc07444c97f96e6df8881cd2d708d6ce-1",
"balena-errors": "^4.7.3",
"balena-image-fs": "^7.0.6",
"balena-preload": "^16.0.0",
Expand Down
15 changes: 14 additions & 1 deletion tests/commands/os/configure.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import * as process from 'process';
import { runCommand } from '../../helpers';
import { promisify } from 'util';
import * as tmp from 'tmp';
import * as stripIndent from 'common-tags/lib/stripIndent';

tmp.setGracefulCleanup();
const tmpNameAsync = promisify(tmp.tmpName);
Expand Down Expand Up @@ -62,7 +63,19 @@ if (process.platform !== 'win32') {
];

const { err } = await runCommand(command.join(' '));
expect(err.join('')).to.equal('');
// Once we replace the dummy.img with one that includes a os-release & device-type.json
// then we should be able to change this to expect no errors.
expect(
err.flatMap((line) => line.split('\n')).filter((line) => line !== ''),
).to.deep.equal(
stripIndent`
[warn] "${tmpPath}":
[warn] 1 partition(s) found, but none containing file "/device-type.json".
[warn] Assuming default boot partition number '1'.
[warn] "${tmpPath}":
[warn] Could not find a previous "/config.json" file in partition '1'.
[warn] Proceeding anyway, but this is unexpected.`.split('\n'),
);

// confirm the image contains a config.json...
const imagefs = await import('balena-image-fs');
Expand Down

0 comments on commit 5ca8c6c

Please sign in to comment.