From b49d32c4dda759dda2ce49f1b0e3ce613432e4d8 Mon Sep 17 00:00:00 2001 From: Danny Lin Date: Sun, 21 Nov 2021 19:44:43 -0800 Subject: [PATCH] blobs: Add support for separate entry source path on disk --- src/blobs/build.ts | 2 +- src/blobs/copy.ts | 2 +- src/blobs/entry.ts | 9 +++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/blobs/build.ts b/src/blobs/build.ts index 11ff932..5f01f2e 100644 --- a/src/blobs/build.ts +++ b/src/blobs/build.ts @@ -53,7 +53,7 @@ export async function generateBuild( for (let entry of entries) { let ext = path.extname(entry.path) let pathParts = entry.path.split('/') - let srcPath = `${source}/${entry.srcPath}` + let srcPath = entry.diskSrcPath ?? `${source}/${entry.srcPath}` let stat = await fs.lstat(srcPath) if (stat.isSymbolicLink()) { diff --git a/src/blobs/copy.ts b/src/blobs/copy.ts index 088b3f3..245b84a 100644 --- a/src/blobs/copy.ts +++ b/src/blobs/copy.ts @@ -9,7 +9,7 @@ export async function copyBlobs(entries: Iterable, srcDir: string, de for (let entry of entries) { let outPath = `${destDir}/${entry.srcPath}` - let srcPath = `${srcDir}/${entry.srcPath}` + let srcPath = entry.diskSrcPath ?? `${srcDir}/${entry.srcPath}` spinner.text = entry.srcPath // Symlinks are created at build time, not copied diff --git a/src/blobs/entry.ts b/src/blobs/entry.ts index 175b2be..abb05ce 100644 --- a/src/blobs/entry.ts +++ b/src/blobs/entry.ts @@ -1,10 +1,19 @@ import { EXT_PARTITIONS } from '../util/partitions' export interface BlobEntry { + // Android partition partition: string + // Sub-partition path path: string + // Combined partition path without "system/" srcPath: string + + // Path to copy file from on host (default = srcDir/srcPath) + diskSrcPath?: string + + // Whether to keep the original signature (for APKs only) isPresigned: boolean + // Whether to force creating a named dependency module isNamedDependency: boolean }