Signed-off-by: Jon Ringle <[email protected]> --- rules/klibc-module-init-tools.in | 52 ++++++++++++++ rules/klibc-module-init-tools.make | 131 ++++++++++++++++++++++++++++++++++++ 2 files changed, 183 insertions(+), 0 deletions(-) create mode 100644 rules/klibc-module-init-tools.in create mode 100644 rules/klibc-module-init-tools.make
diff --git a/rules/klibc-module-init-tools.in b/rules/klibc-module-init-tools.in new file mode 100644 index 0000000..5373ef4 --- /dev/null +++ b/rules/klibc-module-init-tools.in @@ -0,0 +1,52 @@ +## SECTION=initramfs +# klibc-module-init-tools configuration + +menuconfig KLIBC_MODULE_INIT_TOOLS + tristate + select KLIBC + prompt "klibc-module-init-tools " + help + This package contains a set of programs for loading, inserting + and removing kernel modules for Linux (versions 2.5.48 and + above). The programs here are linked against klibc and will + be a part of the initramfs image in the Linux kernel. + +if KLIBC_MODULE_INIT_TOOLS + +config KLIBC_MODULE_INIT_TOOLS_INSMOD + bool + prompt "Install insmod in initramfs image" + help + simple program to insert a module into the Linux Kernel + +config KLIBC_MODULE_INIT_TOOLS_RMMOD + bool + prompt "Install rmmod in initramfs image" + help + simple program to remove a module from the Linux Kernel + +config KLIBC_MODULE_INIT_TOOLS_LSMOD + bool + prompt "Install lsmod in initramfs image" + help + program to show the status of modules in the Linux Kernel + +config KLIBC_MODULE_INIT_TOOLS_MODINFO + bool + prompt "Install modinfo in initramfs image" + help + program to show information about a Linux Kernel module + +config KLIBC_MODULE_INIT_TOOLS_MODPROBE + bool + prompt "Install modprobe in initramfs image" + help + program to add and remove modules from the Linux Kernel + +config KLIBC_MODULE_INIT_TOOLS_DEPMOD + bool + prompt "Install depmod in initramfs image" + help + program to generate modules.dep and map files + +endif diff --git a/rules/klibc-module-init-tools.make b/rules/klibc-module-init-tools.make new file mode 100644 index 0000000..24e8a96 --- /dev/null +++ b/rules/klibc-module-init-tools.make @@ -0,0 +1,131 @@ +# -*-makefile-*- +# $Id$ +# +# Copyright (C) 2009 by Jon Ringle +# +# 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_KLIBC_MODULE_INIT_TOOLS) += klibc-module-init-tools + +# +# Paths and names +# +KLIBC_MODULE_INIT_TOOLS_VERSION := 3.9 +KLIBC_MODULE_INIT_TOOLS := module-init-tools-$(KLIBC_MODULE_INIT_TOOLS_VERSION) +KLIBC_MODULE_INIT_TOOLS_SUFFIX := tar.bz2 +KLIBC_MODULE_INIT_TOOLS_URL := http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/$(KLIBC_MODULE_INIT_TOOLS).$(KLIBC_MODULE_INIT_TOOLS_SUFFIX) +KLIBC_MODULE_INIT_TOOLS_SOURCE := $(SRCDIR)/$(KLIBC_MODULE_INIT_TOOLS).$(KLIBC_MODULE_INIT_TOOLS_SUFFIX) +KLIBC_MODULE_INIT_TOOLS_DIR := $(KLIBC_BUILDDIR)/$(KLIBC_MODULE_INIT_TOOLS) + +ifdef PTXCONF_KLIBC_MODULE_INIT_TOOLS +$(STATEDIR)/kernel.compile: $(STATEDIR)/klibc-module-init-tools.install +endif + +# ---------------------------------------------------------------------------- +# Get +# ---------------------------------------------------------------------------- + +$(STATEDIR)/klibc-module-init-tools.get: $(STATEDIR)/module-init-tools.get + @$(call targetinfo) + @$(call touch) + +# ---------------------------------------------------------------------------- +# Extract +# ---------------------------------------------------------------------------- + +$(STATEDIR)/klibc-module-init-tools.extract: + @$(call targetinfo) + @$(call clean, $(KLIBC_MODULE_INIT_TOOLS_DIR)) + @$(call extract, KLIBC_MODULE_INIT_TOOLS, $(KLIBC_BUILDDIR)) + @$(call patchin, KLIBC_MODULE_INIT_TOOLS, $(KLIBC_MODULE_INIT_TOOLS_DIR)) + + # klibc lacks getc_unlocked, so use getc instead + cd $(KLIBC_MODULE_INIT_TOOLS_DIR) && \ + sed 's|getc_unlocked|getc|g' -i *.c + @$(call touch) + +# ---------------------------------------------------------------------------- +# Prepare +# ---------------------------------------------------------------------------- +KLIBC_MODULE_INIT_TOOLS_PATH := PATH=$(CROSS_PATH) +KLIBC_MODULE_INIT_TOOLS_ENV := $(KLIBC_ENV) + +# +# autoconf +# +KLIBC_MODULE_INIT_TOOLS_AUTOCONF := $(KLIBC_AUTOCONF_KLIBC) + +$(STATEDIR)/klibc-module-init-tools.prepare: + @$(call targetinfo) + @$(call clean, $(KLIBC_MODULE_INIT_TOOLS_DIR)/config.cache) + cd $(KLIBC_MODULE_INIT_TOOLS_DIR) && \ + $(KLIBC_MODULE_INIT_TOOLS_PATH) $(KLIBC_MODULE_INIT_TOOLS_ENV) \ + ./configure $(KLIBC_MODULE_INIT_TOOLS_AUTOCONF) + @$(call touch) + +# ---------------------------------------------------------------------------- +# Compile +# ---------------------------------------------------------------------------- + +$(STATEDIR)/klibc-module-init-tools.compile: + @$(call targetinfo) + cd $(KLIBC_MODULE_INIT_TOOLS_DIR) && $(KLIBC_MODULE_INIT_TOOLS_PATH) CFLAGS="${CFLAGS} -DCONFIG_NO_BACKWARDS_COMPAT" $(MAKE) $(PARALLELMFLAGS) + @$(call touch) + +# ---------------------------------------------------------------------------- +# Install +# ---------------------------------------------------------------------------- + +ifdef PTXCONF_KLIBC_MODULE_INIT_TOOLS +$(STATEDIR)/klibc-user-spec.compile: $(STATEDIR)/klibc-module-init-tools.install +endif + +$(STATEDIR)/klibc-module-init-tools.install: + @$(call targetinfo) + @$(call install, KLIBC_MODULE_INIT_TOOLS) + @$(call install_initramfs, klibc-module-init-tools, 0, 0, 0755, /sbin) +ifdef PTXCONF_KLIBC_MODULE_INIT_TOOLS_INSMOD + @$(call install_initramfs, klibc-module-init-tools, 0, 0, 0755, $(KLIBC_MODULE_INIT_TOOLS_DIR)/build/insmod, /sbin/insmod) +endif +ifdef PTXCONF_KLIBC_MODULE_INIT_TOOLS_RMMOD + @$(call install_initramfs, klibc-module-init-tools, 0, 0, 0755, $(KLIBC_MODULE_INIT_TOOLS_DIR)/build/rmmod, /sbin/rmmod) +endif +ifdef PTXCONF_KLIBC_MODULE_INIT_TOOLS_LSMOD + @$(call install_initramfs, klibc-module-init-tools, 0, 0, 0755, $(KLIBC_MODULE_INIT_TOOLS_DIR)/build/lsmod, /sbin/lsmod) +endif +ifdef PTXCONF_KLIBC_MODULE_INIT_TOOLS_MODINFO + @$(call install_initramfs, klibc-module-init-tools, 0, 0, 0755, $(KLIBC_MODULE_INIT_TOOLS_DIR)/build/modinfo, /sbin/modinfo) +endif +ifdef PTXCONF_KLIBC_MODULE_INIT_TOOLS_MODPROBE + @$(call install_initramfs, klibc-module-init-tools, 0, 0, 0755, $(KLIBC_MODULE_INIT_TOOLS_DIR)/build/modprobe, /sbin/modprobe) +endif +ifdef PTXCONF_KLIBC_MODULE_INIT_TOOLS_DEPMOD + @$(call install_initramfs, klibc-module-init-tools, 0, 0, 0755, $(KLIBC_MODULE_INIT_TOOLS_DIR)/build/depmod, /sbin/depmod) +endif + @$(call touch) + +# ---------------------------------------------------------------------------- +# Target-Install +# ---------------------------------------------------------------------------- + +$(STATEDIR)/klibc-module-init-tools.targetinstall: + @$(call targetinfo) + @$(call touch) + +# ---------------------------------------------------------------------------- +# Clean +# ---------------------------------------------------------------------------- + +klibc-module-init-tools_clean: + rm -rf $(STATEDIR)/klibc-module-init-tools.* + rm -rf $(PKGDIR)/klibc-module-init-tools_* + rm -rf $(KLIBC_MODULE_INIT_TOOLS_DIR) + +# vim: syntax=make -- 1.6.3.3.334.g916e1 -- ptxdist mailing list [email protected]
