Skip to content

Commit

Permalink
add realEntryHasKernel
Browse files Browse the repository at this point in the history
  • Loading branch information
nift4 committed Jan 18, 2025
1 parent fea7bfd commit cf717ae
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
13 changes: 9 additions & 4 deletions app/src/main/java/org/andbootmgr/app/DeviceInfo.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ interface DeviceInfo {
val codename: String
val blBlock: String
val metaonsd: Boolean
val realEntryHasKernel: Boolean
/* Environment variables:
* - BOOTED=true SETUP=false BL_BACKUP=<unset> for droidboot update
* - BOOTED=false SETUP=false BL_BACKUP=<path> for droidboot fix
Expand Down Expand Up @@ -99,14 +100,16 @@ class JsonMetaOnSdDeviceInfo(
override val bdev: String,
override val pbdev: String,
override val postInstallScript: Boolean,
override val havedtbo: Boolean
override val havedtbo: Boolean,
override val realEntryHasKernel: Boolean
) : MetaOnSdDeviceInfo()

class JsonSdLessDeviceInfo(
override val codename: String,
override val blBlock: String,
override val postInstallScript: Boolean,
override val havedtbo: Boolean
override val havedtbo: Boolean,
override val realEntryHasKernel: Boolean
) : SdLessDeviceInfo()

class JsonDeviceInfoFactory(private val ctx: Context) {
Expand Down Expand Up @@ -147,14 +150,16 @@ class JsonDeviceInfoFactory(private val ctx: Context) {
json.getString("sdBlock"),
json.getString("sdBlockP"),
json.getBoolean("postInstallScript"),
json.getBoolean("haveDtbo")
json.getBoolean("haveDtbo"),
json.optBoolean("realEntryHasKernel", false)
)
} else {
JsonSdLessDeviceInfo(
json.getString("codename"),
json.getString("blBlock"),
json.getBoolean("postInstallScript"),
json.getBoolean("haveDtbo")
json.getBoolean("haveDtbo"),
json.optBoolean("realEntryHasKernel", false)
)
}
}
Expand Down
21 changes: 15 additions & 6 deletions app/src/main/java/org/andbootmgr/app/DroidBootFlow.kt
Original file line number Diff line number Diff line change
Expand Up @@ -326,12 +326,21 @@ private fun Flash(d: DroidBootFlowDataHolder) {
db.exportToFile(File(vm.logic.abmDb, "db.conf"))
val entry = ConfigFile()
entry["title"] = d.osName.trim()
entry["linux"] = "null"
entry["initrd"] = "null"
entry["dtb"] = "null"
if (vm.deviceInfo.havedtbo)
entry["dtbo"] = "null"
entry["options"] = "null"
if (vm.deviceInfo.realEntryHasKernel) {
entry["linux"] = "real/kernel"
entry["initrd"] = "real/initrd.cpio.gz"
entry["dtb"] = "real/dtb.dtb"
if (vm.deviceInfo.havedtbo)
entry["dtbo"] = "real/dtbo.dtbo"
entry["options"] = "REPLACECMDLINE"
} else {
entry["linux"] = "null"
entry["initrd"] = "null"
entry["dtb"] = "null"
if (vm.deviceInfo.havedtbo)
entry["dtbo"] = "null"
entry["options"] = "null"
}
entry["xtype"] = "droid"
entry["xpart"] = "real"
entry.exportToFile(File(vm.logic.abmEntries, "real.conf"))
Expand Down

0 comments on commit cf717ae

Please sign in to comment.