misc.img: allow "reserved" filed to be populated for testing purpose

pull/140/head
cfig 2 years ago
parent 66ca430622
commit 609c83db02
No known key found for this signature in database
GPG Key ID: B104C307F0FDABB7

@ -268,3 +268,12 @@ This project is developed with products by Jetbrains.
</a>
</details>
How to merge init_boot.img into boot.img:
* unpack init_boot.img and copy out "build/unzip_boot/root".
* clear workspace by `gradle clear`, then unpack boot.img
* copy back the "build/unzip_boot/root"
* edit build/unzip_boot/boot.json
- change `ramdisk.size` to 1
- change `ramdisk.file` from "build/unzip_boot/ramdisk.img" to "build/unzip_boot/ramdisk.img.lz4"

@ -2,7 +2,6 @@ package miscimg
import cc.cfig.io.Struct
import cfig.helper.Helper
import com.fasterxml.jackson.databind.ObjectMapper
import org.slf4j.LoggerFactory
import java.io.FileInputStream
@ -12,8 +11,6 @@ data class MiscImage(
) {
companion object {
private val log = LoggerFactory.getLogger(MiscImage::class.java)
private val mapper = ObjectMapper()
private val workDir = Helper.prop("workDir")
fun parse(fileName: String): MiscImage {
val ret = MiscImage()
@ -46,7 +43,7 @@ data class MiscImage(
this.status = info[1] as String
this.recovery = info[2] as String
this.stage = info[3] as String
//this.reserved = info[4] as ByteArray
this.reserved = info[4] as ByteArray
}
fun encode(): ByteArray {
@ -55,7 +52,7 @@ data class MiscImage(
this.stage,
this.recovery,
this.stage,
byteArrayOf()
this.reserved,
)
}
@ -85,7 +82,6 @@ data class MiscImage(
companion object {
private const val FORMAT_STRING = "32s32s768s32s1184b"
private val log = LoggerFactory.getLogger(BootloaderMessage::class.java)
const val SIZE = 2048
init {

Loading…
Cancel
Save