mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] Add the 'kmod' tools and library.
@ 2011-12-25 17:56 Juergen Beisert
  2012-01-04  9:55 ` Michael Olbrich
  0 siblings, 1 reply; 4+ messages in thread
From: Juergen Beisert @ 2011-12-25 17:56 UTC (permalink / raw)
  To: ptxdist

'kmod' is a set of tools to handle common tasks with Linux kernel modules
like insert, remove, list, check properties, resolve dependencies and aliases.
It will become the replacement for the current existing kernel module handling
commands. And future versions of 'udev' will use its library to speed up all
the currenlty time consuming tasks at system start.
    
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>

diff --git a/rules/kmod.in b/rules/kmod.in
new file mode 100644
index 0000000..f99b161
--- /dev/null
+++ b/rules/kmod.in
@@ -0,0 +1,38 @@
+## SECTION=system_libraries
+
+menuconfig KMOD
+	tristate
+	select ZLIB if KMOD_ZLIB
+	prompt "kmod                          "
+	help
+	  kmod is a set of tools to handle common tasks with Linux kernel
+	  modules like insert, remove, list, check properties, resolve
+	  dependencies and aliases.
+
+if KMOD
+
+config KMOD_TOOLS
+	bool
+	prompt "install tools"
+	help
+	  Install tools that provide same functionality as the module-init-tools
+
+config KMOD_ZLIB
+	bool
+	prompt "use system zlib"
+	help
+	  Use the system zlib to handle compressed modules
+
+config KMOD_LOGGING
+	bool
+	prompt "enable syslog"
+	help
+	  Enable syslog based logging
+
+config KMOD_DEBUG
+	bool
+	prompt "enable debug output"
+	help
+	  Make the package more noisy
+
+endif
diff --git a/rules/kmod.make b/rules/kmod.make
new file mode 100644
index 0000000..9ed5342
--- /dev/null
+++ b/rules/kmod.make
@@ -0,0 +1,89 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2011 by Juergen Beisert <jbe@pengutronix.de>
+#
+# See CREDITS for details about who has contributed to this project.
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_KMOD) += kmod
+
+#
+# Paths and names
+#
+KMOD_VERSION	:= 2
+KMOD_MD5	:= 6017364434377f6724f749d7a28c5d7a
+KMOD		:= kmod-$(KMOD_VERSION)
+KMOD_SUFFIX	:= tar.xz
+KMOD_URL	:= http://packages.profusion.mobi/kmod/$(KMOD).$(KMOD_SUFFIX)
+KMOD_SOURCE	:= $(SRCDIR)/$(KMOD).$(KMOD_SUFFIX)
+KMOD_DIR	:= $(BUILDDIR)/$(KMOD)
+# note: library: LGPLv2, tools: GPLv2
+KMOD_LICENSE	:= GPLv2/LGPLv2
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+KMOD_CONF_TOOL	:= autoconf
+KMOD_CONF_OPT	:= $(CROSS_AUTOCONF_USR)  \
+	--enable-silent-rules \
+	--disable-dependency-tracking \
+	--disable-static \
+	--enable-shared
+
+ifdef PTXCONF_KMOD_TOOLS
+KMOD_CONF_OPT += --enable-tools
+else
+KMOD_CONF_OPT += --disable-tools
+endif
+
+ifdef PTXCONF_KMOD_DEBUG
+KMOD_CONF_OPT += --enable-debug
+else
+KMOD_CONF_OPT += --disable-debug
+endif
+
+ifdef PTXCONF_KMOD_ZLIB
+KMOD_CONF_OPT += --enable-zlib
+else
+KMOD_CONF_OPT += --disable-zlib
+endif
+
+ifdef PTXCONF_KMOD_LOGGING
+KMOD_CONF_OPT += --enable-logging
+else
+KMOD_CONF_OPT += --disable-logging
+endif
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/kmod.targetinstall:
+	@$(call targetinfo)
+
+	@$(call install_init, kmod)
+	@$(call install_fixup, kmod,PRIORITY,optional)
+	@$(call install_fixup, kmod,SECTION,base)
+	@$(call install_fixup, kmod,AUTHOR,"Juergen Beisert <jbe@pengutronix.de>")
+	@$(call install_fixup, kmod,DESCRIPTION,"Linux kernel module handling")
+
+	@$(call install_lib, kmod, 0, 0, 0644, libkmod)
+
+ifdef PTXCONF_KMOD_TOOLS
+	@for file in kmod-insmod kmod-lsmod kmod-modinfo kmod-modprobe kmod-rmmod; \
+		do \
+			$(call install_copy, kmod, 0, 0, 0755, -, /usr/bin/$$file); \
+		done
+endif
+	@$(call install_finish, kmod)
+
+	@$(call touch)
+
+# vim: syntax=make

-- 
Pengutronix e.K.                              | Juergen Beisert             |
Linux Solutions for Science and Industry      | http://www.pengutronix.de/  |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH] Add the 'kmod' tools and library.
  2011-12-25 17:56 [ptxdist] [PATCH] Add the 'kmod' tools and library Juergen Beisert
@ 2012-01-04  9:55 ` Michael Olbrich
  2012-01-04 10:12   ` Juergen Beisert
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Olbrich @ 2012-01-04  9:55 UTC (permalink / raw)
  To: ptxdist

On Sun, Dec 25, 2011 at 06:56:56PM +0100, Juergen Beisert wrote:
> 'kmod' is a set of tools to handle common tasks with Linux kernel modules
> like insert, remove, list, check properties, resolve dependencies and aliases.
> It will become the replacement for the current existing kernel module handling
> commands. And future versions of 'udev' will use its library to speed up all
> the currenlty time consuming tasks at system start.
>     
> Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
> 
> diff --git a/rules/kmod.in b/rules/kmod.in
> new file mode 100644
> index 0000000..f99b161
> --- /dev/null
> +++ b/rules/kmod.in
> @@ -0,0 +1,38 @@
> +## SECTION=system_libraries
> +
> +menuconfig KMOD
> +	tristate
> +	select ZLIB if KMOD_ZLIB
> +	prompt "kmod                          "
> +	help
> +	  kmod is a set of tools to handle common tasks with Linux kernel
> +	  modules like insert, remove, list, check properties, resolve
> +	  dependencies and aliases.
> +
> +if KMOD
> +
> +config KMOD_TOOLS
> +	bool
> +	prompt "install tools"
> +	help
> +	  Install tools that provide same functionality as the module-init-tools
> +
> +config KMOD_ZLIB
> +	bool
> +	prompt "use system zlib"
> +	help
> +	  Use the system zlib to handle compressed modules

s/system //

otherwise it's not clear that this means on vs. off and not system vs.
builtin.

> +
> +config KMOD_LOGGING
> +	bool
> +	prompt "enable syslog"
> +	help
> +	  Enable syslog based logging
> +
> +config KMOD_DEBUG
> +	bool
> +	prompt "enable debug output"
> +	help
> +	  Make the package more noisy
> +
> +endif
> diff --git a/rules/kmod.make b/rules/kmod.make
> new file mode 100644
> index 0000000..9ed5342
> --- /dev/null
> +++ b/rules/kmod.make
> @@ -0,0 +1,89 @@
> +# -*-makefile-*-
> +#
> +# Copyright (C) 2011 by Juergen Beisert <jbe@pengutronix.de>
> +#
> +# See CREDITS for details about who has contributed to this project.
> +#
> +# For further information about the PTXdist project and license conditions
> +# see the README file.
> +#
> +
> +#
> +# We provide this package
> +#
> +PACKAGES-$(PTXCONF_KMOD) += kmod
> +
> +#
> +# Paths and names
> +#
> +KMOD_VERSION	:= 2
> +KMOD_MD5	:= 6017364434377f6724f749d7a28c5d7a
> +KMOD		:= kmod-$(KMOD_VERSION)
> +KMOD_SUFFIX	:= tar.xz
> +KMOD_URL	:= http://packages.profusion.mobi/kmod/$(KMOD).$(KMOD_SUFFIX)
> +KMOD_SOURCE	:= $(SRCDIR)/$(KMOD).$(KMOD_SUFFIX)
> +KMOD_DIR	:= $(BUILDDIR)/$(KMOD)
> +# note: library: LGPLv2, tools: GPLv2
> +KMOD_LICENSE	:= GPLv2/LGPLv2
> +
> +# ----------------------------------------------------------------------------
> +# Prepare
> +# ----------------------------------------------------------------------------
> +
> +KMOD_CONF_TOOL	:= autoconf
> +KMOD_CONF_OPT	:= 

break

$(CROSS_AUTOCONF_USR)  \
> +	--enable-silent-rules \

> +	--disable-dependency-tracking \

remove

> +	--disable-static \
> +	--enable-shared
> +
> +ifdef PTXCONF_KMOD_TOOLS
> +KMOD_CONF_OPT += --enable-tools
> +else
> +KMOD_CONF_OPT += --disable-tools
> +endif
> +
> +ifdef PTXCONF_KMOD_DEBUG
> +KMOD_CONF_OPT += --enable-debug
> +else
> +KMOD_CONF_OPT += --disable-debug
> +endif
> +
> +ifdef PTXCONF_KMOD_ZLIB
> +KMOD_CONF_OPT += --enable-zlib
> +else
> +KMOD_CONF_OPT += --disable-zlib
> +endif
> +
> +ifdef PTXCONF_KMOD_LOGGING
> +KMOD_CONF_OPT += --enable-logging
> +else
> +KMOD_CONF_OPT += --disable-logging
> +endif

please use ptx/endis. It's shorter and you can sort all parameters as
listed in "configure --help" that makes updates much easier.

> +
> +# ----------------------------------------------------------------------------
> +# Target-Install
> +# ----------------------------------------------------------------------------
> +
> +$(STATEDIR)/kmod.targetinstall:
> +	@$(call targetinfo)
> +
> +	@$(call install_init, kmod)
> +	@$(call install_fixup, kmod,PRIORITY,optional)
> +	@$(call install_fixup, kmod,SECTION,base)
> +	@$(call install_fixup, kmod,AUTHOR,"Juergen Beisert <jbe@pengutronix.de>")
> +	@$(call install_fixup, kmod,DESCRIPTION,"Linux kernel module handling")
> +
> +	@$(call install_lib, kmod, 0, 0, 0644, libkmod)
> +
> +ifdef PTXCONF_KMOD_TOOLS
> +	@for file in kmod-insmod kmod-lsmod kmod-modinfo kmod-modprobe kmod-rmmod; \
> +		do \
> +			$(call install_copy, kmod, 0, 0, 0755, -, /usr/bin/$$file); \
> +		done
> +endif

How do these compare to the 'real' tool? While this is nice for testing,
it would be nice if we could only install these.
I'd use $(foreach ...) but that's no big issue.

Michael

> +	@$(call install_finish, kmod)
> +
> +	@$(call touch)
> +
> +# vim: syntax=make
> 
> -- 
> Pengutronix e.K.                              | Juergen Beisert             |
> Linux Solutions for Science and Industry      | http://www.pengutronix.de/  |
> 
> -- 
> ptxdist mailing list
> ptxdist@pengutronix.de
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH] Add the 'kmod' tools and library.
  2012-01-04  9:55 ` Michael Olbrich
@ 2012-01-04 10:12   ` Juergen Beisert
  2012-01-04 10:50     ` Michael Olbrich
  0 siblings, 1 reply; 4+ messages in thread
From: Juergen Beisert @ 2012-01-04 10:12 UTC (permalink / raw)
  To: ptxdist; +Cc: Michael Olbrich

Michael Olbrich wrote:
> [...]
>
> > +config KMOD_ZLIB
> > +	bool
> > +	prompt "use system zlib"
> > +	help
> > +	  Use the system zlib to handle compressed modules
>
> s/system //
>
> otherwise it's not clear that this means on vs. off and not system vs.
> builtin.

Okay.

> [...]
>
> > +KMOD_CONF_TOOL	:= autoconf
> > +KMOD_CONF_OPT	:=
>
> break
>
> $(CROSS_AUTOCONF_USR)  \
>
> > +	--enable-silent-rules \
> >
> > +	--disable-dependency-tracking \
>
> remove

Okay.

> [...]
>
> > +	--disable-static \
> > +	--enable-shared
> > +
> > +ifdef PTXCONF_KMOD_TOOLS
> > +KMOD_CONF_OPT += --enable-tools
> > +else
> > +KMOD_CONF_OPT += --disable-tools
> > +endif
> > +
> > +ifdef PTXCONF_KMOD_DEBUG
> > +KMOD_CONF_OPT += --enable-debug
> > +else
> > +KMOD_CONF_OPT += --disable-debug
> > +endif
> > +
> > +ifdef PTXCONF_KMOD_ZLIB
> > +KMOD_CONF_OPT += --enable-zlib
> > +else
> > +KMOD_CONF_OPT += --disable-zlib
> > +endif
> > +
> > +ifdef PTXCONF_KMOD_LOGGING
> > +KMOD_CONF_OPT += --enable-logging
> > +else
> > +KMOD_CONF_OPT += --disable-logging
> > +endif
>
> please use ptx/endis. It's shorter and you can sort all parameters as
> listed in "configure --help" that makes updates much easier.

Okay. Didn't really noticed this macro yet.

> [...]
>
> > +ifdef PTXCONF_KMOD_TOOLS
> > +	@for file in kmod-insmod kmod-lsmod kmod-modinfo kmod-modprobe kmod-rmmod; \
> > +		do \ 
> > +			$(call install_copy, kmod, 0, 0, 0755, -, /usr/bin/$$file); \
> > +		done
> > +endif
>
> How do these compare to the 'real' tool? While this is nice for testing,
> it would be nice if we could only install these.

They should replace the current used tools in the long term. Main goal for
this package is the library, as it will be used in the future by 'udev'.

> I'd use $(foreach ...) but that's no big issue.

Another macro I'm not a aware off?

Juergen

-- 
Pengutronix e.K.                              | Juergen Beisert             |
Linux Solutions for Science and Industry      | http://www.pengutronix.de/  |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH] Add the 'kmod' tools and library.
  2012-01-04 10:12   ` Juergen Beisert
@ 2012-01-04 10:50     ` Michael Olbrich
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Olbrich @ 2012-01-04 10:50 UTC (permalink / raw)
  To: ptxdist

On Wed, Jan 04, 2012 at 11:12:49AM +0100, Juergen Beisert wrote:
> Michael Olbrich wrote:
[...]
> > > +ifdef PTXCONF_KMOD_LOGGING
> > > +KMOD_CONF_OPT += --enable-logging
> > > +else
> > > +KMOD_CONF_OPT += --disable-logging
> > > +endif
> >
> > please use ptx/endis. It's shorter and you can sort all parameters as
> > listed in "configure --help" that makes updates much easier.
> 
> Okay. Didn't really noticed this macro yet.

It wasn't really used for a long time, but I think it makes the configure
options much more readable.

> > [...]
> >
> > > +ifdef PTXCONF_KMOD_TOOLS
> > > +	@for file in kmod-insmod kmod-lsmod kmod-modinfo kmod-modprobe kmod-rmmod; \
> > > +		do \ 
> > > +			$(call install_copy, kmod, 0, 0, 0755, -, /usr/bin/$$file); \
> > > +		done
> > > +endif
> >
> > How do these compare to the 'real' tool? While this is nice for testing,
> > it would be nice if we could only install these.
> 
> They should replace the current used tools in the long term. Main goal for
> this package is the library, as it will be used in the future by 'udev'.
> 
> > I'd use $(foreach ...) but that's no big issue.
> 
> Another macro I'm not a aware off?

That's just plain make syntax $(foreach var, list, expression).

Michael

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

end of thread, other threads:[~2012-01-04 10:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-25 17:56 [ptxdist] [PATCH] Add the 'kmod' tools and library Juergen Beisert
2012-01-04  9:55 ` Michael Olbrich
2012-01-04 10:12   ` Juergen Beisert
2012-01-04 10:50     ` Michael Olbrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox