All of lore.kernel.org
 help / color / mirror / Atom feed
* Inheriting conditionally
@ 2007-08-07 23:23 Matt Hoosier
  2007-08-08 12:19 ` Richard Purdie
  0 siblings, 1 reply; 7+ messages in thread
From: Matt Hoosier @ 2007-08-07 23:23 UTC (permalink / raw)
  To: openembedded-devel

Hi all,

I'm search for a syntax that will allow me to inherit from certain
classes only when using a particular distribution. Is there some good
way to do this, like maybe:

  python {
    if bb.getVar("DISTRO") == "mydistro"
      # some API call to add inherited class
  }

The particular thing I want to accomplish is to use the update-rc.d
functionality to start a daemon systemwide only when targeting my own
distro; it's nonstandard and wouldn't be appropriate for most
distributions.

Thanks,

Matt



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Inheriting conditionally
  2007-08-07 23:23 Inheriting conditionally Matt Hoosier
@ 2007-08-08 12:19 ` Richard Purdie
  2007-08-08 13:20   ` Matt Hoosier
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Purdie @ 2007-08-08 12:19 UTC (permalink / raw)
  To: openembedded-devel

Hi,

On Tue, 2007-08-07 at 18:23 -0500, Matt Hoosier wrote:
> I'm search for a syntax that will allow me to inherit from certain
> classes only when using a particular distribution. Is there some good
> way to do this, like maybe:
> 
>   python {
>     if bb.getVar("DISTRO") == "mydistro"
>       # some API call to add inherited class
>   }
> 
> The particular thing I want to accomplish is to use the update-rc.d
> functionality to start a daemon systemwide only when targeting my own
> distro; it's nonstandard and wouldn't be appropriate for most
> distributions.

I can't think of a way to do this 100% neatly, the following is my best
idea:

SYSTEMWIDEDAEMON = "dummy"
SYSTEMWIDEDAEMON_mydistro = "myspecialclass"

inherit ${SYSTEMWIDEDAEMON}

The ugly bit is it needs an empty dummy.bbclass.

A quick test here suggests it might be harmless to use "base" there
since base will always have already been included...

Cheers,

Richard





^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Inheriting conditionally
  2007-08-08 12:19 ` Richard Purdie
@ 2007-08-08 13:20   ` Matt Hoosier
  2007-08-08 13:58     ` Dr. Michael Lauer
  0 siblings, 1 reply; 7+ messages in thread
From: Matt Hoosier @ 2007-08-08 13:20 UTC (permalink / raw)
  To: openembedded-devel; +Cc: openembedded-devel

On 8/8/07, Richard Purdie <rpurdie@rpsys.net> wrote:
> I can't think of a way to do this 100% neatly, the following is my best
> idea:
>
> SYSTEMWIDEDAEMON = "dummy"
> SYSTEMWIDEDAEMON_mydistro = "myspecialclass"
>
> inherit ${SYSTEMWIDEDAEMON}
>
> The ugly bit is it needs an empty dummy.bbclass.
>
> A quick test here suggests it might be harmless to use "base" there
> since base will always have already been included...
>

Thanks. I also got the "bright" idea to install a dummy init script
for any distribution other than mine:

do_install () {

  ...

  install -d -m 0755 ${D}${sysconfdir}/init.d
  if [ "${DISTRO}" = "foinse" ] ; then
      install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/pulseaudio
  else
      echo "#! /bin/sh" > ${D}${sysconfdir}/init.d/pulseaudio
      chmod 0755 ${D}${sysconfdir}/init.d/pulseaudio
  fi
}



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Inheriting conditionally
  2007-08-08 13:20   ` Matt Hoosier
@ 2007-08-08 13:58     ` Dr. Michael Lauer
  2007-08-08 15:35       ` Matt Hoosier
  0 siblings, 1 reply; 7+ messages in thread
From: Dr. Michael Lauer @ 2007-08-08 13:58 UTC (permalink / raw)
  To: openembedded-devel

Matt Hoosier wrote:
> Thanks. I also got the "bright" idea to install a dummy init script
> for any distribution other than mine:

> do_install () {

>   ...

>   install -d -m 0755 ${D}${sysconfdir}/init.d
>   if [ "${DISTRO}" = "foinse" ] ; then
>       install -m 0755 ${WORKDIR}/init
> ${D}${sysconfdir}/init.d/pulseaudio
>   else
>       echo "#! /bin/sh" > ${D}${sysconfdir}/init.d/pulseaudio
>       chmod 0755 ${D}${sysconfdir}/init.d/pulseaudio
>   fi
> }

This looks like something that could be much better done using the
distro OVERRIDE.

Regards,

:M:
-- 
Michael 'Mickey' Lauer | IT-Freelancer | http://www.vanille-media.de




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Inheriting conditionally
  2007-08-08 13:58     ` Dr. Michael Lauer
