coreycothrum / meta-mender-luks

mender with LUKS encrypted partitions
MIT License
11 stars 5 forks source link

invalid candidate rootfs mounted when doing multiple updates w/o reboot #8

Closed coreycothrum closed 2 years ago

coreycothrum commented 2 years ago

only the variable mender_boot_part is used to determine the active partition. During an update that is then inverted to determine what the new root candidate partition is.

That candidate is then mounted, and the new/candidate kernel copied into the corresponding kernel partition (via meta-mender-kernel state scripts).

After an update, mender_boot_part is modified. If you do another update (before rebooting, so essentially overwriting the update with another before it takes effect), this logic is wrong. You'll copy the kernel from the active/current partition.

This logic should include upgrade_available, and not invert mender_boot_part if an update is already in process.

coreycothrum commented 2 years ago

strike that, I think bootcount is a better variable to check here.

and instead of trying to add more logic to handle the case of:

  1. updating, rebooting
  2. write a new update @ startup before the previous update commit/rollback

I'm just going to detect that state and throw an error.