Skip to contentSkip to conversation

introduce BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS

PATCH New Carlos Santos 3 participants 12 messages Jul 7, 2017

lore
Share & tools
lore
#0 lore raw

cover introduce BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS

Several packages that depend on linux-pam need to repeat the same dependency list in their Config.in files. This series introduces a hidden boolean option, BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS, which help us to avoid such repetition.

Carlos Santos (7):
linux-pam: introduce BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS
nodm: use BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS
openvmtools: use BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS
python-pam: use BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS
rsh-redone: use BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS
sudo: use BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS
util-linux: use BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS

 package/linux-pam/Config.in   | 18 ++++++++++++++----
 package/nodm/Config.in        |  8 ++------
 package/openvmtools/Config.in |  7 ++-----
 package/python-pam/Config.in  |  9 ++-------
 package/rsh-redone/Config.in  | 16 ++++------------
 package/sudo/Config.in        |  7 +++++--
 package/util-linux/Config.in  | 16 ++++------------
 7 files changed, 33 insertions(+), 48 deletions(-)
Signature · 1 line
2.9.4
#1 lore raw

PATCH 1/7 linux-pam: introduce BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS

This will allow us to use the hidden option in dependent packages, instead of repeating the dependencies in each Config.in file.

---
 package/linux-pam/Config.in | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)
package/linux-pam/Config.in +14 -4
index 33e5154..0daffe4 100644
@@ -1,9 +1,20 @@
-config BR2_PACKAGE_LINUX_PAM
-	bool "linux-pam"
+# Use this option instead of duplicating the dependencies in each
+# dependent package.
+#
+# If you change these dependencies then update the comment below
+# and the # corresponding ones in other Config.in files.
+#
+config BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS
+	bool
+	default y
 	depends on (BR2_ENABLE_LOCALE && BR2_USE_WCHAR)
 	depends on !BR2_STATIC_LIBS
 	depends on !BR2_TOOLCHAIN_USES_MUSL
 	depends on BR2_USE_MMU # fork()
+
+config BR2_PACKAGE_LINUX_PAM
+	bool "linux-pam"
+	depends on BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS
 	select BR2_PACKAGE_FLEX
 	help
 	  A Security Framework that Provides Authentication for Applications
@@ -11,5 +22,4 @@ config BR2_PACKAGE_LINUX_PAM
 	  http://linux-pam.org
 
 comment "linux-pam needs a uClibc or glibc toolchain w/ wchar, locale, dynamic library"
-	depends on !(BR2_ENABLE_LOCALE && BR2_USE_WCHAR) \
-		|| BR2_STATIC_LIBS || BR2_TOOLCHAIN_USES_MUSL
+	depends on !BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS
Signature · 1 line
2.9.4
#2 lore raw

PATCH 1/7 linux-pam: introduce BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS

Hi Carlos,

Quoted 18 lines · Carlos Santos

This will allow us to use the hidden option in dependent packages, instead of repeating the dependencies in each Config.in file.

---
 package/linux-pam/Config.in | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)
package/linux-pam/Config.in +3 -2
index 33e5154..0daffe4 100644
@@ -1,9 +1,20 @@
-config BR2_PACKAGE_LINUX_PAM
-	bool "linux-pam"
+# Use this option instead of duplicating the dependencies in each
+# dependent package.
+#

package/linux-pam/Config.in line 13

Quoted 10 lines
package/linux-pam/Config.in +6 -0
+# If you change these dependencies then update the comment below
+# and the # corresponding ones in other Config.in files.
+#
+config BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS
+	bool
+	default y
 	depends on (BR2_ENABLE_LOCALE && BR2_USE_WCHAR)
 	depends on !BR2_STATIC_LIBS
 	depends on !BR2_TOOLCHAIN_USES_MUSL
 	depends on BR2_USE_MMU # fork()

These are feature dependencies, not arch dependencies, so the config name is misleading. But regardless of that, we want to see this list in all dependent packages, IMO. This allows us to (more) easily see and grep for direct and indirect dependencies. It also makes dependencies comments easier to maintain as you noted.

baruch

Quoted 14 lines
package/linux-pam/Config.in +5 -2
+
+config BR2_PACKAGE_LINUX_PAM
+	bool "linux-pam"
+	depends on BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS
 	select BR2_PACKAGE_FLEX
 	help
 	  A Security Framework that Provides Authentication for Applications
@@ -11,5 +22,4 @@ config BR2_PACKAGE_LINUX_PAM
 	  http://linux-pam.org
 
 comment "linux-pam needs a uClibc or glibc toolchain w/ wchar, locale, dynamic library"
-	depends on !(BR2_ENABLE_LOCALE && BR2_USE_WCHAR) \
-		|| BR2_STATIC_LIBS || BR2_TOOLCHAIN_USES_MUSL
+	depends on !BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS
Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
#3 lore raw

PATCH 1/7 linux-pam: introduce BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS

Hello,

Quoted 18 lines · Baruch Siach
Quoted 18 lines
package/linux-pam/Config.in +9 -2
index 33e5154..0daffe4 100644
@@ -1,9 +1,20 @@
-config BR2_PACKAGE_LINUX_PAM
-	bool "linux-pam"
+# Use this option instead of duplicating the dependencies in each
+# dependent package.
+#
+# If you change these dependencies then update the comment below
+# and the # corresponding ones in other Config.in files.
+#
+config BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS
+	bool
+	default y
 	depends on (BR2_ENABLE_LOCALE && BR2_USE_WCHAR)
 	depends on !BR2_STATIC_LIBS
Quoted 8 lines

package/linux-pam/Config.in line 13

Quoted 2 lines
package/linux-pam/Config.in +0 -0
 	depends on !BR2_TOOLCHAIN_USES_MUSL
 	depends on BR2_USE_MMU # fork()  

These are feature dependencies, not arch dependencies, so the config name is misleading. But regardless of that, we want to see this list in all dependent packages, IMO. This allows us to (more) easily see and grep for direct and indirect dependencies. It also makes dependencies comments easier to maintain as you noted.

Correct: the <foo>_ARCH_SUPPORTS hidden options should really only be used for architecture dependencies. So in the list above, that would be just BR2_USE_MMU. All the other dependencies are *not* architecture dependencies, and we want to repeat them explicitly, because each package anyway needs to have a Config.in comment that tells the user about such toolchain dependencies.

Therefore, I'm afraid the patch series is not correct :/

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#4 lore raw

PATCH 1/7 linux-pam: introduce BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS

Quoted 6 lines

To: "Baruch Siach" <[email protected]>
Cc: "Carlos Santos" <[email protected]>, "Karoly Kasza" <[email protected]>, "Ezequiel Garcia" <[email protected]>, buildroot at buildroot.org
Sent: Friday, July 7, 2017 4:50:35 AM
Subject: Re: [Buildroot] [PATCH 1/7] linux-pam: introduce BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS

Quoted 30 lines

Hello,

Quoted 26 lines · Baruch Siach
Quoted 10 lines
package/linux-pam/Config.in +3 -2
index 33e5154..0daffe4 100644
@@ -1,9 +1,20 @@
-config BR2_PACKAGE_LINUX_PAM
-	bool "linux-pam"
+# Use this option instead of duplicating the dependencies in each
+# dependent package.
+#

package/linux-pam/Config.in line 13

Quoted 10 lines
package/linux-pam/Config.in +6 -0
+# If you change these dependencies then update the comment below
+# and the # corresponding ones in other Config.in files.
+#
+config BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS
+	bool
+	default y
 	depends on (BR2_ENABLE_LOCALE && BR2_USE_WCHAR)
 	depends on !BR2_STATIC_LIBS
 	depends on !BR2_TOOLCHAIN_USES_MUSL
 	depends on BR2_USE_MMU # fork()

These are feature dependencies, not arch dependencies, so the config name is misleading. But regardless of that, we want to see this list in all dependent packages, IMO. This allows us to (more) easily see and grep for direct and indirect dependencies. It also makes dependencies comments easier to maintain as you noted.

