diff --git a/app/src/main/java/org/andbootmgr/app/DeviceInfo.kt b/app/src/main/java/org/andbootmgr/app/DeviceInfo.kt index 9f12241e..30f4c109 100644 --- a/app/src/main/java/org/andbootmgr/app/DeviceInfo.kt +++ b/app/src/main/java/org/andbootmgr/app/DeviceInfo.kt @@ -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= for droidboot update * - BOOTED=false SETUP=false BL_BACKUP= for droidboot fix @@ -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) { @@ -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) ) } } diff --git a/app/src/main/java/org/andbootmgr/app/DroidBootFlow.kt b/app/src/main/java/org/andbootmgr/app/DroidBootFlow.kt index 4eee6cd1..b862a1bc 100644 --- a/app/src/main/java/org/andbootmgr/app/DroidBootFlow.kt +++ b/app/src/main/java/org/andbootmgr/app/DroidBootFlow.kt @@ -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"))