Merge pull request #1789 from balena-io/1788-update-qemu

balena build/deploy: Update QEMU version to support newer balenalib images
This commit is contained in:
Paulo Castro 2020-04-30 06:54:13 -04:00 committed by GitHub
commit 3f285cc26d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,7 +17,7 @@
import * as Promise from 'bluebird';
import { getBalenaSdk } from './lazy';
export const QEMU_VERSION = 'v4.0.0-balena';
export const QEMU_VERSION = 'v4.0.0+balena2';
export const QEMU_BIN_NAME = 'qemu-execve';
export function qemuPathInContext(context) {
@ -84,11 +84,12 @@ export function installQemu(arch) {
const installStream = fs.createWriteStream(qemuPath);
const qemuArch = balenaArchToQemuArch(arch);
const downloadArchiveName = `qemu-${QEMU_VERSION.replace(
/^v/,
'',
)}-${qemuArch}.tar.gz`;
const qemuUrl = `https://github.com/balena-io/qemu/releases/download/${QEMU_VERSION}/${downloadArchiveName}`;
const fileVersion = QEMU_VERSION.replace(/^v/, '').replace('+', '.');
const urlFile = encodeURIComponent(
`qemu-${fileVersion}-${qemuArch}.tar.gz`,
);
const urlVersion = encodeURIComponent(QEMU_VERSION);
const qemuUrl = `https://github.com/balena-io/qemu/releases/download/${urlVersion}/${urlFile}`;
const extract = tar.extract();
extract.on('entry', function(header, stream, next) {