Commit Graph

2 Commits

Author SHA1 Message Date
Luca Boccassi
517e628c7b resolv.conf: take backup as a fallback
piuparts doesn't like seeing an empty resolv.conf after removing
the package, so take a backup and use it in case resolved/resolv.conf
is not available
2022-08-27 11:59:59 +01:00
Luca Boccassi
5d8a69933d resolved: switch from .links to postinst/rm
dpkg refuses to install the symlink in chroot/container environments
where /etc/resolv.conf is bind mounted:

| Unpacking systemd-resolved (251.4-1) ...
| dpkg: error processing archive /var/cache/apt/archives/systemd-resolved_251.4-1_amd64.deb (--unpack):
|  unable to make backup link of './etc/resolv.conf' before installing new version: Invalid cross-device link

So unfortunately manual handling via maintainerscripts is necessary.
Use maintainer scripts to avoid failing the installation, and provide
feedback to the user if the symlink cannot be successfully installed.
Also on removal, either copy /run/systemd/resolve/resolv.conf or
create an empty /etc/resolv.conf.
2022-08-26 22:25:59 +01:00