mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Guillermo Rodriguez Garcia <guille.rodriguez@gmail.com>
To: ptxdist@pengutronix.de
Subject: [ptxdist] Patch: Allow installation of /etc/hosts as a link to /run/hosts
Date: Tue, 6 May 2014 19:30:28 +0200	[thread overview]
Message-ID: <CABDcavZ_W8hvdTtw=Q_KvK3OS=hq3jktHhmWjdyrm5yAujFg3w@mail.gmail.com> (raw)

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

                 reply	other threads:[~2014-05-06 17:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CABDcavZ_W8hvdTtw=Q_KvK3OS=hq3jktHhmWjdyrm5yAujFg3w@mail.gmail.com' \
    --to=guille.rodriguez@gmail.com \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox