From 48aef329d34b1c680afaee945a0968b64a752a97 Mon Sep 17 00:00:00 2001 From: Nicolas Thill Date: Mon, 5 Oct 2009 19:19:03 +0000 Subject: [PATCH] [packages] libv4l: update to v0.6.1, don't ship dev shared lib sysmlinks SVN-Revision: 17921 --- libs/libv4l/Makefile | 6 +-- libs/libv4l/patches/001-no-shm_open-fix.patch | 43 +++++++++++-------- 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/libs/libv4l/Makefile b/libs/libv4l/Makefile index 454aa411a1..b54c3cd35a 100644 --- a/libs/libv4l/Makefile +++ b/libs/libv4l/Makefile @@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libv4l -PKG_VERSION:=0.6.0 +PKG_VERSION:=0.6.1 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://people.atrpms.net/~hdegoede/ -PKG_MD5SUM:=db389fdf02cabd57f289f0faa37f4060 +PKG_MD5SUM:=0d0d96d77c98871d2e5466c10cb30a0a include $(INCLUDE_DIR)/package.mk @@ -66,7 +66,7 @@ endef define Package/libv4l/install $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libv4l{1,2,convert}.so* $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libv4l{1,2,convert}.so.* $(1)/usr/lib/ $(INSTALL_DIR) $(1)/usr/lib/libv4l $(CP) $(PKG_INSTALL_DIR)/usr/lib/libv4l/v4l{1compat,2convert}.so $(1)/usr/lib/libv4l endef diff --git a/libs/libv4l/patches/001-no-shm_open-fix.patch b/libs/libv4l/patches/001-no-shm_open-fix.patch index 816626e3a5..96b0628ecf 100644 --- a/libs/libv4l/patches/001-no-shm_open-fix.patch +++ b/libs/libv4l/patches/001-no-shm_open-fix.patch @@ -1,25 +1,31 @@ -diff -ruN libv4l-0.6.0.orig/libv4lconvert/control/libv4lcontrol.c libv4l-0.6.0/libv4lconvert/control/libv4lcontrol.c ---- libv4l-0.6.0.orig/libv4lconvert/control/libv4lcontrol.c 2009-07-09 04:59:01.000000000 -0400 -+++ libv4l-0.6.0/libv4lconvert/control/libv4lcontrol.c 2009-08-29 03:23:06.000000000 -0400 -@@ -265,7 +265,7 @@ +--- a/libv4lconvert/control/libv4lcontrol.c ++++ b/libv4lconvert/control/libv4lcontrol.c +@@ -338,7 +338,7 @@ static void v4lcontrol_init_flags(struct struct v4lcontrol_data *v4lcontrol_create(int fd, int always_needs_conversion) { - int shm_fd; + int shm_fd, fdflags; int i, rc, init = 0; - char *s, shm_name[256]; + char *s, shm_name[256], pwd_buf[1024]; struct v4l2_capability cap; -@@ -311,19 +311,26 @@ - return data; /* No need to create a shared memory segment */ +@@ -392,25 +392,31 @@ struct v4lcontrol_data *v4lcontrol_creat + } - SYS_IOCTL(fd, VIDIOC_QUERYCAP, &cap); -- snprintf(shm_name, 256, "/%s:%s", cap.bus_info, cap.card); -+ snprintf(shm_name, 256, "/dev/shm/%s:%s", cap.bus_info, cap.card); + if (getpwuid_r(geteuid(), &pwd, pwd_buf, sizeof(pwd_buf), &pwd_p) == 0) { +- snprintf(shm_name, 256, "/libv4l-%s:%s:%s", pwd.pw_name, ++ snprintf(shm_name, 256, "/dev/shm/libv4l-%s:%s:%s", pwd.pw_name, + cap.bus_info, cap.card); + } else { + perror("libv4lcontrol: error getting username using uid instead"); +- snprintf(shm_name, 256, "/libv4l-%lu:%s:%s", (unsigned long)geteuid(), ++ snprintf(shm_name, 256, "/dev/shm/libv4l-%lu:%s:%s", (unsigned long)geteuid(), + cap.bus_info, cap.card); + } /* / is not allowed inside shm names */ - for (i = 1; shm_name[i]; i++) -+ for (i = 9; shm_name[i]; i++) //start after "/dev/shm", i = 9 ++ for (i = 9; shm_name[i]; i++) /* start after "/dev/shm", i = 9 */ if (shm_name[i] == '/') shm_name[i] = '-'; @@ -28,16 +34,15 @@ diff -ruN libv4l-0.6.0.orig/libv4lconvert/control/libv4lcontrol.c libv4l-0.6.0/l + if ((shm_fd = open(shm_name, (O_CREAT | O_EXCL | O_RDWR), (S_IREAD | S_IWRITE))) >= 0) init = 1; -- else if ((shm_fd = shm_open(shm_name, O_RDWR, (S_IREAD | S_IWRITE))) < 0) -+ else if ((shm_fd = open(shm_name, O_RDWR, (S_IREAD | S_IWRITE))) < 0) - goto error; -+ + else +- shm_fd = shm_open(shm_name, O_RDWR, (S_IREAD | S_IWRITE)); ++ shm_fd = open(shm_name, O_RDWR, (S_IREAD | S_IWRITE)); ++ + /* This is all uClibc > 0.9.30 seems to do for shm_open() in librt/shm.c */ + fdflags = fcntl(shm_fd, F_GETFD, 0); + -+ if (fdflags >= 0) { ++ if (fdflags >= 0) + fdflags = fcntl(fd, F_SETFD, fdflags | FD_CLOEXEC); -+ } - /* Set the shared memory size */ - ftruncate(shm_fd, V4LCONTROL_SHM_SIZE); + if (shm_fd >= 0) { + /* Set the shared memory size */ -- 2.30.2