Skip to contentSkip to conversation

Revert "Makefile: ensure CONF_USR_DIR honours the libdir config"

PATCH Applied [email protected] 5 participants 9 messages Nov 6, 2023 – Nov 13, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "Makefile: ensure CONF_USR_DIR honours the libdir config"

From: Luca Boccassi <[email protected]>

LIBDIR in Debian and derivatives is not /usr/lib/, it's /usr/lib/<architecture triplet>/, which is different, and it's the wrong location where to install architecture-independent default configuration files, which should always go to /usr/lib/ instead. Installing these files to the per-architecture directory is not the right thing, hence revert the change.

This reverts commit 946753a4459bd035132a27bb2eb87529c1979b90.

---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index 54539ce4..7d1819ce 100644
@@ -17,7 +17,7 @@ endif
 PREFIX?=/usr
 SBINDIR?=/sbin
 CONF_ETC_DIR?=/etc/iproute2
-CONF_USR_DIR?=$(LIBDIR)/iproute2
+CONF_USR_DIR?=$(PREFIX)/lib/iproute2
 NETNS_RUN_DIR?=/var/run/netns
 NETNS_ETC_DIR?=/etc/netns
 DATADIR?=$(PREFIX)/share
Signature · 1 line
2.39.2
#1 lore raw
Quoted 8 lines · [email protected] writes:

From: Luca Boccassi <[email protected]>

LIBDIR in Debian and derivatives is not /usr/lib/, it's /usr/lib/<architecture triplet>/, which is different, and it's the wrong location where to install architecture-independent default configuration files, which should always go to /usr/lib/ instead. Installing these files to the per-architecture directory is not the right thing, hence revert the change.

So I looked into the Fedora package. Up until recently, the files were in /etc, but it seems there was a deliberate change in the spec file this September that moved them to /usr/lib or /usr/lib64.

Luca -- since you both sent the patch under reversion, and are Fedora maintainer, could you please elaborate on what the logic was behind it? It does look odd to me to put config files into an arch-dependent directory, but I've been out of packaging for close to a decade at this point.

Thanks!

Quoted 20 lines

This reverts commit 946753a4459bd035132a27bb2eb87529c1979b90.

---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index 54539ce4..7d1819ce 100644
@@ -17,7 +17,7 @@ endif
 PREFIX?=/usr
 SBINDIR?=/sbin
 CONF_ETC_DIR?=/etc/iproute2
-CONF_USR_DIR?=$(LIBDIR)/iproute2
+CONF_USR_DIR?=$(PREFIX)/lib/iproute2
 NETNS_RUN_DIR?=/var/run/netns
 NETNS_ETC_DIR?=/etc/netns
 DATADIR?=$(PREFIX)/share
#2 lore raw
Quoted 16 lines · Petr Machata
Quoted 8 lines · [email protected] writes:

From: Luca Boccassi <[email protected]>

LIBDIR in Debian and derivatives is not /usr/lib/, it's /usr/lib/<architecture triplet>/, which is different, and it's the wrong location where to install architecture-independent default configuration files, which should always go to /usr/lib/ instead. Installing these files to the per-architecture directory is not the right thing, hence revert the change.

So I looked into the Fedora package. Up until recently, the files were in /etc, but it seems there was a deliberate change in the spec file this September that moved them to /usr/lib or /usr/lib64.

Quoted 5 lines

Luca -- since you both sent the patch under reversion, and are Fedora maintainer, could you please elaborate on what the logic was behind it? It does look odd to me to put config files into an arch-dependent directory, but I've been out of packaging for close to a decade at this point.

I am not a Fedora maintainer, and an arch-dependent triplet subdirectory is exactly the problem that this patch is fixing.

#3 lore raw
In reply to Petr Machata
Quoted 11 lines · Petr Machata
Quoted 8 lines · [email protected] writes:

From: Luca Boccassi <[email protected]>

LIBDIR in Debian and derivatives is not /usr/lib/, it's /usr/lib/<architecture triplet>/, which is different, and it's the wrong location where to install architecture-independent default configuration files, which should always go to /usr/lib/ instead. Installing these files to the per-architecture directory is not the right thing, hence revert the change.

Quoted 5 lines

So I looked into the Fedora package. Up until recently, the files were in /etc, but it seems there was a deliberate change in the spec file this September that moved them to /usr/lib or /usr/lib64.

Luca -- since you both sent the patch under reversion, and are Fedora

Ugh, I mean Andrea, not Luca. Sorry!

Quoted 4 lines

maintainer, could you please elaborate on what the logic was behind it? It does look odd to me to put config files into an arch-dependent directory, but I've been out of packaging for close to a decade at this point.

