Commit graph

6 commits

Author SHA1 Message Date
Alessandro Astone
1dfb086ca8 updater: Do not null terminate mount_flags_list array
mount_flags_list is a c-style NULL terminated array, but when
iterating over it via
    for (const auto& [name, value] : mount_flags_list)
the last { 0, 0 } is considered a valid entry.
Then `name` is NULL but checked with (flag == name),
which causes SIGSEGV.

Also move the definition to within setMountFlag()
and make it an std::pair array

Change-Id: Ia6670113620c6e8f95151fda764c3ab40bc2d67e
2021-02-17 00:05:54 +01:00
Treehugger Robot
31deac96f4 Merge changes from topic "nonab_pkg"
* changes:
  Add add_slot_suffix function.
  Add slot suffix to DAP ops
  Detect non-A/B vs. A/B packages correctly.
2020-05-20 00:30:31 +00:00
Yifan Hong
0c328d02c1 Add add_slot_suffix function.
This function appends androidboot.slot_suffix to the
value of the argument.

Test: apply update
Bug: 153581609
Change-Id: I28a4047b5f2051acc039084f65a71deb492d9dcb
(cherry picked from commit dff8004275)
Merged-In: I28a4047b5f2051acc039084f65a71deb492d9dcb
2020-05-19 15:20:14 -07:00
Hongguang Chen
586565fd8b Add more mounting options to updater mount function.
If enabling the oem partition, it will be mounted by updater before
reading product properties from it. To be safety, we want to enable AVB
to this oem partition. But this means the oem partition can never be
mounted to writable. Otherwise, that partition will be corrupted to AVB
verifying.
This change follows fs_mgr to allow to pass more mounting options to the
updater.

BUG: 150156957
Test: make ota package which mounts AVB oem partition to read only and
run OTA.

Change-Id: I2ebbe3c8ac53c70112f3fed2703fcba9170405a6
2020-03-17 23:39:13 -07:00
Tao Bao
d628cfc153 Move mounts.cpp from libotautil into libupdater.
All the active users of mounts.h now live in updater/.

Test: mmma bootable/recovery
Test: Run recovery_unit_test on taimen.
Test: Code search shows no reference to otautil/mounts.h in device dirs.
Change-Id: I6c35d2e403e92a0111102d00aa4773f4f524650e
2019-10-01 12:13:04 -07:00
Tianjie Xu
1536db887f Add UpdaterRuntime class
This class adds a wrapper to the runtime dependent functions. Therefore,
the behavior of update on device stays the same, while simulators can
have their own implementations. Also change the caller side of the
registered updater functions to call these runtime wrappers.

Bug: 131911365
Test: unit tests pass, sideload an update on cuttlefish
Change-Id: Ib3ab67132991d67fc132f27120e4152439d16ac5
2019-05-20 18:03:27 -07:00