How to make a single plugin and install it.

Ray Strode halfline at gmail.com
Wed Jan 7 12:20:16 PST 2009


Hi,

On Tue, Jan 6, 2009 at 11:43 PM, Jonathan Greig <redteam316 at gmail.com> wrote:
> I have plymouth source from git and have already done autoconf automake
> ./configure make on fedora 10. It builds everything and the .so files are
> generated. I have been using the spinfinity plugin as a test. I modified 1
> line in the animation function so that the spinny throbber image should
> appear at 1/4 screen width rather than center(a simple test to start with).

Building from git requires a few things in configure.  As Charlie
already mention you need --prefix=/usr for data files and plugins to
go to standard system directories. On a fedora system you also
probably want:
--localstatedir=/var --enable-tracing
--without-logo=/usr/share/pixmaps/system-logo-white.png
--with-background-start-color-stop=0x0073B3
--with-background-end-color-stop=0x00457E --enable-gdm-transition
--with-system-root-install --with-rhgb-compat-link

You can just pass it all to ./autogen.sh  and then
autoconf/automake/configure etc will all get run for you.

> When I:
> 1) copy the spinfinity.so file that was generated in the .libs directory to
> /usr/lib64/plymouth
> 2) copy the spinfinity folder to /usr/share/plymouth/spinfinity
if you don't do --prefix /usr then you'll need /usr/local/share here,
but only --prefix=/usr has ever been tested so there may be bugs if
you don't.
> 3) /usr/sbin/plymouth-set-default-plugin spinfinity
> 4) /usr/libexec/plymouth/plymouth-update-initrd
>
> What is the proper way to install a plugin?
make install
/usr/sbin/plymouth-set-default-plugin the-name
/usr/libexec/plymouth/plymouth-update-initrd

> I know there isn't any documentation on
> plugins yet, but I might be able to help somewhat if I could even test some
> of my own code.
That'd be great!  Help is always welcome.

> Also, I am familiar with usplash. Is it possible to make a plugin from a
> single makefile in a plugin directory somewhere else on my harddrive rather
> than having to make the whole source? I can barely understand Makefiles as
> is but all this automake .in .am stuff just further adds to the confusion.
There is infrastructure in place for building out of tree plugins but
it's never been tested.

"make install" will install header files and a pkg-config .pc file.
Normally, you'd use the
.pc file in your configure.in/configure.ac via the PKG_CHECK_MODULES macro.

If you're doing a one-off Makefile you'll need to invoke pkg-config
directly. Something like

CFLAGS=`pkg-config --cflags plymouth-1`
LIBS=`pkg-config --libs plymouth-1`

all: *.c
     gcc plugin.c $(LIBS) $(CFLAGS) -shared -o plugin.so

Again it's never been tested, so there may be some wrinkles if you try
it.  Patches to iron out those wrinkles would be appreciated.

Otherwise, working in tree should be pretty straightforward.  Just
take an existing plugin and start hacking at it.  You could copy one
of the plugins to a new directory and rename it also.

Feel free to ask more questions if you hit any snags.

--Ray


More information about the plymouth mailing list