diff --git a/mkrootfs.sh b/mkrootfs.sh index b76f10d..505910a 100644 --- a/mkrootfs.sh +++ b/mkrootfs.sh @@ -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}" \ diff --git a/overlay/etc/dhcp/dhclient.conf b/overlay/etc/dhcp/dhclient.conf new file mode 100644 index 0000000..6af00c5 --- /dev/null +++ b/overlay/etc/dhcp/dhclient.conf @@ -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; diff --git a/overlay/etc/fstab b/overlay/etc/fstab index 92f7e54..e407145 100644 --- a/overlay/etc/fstab +++ b/overlay/etc/fstab @@ -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 diff --git a/overlay/etc/systemd/system/dhclient@.service b/overlay/etc/systemd/system/dhclient@.service new file mode 100644 index 0000000..81de0f8 --- /dev/null +++ b/overlay/etc/systemd/system/dhclient@.service @@ -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