Skip to content

Commit

Permalink
ksud: use boot partition when replace kernel
Browse files Browse the repository at this point in the history
  • Loading branch information
tiann committed Jan 18, 2024
1 parent 1e676e5 commit 2fec279
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions userspace/ksud/src/boot_patch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ pub fn patch(
ensure_gki_kernel()?;
}

if kernel.is_some() {
let is_replace_kernel = kernel.is_some();

if is_replace_kernel {
ensure!(
init.is_none() && kmod.is_none(),
"init and module must not be specified."
Expand Down Expand Up @@ -101,7 +103,7 @@ pub fn patch(

let init_boot_exist =
Path::new(&format!("/dev/block/by-name/init_boot{slot_suffix}")).exists();
let boot_partition = if init_boot_exist {
let boot_partition = if !is_replace_kernel && init_boot_exist {
format!("/dev/block/by-name/init_boot{slot_suffix}")
} else {
format!("/dev/block/by-name/boot{slot_suffix}")
Expand Down

0 comments on commit 2fec279

Please sign in to comment.