diff mbox series

util-linux: use update-alternatives to solve conflicts with lastlog2

Message ID 1724833600-2270-2-git-send-email-wangmy@fujitsu.com
State New
Headers show
Series util-linux: use update-alternatives to solve conflicts with lastlog2 | expand

Commit Message

Mingyu Wang (Fujitsu) Aug. 28, 2024, 8:26 a.m. UTC
From: Wang Mingyu <wangmy@fujitsu.com>

Error: Transaction test error:
  file /usr/bin/lastlog2 conflicts between attempted installs of lastlog2-1.2.0-r0.core2_64 and util-linux-lastlog2-2.40.1-r0.core2_64
  file /usr/lib/security/pam_lastlog2.so conflicts between attempted installs of lastlog2-1.2.0-r0.core2_64 and util-linux-lastlog2-2.40.1-r0.core2_64

lastlog2 also uses the doc '/usr/bin/lastlog2' and '/usr/lib/security/pam_lastlog2.so'.
lastlog2 has a priority of 100.

Signed-off-by: Wang Mingyu <wangmy@fujitsu.com>
---
 meta/recipes-core/util-linux/util-linux_2.40.2.bb | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Alexander Kanavin Aug. 28, 2024, 8:31 a.m. UTC | #1
I don't think this is the right way to resolve the problem. You should
be installing one or the other, but not both.

Alex

On Wed, 28 Aug 2024 at 10:27, wangmy via lists.openembedded.org
<wangmy=fujitsu.com@lists.openembedded.org> wrote:
>
> From: Wang Mingyu <wangmy@fujitsu.com>
>
> Error: Transaction test error:
>   file /usr/bin/lastlog2 conflicts between attempted installs of lastlog2-1.2.0-r0.core2_64 and util-linux-lastlog2-2.40.1-r0.core2_64
>   file /usr/lib/security/pam_lastlog2.so conflicts between attempted installs of lastlog2-1.2.0-r0.core2_64 and util-linux-lastlog2-2.40.1-r0.core2_64
>
> lastlog2 also uses the doc '/usr/bin/lastlog2' and '/usr/lib/security/pam_lastlog2.so'.
> lastlog2 has a priority of 100.
>
> Signed-off-by: Wang Mingyu <wangmy@fujitsu.com>
> ---
>  meta/recipes-core/util-linux/util-linux_2.40.2.bb | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/meta/recipes-core/util-linux/util-linux_2.40.2.bb b/meta/recipes-core/util-linux/util-linux_2.40.2.bb
> index a8e346539a..e21a16ab84 100644
> --- a/meta/recipes-core/util-linux/util-linux_2.40.2.bb
> +++ b/meta/recipes-core/util-linux/util-linux_2.40.2.bb
> @@ -298,6 +298,10 @@ ALTERNATIVE_LINK_NAME[unshare] = "${bindir}/unshare"
>  ALTERNATIVE_LINK_NAME[utmpdump] = "${bindir}/utmpdump"
>  ALTERNATIVE_LINK_NAME[uuidgen] = "${bindir}/uuidgen"
>  ALTERNATIVE_LINK_NAME[wall] = "${bindir}/wall"
> +ALTERNATIVE:${PN}-lastlog2 = "lastlog2 pam_lastlog2"
> +ALTERNATIVE_LINK_NAME[lastlog2] = "${bindir}/lastlog2"
> +ALTERNATIVE_TARGET[pam_lastlog2] = "${libdir}/security/pam_lastlog2.so"
> +ALTERNATIVE_LINK_NAME[pam_lastlog2] = "${libdir}/security/pam_lastlog2.so"
>
>  ALTERNATIVE:${PN}-doc = "\
>  blkid.8 eject.1 findfs.8 fsck.8 kill.1 last.1 lastb.1 libblkid.3 logger.1 mesg.1 \
> --
> 2.34.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#203870): https://lists.openembedded.org/g/openembedded-core/message/203870
> Mute This Topic: https://lists.openembedded.org/mt/108138530/1686489
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Mingyu Wang (Fujitsu) Aug. 28, 2024, 9:04 a.m. UTC | #2
I found that the lastlog2 have been merged into util-linux:
https://github.com/thkukuk/lastlog2/commit/60bea9dcee0fa18ea3dce0372a14f5e4f177ada6

There are two solutions:
1. delete lastlog2
2. Add RCONFLICTS option for control

Which option is better to choose? Or if there are any other better suggestions, please let me know

  --
Best Regards
---------------------------------------------------
Wang Mingyu
FUJITSU NANJING SOFTWARE TECHNOLOGY CO., LTD. (FNST)
No.6 Wenzhu Road, Nanjing, 210012, China
TEL:+86+25-86630566--8568
COINS: 79988548
FAX: +86+25-83317685
MAIL: wangmy@fujitsu.com

> -----Original Message-----
> From: Alexander Kanavin <alex.kanavin@gmail.com>
> Sent: Wednesday, August 28, 2024 4:32 PM
> To: Wang, Mingyu/王 鸣瑜 <wangmy@fujitsu.com>
> Cc: openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core] [PATCH] util-linux: use update-alternatives to solve
> conflicts with lastlog2
> 
> I don't think this is the right way to resolve the problem. You should be installing
> one or the other, but not both.
> 
> Alex
> 
> On Wed, 28 Aug 2024 at 10:27, wangmy via lists.openembedded.org
> <wangmy=fujitsu.com@lists.openembedded.org> wrote:
> >
> > From: Wang Mingyu <wangmy@fujitsu.com>
> >
> > Error: Transaction test error:
> >   file /usr/bin/lastlog2 conflicts between attempted installs of
> lastlog2-1.2.0-r0.core2_64 and util-linux-lastlog2-2.40.1-r0.core2_64
> >   file /usr/lib/security/pam_lastlog2.so conflicts between attempted
> > installs of lastlog2-1.2.0-r0.core2_64 and
> > util-linux-lastlog2-2.40.1-r0.core2_64
> >
> > lastlog2 also uses the doc '/usr/bin/lastlog2' and
> '/usr/lib/security/pam_lastlog2.so'.
> > lastlog2 has a priority of 100.
> >
> > Signed-off-by: Wang Mingyu <wangmy@fujitsu.com>
> > ---
> >  meta/recipes-core/util-linux/util-linux_2.40.2.bb | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/meta/recipes-core/util-linux/util-linux_2.40.2.bb
> > b/meta/recipes-core/util-linux/util-linux_2.40.2.bb
> > index a8e346539a..e21a16ab84 100644
> > --- a/meta/recipes-core/util-linux/util-linux_2.40.2.bb
> > +++ b/meta/recipes-core/util-linux/util-linux_2.40.2.bb
> > @@ -298,6 +298,10 @@ ALTERNATIVE_LINK_NAME[unshare] =
> "${bindir}/unshare"
> >  ALTERNATIVE_LINK_NAME[utmpdump] = "${bindir}/utmpdump"
> >  ALTERNATIVE_LINK_NAME[uuidgen] = "${bindir}/uuidgen"
> >  ALTERNATIVE_LINK_NAME[wall] = "${bindir}/wall"
> > +ALTERNATIVE:${PN}-lastlog2 = "lastlog2 pam_lastlog2"
> > +ALTERNATIVE_LINK_NAME[lastlog2] = "${bindir}/lastlog2"
> > +ALTERNATIVE_TARGET[pam_lastlog2] = "${libdir}/security/pam_lastlog2.so"
> > +ALTERNATIVE_LINK_NAME[pam_lastlog2] =
> "${libdir}/security/pam_lastlog2.so"
> >
> >  ALTERNATIVE:${PN}-doc = "\
> >  blkid.8 eject.1 findfs.8 fsck.8 kill.1 last.1 lastb.1 libblkid.3
> > logger.1 mesg.1 \
> > --
> > 2.34.1
> >
> >
> > -=-=-=-=-=-=-=-=-=-=-=-
> > Links: You receive all messages sent to this group.
> > View/Reply Online (#203870):
> > https://lists.openembedded.org/g/openembedded-core/message/203870
> > Mute This Topic: https://lists.openembedded.org/mt/108138530/1686489
> > Group Owner: openembedded-core+owner@lists.openembedded.org
> > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub
> > [alex.kanavin@gmail.com]
> > -=-=-=-=-=-=-=-=-=-=-=-
> >
Alexander Kanavin Aug. 28, 2024, 9:13 a.m. UTC | #3
On Wed, 28 Aug 2024 at 11:04, Mingyu Wang (Fujitsu) <wangmy@fujitsu.com> wrote:
> I found that the lastlog2 have been merged into util-linux:
> https://github.com/thkukuk/lastlog2/commit/60bea9dcee0fa18ea3dce0372a14f5e4f177ada6
>
> There are two solutions:
> 1. delete lastlog2
> 2. Add RCONFLICTS option for control
>
> Which option is better to choose? Or if there are any other better suggestions, please let me know

Option 1 please. Send a patch to meta-openembedded that deletes the recipe.

Alex
diff mbox series

Patch

diff --git a/meta/recipes-core/util-linux/util-linux_2.40.2.bb b/meta/recipes-core/util-linux/util-linux_2.40.2.bb
index a8e346539a..e21a16ab84 100644
--- a/meta/recipes-core/util-linux/util-linux_2.40.2.bb
+++ b/meta/recipes-core/util-linux/util-linux_2.40.2.bb
@@ -298,6 +298,10 @@  ALTERNATIVE_LINK_NAME[unshare] = "${bindir}/unshare"
 ALTERNATIVE_LINK_NAME[utmpdump] = "${bindir}/utmpdump"
 ALTERNATIVE_LINK_NAME[uuidgen] = "${bindir}/uuidgen"
 ALTERNATIVE_LINK_NAME[wall] = "${bindir}/wall"
+ALTERNATIVE:${PN}-lastlog2 = "lastlog2 pam_lastlog2"
+ALTERNATIVE_LINK_NAME[lastlog2] = "${bindir}/lastlog2"
+ALTERNATIVE_TARGET[pam_lastlog2] = "${libdir}/security/pam_lastlog2.so"
+ALTERNATIVE_LINK_NAME[pam_lastlog2] = "${libdir}/security/pam_lastlog2.so"
 
 ALTERNATIVE:${PN}-doc = "\
 blkid.8 eject.1 findfs.8 fsck.8 kill.1 last.1 lastb.1 libblkid.3 logger.1 mesg.1 \