aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/filesystems/nfs
diff options
context:
space:
mode:
authorChris Novakovic <chris@chrisn.me.uk>2018-04-23 22:56:39 -0400
committerDavid S. Miller <davem@davemloft.net>2018-04-24 13:40:42 -0400
commitc04d2cb2009f87cba7431c4ed3d85a602f71658e (patch)
tree3a3a99d67bf734d15698d47cdf9940e1bf873d71 /Documentation/filesystems/nfs
parent4d019b3f80dc147fd9d177e7e0337fc66e3c0032 (diff)
ipconfig: Write NTP server IPs to /proc/net/ipconfig/ntp_servers
Distributed filesystems are most effective when the server and client clocks are synchronised. Embedded devices often use NFS for their root filesystem but typically do not contain an RTC, so the clocks of the NFS server and the embedded device will be out-of-sync when the root filesystem is mounted (and may not be synchronised until late in the boot process). Extend ipconfig with the ability to export IP addresses of NTP servers it discovers to /proc/net/ipconfig/ntp_servers. They can be supplied as follows: - If ipconfig is configured manually via the "ip=" or "nfsaddrs=" kernel command line parameters, one NTP server can be specified in the new "<ntp0-ip>" parameter. - If ipconfig is autoconfigured via DHCP, request DHCP option 42 in the DHCPDISCOVER message, and record the IP addresses of up to three NTP servers sent by the responding DHCP server in the subsequent DHCPOFFER message. ipconfig will only write the NTP server IP addresses it discovers to /proc/net/ipconfig/ntp_servers, one per line (in the order received from the DHCP server, if DHCP autoconfiguration is used); making use of these NTP servers is the responsibility of a user space process (e.g. an initrd/initram script that invokes an NTP client before mounting an NFS root filesystem). Signed-off-by: Chris Novakovic <chris@chrisn.me.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'Documentation/filesystems/nfs')
-rw-r--r--Documentation/filesystems/nfs/nfsroot.txt35
1 files changed, 29 insertions, 6 deletions
diff --git a/Documentation/filesystems/nfs/nfsroot.txt b/Documentation/filesystems/nfs/nfsroot.txt
index a1030bea60d3..d2963123eb1c 100644
--- a/Documentation/filesystems/nfs/nfsroot.txt
+++ b/Documentation/filesystems/nfs/nfsroot.txt
@@ -5,6 +5,7 @@ Written 1996 by Gero Kuhlmann <gero@gkminix.han.de>
5Updated 1997 by Martin Mares <mj@atrey.karlin.mff.cuni.cz> 5Updated 1997 by Martin Mares <mj@atrey.karlin.mff.cuni.cz>
6Updated 2006 by Nico Schottelius <nico-kernel-nfsroot@schottelius.org> 6Updated 2006 by Nico Schottelius <nico-kernel-nfsroot@schottelius.org>
7Updated 2006 by Horms <horms@verge.net.au> 7Updated 2006 by Horms <horms@verge.net.au>
8Updated 2018 by Chris Novakovic <chris@chrisn.me.uk>
8 9
9 10
10 11
@@ -79,7 +80,7 @@ nfsroot=[<server-ip>:]<root-dir>[,<nfs-options>]
79 80
80 81
81ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>: 82ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>:
82 <dns0-ip>:<dns1-ip> 83 <dns0-ip>:<dns1-ip>:<ntp0-ip>
83 84
84 This parameter tells the kernel how to configure IP addresses of devices 85 This parameter tells the kernel how to configure IP addresses of devices
85 and also how to set up the IP routing table. It was originally called 86 and also how to set up the IP routing table. It was originally called
@@ -178,9 +179,18 @@ ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>:
178 <dns1-ip> IP address of secondary nameserver. 179 <dns1-ip> IP address of secondary nameserver.
179 See <dns0-ip>. 180 See <dns0-ip>.
180 181
181 After configuration (whether manual or automatic) is complete, a file is 182 <ntp0-ip> IP address of a Network Time Protocol (NTP) server.
182 created at /proc/net/pnp in the following format; lines are omitted if 183 Value is exported to /proc/net/ipconfig/ntp_servers, but is
183 their respective value is empty following configuration. 184 otherwise unused (see below).
185
186 Default: None if not using autoconfiguration; determined
187 automatically if using autoconfiguration.
188
189 After configuration (whether manual or automatic) is complete, two files
190 are created in the following format; lines are omitted if their respective
191 value is empty following configuration:
192
193 - /proc/net/pnp:
184 194
185 #PROTO: <DHCP|BOOTP|RARP|MANUAL> (depending on configuration method) 195 #PROTO: <DHCP|BOOTP|RARP|MANUAL> (depending on configuration method)
186 domain <dns-domain> (if autoconfigured, the DNS domain) 196 domain <dns-domain> (if autoconfigured, the DNS domain)
@@ -189,13 +199,26 @@ ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>:
189 nameserver <dns2-ip> (tertiary name server IP) 199 nameserver <dns2-ip> (tertiary name server IP)
190 bootserver <server-ip> (NFS server IP) 200 bootserver <server-ip> (NFS server IP)
191 201
192 <dns-domain> and <dns2-ip> are requested during autoconfiguration; they 202 - /proc/net/ipconfig/ntp_servers:
193 cannot be specified as part of the "ip=" kernel command line parameter. 203
204 <ntp0-ip> (NTP server IP)
205 <ntp1-ip> (NTP server IP)
206 <ntp2-ip> (NTP server IP)
207
208 <dns-domain> and <dns2-ip> (in /proc/net/pnp) and <ntp1-ip> and <ntp2-ip>
209 (in /proc/net/ipconfig/ntp_servers) are requested during autoconfiguration;
210 they cannot be specified as part of the "ip=" kernel command line parameter.
194 211
195 Because the "domain" and "nameserver" options are recognised by DNS 212 Because the "domain" and "nameserver" options are recognised by DNS
196 resolvers, /etc/resolv.conf is often linked to /proc/net/pnp on systems 213 resolvers, /etc/resolv.conf is often linked to /proc/net/pnp on systems
197 that use an NFS root filesystem. 214 that use an NFS root filesystem.
198 215
216 Note that the kernel will not synchronise the system time with any NTP
217 servers it discovers; this is the responsibility of a user space process
218 (e.g. an initrd/initramfs script that passes the IP addresses listed in
219 /proc/net/ipconfig/ntp_servers to an NTP client before mounting the real
220 root filesystem if it is on NFS).
221
199 222
200nfsrootdebug 223nfsrootdebug
201 224