@ 2007-08-08 15:35       ` Matt Hoosier
  2007-08-08 15:37         ` Matt Hoosier
  2007-08-08 15:43         ` Dr. Michael Lauer
  0 siblings, 2 replies; 7+ messages in thread
From: Matt Hoosier @ 2007-08-08 15:35 UTC (permalink / raw)
  To: openembedded-devel

On 8/8/07, Dr. Michael Lauer <mickey@vanille-media.de> wrote:
> Matt Hoosier wrote:
> > Thanks. I also got the "bright" idea to install a dummy init script
> > for any distribution other than mine:
>
> > do_install () {
>
> >   ...
>
> >   install -d -m 0755 ${D}${sysconfdir}/init.d
> >   if [ "${DISTRO}" = "foinse" ] ; then
> >       install -m 0755 ${WORKDIR}/init
> > ${D}${sysconfdir}/init.d/pulseaudio
> >   else
> >       echo "#! /bin/sh" > ${D}${sysconfdir}/init.d/pulseaudio
> >       chmod 0755 ${D}${sysconfdir}/init.d/pulseaudio
> >   fi
> > }
>
> This looks like something that could be much better done using the
> distro OVERRIDE.

Hmm, http://www.openembedded.org/user-manual&dpage=special_overrides
doesn't have anything at the moment.

I also had trouble finding a good example in the existing packages
(well, it was Poky, which contains fewer packages than full OE). Do
you happen to know a good example?



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Inheriting conditionally
  2007-08-08 15:35       ` Matt Hoosier
@ 2007-08-08 15:37         ` Matt Hoosier
  2007-08-08 15:43         ` Dr. Michael Lauer
  1 sibling, 0 replies; 7+ messages in thread
From: Matt Hoosier @ 2007-08-08 15:37 UTC (permalink / raw)
  To: openembedded-devel

> Hmm, http://www.openembedded.org/user-manual&dpage=special_overrides
> doesn't have anything at the moment.
>
> I also had trouble finding a good example in the existing packages
> (well, it was Poky, which contains fewer packages than full OE). Do
> you happen to know a good example?
>

Oh, wait a minute. Maybe you're just referring to stuff like:

  DEPENDS = "default set of packages"
  DEPENDS_distro = "special set of packages"



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Inheriting conditionally
  2007-08-08 15:35       ` Matt Hoosier
  2007-08-08 15:37         ` Matt Hoosier
@ 2007-08-08 15:43         ` Dr. Michael Lauer
  1 sibling, 0 replies; 7+ messages in thread
From: Dr. Michael Lauer @ 2007-08-08 15:43 UTC (permalink / raw)
  To: openembedded-devel

Matt Hoosier wrote:
> On 8/8/07, Dr. Michael Lauer <mickey@vanille-media.de> wrote:
>> Matt Hoosier wrote:
>> > Thanks. I also got the "bright" idea to install a dummy init script
>> > for any distribution other than mine:
>>
>> > do_install () {
>>
>> >   ...
>>
>> >   install -d -m 0755 ${D}${sysconfdir}/init.d
>> >   if [ "${DISTRO}" = "foinse" ] ; then
>> >       install -m 0755 ${WORKDIR}/init
>> > ${D}${sysconfdir}/init.d/pulseaudio
>> >   else
>> >       echo "#! /bin/sh" > ${D}${sysconfdir}/init.d/pulseaudio
>> >       chmod 0755 ${D}${sysconfdir}/init.d/pulseaudio
>> >   fi
>> > }
>>
>> This looks like something that could be much better done using the
>> distro OVERRIDE.

> Hmm, http://www.openembedded.org/user-manual&dpage=special_overrides
> doesn't have anything at the moment.

> I also had trouble finding a good example in the existing packages
> (well, it was Poky, which contains fewer packages than full OE). Do
> you happen to know a good example?

Check initscripts. We're using DISTRO overrides here to provide some
branding in issue and issue.net.

Regards,

:M:
-- 
Michael 'Mickey' Lauer | IT-Freelancer | http://www.vanille-media.de




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-08-08 15:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-07 23:23 Inheriting conditionally Matt Hoosier
2007-08-08 12:19 ` Richard Purdie
2007-08-08 13:20   ` Matt Hoosier
2007-08-08 13:58     ` Dr. Michael Lauer
2007-08-08 15:35       ` Matt Hoosier
2007-08-08 15:37         ` Matt Hoosier
2007-08-08 15:43         ` Dr. Michael Lauer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.