[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Modifying behavior of netcfg in debian-installer



Hello,
tl;dr: I want to add a script to be executed to the initrd used in pxeboot to execute either in the case of DHCP autoconfig failing, or to subvert and bypass the existing DHCP method entirely.  I would like to do this by replacing or modifying installation steps pertaining to configuring network interfaces.

I am part of a team who manages a very large production cluster with very little hardware consistency, especially when it comes to network configurations, and we support multiple debian-based distros and versions with local mirrors. We image all of our hosts via pxeboot/preseed with kernels and initrds hosted locally.

Because of the hardware differences, we can't just set `interface=ethX` in the pxeconfig file for any given host. I humbly and respectfully request that not be suggested as a solution to our problem. We did that for years and it was a nightmare to maintain that information. 
We've also found that `interface=auto` doesn't reliably attempt dhcp over the correct interface; it will try one and fail if it did did not pick the right one (different distros have different first choices). We do not consider it acceptable to interact with the preseed installer as part of routine imaging; it should only be done to debug problems. 

I've found that if after any given host PXEboots, I can let DHCP fail, hit 'continue', pop into TTY2 and execute 'dhclient -v', pop back to TTY1 and select 'Do not configure the network at this time', it will successfully download the debconf file from our local repo and everything works perfectly after this.

I notice that I can't just execute `dhclient -v` in the init script, because 'Configure the network` wipes out all existing dhcp leases because ??????.

What I would like to do is change the behavior of the installation step that configures the network, either to try alternate methods of getting a dhcp lease upon failure, or bypassing the default method altogether.  I've dug through the initramfs a bit and gone down a bunch of rabbit holes that the init scripts point to, but every one of them ends at a pre-compiled binary.  I'm hoping to solve the issue with shell scripts and config files. I'd really rather not make custom versions of binaries. 

I apologize if this is covered in an existing how-to guide.  I've tried searching for methods of modifying debian-installer, but most seem to center around using custom kernels or custom packages, not custom installation steps.

Thank you!


Reply to: