[Unit]
Description=Detect if the system suffers from bsc#1089761
ConditionDirectoryNotEmpty=/run/udev/data

[Service]
RemainAfterExit=true
StandardOutput=journal+console
SyslogLevel=warning
ExecStart=/bin/sh -c " \
    if [ $(grep -r "E:ID_PART_ENTRY_NAME=primary" /run/udev/data | wc -l) -ge 100 ]; then \
      echo 'Warning: a high number of partitions uses \"primary\" or \"logical\" as'; \
      echo 'partition label name, which may cause slow-down in the boot process.'; \
      echo 'To prevent it, a workaround is temporarly in place but we recommend to'; \
      echo 'refer to TID #7023057 in order to permanently fix this issue (as the'; \
      echo 'workaround will be dropped in the future).'; \
    fi"
