dhcpcd icon indicating copy to clipboard operation
dhcpcd copied to clipboard

dhcpcd -U stops working on /dev/console loopback

Open jorknu opened this issue 2 years ago • 1 comments
trafficstars

Version: dhcpcd 10.0.1 Architecture: x86_64 (Intel Xeon 3rd generation Scalable processors)

Short problem description: dhcpcd -U function stops working in the minimalistic initramfs when a serial loopback is present on the console device.

Behavior: -> the regular dhcpcd call succeeds and gets a IP address from the DHCP server, the lease file in /var/db/dhcpcd is created and filled with correct information. -> dhcpcd -U complains that the family (-4 or -6) should be provided, this is different behavior when the serial loopback is not present -> If the family (-4) is provided and the debug flags is provided the following behavior is observed:

Boot sequence: -> PXE loads EFI linux kernel -> EFI linux kernel loads minimalistic initramfs (packaged into bzImage) -> init script in initramfs calls dhcpcd followed by dhcpcd -U to get the lease information for the last handed out lease -> problem point -> the lease information is used to get the full rootfs via http -> the full rootfs is mounted as fs overlay and init of the rootfs is kicked off

OS information: Buildroot: 2023.08 Linux: 6.4.9

Log of normal dhcpcd call with -d: Dhcpcd_-d_orig.txt -> as received on serial terminal with loopback present Dhcpcd_-d_filt.text -> Unscrambled the orig log and filtered on output of dhcpcd

Log of dhcpcd -d -U: Dhcpcd_-d_orig.txt -> as received on serial terminal with loopback present Dhcpcd_-d_filt.text -> Unscrambled the orig log and filtered on output of dhcpcd

Log of dhcpcd -d -U -4: Dhcpcd_-4_orig.txt -> as received on serial terminal with loopback present Dhcpcd_-4_filt.txt -> Unscrambled the orig log and filtered on output of dhcpcd

Questions:

  • Why is the behavior between serial loopback present and serial loopback absent different?
  • Is there an option to pass the /var/db/dhcpcd/*.lease file to dhcpcd directly for parsing?

If anything is unclear or information is lacking don't hesitate to contact me.

Attachments: Dhcpcd_-4_orig.txt Dhcpcd_-d_filt.txt Dhcpcd_-d_orig.txt Dhcpcd_-4_filt.txt

jorknu avatar Oct 31 '23 08:10 jorknu

Call: dhcpcd -d -U

getpwnam: No such file or directory
Family not specified. Please use -4 or -6.

Family not specificed means dhcpcd is trying to read a lease from stdin. Maybe close stdin and call dhcpcd -U in a subshell if you have stdin open?

rsmarples avatar Nov 07 '23 11:11 rsmarples