* [ptxdist] Patch: Allow installation of /etc/hosts as a link to /run/hosts
@ 2014-05-06 17:30 Guillermo Rodriguez Garcia
0 siblings, 0 replies; only message in thread
From: Guillermo Rodriguez Garcia @ 2014-05-06 17:30 UTC (permalink / raw)
To: ptxdist
Hi all,
Here's a patch that allows installation of /etc/hosts as a link to
/run/hosts
This is useful when the root filesystem is mounted read only.
A similar option already exists for /etc/resolv.conf
--- orig/rules/rootfs.in 2013-09-09 15:59:23.000000000 +0200
+++ rules/rootfs.in 2014-05-06 19:20:28.795239261 +0200
@@ -342,13 +342,32 @@ config ROOTFS_ETC_HOSTNAME
prompt "hostname"
depends on ROOTFS_HOSTNAME
-config ROOTFS_HOSTS
- bool
+choice
prompt "install /etc/hosts"
- help
- If enabled, it installs the "./projectroot/etc/hosts" file if
- present, else a generic one from the ptxdist directory.
+ default ROOTFS_HOSTS_FILE
+
+ config ROOTFS_HOSTS_FILE
+ bool
+ prompt "from file"
+ help
+ If enabled, it installs the "./projectroot/etc/hosts" file if
+ present, else a generic one from the ptxdist directory.
+ config ROOTFS_HOSTS_RUN
+ bool
+ prompt "link to /run/hosts"
+ help
+ If enabled, it installs /etc/hosts as a link to
+ /run/hosts. This is useful if the root filesystem is mounted
+ read-only.
+
+ config ROOTFS_HOSTS_NONE
+ bool
+ prompt "none"
+ help
+ If enabled, no /etc/hosts will be installed.
+endchoice
+
config ROOTFS_ISSUE
bool
prompt "install /etc/issue"
@@ -419,7 +438,7 @@ choice
bool
prompt "none"
help
- If enabled, no /etc/resolv.conf will be install.
+ If enabled, no /etc/resolv.conf will be installed.
endchoice
--- orig/rules/rootfs.make 2013-09-09 15:59:23.000000000 +0200
+++ rules/rootfs.make 2014-05-06 19:06:32.645238375 +0200
@@ -199,9 +199,12 @@ ifdef PTXCONF_ROOTFS_ISSUE
`sed -r 's/ ?([\.:;,]) ?/ \1 /' <<< $(PTXCONF_ROOTFS_ETC_HOSTNAME)`)
endif
-ifdef PTXCONF_ROOTFS_HOSTS
+ifdef PTXCONF_ROOTFS_HOSTS_FILE
@$(call install_alternative, rootfs, 0, 0, 0644, /etc/hosts)
endif
+ifdef PTXCONF_ROOTFS_HOSTS_RUN
+ @$(call install_link, rootfs, /run/hosts, /etc/hosts)
+endif
ifdef PTXCONF_ROOTFS_MODPROBE_CONF
@$(call install_alternative, rootfs, 0, 0, 0644, /etc/modprobe.conf)
endif
--
Guillermo Rodriguez Garcia
guille.rodriguez@gmail.com
--
ptxdist mailing list
ptxdist@pengutronix.de
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-05-06 17:30 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-06 17:30 [ptxdist] Patch: Allow installation of /etc/hosts as a link to /run/hosts Guillermo Rodriguez Garcia
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox