aboutsummaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorJosh Triplett2011-06-15 17:08:28 -0500
committerLinus Torvalds2011-06-15 22:04:00 -0500
commitbd5dc17be87b3a3073d50b23802647db3ae3fa8e (patch)
treeb8abfc57e4282d943bb2bb21762a868efa29bd20 /init
parentca39599c633fb02aceac31a7e67563612e4fe347 (diff)
downloadkernel-common-bd5dc17be87b3a3073d50b23802647db3ae3fa8e.tar.gz
kernel-common-bd5dc17be87b3a3073d50b23802647db3ae3fa8e.tar.xz
kernel-common-bd5dc17be87b3a3073d50b23802647db3ae3fa8e.zip
uts: make default hostname configurable, rather than always using "(none)"
The "hostname" tool falls back to setting the hostname to "localhost" if /etc/hostname does not exist. Distribution init scripts have the same fallback. However, if userspace never calls sethostname, such as when booting with init=/bin/sh, or otherwise booting a minimal system without the usual init scripts, the default hostname of "(none)" remains, unhelpfully appearing in various places such as prompts ("root@(none):~#") and logs. Furthermore, "(none)" doesn't typically resolve to anything useful. Make the default hostname configurable. This removes the need for the standard fallback, provides a useful default for systems that never call sethostname, and makes minimal systems that much more useful with less configuration. Distributions could choose to use "localhost" here to avoid the fallback, while embedded systems may wish to use a specific target hostname. Signed-off-by: Josh Triplett <josh@joshtriplett.org> Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Acked-by: David Miller <davem@davemloft.net> Cc: Serge Hallyn <serue@us.ibm.com> Cc: Kel Modderman <kel@otaku42.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'init')
-rw-r--r--init/Kconfig9
1 files changed, 9 insertions, 0 deletions
diff --git a/init/Kconfig b/init/Kconfig
index ebafac4231e..e0a22e42d39 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -204,6 +204,15 @@ config KERNEL_LZO
204 204
205endchoice 205endchoice
206 206
207config DEFAULT_HOSTNAME
208 string "Default hostname"
209 default "(none)"
210 help
211 This option determines the default system hostname before userspace
212 calls sethostname(2). The kernel traditionally uses "(none)" here,
213 but you may wish to use a different default here to make a minimal
214 system more usable with less configuration.
215
207config SWAP 216config SWAP
208 bool "Support for paging of anonymous memory (swap)" 217 bool "Support for paging of anonymous memory (swap)"
209 depends on MMU && BLOCK 218 depends on MMU && BLOCK