Adding systemd-resolved Support to Connman

A simple guide on how to add systemd-resolved support to Arch Linux connman package.

This is a quick guide to enable systemd-resolved support for connman package in arch because arch wiki being arch wiki, it RTFMed the reader with no futher explanation on how to actually rebuild this package.

Prerequisites

Install a few packages before we start rebuilding. These are the required dependencies as per connman’s PKGBUILD.

  • base-devel
  • devtools
  • bluez
  • iwd
  • openconnect
  • openvpn
  • ppp
  • wpa_supplicant

devtools is required as well since it has the tools for rebuilding the package.

Command for installing:

1
2
3
4
5
6
7
8
sudo pacman -S bluez \
               iwd \
               openconnect \
               openvpn \
               ppp \
               wpa_supplicant \
               devtools \
               base-devel

Re-Building the Package

First, We need to get the source files of connman package from arch’s gitlab.

1
2
pkgctl repo clone --protocol=https connman
cd connman

Now, Open up PKGBUILD and modify it to add --with-dns-backend=systemd-resolved option.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
...
build() {
  cd $pkgname-$pkgver
  ./configure \
    --prefix=/usr \
    ...
    --with-dns-backend=systemd-resolved
    ...
    --enable-pie \
    --enable-iwd
  make
}
...

Write the changes and re-build the package.

1
makepkg --syncdeps --rmdeps

--syncdeps: Installs required dependencies.
--rmdeps: Removes make dependencies after building, which are not needed.

ps. If makepkg fails due to PGP key not being verified, you can pass --skippgpcheck flag to the command.

1
2
3
==> ERROR: One or more PGP signatures could not be verified!

$ makepkg --syncdeps --skippgpcheck

Installing the Modified Version

Once the building process is complete, a package file (connman-pkgver.pkg.tar.zst) will be created in the working directory.

To install it, use makepkg’s -i flag

1
makepkg --install

Final setup

After installing the modified package, setup the stub resolver as /etc/resolv.conf

1
ln -sf ../run/systemd/resolve/stub-resolv.conf /etc/resolv.conf

Then, Restart connman.service, systemd-resolved.service and (if you’re using it) tailscale.service.

1
2
sudo systemctl restart connman.service
sudo systemctl restart systemd-resolved.service

That’s it. :)

Licensed under CC BY-NC-SA 4.0
Built with Hugo
Theme Stack designed by Jimmy