Skip to contentSkip to conversation

explanation for ALTERNATIVE_LINK_NAME in ref manual seems incomplete

DISCUSSION Robert P. J. Day 2 participants 3 messages Nov 2, 2013 – Nov 4, 2013

lore
Share & tools
lore
#0 lore raw

on my quest to spiff up the ref manual variables glossary, a question
about ALTERNATIVE_LINK_NAME, explained here:

http://www.yoctoproject.org/docs/latest/ref-manual/ref-manual.html#var-ALTERNATIVE_LINK_NAME

at first glance, that explanation *suggests* that the purpose of that
variable is to support an alternative name to an existing command, but it doesn't make it clear that a *very* common usage is to simply create a link with precisely the same name elsewhere. you see a *lot* of this throughout the recipes (like this snippet from util-linux):

ALTERNATIVE_LINK_NAME[dmesg] = "${base_bindir}/dmesg" ALTERNATIVE_LINK_NAME[kill] = "${base_bindir}/kill" ALTERNATIVE_LINK_NAME[more] = "${base_bindir}/more" ALTERNATIVE_LINK_NAME[mkswap] = "${base_sbindir}/mkswap" ALTERNATIVE_LINK_NAME[blockdev] = "${base_sbindir}/blockdev"

which appears to simply create symlinks from /bin to programs in /usr/bin, yes? (that's what it's doing, right?) i suspect it would be useful to mention that application in the explanation, unless i'm totally misunderstanding what i'm reading.

also, since:

"If ALTERNATIVE_LINK_NAME is not defined, it defaults to ${bindir}/<name>."

lines like this from util-linux.inc:

ALTERNATIVE_LINK_NAME[eject] = "${bindir}/eject"

are kind of silly, no?

rday

Signature · 7 lines
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================
#1 lore raw
Quoted 18 lines · Robert P. J. Day

on my quest to spiff up the ref manual variables glossary, a question
about ALTERNATIVE_LINK_NAME, explained here:

http://www.yoctoproject.org/docs/latest/ref-manual/ref-manual.html#var-ALTERNATIVE_LINK_NAME

at first glance, that explanation *suggests* that the purpose of that
variable is to support an alternative name to an existing command, but it doesn't make it clear that a *very* common usage is to simply create a link with precisely the same name elsewhere. you see a *lot* of this throughout the recipes (like this snippet from util-linux):

ALTERNATIVE_LINK_NAME[dmesg] = "${base_bindir}/dmesg" ALTERNATIVE_LINK_NAME[kill] = "${base_bindir}/kill" ALTERNATIVE_LINK_NAME[more] = "${base_bindir}/more" ALTERNATIVE_LINK_NAME[mkswap] = "${base_sbindir}/mkswap" ALTERNATIVE_LINK_NAME[blockdev] = "${base_sbindir}/blockdev"

Quoted 5 lines

which appears to simply create symlinks from /bin to programs in /usr/bin, yes? (that's what it's doing, right?) i suspect it would be useful to mention that application in the explanation, unless i'm totally misunderstanding what i'm reading.

I’m pretty sure that’s not the case. Afaik it creates a link from ALTERNATIVE_TARGET[name] to ALTERNATIVE_LINK_NAME[name]. If the target isn’t defined, iirc it defaults to adding a .${BPN} suffix to the link name. See lines 41 through 45 of update-alternatives.bbclass:

# NOTE: If ALTERNATIVE_TARGET is not defined, it will inherit the value # from ALTERNATIVE_LINK_NAME.
#
# NOTE: If the ALTERNATIVE_LINK_NAME and ALTERNATIVE_TARGET are the
same,
# ALTERNATIVE_TARGET will have '.{BPN}' appended to it.

Signature · 5 lines
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
#2 lore raw
Quoted 25 lines · Chris Larson

On Sat, Nov 2, 2013 at 3:13 AM, Robert P. J. Day <[email protected]> wrote:
 on my quest to spiff up the ref manual variables glossary, a question about ALTERNATIVE_LINK_NAME, explained here:

http://www.yoctoproject.org/docs/latest/ref-manual/ref-manual.html#var-ALTERNATIVE_LINK_NAME

 at first glance, that explanation *suggests* that the purpose of that variable is to support an alternative name to an existing command, but it doesn't make it clear that a *very* common usage is to simply create a link with precisely the same name elsewhere. you see a *lot* of this throughout the recipes (like this snippet from util-linux):

ALTERNATIVE_LINK_NAME[dmesg] = "${base_bindir}/dmesg" ALTERNATIVE_LINK_NAME[kill] = "${base_bindir}/kill" ALTERNATIVE_LINK_NAME[more] = "${base_bindir}/more" ALTERNATIVE_LINK_NAME[mkswap] = "${base_sbindir}/mkswap" ALTERNATIVE_LINK_NAME[blockdev] = "${base_sbindir}/blockdev"

which appears to simply create symlinks from /bin to programs in /usr/bin, yes? (that's what it's doing, right?) i suspect it would be useful to mention that application in the explanation, unless i'm totally misunderstanding what i'm reading.

Quoted 8 lines

I’m pretty sure that’s not the case. Afaik it creates a link from ALTERNATIVE_TARGET[name] to ALTERNATIVE_LINK_NAME[name]. If the target isn’t defined, iirc it defaults to adding a .${BPN} suffix to the link name. See lines 41 through 45 of update-alternatives.bbclass:

    # NOTE: If ALTERNATIVE_TARGET is not defined, it will inherit the value

    # from ALTERNATIVE_LINK_NAME.
    #
    # NOTE: If the ALTERNATIVE_LINK_NAME and ALTERNATIVE_TARGET are the same,
    # ALTERNATIVE_TARGET will have '.{BPN}' appended to it.

ok, i obviously didn't read that carefully enough, thanks.

rday

Signature · 7 lines
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================