From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-wg0-x22c.google.com ([2a00:1450:400c:c00::22c]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1WhjCJ-0001k6-BL for ptxdist@pengutronix.de; Tue, 06 May 2014 19:30:32 +0200 Received: by mail-wg0-f44.google.com with SMTP id a1so6921745wgh.27 for ; Tue, 06 May 2014 10:30:28 -0700 (PDT) MIME-Version: 1.0 Date: Tue, 6 May 2014 19:30:28 +0200 Message-ID: From: Guillermo Rodriguez Garcia Subject: [ptxdist] Patch: Allow installation of /etc/hosts as a link to /run/hosts Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de 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