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

Bug#974106: initramfs-tools: No hostname for nfs root



Package: initramfs-tools
Version: 0.133+deb10u1
Severity: normal
X-Debbugs-CC: rossboylan@stanfordalumni.org

Dear Maintainer,

   * What led up to the situation?
     PXE booting a system with NFS root using isc-dhcp-server and tftpd-hpa,
     the initrd environment does not know the hostname and does not communicate
     it to the dhcp server.

   * What exactly did you do (or not do) that was effective (or
     ineffective)?
     Traced through the init scripts and recorded network traffic to
     better understand the problem.  Results reported in "Analysis:"
     below.
     
     Work-around: hard code ddns-hostname in server's dhcpd.conf, ensuring
     that it matches /etc/hostname in the final system the initrd
     pivots to.

     See below for other strategies.

   * What was the outcome of this action?
     The work around worked, as long  as I don't boot alternate systems.
     Without the work-around, dhcpd triggered no DNS
     update, and so the netbooted system was unknown to DNS (bind). A
     work-around for that problem was to hard code an entry into the
     bind configuration.
   
   * What outcome did you expect instead?
     I expected that as the system came up it would communicate its
     hostname to the dhcp server, which could then use that
     information to update DNS.

Analysis: when PXE booting the DHCP server is called twice, first from
the system or network card firmware (I assume) to get the initial PXE
image pxelinux.0, and second from within the initrd environment.  The
first problem is that there is no /etc/hostname in that environment.
The second is that the scripts invoked klibc's ipconfig.  ipconfig,
though limited, does allow the specification of a client hostname, but
that option is not used.

There is no 3rd time the DHCP server is contacted from the "real" OS,
in which the hostname is known.

It looked as if it might be possible to use the IP= option on the
kernel command line to pass the host name in and have the scripts use
it, but I've been unable to get that to work (that is, I can't even
boot when I do that).  _handle_device_vs_ip, called from
configure_networking, works with the IP argument.

All the work-arounds are ugly, because they all require that the
hostnames assigned in several different places (dhcpd or bind
configuration file, kernel command line from pxelinux.cfg) match,
which they may not. Given that I can select from among different
systems at the time I PXE boot, the name of the system may not be
known until after that selection, and may not be unique for a given
IP.

I prepared this bug report inside a chroot for the system that I
netboot.  So this should be the environment in which new initrd's are
generated.  I copy them manually so they are available during the PXE boot.

-- Package-specific info:
-- initramfs sizes
-rw-r--r-- 1 root root 36M Sep 27 13:54 /boot/initrd.img-4.19.0-11-amd64
-rw-r--r-- 1 root root 36M Oct 19 13:46 /boot/initrd.img-4.19.0-12-amd64
-- /proc/cmdline

-- /proc/filesystems

-- lsmod

-- /etc/initramfs-tools/modules

-- /etc/initramfs-tools/initramfs.conf
MODULES=most
BUSYBOX=auto
KEYMAP=n
COMPRESS=gzip
DEVICE=
NFSROOT=auto
RUNSIZE=10%

-- /etc/initramfs-tools/update-initramfs.conf
update_initramfs=yes
backup_initramfs=no

-- mkinitramfs hooks
/etc/initramfs-tools/hooks/:

/usr/share/initramfs-tools/hooks:
btrfs
dmsetup
fsck
fuse
keymap
klibc-utils
kmod
mdadm
ntfs_3g
plymouth
resume
thermal
udev
zz-busybox


-- System Information:
Debian Release: 10.6
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.19.0-12-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE= (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: unable to detect

Versions of packages initramfs-tools depends on:
ii  initramfs-tools-core  0.133+deb10u1
ii  linux-base            4.6

initramfs-tools recommends no packages.

Versions of packages initramfs-tools suggests:
pn  bash-completion  <none>

-- no debconf information

Reply to: