Skip to content
Snippets Groups Projects

udev: split wifi and bt rules into two separate files, add systemd unit file, and add BT mac retry

Merged Clayton Craft requested to merge craftyguy/split-udev into master

The udev rule for bluetooth doesn't work on systemd[1], by splitting the rule into two separate rules, distros can leave this bluetooth rule out when packaging for systemd.

Distros packaging bootmac will have to make note of the new rule files/names.

This also includes a systemd unit file that can be used to autostart bootmac when bluetooth stuff is starting up (e.g. when the adapter is available), and provides a nicer way to add delays instead of trying to delay udev scripts, scripts that take 'too long' for udev can cause problems.

  1. https://github.com/systemd/systemd/issues/35003

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Dylan Van Assche
  • Clayton Craft added 2 commits

    added 2 commits

    • 476c1125 - udev: split wifi and bt rules into two separate files
    • 52f0ab91 - add systemd unit file

    Compare with previous version

  • Clayton Craft added 2 commits

    added 2 commits

    • 3ff0f370 - Add systemd unit file
    • 93e07537 - Add retry mechnism for setting BT MAC addr

    Compare with previous version

  • mentioned in commit pmaports@e8c8d548

  • mentioned in commit pmaports@18347d65

  • mentioned in commit pmaports@48d308b8

  • Clayton Craft changed title from udev: split wifi and bt rules into two separate files to udev: split wifi and bt rules into two separate files, add systemd unit file, and add BT mac retry

    changed title from udev: split wifi and bt rules into two separate files to udev: split wifi and bt rules into two separate files, add systemd unit file, and add BT mac retry

  • Dylan Van Assche resolved all threads

    resolved all threads

  • Robert Eckelmann approved this merge request

    approved this merge request

  • Anjan Momi approved this merge request

    approved this merge request

  • Alexey Minnekhanov
    • Resolved by Clayton Craft

      I tried this on systemd with GNOME Mobile with SHIFT6mq, but I have no luck it seems:

      ● bootmac.service - Set Mac Address
           Loaded: loaded (/etc/systemd/system/bootmac.service; enabled; preset: disabled)
           Active: active (exited) since Sun 2025-01-19 20:10:24 CET; 10s ago
       Invocation: dbbbad44ba5946b2997d9ba4dae39821
          Process: 2578 ExecStart=/usr/bin/bootmac --bluetooth (code=exited, status=0/SUCCESS)
         Main PID: 2578 (code=exited, status=0/SUCCESS)
         Mem peak: 3.1M
              CPU: 82ms
      
      Jan 19 20:10:24 shift-axolotl systemd[1]: Starting Set Mac Address...
      Jan 19 20:10:24 shift-axolotl bootmac[2617]: Set Powered for hci0 failed with status 0x11 (Invalid Index)
      Jan 19 20:10:24 shift-axolotl bootmac[2617]: 
      Jan 19 20:10:24 shift-axolotl bootmac[2616]: yes: : Broken pipe
      Jan 19 20:10:24 shift-axolotl bootmac[2621]: hci0 Set Public Address complete, options:
      Jan 19 20:10:24 shift-axolotl bootmac[2620]: yes: : Broken pipe
      Jan 19 20:10:24 shift-axolotl bootmac[2628]: Set Powered for hci0 failed with status 0x11 (Invalid Index)
      Jan 19 20:10:24 shift-axolotl bootmac[2628]: 
      Jan 19 20:10:24 shift-axolotl bootmac[2627]: yes: : Broken pipe
      Jan 19 20:10:24 shift-axolotl systemd[1]: Finished Set Mac Address.

      Problem is also that bluetoothctl does not even see the Bluetooth controller. Might be a kernel issue. Therefore, I cannot really verify myself if this patch works. But if you check if it works on OpenRC and systemd, I can merge this easily.

  • Clayton Craft added 1 commit

    added 1 commit

    • eb108c6d - Add retry mechnism for setting BT MAC addr

    Compare with previous version

  • Clayton Craft added 1 commit

    added 1 commit

    • dd7dd584 - Add retry mechnism for setting BT MAC addr

    Compare with previous version

  • Clayton Craft added 2 commits

    added 2 commits

    • 20254062 - Add systemd unit files
    • 2d52c50b - Add retry mechnism for setting BT and wlan MAC addr

    Compare with previous version

  • Clayton Craft added 1 commit

    added 1 commit

    • 1ac151a8 - Add retry mechnism for setting BT and wlan MAC addr

    Compare with previous version

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading