diff options
-rw-r--r-- | mk/kernel.mk | 4 | ||||
-rw-r--r-- | package/base-files/Makefile | 6 | ||||
-rw-r--r-- | package/base-files/files/rcdev.mdev | 7 | ||||
-rw-r--r-- | package/base-files/files/rcdev.udev | 4 | ||||
-rwxr-xr-x | package/base-files/src/etc/init.d/rcS | 11 | ||||
-rw-r--r-- | package/eudev/Makefile | 2 | ||||
-rw-r--r-- | package/kmod/Makefile | 9 | ||||
-rw-r--r-- | package/kmod/patches/patch-libkmod_libkmod-util_c | 24 | ||||
-rw-r--r-- | target/Makefile | 6 | ||||
-rw-r--r-- | target/linux/kernel.config | 1 |
10 files changed, 39 insertions, 35 deletions
diff --git a/mk/kernel.mk b/mk/kernel.mk index 0bc29b217..8eb8ec2d1 100644 --- a/mk/kernel.mk +++ b/mk/kernel.mk @@ -14,7 +14,8 @@ INSTALL_TARGETS:= $(KERNEL_PKG) NOINSTALL_TARGETS:= TARGETS:= -# KMOD_template +ifneq ($(ADK_RUNTIME_DEV_UDEV),y) +# KMOD_template (not used for udev which autoloads modules) # # Adds a target for creating a package containing # the specified (kernel-provided) modules. @@ -72,5 +73,6 @@ endif $${RSTRIP} $${I_$(1)} $(MAKE_TRACE) $(PKG_BUILD) $$(I_$(1)) $(PACKAGE_DIR) $(MAKE_TRACE) endef +endif include $(BUILD_DIR)/.kernelconfig diff --git a/package/base-files/Makefile b/package/base-files/Makefile index f25565aa9..84f9a2db1 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -23,6 +23,11 @@ INSTALL_STYLE:= manual do-install: $(CP) ./src/* $(IDIR_BASE_FILES) +ifeq ($(ADK_RUNTIME_DEV_MDEV),y) + $(CP) ./files/rcdev.mdev $(IDIR_BASE_FILES)/etc/init.d/rcdev +else ifeq ($(ADK_RUNTIME_DEV_UDEV),y) + $(CP) ./files/rcdev.udev $(IDIR_BASE_FILES)/etc/init.d/rcdev +endif ifeq (${ADK_TARGET_ROOTFS_NFSROOT},y) @echo "#" > $(IDIR_BASE_FILES)/etc/network/interfaces endif @@ -73,6 +78,7 @@ endif ln -sf ../proc/mounts $(IDIR_BASE_FILES)/etc/mtab rm -rf $(IDIR_BASE_FILES)/var ln -sf tmp $(IDIR_BASE_FILES)/var + ln -sf var/run $(IDIR_BASE_FILES)/run test -z $(ADK_RUNTIME_SHELL) || \ cat ./files/inittab.shell >> $(IDIR_BASE_FILES)/etc/inittab ifeq ($(ADK_TARGET_WITH_VGA),y) diff --git a/package/base-files/files/rcdev.mdev b/package/base-files/files/rcdev.mdev new file mode 100644 index 000000000..18f9d1128 --- /dev/null +++ b/package/base-files/files/rcdev.mdev @@ -0,0 +1,7 @@ +# start mdev dynamic device node management +echo >/dev/mdev.seq +if [ -f /proc/sys/kernel/hotplug ];then + echo "/sbin/mdev" >/proc/sys/kernel/hotplug +fi +# creates f.e. /dev/root +mdev -s diff --git a/package/base-files/files/rcdev.udev b/package/base-files/files/rcdev.udev new file mode 100644 index 000000000..340adffa2 --- /dev/null +++ b/package/base-files/files/rcdev.udev @@ -0,0 +1,4 @@ +# start udev dynamic device node management +udevd --daemon +udevadm trigger +udevadm settle diff --git a/package/base-files/src/etc/init.d/rcS b/package/base-files/src/etc/init.d/rcS index 3e65d0967..3c46c976b 100755 --- a/package/base-files/src/etc/init.d/rcS +++ b/package/base-files/src/etc/init.d/rcS @@ -13,14 +13,6 @@ fi # remount /dev with smaller size mount -o remount,nosuid,size=128k,mode=0755 -t tmpfs mdev /dev -# start mdev dynamic device node management -echo >/dev/mdev.seq -if [ -f /proc/sys/kernel/hotplug ];then - echo "/sbin/mdev" >/proc/sys/kernel/hotplug -fi -# creates f.e. /dev/root -mdev -s - # seed some random cat /etc/.rnd >/dev/urandom 2>&1 @@ -42,6 +34,9 @@ mkdir -p /var/tmp touch /var/log/lastlog touch /var/log/wtmp +# start dynamic device node management +[ -f /etc/init.d/rcdev ] && . /etc/init.d/rcdev + HOSTNAME= [[ -s /etc/hostname ]] && HOSTNAME=$(cat /etc/hostname) HOSTNAME=${HOSTNAME%%.*} diff --git a/package/eudev/Makefile b/package/eudev/Makefile index 58f20a063..817752322 100644 --- a/package/eudev/Makefile +++ b/package/eudev/Makefile @@ -9,7 +9,7 @@ PKG_RELEASE:= 2 PKG_HASH:= d3a0c7f613d4917b89afd57498860a1c35b9c59abf9fea22a09c30eec25c32e4 PKG_DESCR:= device manager (udev clone) PKG_SECTION:= sys/utils -PKG_BUILDDEP:= gperf-host glib +PKG_BUILDDEP:= gperf-host kmod-host glib PKG_DEPENDS:= glib kmod PKG_URL:= http://wiki.gentoo.org/wiki/Project:Eudev PKG_SITES:= http://dev.gentoo.org/~blueness/eudev/ diff --git a/package/kmod/Makefile b/package/kmod/Makefile index 59f3c0208..88037f45c 100644 --- a/package/kmod/Makefile +++ b/package/kmod/Makefile @@ -20,8 +20,10 @@ PKG_SUBPKGS:= KMOD LIBKMOD PKGSD_LIBKMOD:= kernel module library PKGSC_LIBKMOD:= libs/misc +include $(ADK_TOPDIR)/mk/host.mk include $(ADK_TOPDIR)/mk/package.mk +$(eval $(call HOST_template,KMOD,kmod,$(PKG_VERSION)-${PKG_RELEASE})) $(eval $(call PKG_template,KMOD,kmod,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION})) $(eval $(call PKG_template,LIBKMOD,libkmod,$(PKG_VERSION)-${PKG_RELEASE},${PKGSS_LIBKMOD},${PKGSD_LIBKMOD},${PKGSC_LIBKMOD},${PKG_OPTS})) @@ -44,4 +46,11 @@ libkmod-install: $(CP) $(WRKINST)/usr/lib/libkmod*.so* \ $(IDIR_LIBKMOD)/usr/lib +HOST_CONFIGURE_ARGS+= --disable-manpages \ + --disable-logging + +hostpost-install: + ln -sf kmod $(STAGING_HOST_DIR)/usr/bin/depmod + +include ${ADK_TOPDIR}/mk/host-bottom.mk include ${ADK_TOPDIR}/mk/pkg-bottom.mk diff --git a/package/kmod/patches/patch-libkmod_libkmod-util_c b/package/kmod/patches/patch-libkmod_libkmod-util_c deleted file mode 100644 index 330fce456..000000000 --- a/package/kmod/patches/patch-libkmod_libkmod-util_c +++ /dev/null @@ -1,24 +0,0 @@ ---- kmod-15.orig/libkmod/libkmod-util.c 2013-07-15 17:45:31.000000000 +0200 -+++ kmod-15/libkmod/libkmod-util.c 2013-12-21 18:02:49.000000000 +0100 -@@ -28,6 +28,7 @@ - #include <unistd.h> - #include <errno.h> - #include <string.h> -+#include <limits.h> - #include <ctype.h> - - #include "libkmod.h" -@@ -323,8 +324,12 @@ static inline int is_dir(const char *pat - int mkdir_p(const char *path, int len, mode_t mode) - { - char *start, *end; -+ char buf[PATH_MAX+1]; - -- start = strndupa(path, len); -+ snprintf(buf, sizeof buf, "%s", path); -+ assert(len < sizeof(buf)); -+ buf[len] = 0; -+ start = buf; - end = start + len; - - /* diff --git a/target/Makefile b/target/Makefile index a0b99fc0e..e0fb607b2 100644 --- a/target/Makefile +++ b/target/Makefile @@ -135,6 +135,12 @@ clean: $(ADK_TARGET_ARCH)-clean $(ADK_TARGET_ARCH)-imageclean %-imageprepare: $(TRACE) target/$(patsubst %-imageprepare,%,$@)-imageprepare +ifeq ($(ADK_RUNTIME_DEV_UDEV),y) + $(CP) -a $(BUILD_DIR)/linux-$(ADK_TARGET_ARCH)/modules/lib $(TARGET_DIR) + rm -f "$(TARGET_DIR)/lib/modules/$(ADK_KERNEL_VERSION)/build" \ + "$(TARGET_DIR)/lib/modules/$(ADK_KERNEL_VERSION)/source" + $(STAGING_HOST_DIR)/usr/bin/depmod -a -b $(TARGET_DIR) $(ADK_KERNEL_VERSION) +endif @for x in $$(ls $(ADK_TOPDIR)/scripts/preimage/*.sh 2>/dev/null); do \ [[ -x "$$x" ]] && $$x; \ break; \ diff --git a/target/linux/kernel.config b/target/linux/kernel.config index 3e36f4d1f..74d63eaa0 100644 --- a/target/linux/kernel.config +++ b/target/linux/kernel.config @@ -27,7 +27,6 @@ CONFIG_BINFMT_ELF=y CONFIG_BINFMT_SCRIPT=y CONFIG_HOTPLUG=y CONFIG_UEVENT_HELPER=y -CONFIG_UEVENT_HELPER_PATH="/sbin/mdev" CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y CONFIG_STANDALONE=y |