How would repeating the list in all dependent packages make dependencies comments *easier* to maintain? I didn't meant to say that.

Quoted 6 lines

Correct: the <foo>_ARCH_SUPPORTS hidden options should really only be used for architecture dependencies. So in the list above, that would be just BR2_USE_MMU. All the other dependencies are *not* architecture dependencies, and we want to repeat them explicitly, because each package anyway needs to have a Config.in comment that tells the user about such toolchain dependencies.

What could be used instead of <foo>_ARCH_SUPPORTS in cases like this?

Signature · 4 lines
Carlos Santos (Casantos) - DATACOM, P&D
?The greatest triumph that modern PR can offer is the transcendent 
success of having your words and actions judged by your reputation, 
rather than the other way about.? ? Christopher Hitchens
#5 lore raw

PATCH 1/7 linux-pam: introduce BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS

Hello,

Quoted 8 lines · Carlos Santos
Quoted 5 lines
Quoted 5 lines

These are feature dependencies, not arch dependencies, so the config name is misleading. But regardless of that, we want to see this list in all dependent packages, IMO. This allows us to (more) easily see and grep for direct and indirect dependencies. It also makes dependencies comments easier to maintain as you noted.

How would repeating the list in all dependent packages make dependencies comments *easier* to maintain? I didn't meant to say that.

It makes maintaining the comments easier to maintain, because they are always next to the list of dependencies, in the same Config.in file.

With your patches, to know what the Config.in comment in package/nodm/Config.in should be, you need to recursively look into package/linux-pam/Config.in to find what BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS actually means.

Quoted 8 lines
Quoted 6 lines

Correct: the <foo>_ARCH_SUPPORTS hidden options should really only be used for architecture dependencies. So in the list above, that would be just BR2_USE_MMU. All the other dependencies are *not* architecture dependencies, and we want to repeat them explicitly, because each package anyway needs to have a Config.in comment that tells the user about such toolchain dependencies.

What could be used instead of <foo>_ARCH_SUPPORTS in cases like this?

I don't think we want to change how things are done today. Since we anyway wants to have this Config.in comment that details what the dependencies are, I believe keeping the full list of dependencies is the most reasonable solution.

Yes, it's not perfect, but we simply work within the limitations of kconfig.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#6 lore raw

PATCH 2/7 nodm: use BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS

In reply to Carlos Santos

Do not repeat linux-pam dependencies.

---
 package/nodm/Config.in | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
package/nodm/Config.in +2 -6
index 38171e8..038b1fd 100644
@@ -1,10 +1,7 @@
 config BR2_PACKAGE_NODM
 	bool "nodm"
 	depends on BR2_PACKAGE_XORG7
-	depends on (BR2_ENABLE_LOCALE && BR2_USE_WCHAR) # linux-pam
-	depends on !BR2_STATIC_LIBS # linux-pam
-	depends on !BR2_TOOLCHAIN_USES_MUSL # linux-pam
-	depends on BR2_USE_MMU # linux-pam
+	depends on BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS
 	select BR2_PACKAGE_XLIB_LIBX11
 	select BR2_PACKAGE_LINUX_PAM
 	help
@@ -20,5 +17,4 @@ config BR2_PACKAGE_NODM
 
 comment "nodm needs a glibc or uClibc toolchain w/ wchar, locale, dynamic library"
 	depends on BR2_PACKAGE_XORG7
-	depends on !(BR2_ENABLE_LOCALE && BR2_USE_WCHAR) \
-		|| BR2_STATIC_LIBS || BR2_TOOLCHAIN_USES_MUSL
+	depends on !BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS
Signature · 1 line
2.9.4
#7 lore raw

PATCH 3/7 openvmtools: use BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS

In reply to Carlos Santos

Do not repeat linux-pam dependencies.

---
 package/openvmtools/Config.in | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
package/openvmtools/Config.in +2 -5
index f76bdf2..d0bb27c 100644
@@ -33,16 +33,13 @@ comment "procps support needs BR2_PACKAGE_BUSYBOX_SHOW_OTHERS"
 
 config BR2_PACKAGE_OPENVMTOOLS_PAM
 	bool "PAM support"
-	# linux-pam needs locale and wchar, but we already have this
-	# dependency on the main symbol, above.
-	depends on !BR2_STATIC_LIBS
-	depends on !BR2_TOOLCHAIN_USES_MUSL # linux-pam
+	depends on BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS
 	select BR2_PACKAGE_LINUX_PAM
 	help
 	  Support for PAM in openvmtools
 
 comment "PAM support needs a glibc toolchain w/ dynamic library"
-	depends on BR2_STATIC_LIBS || BR2_TOOLCHAIN_USES_MUSL
+	depends on !BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS
 
 endif
 
Signature · 1 line
2.9.4
#8 lore raw

PATCH 4/7 python-pam: use BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS

In reply to Carlos Santos

Do not repeat linux-pam dependencies.

---
 package/python-pam/Config.in | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
package/python-pam/Config.in +2 -7
index 02865d0..366492b 100644
@@ -1,16 +1,11 @@
 comment "python-pam needs a uClibc or glibc toolchain w/ wchar, locale, dynamic library"
 	depends on BR2_PACKAGE_PYTHON
-	depends on !BR2_ENABLE_LOCALE || !BR2_USE_WCHAR || BR2_STATIC_LIBS || \
-		BR2_TOOLCHAIN_USES_MUSL
+	depends on !BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS
 
 config BR2_PACKAGE_PYTHON_PAM
 	bool "python-pam"
 	depends on BR2_PACKAGE_PYTHON # C extension not compatible with python3
-	depends on BR2_ENABLE_LOCALE # linux-pam
-	depends on BR2_USE_WCHAR # linux-pam
-	depends on BR2_USE_MMU # linux-pam
-	depends on !BR2_STATIC_LIBS # linux-pam
-	depends on !BR2_TOOLCHAIN_USES_MUSL # linux-pam
+	depends on BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS
 	select BR2_PACKAGE_LINUX_PAM
 	help
 	  PAM (Pluggable Authentication Module) bindings for Python.
Signature · 1 line
2.9.4
#9 lore raw

PATCH 5/7 rsh-redone: use BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS

In reply to Carlos Santos

Do not repeat linux-pam dependencies.

---
 package/rsh-redone/Config.in | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)
package/rsh-redone/Config.in +4 -12
index 6a8aec0..4042f39 100644
@@ -14,29 +14,21 @@ config BR2_PACKAGE_RSH_REDONE_RLOGIN
 
 config BR2_PACKAGE_RSH_REDONE_RLOGIND
 	bool "rlogind"
-	depends on !BR2_STATIC_LIBS
-	depends on BR2_ENABLE_LOCALE && BR2_USE_WCHAR
-	depends on !BR2_TOOLCHAIN_USES_MUSL # linux-pam
-	depends on BR2_USE_MMU # linux-pam
+	depends on BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS
 	select BR2_PACKAGE_LINUX_PAM
 
 comment "rlogind needs a uClibc or glibc toolchain w/ wchar, locale, dynamic library"
-	depends on !(BR2_ENABLE_LOCALE && BR2_USE_WCHAR) \
-		|| BR2_STATIC_LIBS || BR2_TOOLCHAIN_USES_MUSL
+	depends on !BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS
 
 config BR2_PACKAGE_RSH_REDONE_RSH
 	bool "rsh"
 
 config BR2_PACKAGE_RSH_REDONE_RSHD
 	bool "rshd"
-	depends on BR2_ENABLE_LOCALE && BR2_USE_WCHAR
-	depends on !BR2_STATIC_LIBS
-	depends on !BR2_TOOLCHAIN_USES_MUSL # linux-pam
-	depends on BR2_USE_MMU # linux-pam
+	depends on BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS
 	select BR2_PACKAGE_LINUX_PAM
 
 comment "rshd needs a uClibc or glibc toolchain w/ wchar, locale, dynamic library"
-	depends on !(BR2_ENABLE_LOCALE && BR2_USE_WCHAR) \
-		|| BR2_STATIC_LIBS || BR2_TOOLCHAIN_USES_MUSL
+	depends on !BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS
 
 endif
Signature · 1 line
2.9.4
#10 lore raw

PATCH 6/7 sudo: use BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS

In reply to Carlos Santos

Do not repeat linux-pam dependencies.

---
 package/sudo/Config.in | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
package/sudo/Config.in +5 -2
index cbef15d..a604848 100644
@@ -1,7 +1,7 @@
 config BR2_PACKAGE_SUDO
 	bool "sudo"
-	# uses fork()
-	depends on BR2_USE_MMU
+	depends on BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS
+	select BR2_PACKAGE_LINUX_PAM
 	help
 	  Sudo is a program designed to allow a sysadmin to give
 	  limited root privileges to users and log root activity. The
@@ -9,3 +9,6 @@ config BR2_PACKAGE_SUDO
 	  but still allow people to get their work done.
 
 	  http://www.sudo.ws/sudo/
+
+comment "sudo needs a uClibc or glibc toolchain w/ wchar, locale, dynamic library"
+	depends on !BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS
Signature · 1 line
2.9.4
#11 lore raw

PATCH 7/7 util-linux: use BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS

In reply to Carlos Santos

Do not repeat linux-pam dependencies.

---
 package/util-linux/Config.in | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)
package/util-linux/Config.in +4 -12
index cba590c..858f523 100644
@@ -82,17 +82,13 @@ config BR2_PACKAGE_UTIL_LINUX_CAL
 
 config BR2_PACKAGE_UTIL_LINUX_CHFN_CHSH
 	bool "chfn/chsh"
-	depends on (BR2_ENABLE_LOCALE && BR2_USE_WCHAR) # linux-pam
-	depends on !BR2_STATIC_LIBS
-	depends on !BR2_TOOLCHAIN_USES_MUSL # linux-pam
-	depends on BR2_USE_MMU # linux-pam
+	depends on BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS
 	select BR2_PACKAGE_LINUX_PAM
 	help
 	  Change login shell, real user name and information
 
 comment "chfn/chsh needs a uClibc or glibc toolchain w/ wchar, locale, dynamic library"
-	depends on !(BR2_ENABLE_LOCALE && BR2_USE_WCHAR) \
-		|| BR2_STATIC_LIBS || BR2_TOOLCHAIN_USES_MUSL
+	depends on !BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS
 
 config BR2_PACKAGE_UTIL_LINUX_CHMEM
 	bool "chmem"
@@ -167,17 +163,13 @@ config BR2_PACKAGE_UTIL_LINUX_LINE
 config BR2_PACKAGE_UTIL_LINUX_LOGIN_UTILS
 	bool "login utilities"
 	depends on BR2_USE_MMU # fork() (login, runuser, su, sulogin)
-	depends on (BR2_ENABLE_LOCALE && BR2_USE_WCHAR) # linux-pam
-	depends on !BR2_STATIC_LIBS
-	depends on !BR2_TOOLCHAIN_USES_MUSL # linux-pam
-	depends on BR2_USE_MMU # linux-pam
+	depends on BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS
 	select BR2_PACKAGE_LINUX_PAM
 	help
 	  Login utilities (last, login, runuser, su, sulogin)
 
 comment "login utilities needs a uClibc or glibc toolchain w/ wchar, locale, dynamic library"
-	depends on !(BR2_ENABLE_LOCALE && BR2_USE_WCHAR) \
-		|| BR2_STATIC_LIBS || BR2_TOOLCHAIN_USES_MUSL
+	depends on !BR2_PACKAGE_LINUX_PAM_ARCH_SUPPORTS
 
 config BR2_PACKAGE_UTIL_LINUX_LOGGER
 	bool "logger"
Signature · 1 line
2.9.4