FooDeas / raspberrypi-ua-netinst

RaspberryPi (minimal) unattended netinstaller
ISC License
220 stars 45 forks source link

installer: Config from udhcpc options. #157

Closed mrichar1 closed 6 years ago

mrichar1 commented 6 years ago

This is a first stab at resolving #156 which aims to read extra options from udhcpc and use them to override config options.

The idea is that there is a dhcp_options config list, and any item listed there will be read from udhcpc if an equivalent exists. The full list of udhcpc options is given here:

https://udhcp.busybox.net/README.udhcpc

The most useful ones are hostname and domain - additionally timeserver is specially handled since the udhcpc option is named ntpsrv.

The code seems to work as expected, but probably needs a review, since it's a while since I did anything advanced in bash - especially the sourcing of the variables from the default.script and use of tmpvar and variable expansion which might not be 'best practice'. So please feel free to comment/suggest improvements/alternatives!

FooDeas commented 6 years ago

Nice! I think, we can add this very soon.

mrichar1 commented 5 years ago

Hi - just coming back to this and just realised that theis PR was merged into FooDeas:dhcp_options but doesn't seem to have then been merged into master.

Is there any chance this could happen for the next release? Thanks!