From: Jim Meyering <jim@meyering.net>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] gfs2-utils "make install" failure and fix
Date: Mon, 29 Jun 2009 15:26:56 +0200 [thread overview]
Message-ID: <87hbxzrx0f.fsf@meyering.net> (raw)
In-Reply-To: <1246268330.25867.25.camel@cerberus.int.fabbione.net> (Fabio M. Di Nitto's message of "Mon, 29 Jun 2009 11:38:50 +0200")
Fabio M. Di Nitto wrote:
> On Mon, 2009-06-29 at 11:24 +0200, Jim Meyering wrote:
>> With an explicit --prefix, "make install" would install into /sbin regardless:
>>
>> $ ./configure --prefix=/p/p/coro
>> ...
>> $ make install
>> make[1]: Entering directory `/h/meyering/w/co/gfs2-utils/gfs2/mkfs'
>> /p/bin/install -c -d /sbin
>> make[1]: Nothing to be done for `install-data-am'.
>> /p/bin/install -c -m 755 mkfs.gfs2 /sbin
>> /p/bin/install: cannot create regular file `/sbin/mkfs.gfs2': Permission denied
>> make[1]: *** [install-exec-local] Error 1
>> make[1]: Leaving directory `/h/meyering/w/co/gfs2-utils/gfs2/mkfs'
>> make: *** [install-am] Error 2
>>
>> Along the way I noticed the Makefile.am files
>> were using noinst_PROGRAMS and adding their own install rules.
>> It's easier/cleaner/etc. to use sbin_PROGRAMS.
>> Here's the patch:
>>
>> >From d794b4e7948741f5d6767970a2fde2c5fce15947 Mon Sep 17 00:00:00 2001
>> From: Jim Meyering <meyering@redhat.com>
>> Date: Mon, 29 Jun 2009 11:23:09 +0200
>> Subject: [PATCH gfs2-utils] Use automake's sbin_PROGRAMS, rather than writing our own rules.
>>
>> This also fixes a "make install" failure to honor --prefix.
>> * gfs2/mount/Makefile.am (sbin_PROGRAMS): Use sbin_PROGRAMS,
>> not noinst_PROGRAMS.
>> (install-exec-local, uninstall-local): Remove rules.
>> Automake automates this when you define sbin_PROGRAMS.
>> * gfs2/fsck/Makefile.am (sbin_PROGRAMS): Likewise.
>> (install-exec-local, uninstall-local): Remove rules.
>> * gfs2/mkfs/Makefile.am (sbin_PROGRAMS): Likewise.
>> (install-exec-local, uninstall-local): Remove rules.
>> (install-exec-hook, uninstall-hook): Remove unnecessary sub-shells.
>> ---
>> gfs2/fsck/Makefile.am | 10 +---------
>> gfs2/mkfs/Makefile.am | 16 ++++------------
>> gfs2/mount/Makefile.am | 10 +---------
>> 3 files changed, 6 insertions(+), 30 deletions(-)
>
> This is the same problem we discussed in another occasion (can't
> remember which one).
>
> Those 3 binaries need to go in /sbin. mount(8) looks for mount helpers
> only in /sbin. Without the helper we fail to mount gfs2 or /usr could be
> on a gfs2 filesystem.. chicken egg?
>
> sbin_PROGRAM will install them in /usr/sbin that is not correct (in the
> default case of course). All distro ship fsck* and mkfs* also in /sbin
> in order to check the filesystem (without /usr mounted) or reformat
> (same reason).
>
> Handling of prefix can be better I agree, but turning them into
> sbin_PROGRAM doesn't work either.
>
> Clearly I am open to any better solution than the one I have in place...
Sure.
There's already so much default-munging going on in configure.ac,
why not add a tiny bit more.
This incremental patch does what you seem to want:
In case we're using the default (/usr) prefix
and the default exec_prefix, and set sbindir to /sbin:
diff --git a/configure.ac b/configure.ac
index a568463..ca0301e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -38,6 +38,7 @@ fi
case $exec_prefix in
NONE) exec_prefix=$prefix;;
+ test "$prefix:$sbindir" = '/usr:${exec_prefix}/sbin' && sbindir=/sbin
prefix) exec_prefix=$prefix;;
esac
next prev parent reply other threads:[~2009-06-29 13:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-29 9:24 [Cluster-devel] gfs2-utils "make install" failure and fix Jim Meyering
2009-06-29 9:38 ` Fabio M. Di Nitto
2009-06-29 13:26 ` Jim Meyering [this message]
2009-06-29 13:30 ` Fabio M. Di Nitto
2009-06-29 15:17 ` Jim Meyering
2009-06-29 16:27 ` Fabio M. Di Nitto
2009-08-05 11:55 ` [Cluster-devel] [patch] remove description for non existed option in man page Masatake YAMATO
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=87hbxzrx0f.fsf@meyering.net \
--to=jim@meyering.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.