source: trunk/package/hotplug2/Makefile @ 18725

Last change on this file since 18725 was 18725, checked in by nbd, 7 years ago

Fix a memory leak in hotplug2 environment handling.
Bump hotplug2 to the latest svn revision, remove obsolete patches.

Memory leak is caused by the way hotplug2 handles environment variables,
using setenv() and unsetenv(). setenv() creates copies of the supplied
strings, but, due to a POSIX blunder, these copies are never destroyed
by unsetenv(), neither in glibc nor uclibc - not until the program
terminates.

Since some events are handled directly in the main process, even when
configured with the "fork" worker, hotplug2 memory usage will keep
growing over time. This can be observed by running "udevtrigger" and
noting the increase in hotplug2 VmRSS after each run.

This patch uses putenv() instead, which leaves storage management to
the caller, so that we can explicitly delete stuff when it's no longer
needed.

Signed-off-by: Aleksandar Radovanovic <biblbroks@…>

File size: 1.3 KB
Line 
1#
2# Copyright (C) 2006-2009 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7
8include $(TOPDIR)/rules.mk
9
10PKG_NAME:=hotplug2
11PKG_REV:=201
12PKG_VERSION:=$(PKG_REV)
13PKG_RELEASE:=1
14
15PKG_SOURCE_PROTO:=svn
16PKG_SOURCE_VERSION:=$(PKG_REV)
17PKG_SOURCE_SUBDIR:=hotplug2-$(PKG_VERSION)
18PKG_SOURCE_URL:=http://svn.nomi.cz/svn/isteve/hotplug2
19PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
20#PKG_SOURCE_URL:=http://isteve.bofh.cz/~isteve/hotplug2
21#PKG_MD5SUM:=ea2c01d027b4002e4e6b0ff266f51a51
22
23include $(INCLUDE_DIR)/package.mk
24
25define Package/hotplug2
26  SECTION:=base
27  CATEGORY:=Base system
28  VERSION:=1.0-beta-$(PKG_RELEASE)
29  TITLE:=Version 1.0 Dynamic device management subsystem for embedded systems
30  URL:=http://isteve.bofh.cz/~isteve/hotplug2/
31endef
32
33define Package/hotplug2/description
34 Hotplug2 is a trivial replacement of some of the UDev functionality
35 in a tiny pack, intended for Linux early userspace: Init RAM FS and InitRD.
36 This is an implementation of Hotplug2-1.0-beta
37endef
38
39MAKE_FLAGS += \
40        COPTS="$(TARGET_CFLAGS)" \
41        STATIC_WORKER="fork"
42
43define Package/hotplug2/install
44        $(INSTALL_DIR) $(1)/etc
45        $(INSTALL_DATA) ./files/hotplug2.rules $(1)/etc/
46        $(INSTALL_DIR) $(1)/sbin
47        $(INSTALL_BIN) $(PKG_BUILD_DIR)/hotplug2 $(1)/sbin/
48endef
49
50$(eval $(call BuildPackage,hotplug2))
Note: See TracBrowser for help on using the repository browser.