aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/base-passwd/base-passwd/0006-Make-it-possible-to-build-without-debconf-support.patch
diff options
context:
space:
mode:
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>2022-05-14 23:14:50 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-05-16 23:18:23 +0100
commite7abf63cc8bdc61c8d978b3c21a38e17716fc292 (patch)
treecba057ed001e4dfba4714c5ca44d34627789a04d /meta/recipes-core/base-passwd/base-passwd/0006-Make-it-possible-to-build-without-debconf-support.patch
parent6515d96c12b080b9e7f344799e26dba3b98e17e2 (diff)
downloadopenembedded-core-e7abf63cc8bdc61c8d978b3c21a38e17716fc292.tar.gz
base-passwd: Update to 3.5.52
* Add a patch to allow the use of debconf to be disabled. * Replace 0007-Disable-generation-of-the-documentation.patch with a new patch to disable the generation of the documentation using a configuration option. * Replace 0006-Disable-shell-for-default-users.patch with a sed expression that uses a variable, NOLOGIN, to specify what command to use for users that are not expected to login. This allows to use some other command than "nologin", e.g., "false". Also, by using ${base_sbindir}, it adheres to usrmerge being configured. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/base-passwd/base-passwd/0006-Make-it-possible-to-build-without-debconf-support.patch')
-rw-r--r--meta/recipes-core/base-passwd/base-passwd/0006-Make-it-possible-to-build-without-debconf-support.patch129
1 files changed, 129 insertions, 0 deletions
diff --git a/meta/recipes-core/base-passwd/base-passwd/0006-Make-it-possible-to-build-without-debconf-support.patch b/meta/recipes-core/base-passwd/base-passwd/0006-Make-it-possible-to-build-without-debconf-support.patch
new file mode 100644
index 0000000000..61ed1641a1
--- /dev/null
+++ b/meta/recipes-core/base-passwd/base-passwd/0006-Make-it-possible-to-build-without-debconf-support.patch
@@ -0,0 +1,129 @@
+From 236d6c8c0dd7e15d9a9795813b94bc87ce09eec5 Mon Sep 17 00:00:00 2001
+From: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
+Date: Fri, 29 Apr 2022 19:32:29 +0200
+Subject: [PATCH] Make it possible to build without debconf support
+
+Not all systems have the debconfclient library available.
+
+Upstream-Status: Submitted [https://salsa.debian.org/debian/base-passwd/-/merge_requests/11]
+Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
+---
+ Makefile.am | 1 -
+ configure.ac | 13 +++++++++++++
+ update-passwd.c | 15 +++++++++++++++
+ 3 files changed, 28 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 223916f..4bdd769 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -3,7 +3,6 @@ SUBDIRS = doc man
+ sbin_PROGRAMS = update-passwd
+
+ update_passwd_SOURCES = update-passwd.c
+-update_passwd_LDADD = -ldebconfclient
+
+ pkgdata_DATA = passwd.master group.master
+
+diff --git a/configure.ac b/configure.ac
+index 9d1ace5..1e35ad1 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -14,6 +14,19 @@ AC_SYS_LARGEFILE
+ dnl Scan for things we need
+ AC_CHECK_FUNCS([putgrent])
+
++dnl Check for debconf
++AC_MSG_CHECKING([whether to enable debconf support])
++AC_ARG_ENABLE([debconf],
++ [AS_HELP_STRING([--disable-debconf], [disable support for debconf])],
++ [],
++ [enable_debconf=yes])
++AC_MSG_RESULT($enable_debconf)
++AS_IF([test "x$enable_debconf" != xno],
++ [AC_CHECK_LIB([debconfclient], [debconfclient_new], [],
++ [AC_MSG_ERROR(
++ [debconf support not available (use --disable-debconf to disable)])])
++ AC_DEFINE([HAVE_DEBCONF], [1], [Define if you have libdebconfclient])])
++
+ dnl Finally output everything
+ AC_CONFIG_FILES([Makefile doc/Makefile man/Makefile])
+ AC_OUTPUT
+diff --git a/update-passwd.c b/update-passwd.c
+index 3f3dffa..5b49740 100644
+--- a/update-passwd.c
++++ b/update-passwd.c
+@@ -39,7 +39,9 @@
+ #include <stdarg.h>
+ #include <ctype.h>
+
++#ifdef HAVE_DEBCONF
+ #include <cdebconf/debconfclient.h>
++#endif
+
+ #define DEFAULT_PASSWD_MASTER "/usr/share/base-passwd/passwd.master"
+ #define DEFAULT_GROUP_MASTER "/usr/share/base-passwd/group.master"
+@@ -143,6 +145,7 @@ int flag_debconf = 0;
+ const char* user_domain = DEFAULT_DEBCONF_DOMAIN;
+ const char* group_domain = DEFAULT_DEBCONF_DOMAIN;
+
++#ifdef HAVE_DEBCONF
+ struct debconfclient* debconf = NULL;
+
+ /* Abort the program if talking to debconf fails. Use ret exactly once. */
+@@ -162,6 +165,10 @@ struct debconfclient* debconf = NULL;
+ DEBCONF_CHECK(debconf_register(debconf, (template), (question)))
+ #define DEBCONF_SUBST(question, var, value) \
+ DEBCONF_CHECK(debconf_subst(debconf, (question), (var), (value)))
++#else
++#define DEBCONF_REGISTER(template, question)
++#define DEBCONF_SUBST(question, var, value)
++#endif
+
+
+ /* malloc() with out-of-memory checking.
+@@ -621,6 +628,7 @@ void version() {
+ * flag. Aborts the problem on any failure.
+ */
+ int ask_debconf(const char* priority, const char* question) {
++#ifdef HAVE_DEBCONF
+ int ret;
+ const char* response;
+
+@@ -640,6 +648,9 @@ int ask_debconf(const char* priority, const char* question) {
+ return 1;
+ else
+ return 0;
++#else
++ return 0;
++#endif
+ }
+
+
+@@ -1427,6 +1438,7 @@ int main(int argc, char** argv) {
+ /* If DEBIAN_HAS_FRONTEND is set in the environment, we're running under
+ * debconf. Enable debconf prompting unless --dry-run was also given.
+ */
++#ifdef HAVE_DEBCONF
+ if (getenv("DEBIAN_HAS_FRONTEND")!=NULL && !opt_dryrun) {
+ debconf=debconfclient_new();
+ if (debconf==NULL) {
+@@ -1435,6 +1447,7 @@ int main(int argc, char** argv) {
+ }
+ flag_debconf=1;
+ }
++#endif
+
+ if (read_passwd(&master_accounts, master_passwd)!=0)
+ return 2;
+@@ -1480,8 +1493,10 @@ int main(int argc, char** argv) {
+ if (!unlock_files())
+ return 5;
+
++#ifdef HAVE_DEBCONF
+ if (debconf!=NULL)
+ debconfclient_delete(debconf);
++#endif
+
+ if (opt_dryrun)
+ return flag_dirty;