public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: Mingming Cao <cmm@us.ibm.com>
To: Theodore Tso <tytso@mit.edu>
Cc: linux-ext4@vger.kernel.org
Subject: Re: [PATCH, RFC] Add more intelligent handling of the mke2fs.conf installation process
Date: Wed, 16 Jul 2008 11:24:36 -0700	[thread overview]
Message-ID: <1216232676.6424.18.camel@mingming-laptop> (raw)
In-Reply-To: <20080716175257.GF2167@mit.edu>


在 2008-07-16三的 13:52 -0400,Theodore Tso写道:
> On Wed, Jul 16, 2008 at 10:02:00AM -0700, Mingming Cao wrote:
> > I looked at misc/Makefile, it seems if the system already
> > have /etc/mke2fs.conf, it will not get updated. This is reasonable for
> > ext3.   But not good for ext4.
> 
> Good point.  The following patch won't do anything for people building
> RPM or dpkg packages (which have their own automatic configuration
> file handling); this will provide a poor person's config handling
> machinery for people building e2fsprogs and the installing on their
> own local system.
> 

Thanks Ted, 

I verified it works great.

Mingming
> 						- Ted
> 
> From f8e42224f8cc77afd2b2372dc527428072e28519 Mon Sep 17 00:00:00 2001
> From: Theodore Ts'o <tytso@mit.edu>
> Date: Wed, 16 Jul 2008 13:39:32 -0400
> Subject: [PATCH] Add more intelligent handling of the mke2fs.conf installation process
> 
> For people who are compiling mke2fs for their own use outside of a
> package manager, we need to make sure the system /etc/mke2fs.conf is
> sufficiently up-to-date that it won't cause problems, but at the same
> time we don't want to blow away any user-specific customizations.
> 
> So if /etc/mk2fs.conf exists, but does not mention ext4dev, we will
> move it aside to /etc/mke2fs.conf.e2fsprogs-old and then install the
> new mke2fs.conf.  If the /etc/mke2fs.conf file exists but does mention
> ext4dev, we install the new mke2fs.conf file as
> /etc/mke2fs.conf.e2fsprogs-new.  In both we print warning to the user
> so they can manually make any changes as needed.
> 
> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
> ---
>  misc/Makefile.in |   25 ++++++++++++++++++++++++-
>  1 files changed, 24 insertions(+), 1 deletions(-)
> 
> diff --git a/misc/Makefile.in b/misc/Makefile.in
> index a8d1018..a81df8a 100644
> --- a/misc/Makefile.in
> +++ b/misc/Makefile.in
> @@ -343,7 +343,30 @@ install: all $(SMANPAGES) $(UMANPAGES) installdirs
>  		echo "	INSTALL_DATA $(man5dir)/$$i"; \
>  		$(INSTALL_DATA) $$i $(DESTDIR)$(man5dir)/$$i; \
>  	done
> -	@if ! test -f $(DESTDIR)$(root_sysconfdir)/mke2fs.conf; then \
> +	@if test -f $(DESTDIR)$(root_sysconfdir)/mke2fs.conf; then \
> +		if cmp -s $(DESTDIR)$(root_sysconfdir)/mke2fs.conf \
> +			$(srcdir)/mke2fs.conf; then \
> +			true; \
> +		else \
> +			if grep -q ext4dev $(DESTDIR)$(root_sysconfdir)/mke2fs.conf ; then \
> +				echo "	INSTALL_DATA $(root_sysconfdir)/mke2fs.conf.e2fsprogs-new"; \
> +				$(INSTALL_DATA) $(srcdir)/mke2fs.conf \
> +					$(DESTDIR)$(root_sysconfdir)/mke2fs.conf.e2fsprogs-new; \
> +				echo "Warning: installing mke2fs.conf in $(DESTDIR)$(root_sysconfdir)/mke2fs.conf.e2fsprogs-new"; \
> +				echo "Check to see if you need to update your $(root_sysconfdir)/mke2fs.conf"; \
> +			else \
> +				echo "	INSTALL_DATA $(root_sysconfdir)/mke2fs.conf"; \
> +				mv $(DESTDIR)$(root_sysconfdir)/mke2fs.conf \
> +				   $(DESTDIR)$(root_sysconfdir)/mke2fs.conf.e2fsprogs-old; \
> +				$(INSTALL_DATA) $(srcdir)/mke2fs.conf \
> +					$(DESTDIR)$(root_sysconfdir)/mke2fs.conf; \
> +				echo "Your mke2fs.conf is too old.  Backing up old version in"; \
> +				echo "$(DESTDIR)$(root_sysconfdir)/mke2fs.conf.e2fsprogs-old.  Please check to see"; \
> +				echo "if you have any local customizations that you wish to preserve."; \
> +			fi; \
> +			echo " "; \
> +		fi; \
> +	else \
>  		echo "	INSTALL_DATA $(root_sysconfdir)/mke2fs.conf"; \
>  		$(INSTALL_DATA) $(srcdir)/mke2fs.conf \
>  			$(DESTDIR)$(root_sysconfdir)/mke2fs.conf; \

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2008-07-16 18:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-14 19:24 Making it easier for end users to use ext4 Theodore Ts'o
2008-07-14 19:35 ` Eric Sandeen
2008-07-14 19:55   ` Theodore Tso
2008-07-14 21:27     ` Eric Sandeen
     [not found]     ` <1216172323.8292.23.camel@mingming-laptop>
     [not found]       ` <20080716023532.GO8185@mit.edu>
     [not found]         ` <1216227720.6424.7.camel@mingming-laptop>
2008-07-16 17:52           ` [PATCH, RFC] Add more intelligent handling of the mke2fs.conf installation process Theodore Tso
2008-07-16 18:24             ` Mingming Cao [this message]
2008-07-16 21:29             ` Andreas Dilger
2008-07-16 23:08               ` Theodore Tso
2008-07-15  5:22 ` Making it easier for end users to use ext4 Goswin von Brederlow

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=1216232676.6424.18.camel@mingming-laptop \
    --to=cmm@us.ibm.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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