···1+diff --git a/distrobuilder/lxc.generator b/distrobuilder/lxc.generator
2+index 0ad81d1..69dbfe7 100644
3+--- a/distrobuilder/lxc.generator
4++++ b/distrobuilder/lxc.generator
5+@@ -25,16 +25,6 @@ is_incus_vm() {
6+ [ -e /dev/virtio-ports/org.linuxcontainers.incus ]
7+ }
8+9+-# is_in_path succeeds if the given file exists in on of the paths
10+-is_in_path() {
11+- # Don't use $PATH as that may not include all relevant paths
12+- for path in /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin; do
13+- [ -e "${path}/$1" ] && return 0
14+- done
15+-
16+- return 1
17+-}
18+-
19+ ## Fix functions
20+ # fix_ro_paths avoids udevd issues with /sys and /proc being writable
21+ fix_ro_paths() {
22+@@ -45,35 +35,6 @@ BindReadOnlyPaths=/sys /proc
23+ EOF
24+ }
25+26+-# fix_nm_link_state forces the network interface to a DOWN state ahead of NetworkManager starting up
27+-fix_nm_link_state() {
28+- [ -e "/sys/class/net/$1" ] || return 0
29+- ip_path=
30+- if [ -f /sbin/ip ]; then
31+- ip_path=/sbin/ip
32+- elif [ -f /bin/ip ]; then
33+- ip_path=/bin/ip
34+- else
35+- return 0
36+- fi
37+- cat <<-EOF > /run/systemd/system/network-device-down.service
38+-[Unit]
39+-Description=Turn off network device
40+-Before=NetworkManager.service
41+-Before=systemd-networkd.service
42+-[Service]
43+-# do not turn off if there is a default route to 169.254.0.1, i.e. the device is a routed nic
44+-ExecCondition=/bin/sh -c '! /usr/bin/grep -qs 00000000.0100FEA9 /proc/net/route'
45+-ExecStart=-${ip_path} link set $1 down
46+-Type=oneshot
47+-RemainAfterExit=true
48+-[Install]
49+-WantedBy=default.target
50+-EOF
51+- mkdir -p /run/systemd/system/default.target.wants
52+- ln -sf /run/systemd/system/network-device-down.service /run/systemd/system/default.target.wants/network-device-down.service
53+-}
54+-
55+ # fix_systemd_override_unit generates a unit specific override
56+ fix_systemd_override_unit() {
57+ dropin_dir="/run/systemd/${1}.d"
58+@@ -112,16 +73,7 @@ fix_systemd_mask() {
59+ # fix_systemd_udev_trigger overrides the systemd-udev-trigger.service to match the latest version
60+ # of the file which uses "ExecStart=-" instead of "ExecStart=".
61+ fix_systemd_udev_trigger() {
62+- cmd=
63+- if [ -f /usr/bin/udevadm ]; then
64+- cmd=/usr/bin/udevadm
65+- elif [ -f /sbin/udevadm ]; then
66+- cmd=/sbin/udevadm
67+- elif [ -f /bin/udevadm ]; then
68+- cmd=/bin/udevadm
69+- else
70+- return 0
71+- fi
72++ cmd=udevadm
73+74+ mkdir -p /run/systemd/system/systemd-udev-trigger.service.d
75+ cat <<-EOF > /run/systemd/system/systemd-udev-trigger.service.d/zzz-lxc-override.conf
76+@@ -145,24 +97,12 @@ EOF
77+ }
78+79+ ## Main logic
80+-# Nothing to do in Incus VM but deployed in case it is later converted to a container
81+-is_incus_vm || is_lxd_vm && exit 0
82+83+ # Exit immediately if not an Incus/LXC container
84+ is_lxc_container || exit 0
85+86+-# Check for NetworkManager
87+-nm_exists=0
88+-
89+-is_in_path NetworkManager && nm_exists=1
90+-
91+ # Determine systemd version
92+-for path in /usr/lib/systemd/systemd /lib/systemd/systemd; do
93+- [ -x "${path}" ] || continue
94+-
95+- systemd_version="$("${path}" --version | head -n1 | cut -d' ' -f2)"
96+- break
97+-done
98++systemd_version="$(systemd --version | head -n1 | cut -d' ' -f2)"
99+100+ # Determine distro name and release
101+ ID=""
102+@@ -222,11 +162,6 @@ ACTION=="add|change|move", ENV{ID_NET_DRIVER}=="veth", ENV{INTERFACE}=="eth[0-9]
103+ EOF
104+ fi
105+106+-# Workarounds for NetworkManager in containers
107+-if [ "${nm_exists}" -eq 1 ]; then
108+- fix_nm_link_state eth0
109+-fi
110+-
111+ # Allow masking units created by the lxc system-generator.
112+ for d in /etc/systemd/system /usr/lib/systemd/system /lib/systemd/system; do
113+ if ! [ -d "${d}" ]; then