This will require a bit more work than anticipated. The patch posted above will only do half of the job. netcfg will call udhcp with the "-O search" option added which will update /etc/resolv.conf with the correct search domain values assuming that the patch for /etc/udhcpc/default.script is also applied along this one.
Now the problem is that netcfg is calling the "netcfg_write_resolv" function from static.c that will overwrite any changes made by udhcpc on resolv.conf and will only keep the domain and nameservers. https://salsa.debian.org/installer-team/netcfg/-/blob/master/dhcp.c#L513 https://salsa.debian.org/installer-team/netcfg/-/blob/master/dhcp.c#L616 https://salsa.debian.org/installer-team/netcfg/-/blob/master/static.c?ref_type=heads#L261