Force kernel to load rootfs only for legacy SAR devices

This commit is contained in:
vvb2060
2023-07-09 23:53:59 +08:00
committed by John Wu
parent 275208e81b
commit d12d9e82f1
6 changed files with 23 additions and 7 deletions

View File

@@ -28,6 +28,7 @@ object Info {
// Device state
@JvmStatic val env by lazy { loadState() }
@JvmField var isSAR = false
var legacySAR = false
var isAB = false
@JvmField val isZygiskEnabled = System.getenv("ZYGISK_ENABLED") == "1"
@JvmStatic val isFDE get() = crypto == "block"

View File

@@ -492,7 +492,7 @@ abstract class MagiskInstallImpl protected constructor(
"KEEPVERITY=${Config.keepVerity} " +
"PATCHVBMETAFLAG=${Config.patchVbmeta} " +
"RECOVERYMODE=${Config.recovery} " +
"SYSTEM_ROOT=${Info.isSAR} " +
"LEGACYSAR=${Info.legacySAR} " +
"sh boot_patch.sh $srcBoot")
val isSuccess = cmds.sh().isSuccess

View File

@@ -78,6 +78,7 @@ class ShellInit : Shell.Initializer() {
Info.vbmeta = getBool("VBMETAEXIST")
Info.isAB = getBool("ISAB")
Info.crypto = getVar("CRYPTOTYPE")
Info.legacySAR = getBool("LEGACYSAR")
// Default presets
Config.recovery = getBool("RECOVERYMODE")