diff mbox series

[styhead,12/18] shadow: use update-alternatives to handle groups.1

Message ID 822d70b7ccc2e5922de99a7703ec7eb3f814e29f.1732680538.git.steve@sakoman.com
State New
Headers show
Series [styhead,01/18] cve-check: do not skip cve status description after : | expand

Commit Message

Steve Sakoman Nov. 27, 2024, 4:11 a.m. UTC
From: Chen Qi <Qi.Chen@windriver.com>

This patch fixes the following error at do_rootfs:

  update-alternatives: Error: not linking /PATH/TO/rootfs/usr/share
  /man/man1/groups.1 to /usr/share/man/man1/groups.1.coreutils since
  /PATH/TO/rootfs/usr/share/man/man1/groups.1 exists and is not a link

The problem can be reproduced by adding the following lines to local.conf
and then building an image:

  EXTRA_IMAGE_FEATURES:append = " doc-pkgs"
  IMAGE_INSTALL:append = " shadow coreutils"

groups.1 is handled by update-alternatives in coreutils recipe, so
do it in shadow recipe too.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 78c8eb60097df2e16c699464c39ff9142fc1ae69)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
---
 meta/recipes-extended/shadow/shadow.inc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/recipes-extended/shadow/shadow.inc b/meta/recipes-extended/shadow/shadow.inc
index b5e77b9874..171d6e27c3 100644
--- a/meta/recipes-extended/shadow/shadow.inc
+++ b/meta/recipes-extended/shadow/shadow.inc
@@ -200,9 +200,10 @@  ALTERNATIVE_LINK_NAME[vipw] = "${base_sbindir}/vipw"
 ALTERNATIVE_LINK_NAME[vigr] = "${base_sbindir}/vigr"
 ALTERNATIVE_LINK_NAME[nologin] = "${base_sbindir}/nologin"
 
-ALTERNATIVE:${PN}-doc = "chfn.1 chsh.1"
+ALTERNATIVE:${PN}-doc = "chfn.1 chsh.1 groups.1"
 ALTERNATIVE_LINK_NAME[chfn.1] = "${mandir}/man1/chfn.1"
 ALTERNATIVE_LINK_NAME[chsh.1] = "${mandir}/man1/chsh.1"
+ALTERNATIVE_LINK_NAME[groups.1] = "${mandir}/man1/groups.1"
 
 ALTERNATIVE:${PN}-base = "newgrp groups login su"
 ALTERNATIVE_LINK_NAME[login] = "${base_bindir}/login"