#4 lore raw
Quoted 14 lines · Petr Machata
Quoted 11 lines · Petr Machata
Quoted 8 lines · [email protected] writes:

From: Luca Boccassi <[email protected]>

LIBDIR in Debian and derivatives is not /usr/lib/, it's /usr/lib/<architecture triplet>/, which is different, and it's the wrong location where to install architecture-independent default configuration files, which should always go to /usr/lib/ instead. Installing these files to the per-architecture directory is not the right thing, hence revert the change.

Quoted 12 lines
Quoted 5 lines

So I looked into the Fedora package. Up until recently, the files were in /etc, but it seems there was a deliberate change in the spec file this September that moved them to /usr/lib or /usr/lib64.

Luca -- since you both sent the patch under reversion, and are Fedora

Ugh, I mean Andrea, not Luca. Sorry!

Quoted 4 lines

maintainer, could you please elaborate on what the logic was behind it? It does look odd to me to put config files into an arch-dependent directory, but I've been out of packaging for close to a decade at this point.

Hi Petr,
the change in Fedora iproute package is in response to 0a0a8f12fa1b ("Read configuration files from /etc and /usr"): it moves config files from /etc to /usr to make room for customization using /etc/iproute2, as described over there.

What I tried to achieve with my patch is to have a single location in /usr for iproute files; but I agree with both you and Luca that storing config files in an arch-dependent directory doesn't look right.

However, even using /usr/lib doesn't seems quite right to me. According to the FHS [1]:

"/usr/lib includes object files and libraries. On some systems, it may also include internal binaries that are not intended to be executed directly by users or shell scripts."

A better location is probably /usr/share [2]:

"The /usr/share hierarchy is for all read-only architecture independent data files.
This hierarchy is intended to be shareable among all architecture platforms of a given OS; thus, for example, a site with i386, Alpha, and PPC platforms might maintain a single /usr/share directory that is centrally-mounted."

And this is exactly our case: read-only, shareable, config files that can be overridden using /etc/iproute2.

Luca, does something along the lines below work for you? If so, I can test and send a patch fixing my own stuff.

Makefile +2 -2
index 5c559c8d..ec57bd4c 100644
@@ -16,11 +16,11 @@ endif
 
 PREFIX?=/usr
 SBINDIR?=/sbin
+DATADIR?=$(PREFIX)/share
 CONF_ETC_DIR?=/etc/iproute2
-CONF_USR_DIR?=$(LIBDIR)/iproute2
+CONF_USR_DIR?=$(DATADIR)/iproute2
 NETNS_RUN_DIR?=/var/run/netns
 NETNS_ETC_DIR?=/etc/netns
-DATADIR?=$(PREFIX)/share
 HDRDIR?=$(PREFIX)/include/iproute2
 DOCDIR?=$(DATADIR)/doc/iproute2
 MANDIR?=$(DATADIR)/man

[1] https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch04s06.html
[2] https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch04s11.html

#5 lore raw
Quoted 80 lines · Andrea Claudi
Quoted 14 lines · Petr Machata
Quoted 11 lines · Petr Machata
Quoted 8 lines · [email protected] writes:

From: Luca Boccassi <[email protected]>

LIBDIR in Debian and derivatives is not /usr/lib/, it's /usr/lib/<architecture triplet>/, which is different, and it's the wrong location where to install architecture-independent default configuration files, which should always go to /usr/lib/ instead. Installing these files to the per-architecture directory is not the right thing, hence revert the change.

Quoted 12 lines
Quoted 5 lines

So I looked into the Fedora package. Up until recently, the files were in /etc, but it seems there was a deliberate change in the spec file this September that moved them to /usr/lib or /usr/lib64.

Luca -- since you both sent the patch under reversion, and are Fedora

Ugh, I mean Andrea, not Luca. Sorry!

Quoted 4 lines

maintainer, could you please elaborate on what the logic was behind it? It does look odd to me to put config files into an arch-dependent directory, but I've been out of packaging for close to a decade at this point.

Hi Petr,
the change in Fedora iproute package is in response to 0a0a8f12fa1b ("Read configuration files from /etc and /usr"): it moves config files from /etc to /usr to make room for customization using /etc/iproute2, as described over there.

What I tried to achieve with my patch is to have a single location in /usr for iproute files; but I agree with both you and Luca that storing config files in an arch-dependent directory doesn't look right.

However, even using /usr/lib doesn't seems quite right to me. According to the FHS [1]:

"/usr/lib includes object files and libraries. On some systems, it may also include internal binaries that are not intended to be executed directly by users or shell scripts."

A better location is probably /usr/share [2]:

