[make-initrd] [PATCH 0/3] New locking functions based on flock utility

Alexey Gladkov gladkov.alexey at gmail.com
Wed May 17 19:04:39 MSK 2023


Привет!

Чтобы избавиться от лишнего поллинга в реализации блокировок я сделал другой
API основанный на flock из busybox. Добавилась возможность делать shared locks.

Я не стал использовать bash-builtin-lockf, который использует hasher, потому что
не хочу завязываться на версию bash и тянуть зависимость на bash-devel.

Как следствие блокировка может утечь в запускаемый под блокировкой код и теперь
за этим нужно следить.

Далее нужно будет провести рефакторинг и посмотреть нельзя ли сократить код под
блокировкой.

Alexey Gladkov (3):
  runtime: Add locking functions based on flock utility
  Rewrite console locking
  feature/network: Use flock-based locking

 data/bin/rdshell                              | 12 ----
 data/bin/rdshell-locked                       |  1 -
 data/bin/rdshell-sh-functions                 | 29 ---------
 data/bin/shell-locks                          | 40 ++++++++++++
 data/etc/rc.d/init.d/cmdline                  |  2 -
 data/etc/rc.d/rc                              | 15 +++--
 data/lib/initrd/boot/scripts/console-inactive |  7 +--
 data/lib/initrd/spawn-shell                   |  7 ++-
 data/lib/uevent/each/pre/.gitignore           |  0
 data/lib/uevent/each/pre/console              | 25 --------
 data/lib/uevent/handlers/poll/400-rootdelay   | 21 ++++---
 .../lib/initrd/boot/method/bootloader/action  | 18 +++---
 .../data/lib/uevent/handlers/040-mountdev     | 13 ++--
 .../luks/data/lib/uevent/handlers/085-luks    | 11 ++--
 .../network/data/etc/rc.d/init.d/network-up   | 10 +++
 features/network/data/lib/network/config      |  8 ---
 features/network/data/lib/network/hostname    | 10 +--
 features/network/data/lib/network/resolvconf  | 10 +--
 .../network/data/lib/network/udhcpc4.script   | 12 ++--
 .../data/lib/uevent/handlers/040-sshfsroot    | 13 ++--
 .../zfs/data/lib/uevent/extenders/200-zfs     | 12 ++--
 testing/sh-functions                          |  4 +-
 testing/units/runtime-locks/ts0001/expect     | 24 ++++++++
 testing/units/runtime-locks/ts0001/lock-1     |  0
 testing/units/runtime-locks/ts0001/lock-2     |  0
 testing/units/runtime-locks/ts0001/lock-3     |  0
 testing/units/runtime-locks/ts0001/run        | 61 +++++++++++++++++++
 testing/units/runtime-locks/ts0002/expect     |  5 ++
 testing/units/runtime-locks/ts0002/lock-1     |  0
 testing/units/runtime-locks/ts0002/lock-2     |  0
 testing/units/runtime-locks/ts0002/lock-3     |  0
 testing/units/runtime-locks/ts0002/run        | 25 ++++++++
 testing/units/runtime-locks/ts0003/expect     |  9 +++
 testing/units/runtime-locks/ts0003/lock-1     |  0
 testing/units/runtime-locks/ts0003/lock-2     |  0
 testing/units/runtime-locks/ts0003/lock-3     |  0
 testing/units/runtime-locks/ts0003/run        | 38 ++++++++++++
 .../units/sort-services/ts0007/data00-cmdline |  2 -
 .../units/sort-services/ts0008/data00-cmdline |  2 -
 39 files changed, 283 insertions(+), 163 deletions(-)
 delete mode 120000 data/bin/rdshell-locked
 delete mode 100644 data/bin/rdshell-sh-functions
 create mode 100644 data/bin/shell-locks
 create mode 100644 data/lib/uevent/each/pre/.gitignore
 delete mode 100755 data/lib/uevent/each/pre/console
 create mode 100644 testing/units/runtime-locks/ts0001/expect
 create mode 100644 testing/units/runtime-locks/ts0001/lock-1
 create mode 100644 testing/units/runtime-locks/ts0001/lock-2
 create mode 100644 testing/units/runtime-locks/ts0001/lock-3
 create mode 100755 testing/units/runtime-locks/ts0001/run
 create mode 100644 testing/units/runtime-locks/ts0002/expect
 create mode 100644 testing/units/runtime-locks/ts0002/lock-1
 create mode 100644 testing/units/runtime-locks/ts0002/lock-2
 create mode 100644 testing/units/runtime-locks/ts0002/lock-3
 create mode 100755 testing/units/runtime-locks/ts0002/run
 create mode 100644 testing/units/runtime-locks/ts0003/expect
 create mode 100644 testing/units/runtime-locks/ts0003/lock-1
 create mode 100644 testing/units/runtime-locks/ts0003/lock-2
 create mode 100644 testing/units/runtime-locks/ts0003/lock-3
 create mode 100755 testing/units/runtime-locks/ts0003/run

-- 
2.33.8



More information about the Make-initrd mailing list