mbox series

[0/2] Protect isar-apt usages in shell

Message ID 20240712065646.2156320-1-amikan@ilbers.de
Headers show
Series Protect isar-apt usages in shell | expand

Message

Anton Mikanovich July 12, 2024, 6:56 a.m. UTC
Read operations on isar-apt should be covered by shared lock.
This was not implemented for deb_dl_dir_export and imager_run.
At least following CI error was caused by isar-apt race:

DEBUG: Executing shell function rootfs_export_package_cache
find: 'isar-apt/debian-bullseye-arm64/apt/debian-bullseye/pool/main/e/enable-fsck': No such file or directory

Find call inside deb_dl_dir_export was trying to look into enable-fsck
directory while is was deleted by deb_clean function of do_deploy_deb
task of enable-fsck package.

The same situation can potentially happen on imager_run call, causing
races during image preparations.

To protect isar-apt usages inside big shell functions introduce
lockrun.py helper for using with isar-apt lock.
More clear implementation will require tasks rewrite in python, which
is not an option for the big downstream projects.

Anton Mikanovich (2):
  deb-dl-dir: Avoid multiple find run on export
  meta: Cover bash isar-apt usages by isar.lock

 meta/classes/deb-dl-dir.bbclass            |  9 +++--
 meta/classes/image-tools-extension.bbclass |  2 +
 scripts/lockrun.py                         | 44 ++++++++++++++++++++++
 3 files changed, 52 insertions(+), 3 deletions(-)
 create mode 100755 scripts/lockrun.py