"The /usr/share hierarchy is for all read-only architecture independent data files.
This hierarchy is intended to be shareable among all architecture platforms of a given OS; thus, for example, a site with i386, Alpha, and PPC platforms might maintain a single /usr/share directory that is centrally-mounted."

And this is exactly our case: read-only, shareable, config files that can be overridden using /etc/iproute2.

Luca, does something along the lines below work for you? If so, I can test and send a patch fixing my own stuff.

Makefile +2 -2
index 5c559c8d..ec57bd4c 100644
@@ -16,11 +16,11 @@ endif
 
 PREFIX?=/usr
 SBINDIR?=/sbin
+DATADIR?=$(PREFIX)/share
 CONF_ETC_DIR?=/etc/iproute2
-CONF_USR_DIR?=$(LIBDIR)/iproute2
+CONF_USR_DIR?=$(DATADIR)/iproute2
 NETNS_RUN_DIR?=/var/run/netns
 NETNS_ETC_DIR?=/etc/netns
-DATADIR?=$(PREFIX)/share
 HDRDIR?=$(PREFIX)/include/iproute2
 DOCDIR?=$(DATADIR)/doc/iproute2
 MANDIR?=$(DATADIR)/man
Quoted 2 lines

[1] https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch04s06.html
[2] https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch04s11.html

/usr/lib/ is used for configuration too - all the systemd configs for example are stored there. That said, /usr/share/ works just as well for me, so I don't mind one way or the other.

#6 lore raw
In reply to [email protected]
This patch was applied to iproute2/iproute2.git (main) by Stephen Hemminger <[email protected]>:

Hello:

This patch was applied to iproute2/iproute2.git (main) by Stephen Hemminger <[email protected]>:

Quoted 10 lines · On Mon, 6 Nov 2023 00:14:10 +0000 you wrote:

From: Luca Boccassi <[email protected]>

LIBDIR in Debian and derivatives is not /usr/lib/, it's /usr/lib/<architecture triplet>/, which is different, and it's the wrong location where to install architecture-independent default configuration files, which should always go to /usr/lib/ instead. Installing these files to the per-architecture directory is not the right thing, hence revert the change.

[...]

Here is the summary with links:
- [iproute2] Revert "Makefile: ensure CONF_USR_DIR honours the libdir config"
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=deb66acabe44

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
#7 lore raw
Quoted 15 lines · On Mon, Nov 13, 2023 at 04:40:23PM +0000, [email protected]…

Hello:

This patch was applied to iproute2/iproute2.git (main) by Stephen Hemminger <[email protected]>:

Quoted 9 lines · On Mon, 6 Nov 2023 00:14:10 +0000 you wrote:

From: Luca Boccassi <[email protected]>

LIBDIR in Debian and derivatives is not /usr/lib/, it's /usr/lib/<architecture triplet>/, which is different, and it's the wrong location where to install architecture-independent default configuration files, which should always go to /usr/lib/ instead. Installing these files to the per-architecture directory is not the right thing, hence revert the change.

Quoted 12 lines
Quoted 1 line

[...]

Here is the summary with links:
- [iproute2] Revert "Makefile: ensure CONF_USR_DIR honours the libdir config"
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=deb66acabe44

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Hi Stephen, actually Luca and I agreed on a different solution, see "[PATCH iproute2] Makefile: use /usr/share/iproute2 for config files".

I can rebase that patch on top of this one, if this is ok for you.

Regards,
Andrea

#8 lore raw
Quoted 29 lines · On Mon, 13 Nov 2023 19:12:58 +0100 Andrea Claudi <[email protected]> wrote:
Quoted 15 lines · On Mon, Nov 13, 2023 at 04:40:23PM +0000, [email protected]…

Hello:

This patch was applied to iproute2/iproute2.git (main) by Stephen Hemminger <[email protected]>:

Quoted 9 lines · On Mon, 6 Nov 2023 00:14:10 +0000 you wrote:

From: Luca Boccassi <[email protected]>

LIBDIR in Debian and derivatives is not /usr/lib/, it's /usr/lib/<architecture triplet>/, which is different, and it's the wrong location where to install architecture-independent default configuration files, which should always go to /usr/lib/ instead. Installing these files to the per-architecture directory is not the right thing, hence revert the change.

Quoted 12 lines
Quoted 1 line

[...]

Here is the summary with links:
- [iproute2] Revert "Makefile: ensure CONF_USR_DIR honours the libdir config"
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=deb66acabe44

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
Quoted 8 lines

Hi Stephen, actually Luca and I agreed on a different solution, see "[PATCH iproute2] Makefile: use /usr/share/iproute2 for config files".

I can rebase that patch on top of this one, if this is ok for you.

Regards,
Andrea

Send a new patch please.