Package: netcfg
Version: 1.197

I have (re-)created a Debian netinst boot-stick incorporating a tailored
preseed.cfg.

For some reason I need server names with a node-name only (like "timeserv").
Without a dns-domain, so not a FQDN.

This wouldn't be a problem if /etc/resolv.conf contains a line
"search <dns-domain>"

Unfortunately netcfg fails to write it.

I have modified postinst to do this. See patch.

Maybe it would be better to modify the netcfg itself. But this is beyond my
scope.

Markus



--- /tmp/tempdir.22011.qKa2Itxt/postinst        2021-02-08 13:53:34.000000000 
+0100
+++ /tmp/tempdir.22084.sbeFJguT/postinst        2026-01-24 16:09:15.000000000 
+0100
@@ -1,2 +1,14 @@
 #!/bin/sh
-exec netcfg
+logger -t $0 "Start"
+
+netcfg
+
+DNSDOMAIN=$(grep 'DHCP domain name is' /var/log/syslog | head -1 | awk -F\' 
'{print $2}')
+logger -t $0 "DNSDOMAIN=$DNSDOMAIN"
+
+{      grep -v "^search" /etc/resolv.conf
+       echo "search $DNSDOMAIN"
+} > /etc/resolv.conf.new
+mv /etc/resolv.conf.new /etc/resolv.conf
+
+logger -t $0 "Ende"

Reply via email to