-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
31 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,27 @@ | ||
package cfig.lazybox | ||
|
||
import cfig.helper.Helper | ||
import java.io.File | ||
|
||
class CompileCommand { | ||
} | ||
fun run(workDir: String, stem: String) { | ||
val simg2simg = "simg2simg" | ||
val cmd = "$simg2simg $workDir/$stem.subimg $workDir/$stem.subimg 524288000" | ||
Helper.powerRun(cmd, null) | ||
val emmcImageListFile = File(workDir, "emmc_image_list") | ||
val theLines = emmcImageListFile.readLines().toMutableList() | ||
val stemLine = (theLines.filter { it.startsWith("$stem.subimg,") }).get(0).split(",") | ||
check(stemLine.size == 2) | ||
val stemPart = stemLine[1] | ||
theLines.apply { | ||
removeIf { it.startsWith("$stem.subimg") } | ||
val superImageFiles = File(workDir).listFiles { file -> file.name.startsWith("$stem.subimg.") } | ||
superImageFiles.forEach { | ||
val newLine = "${it.name},$stemPart" | ||
println("Adding $newLine") | ||
add(newLine) | ||
} | ||
} | ||
emmcImageListFile.writeText(theLines.joinToString("\n") + "\n") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters