diff mbox series

[meta-oe] mariadb: Move useradd handling in target side of the recipe

Message ID 20240209111815.1901401-1-yoann.congal@smile.fr
State Accepted
Headers show
Series [meta-oe] mariadb: Move useradd handling in target side of the recipe | expand

Commit Message

Yoann Congal Feb. 9, 2024, 11:18 a.m. UTC
Having useradd class inherited for the -native recipe makes no sense and
emit this kind of warning during reproducibility test:
  stdio: WARNING: QA Issue: mariadb-native: native/nativesdk class is not inherited last, this can result in unexpected behaviour. Classes inherited after native/nativesdk: useradd-staticids.bbclass [native-last]

So, move the useradd inherit and associated variables to the target side
of the recipe.

Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
---
Tested target ptest OK but could not find a -native test.
---
 meta-oe/recipes-dbs/mysql/mariadb.inc        | 6 +-----
 meta-oe/recipes-dbs/mysql/mariadb_10.11.6.bb | 6 ++++++
 2 files changed, 7 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/meta-oe/recipes-dbs/mysql/mariadb.inc b/meta-oe/recipes-dbs/mysql/mariadb.inc
index 7e6ef42bc..25dc15b46 100644
--- a/meta-oe/recipes-dbs/mysql/mariadb.inc
+++ b/meta-oe/recipes-dbs/mysql/mariadb.inc
@@ -33,7 +33,7 @@  S = "${WORKDIR}/mariadb-${PV}"
 
 BINCONFIG_GLOB = "mysql_config"
 
-inherit cmake gettext binconfig update-rc.d useradd systemd multilib_script pkgconfig
+inherit cmake gettext binconfig update-rc.d systemd multilib_script pkgconfig
 
 MULTILIB_SCRIPTS = "${PN}-server:${bindir}/mariadbd-safe \
                     ${PN}-setupdb:${bindir}/mariadb-install-db"
@@ -42,10 +42,6 @@  INITSCRIPT_PACKAGES = "${PN}-server ${PN}-setupdb"
 INITSCRIPT_NAME:${PN}-server = "mysqld"
 INITSCRIPT_PARAMS:${PN}-server ?= "start 45 5 . stop 45 0 6 1 ."
 
-USERADD_PACKAGES = "${PN}-setupdb"
-USERADD_PARAM:${PN}-setupdb = "--system --home-dir /var/mysql -g mysql --shell /bin/false mysql"
-GROUPADD_PARAM:${PN}-setupdb = "--system mysql"
-
 INITSCRIPT_NAME:${PN}-setupdb = "install_db"
 INITSCRIPT_PARAMS:${PN}-setupdb ?= "defaults 44 44"
 
diff --git a/meta-oe/recipes-dbs/mysql/mariadb_10.11.6.bb b/meta-oe/recipes-dbs/mysql/mariadb_10.11.6.bb
index a4498fa44..b1d1355e2 100644
--- a/meta-oe/recipes-dbs/mysql/mariadb_10.11.6.bb
+++ b/meta-oe/recipes-dbs/mysql/mariadb_10.11.6.bb
@@ -1,6 +1,8 @@ 
 require mariadb.inc
 
 inherit ptest
+inherit useradd
+
 SRC_URI += "${@bb.utils.contains('PTEST_ENABLED', '1', 'file://run-ptest', '', d)}"
 DEPENDS += "${@bb.utils.contains('PTEST_ENABLED', '1', 'rsync-native', '', d)}"
 RDEPENDS:${PN}-ptest += "cmake sed perl-module-test-more"
@@ -36,6 +38,10 @@  DEPENDS += "mariadb-native bison-native boost libpcre2 curl ncurses \
 
 PROVIDES += "mysql5 libmysqlclient"
 
+USERADD_PACKAGES = "${PN}-setupdb"
+USERADD_PARAM:${PN}-setupdb = "--system --home-dir /var/mysql -g mysql --shell /bin/false mysql"
+GROUPADD_PARAM:${PN}-setupdb = "--system mysql"
+
 RPROVIDES:${PN} += "mysql5"
 RREPLACES:${PN} += "mysql5"
 RCONFLICTS:${PN} += "mysql5"