diff --git a/server/tar2squashfs.js b/server/tar2squashfs.js index 336cda8..bff7a7f 100644 --- a/server/tar2squashfs.js +++ b/server/tar2squashfs.js @@ -48,7 +48,9 @@ export async function tar2squashfs(streams, output, extraFiles) { p.pipe(child.stdin); p.on("error", console.error); - for (const streamP of streams) { + // We reverse the arrays because mksquashfs ignores files if they already exist, + // so we leave the last layers first so they are the ones used instead of the last ones + for (const streamP of [...streams].reverse()) { const stream = await streamP; const ex = extract();