Switch from NetworkManager to dhclient
basementhud/pipeline/head This commit looks good
Details
basementhud/pipeline/head This commit looks good
Details
NetworkManager is a memory hog. We don't need it to do anything except renew the DHCP lease when it's time, so let's switch to a more lightweight alternative. Unfortunately, Fedora does not include any systemd units for `dhclient`, so we have to provide our own.pull/1/head
parent
919b578ebc
commit
d6139d4884
|
@ -18,6 +18,7 @@ echo install_weak_deps=False >> "${destdir}"/etc/dnf/dnf.conf
|
|||
|
||||
dnf --installroot "${destdir}" install -y \
|
||||
bcm2711-firmware \
|
||||
dhcp-client \
|
||||
dracut-network \
|
||||
firefox \
|
||||
hostname \
|
||||
|
@ -28,7 +29,6 @@ dnf --installroot "${destdir}" install -y \
|
|||
openssh-server \
|
||||
rsyslog \
|
||||
systemd \
|
||||
systemd-resolved \
|
||||
xinit \
|
||||
xorg-x11-server-Xorg \
|
||||
xset \
|
||||
|
@ -59,12 +59,14 @@ if ! grep -qE '^video:.*:.+:.*,?user' "${destdir}"/etc/group; then
|
|||
chroot "${destdir}" gpasswd -a user video
|
||||
fi
|
||||
chroot "${destdir}" systemctl enable \
|
||||
dhclient@eth0 \
|
||||
systemd-time-wait-sync \
|
||||
systemd-timesyncd \
|
||||
xinit@user
|
||||
chroot "${destdir}" systemctl disable \
|
||||
systemd-homed \
|
||||
systemd-userdbd
|
||||
ln -sf /run/resolv.conf "${destdir}"/etc/resolv.conf
|
||||
|
||||
umask 0022
|
||||
mksquashfs "${destdir}" "${destdir}/boot/${dest}" \
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
option classless-static-routes code 121 = array of unsigned integer 8;
|
||||
|
||||
send dhcp-client-identifier = hardware;
|
||||
|
||||
request subnet-mask, broadcast-address, time-offset, routers,
|
||||
domain-name, domain-name-servers, domain-search, host-name,
|
||||
root-path, interface-mtu, classless-static-routes,
|
||||
netbios-name-servers, netbios-scope, ntp-servers,
|
||||
dhcp6.domain-search, dhcp6.fqdn,
|
||||
dhcp6.name-servers, dhcp6.sntp-servers;
|
|
@ -1,7 +1,6 @@
|
|||
tmpfs /var/lib/rsyslog tmpfs defaults 0 0
|
||||
tmpfs /var/log tmpfs defaults 0 0
|
||||
tmpfs /var/lib/systemd tmpfs defaults 0 0
|
||||
tmpfs /var/lib/NetworkManager tmpfs defaults 0 0
|
||||
/dev/mmcblk0 /run/storage ext4 ro,noexec,nosuid,nodev,x-systemd.makefs 0 2
|
||||
overlay /etc/ssh overlay ro,lowerdir=/etc/ssh:/run/storage/ssh,noexec,nodev,nosuid,x-systemd.requires-mounts-for=/run/storage 0 0
|
||||
/dev/nbd1 swap swap noauto,x-systemd.makefs 0 0
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
[Unit]
|
||||
Description=DHCPv4 client for %I
|
||||
Before=network-online.target
|
||||
Before=network.target
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
RuntimeDirectory=dhclient
|
||||
ExecStart=/usr/sbin/dhclient -4 -1 -lf /run/dhclient/%I.lease -pf /run/dhclient/%I.pid
|
||||
PIDFile=/run/dhclient/%I.pid
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
Reference in New Issue