mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-24 11:16:51 +00:00
Merge branch 'master' of github.com:OpenELEC/OpenELEC.tv into openelec-systemd
Conflicts: packages/network/connman/scripts/connman-setup packages/sysutils/dbus/init.d/14_dbus packages/sysutils/udisks/init.d/31_mount-disks packages/tools/installer/package.mk projects/ARCTIC_MC/options projects/ATV/options projects/Fusion/options projects/Generic/options projects/Generic_OSS/options projects/ION/options projects/Intel/options projects/RPi/options projects/Virtual/options tools/mkpkg/mkpkg_udevil
This commit is contained in:
commit
eb7032c245
@ -34,7 +34,7 @@ case "$LINUX" in
|
||||
PKG_URL="$DISTRO_SRC/$PKG_NAME-$PKG_VERSION.tar.bz2"
|
||||
;;
|
||||
*)
|
||||
PKG_VERSION="3.10.7"
|
||||
PKG_VERSION="3.10.9"
|
||||
PKG_URL="http://www.kernel.org/pub/linux/kernel/v3.x/$PKG_NAME-$PKG_VERSION.tar.xz"
|
||||
;;
|
||||
esac
|
||||
|
@ -0,0 +1,367 @@
|
||||
From 9295c3ffac97c64cebee88229ee6ac8376f150ae Mon Sep 17 00:00:00 2001
|
||||
From: davilla <davilla@4pi.com>
|
||||
Date: Fri, 20 Apr 2012 13:23:19 -0400
|
||||
Subject: [PATCH] [aml] fixed, add UDevProvider to handle usb disk add/remove
|
||||
storage handling
|
||||
|
||||
---
|
||||
xbmc/storage/linux/LinuxStorageProvider.h | 5 +
|
||||
xbmc/storage/linux/Makefile | 9 +-
|
||||
xbmc/storage/linux/UDevProvider.cpp | 241 ++++++++++++++++++++++++++++++
|
||||
xbmc/storage/linux/UDevProvider.h | 55 +++++++
|
||||
4 files changed, 306 insertions(+), 4 deletions(-)
|
||||
create mode 100644 xbmc/storage/linux/UDevProvider.cpp
|
||||
create mode 100644 xbmc/storage/linux/UDevProvider.h
|
||||
|
||||
diff --git a/xbmc/storage/linux/LinuxStorageProvider.h b/xbmc/storage/linux/LinuxStorageProvider.h
|
||||
index 1f14548..740b282 100644
|
||||
--- a/xbmc/storage/linux/LinuxStorageProvider.h
|
||||
+++ b/xbmc/storage/linux/LinuxStorageProvider.h
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "storage/IStorageProvider.h"
|
||||
#include "HALProvider.h"
|
||||
#include "DeviceKitDisksProvider.h"
|
||||
+#include "UDevProvider.h"
|
||||
#include "UDisksProvider.h"
|
||||
#include "PosixMountProvider.h"
|
||||
|
||||
@@ -41,6 +42,10 @@ class CLinuxStorageProvider : public IStorageProvider
|
||||
if (m_instance == NULL)
|
||||
m_instance = new CHALProvider();
|
||||
#endif
|
||||
+#ifdef HAVE_LIBUDEV
|
||||
+ if (m_instance == NULL)
|
||||
+ m_instance = new CUDevProvider();
|
||||
+#endif
|
||||
|
||||
if (m_instance == NULL)
|
||||
m_instance = new CPosixMountProvider();
|
||||
diff --git a/xbmc/storage/linux/Makefile b/xbmc/storage/linux/Makefile
|
||||
index 9be601d..325f84d 100644
|
||||
--- a/xbmc/storage/linux/Makefile
|
||||
+++ b/xbmc/storage/linux/Makefile
|
||||
@@ -1,8 +1,9 @@
|
||||
-SRCS=DeviceKitDisksProvider.cpp \
|
||||
- HALProvider.cpp \
|
||||
- UDisksProvider.cpp \
|
||||
+SRCS = DeviceKitDisksProvider.cpp
|
||||
+SRCS += UDisksProvider.cpp
|
||||
+SRCS += HALProvider.cpp
|
||||
+SRCS += UDevProvider.cpp
|
||||
|
||||
-LIB=storage_linux.a
|
||||
+LIB = storage_linux.a
|
||||
|
||||
include ../../../Makefile.include
|
||||
-include $(patsubst %.cpp,%.P,$(patsubst %.c,%.P,$(SRCS)))
|
||||
diff --git a/xbmc/storage/linux/UDevProvider.cpp b/xbmc/storage/linux/UDevProvider.cpp
|
||||
new file mode 100644
|
||||
index 0000000..21b6b50
|
||||
--- /dev/null
|
||||
+++ b/xbmc/storage/linux/UDevProvider.cpp
|
||||
@@ -0,0 +1,241 @@
|
||||
+/*
|
||||
+ * Copyright (C) 2005-2012 Team XBMC
|
||||
+ * http://www.xbmc.org
|
||||
+ *
|
||||
+ * This Program is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation; either version 2, or (at your option)
|
||||
+ * any later version.
|
||||
+ *
|
||||
+ * This Program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with XBMC; see the file COPYING. If not, write to
|
||||
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
+ * http://www.gnu.org/copyleft/gpl.html
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+#include "UDevProvider.h"
|
||||
+
|
||||
+#ifdef HAVE_LIBUDEV
|
||||
+
|
||||
+#include "linux/PosixMountProvider.h"
|
||||
+#include "utils/log.h"
|
||||
+#include "utils/URIUtils.h"
|
||||
+
|
||||
+extern "C" {
|
||||
+#include <libudev.h>
|
||||
+#include <poll.h>
|
||||
+}
|
||||
+
|
||||
+static const char *get_mountpoint(const char *devnode)
|
||||
+{
|
||||
+ static char buf[4096];
|
||||
+ const char *delim = " ";
|
||||
+ const char *mountpoint = NULL;
|
||||
+ FILE *fp = fopen("/proc/mounts", "r");
|
||||
+
|
||||
+ while (fgets(buf, sizeof (buf), fp))
|
||||
+ {
|
||||
+ const char *node = strtok(buf, delim);
|
||||
+ if (strcmp(node, devnode) == 0)
|
||||
+ {
|
||||
+ mountpoint = strtok(NULL, delim);
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (mountpoint != NULL)
|
||||
+ {
|
||||
+ // If mount point contain characters like space, it is converted to
|
||||
+ // "\040". This situation should be handled.
|
||||
+ char *c1, *c2;
|
||||
+ for (c1 = c2 = (char*)mountpoint; *c2; ++c1)
|
||||
+ {
|
||||
+ if (*c2 == '\\')
|
||||
+ {
|
||||
+ *c1 = (((c2[1] - '0') << 6) | ((c2[2] - '0') << 3) | (c2[3] - '0'));
|
||||
+ c2 += 4;
|
||||
+ continue;
|
||||
+ }
|
||||
+ if (c1 != c2)
|
||||
+ *c1 = *c2;
|
||||
+ ++c2;
|
||||
+ }
|
||||
+ *c1 = *c2;
|
||||
+ }
|
||||
+
|
||||
+ fclose(fp);
|
||||
+ return mountpoint;
|
||||
+}
|
||||
+
|
||||
+CUDevProvider::CUDevProvider()
|
||||
+{
|
||||
+ m_udev = NULL;
|
||||
+ m_udevMon = NULL;
|
||||
+}
|
||||
+
|
||||
+void CUDevProvider::Initialize()
|
||||
+{
|
||||
+ CLog::Log(LOGDEBUG, "Selected UDev as storage provider");
|
||||
+
|
||||
+ m_udev = udev_new();
|
||||
+ if (!m_udev)
|
||||
+ {
|
||||
+ CLog::Log(LOGERROR, "%s - failed to allocate udev context", __FUNCTION__);
|
||||
+ return;
|
||||
+ }
|
||||
+ /* set up a devices monitor that listen for any device change */
|
||||
+ m_udevMon = udev_monitor_new_from_netlink(m_udev, "udev");
|
||||
+ udev_monitor_filter_add_match_subsystem_devtype(m_udevMon, "block", "disk");
|
||||
+ udev_monitor_filter_add_match_subsystem_devtype(m_udevMon, "block", "partition");
|
||||
+ udev_monitor_enable_receiving(m_udevMon);
|
||||
+
|
||||
+ PumpDriveChangeEvents(NULL);
|
||||
+}
|
||||
+
|
||||
+void CUDevProvider::Stop()
|
||||
+{
|
||||
+ udev_monitor_unref(m_udevMon);
|
||||
+ udev_unref(m_udev);
|
||||
+}
|
||||
+
|
||||
+void CUDevProvider::GetDisks(VECSOURCES& disks, bool removable)
|
||||
+{
|
||||
+ // enumerate existing block devices
|
||||
+ struct udev_enumerate *u_enum = udev_enumerate_new(m_udev);
|
||||
+ if (u_enum == NULL)
|
||||
+ {
|
||||
+ fprintf(stderr, "Error: udev_enumerate_new(udev)\n");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ udev_enumerate_add_match_subsystem(u_enum, "block");
|
||||
+ udev_enumerate_add_match_property(u_enum, "DEVTYPE", "disk");
|
||||
+ udev_enumerate_add_match_property(u_enum, "DEVTYPE", "partition");
|
||||
+ udev_enumerate_scan_devices(u_enum);
|
||||
+
|
||||
+ struct udev_list_entry *u_list_ent;
|
||||
+ struct udev_list_entry *u_first_list_ent;
|
||||
+ u_first_list_ent = udev_enumerate_get_list_entry(u_enum);
|
||||
+ udev_list_entry_foreach(u_list_ent, u_first_list_ent)
|
||||
+ {
|
||||
+ const char *name = udev_list_entry_get_name(u_list_ent);
|
||||
+ struct udev *context = udev_enumerate_get_udev(u_enum);
|
||||
+ struct udev_device *device = udev_device_new_from_syspath(context, name);
|
||||
+ if (device == NULL)
|
||||
+ continue;
|
||||
+
|
||||
+ // filter out devices that are not mounted
|
||||
+ const char *mountpoint = get_mountpoint(udev_device_get_devnode(device));
|
||||
+ if (!mountpoint)
|
||||
+ {
|
||||
+ udev_device_unref(device);
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ // filter out things mounted on /tmp
|
||||
+ if (strstr(mountpoint, "/tmp"))
|
||||
+ {
|
||||
+ udev_device_unref(device);
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ // look for usb devices on the usb bus or mounted on /media/usbX (sdcards)
|
||||
+ const char *bus = udev_device_get_property_value(device, "ID_BUS");
|
||||
+ if (removable &&
|
||||
+ ((bus && strstr(bus, "usb")) ||
|
||||
+ (mountpoint && strstr(mountpoint, "usb"))))
|
||||
+ {
|
||||
+ const char *label = udev_device_get_property_value(device, "ID_FS_LABEL");
|
||||
+ if (!label)
|
||||
+ label = URIUtils::GetFileName(mountpoint);
|
||||
+
|
||||
+ CMediaSource share;
|
||||
+ share.strName = label;
|
||||
+ share.strPath = mountpoint;
|
||||
+ share.m_ignore = true;
|
||||
+ share.m_iDriveType = CMediaSource::SOURCE_TYPE_REMOVABLE;
|
||||
+ AddOrReplace(disks, share);
|
||||
+ }
|
||||
+ udev_device_unref(device);
|
||||
+ }
|
||||
+ udev_enumerate_unref(u_enum);
|
||||
+}
|
||||
+
|
||||
+void CUDevProvider::GetLocalDrives(VECSOURCES &localDrives)
|
||||
+{
|
||||
+ GetDisks(localDrives, false);
|
||||
+}
|
||||
+
|
||||
+void CUDevProvider::GetRemovableDrives(VECSOURCES &removableDrives)
|
||||
+{
|
||||
+ GetDisks(removableDrives, true);
|
||||
+}
|
||||
+
|
||||
+bool CUDevProvider::Eject(CStdString mountpath)
|
||||
+{
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
+std::vector<CStdString> CUDevProvider::GetDiskUsage()
|
||||
+{
|
||||
+ CPosixMountProvider legacy;
|
||||
+ return legacy.GetDiskUsage();
|
||||
+}
|
||||
+
|
||||
+bool CUDevProvider::PumpDriveChangeEvents(IStorageEventsCallback *callback)
|
||||
+{
|
||||
+ bool changed = false;
|
||||
+
|
||||
+ fd_set readfds;
|
||||
+ FD_ZERO(&readfds);
|
||||
+ FD_SET(udev_monitor_get_fd(m_udevMon), &readfds);
|
||||
+
|
||||
+ // non-blocking, check the file descriptor for received data
|
||||
+ struct timeval tv = {0};
|
||||
+ int count = select(udev_monitor_get_fd(m_udevMon) + 1, &readfds, NULL, NULL, &tv);
|
||||
+ if (count < 0)
|
||||
+ return false;
|
||||
+
|
||||
+ if (FD_ISSET(udev_monitor_get_fd(m_udevMon), &readfds))
|
||||
+ {
|
||||
+ struct udev_device *dev = udev_monitor_receive_device(m_udevMon);
|
||||
+ if (!dev)
|
||||
+ return false;
|
||||
+
|
||||
+ const char *action = udev_device_get_action(dev);
|
||||
+ const char *devtype = udev_device_get_devtype(dev);
|
||||
+ if (action)
|
||||
+ {
|
||||
+ const char *label = udev_device_get_property_value(dev, "ID_FS_LABEL");
|
||||
+ const char *mountpoint = get_mountpoint(udev_device_get_devnode(dev));
|
||||
+ if (!label)
|
||||
+ label = URIUtils::GetFileName(mountpoint);
|
||||
+
|
||||
+ if (!strcmp(action, "add") && !strcmp(devtype, "partition"))
|
||||
+ {
|
||||
+ CLog::Log(LOGNOTICE, "UDev: Added %s", mountpoint);
|
||||
+ if (callback)
|
||||
+ callback->OnStorageAdded(label, mountpoint);
|
||||
+ changed = true;
|
||||
+ }
|
||||
+ if (!strcmp(action, "remove") && !strcmp(devtype, "partition"))
|
||||
+ {
|
||||
+ CLog::Log(LOGNOTICE, "UDev: Removed %s", mountpoint);
|
||||
+ if (callback)
|
||||
+ callback->OnStorageSafelyRemoved(label);
|
||||
+ changed = true;
|
||||
+ }
|
||||
+ }
|
||||
+ udev_device_unref(dev);
|
||||
+ }
|
||||
+
|
||||
+ return changed;
|
||||
+}
|
||||
+
|
||||
+#endif
|
||||
diff --git a/xbmc/storage/linux/UDevProvider.h b/xbmc/storage/linux/UDevProvider.h
|
||||
new file mode 100644
|
||||
index 0000000..6b51e2a
|
||||
--- /dev/null
|
||||
+++ b/xbmc/storage/linux/UDevProvider.h
|
||||
@@ -0,0 +1,55 @@
|
||||
+#pragma once
|
||||
+/*
|
||||
+ * Copyright (C) 2005-2012 Team XBMC
|
||||
+ * http://www.xbmc.org
|
||||
+ *
|
||||
+ * This Program is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation; either version 2, or (at your option)
|
||||
+ * any later version.
|
||||
+ *
|
||||
+ * This Program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with XBMC; see the file COPYING. If not, write to
|
||||
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
+ * http://www.gnu.org/copyleft/gpl.html
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+#include "storage/IStorageProvider.h"
|
||||
+
|
||||
+#ifdef HAVE_LIBUDEV
|
||||
+
|
||||
+struct udev;
|
||||
+struct udev_monitor;
|
||||
+
|
||||
+class CUDevProvider : public IStorageProvider
|
||||
+{
|
||||
+public:
|
||||
+ CUDevProvider();
|
||||
+ virtual ~CUDevProvider() { }
|
||||
+
|
||||
+ virtual void Initialize();
|
||||
+ virtual void Stop();
|
||||
+
|
||||
+ virtual void GetLocalDrives(VECSOURCES &localDrives);
|
||||
+ virtual void GetRemovableDrives(VECSOURCES &removableDrives);
|
||||
+
|
||||
+ virtual bool Eject(CStdString mountpath);
|
||||
+
|
||||
+ virtual std::vector<CStdString> GetDiskUsage();
|
||||
+
|
||||
+ virtual bool PumpDriveChangeEvents(IStorageEventsCallback *callback);
|
||||
+
|
||||
+private:
|
||||
+ void GetDisks(VECSOURCES& devices, bool removable);
|
||||
+
|
||||
+ struct udev *m_udev;
|
||||
+ struct udev_monitor *m_udevMon;
|
||||
+};
|
||||
+
|
||||
+#endif
|
||||
--
|
||||
1.8.1.6
|
||||
|
@ -23,14 +23,21 @@
|
||||
. config/options $1
|
||||
|
||||
cd $PKG_BUILD
|
||||
ac_cv_have_decl_TUNSETPERSIST=no \
|
||||
./configure --host=$TARGET_NAME \
|
||||
--build=$HOST_NAME \
|
||||
--prefix=/usr \
|
||||
--disable-server \
|
||||
--enable-password-save \
|
||||
--disable-plugin-auth-pam \
|
||||
--disable-plugin-down-root \
|
||||
--disable-plugins \
|
||||
--enable-iproute2 IPROUTE="/sbin/ip" \
|
||||
--disable-management \
|
||||
--disable-socks \
|
||||
--disable-http-proxy \
|
||||
--disable-fragment \
|
||||
--disable-multihome \
|
||||
--disable-port-share \
|
||||
--disable-debug \
|
||||
|
||||
|
||||
make
|
||||
|
@ -635,16 +635,16 @@ CONFIG_FEATURE_VOLUMEID_LINUXRAID=y
|
||||
# Miscellaneous Utilities
|
||||
#
|
||||
# CONFIG_CONSPY is not set
|
||||
# CONFIG_LESS is not set
|
||||
CONFIG_FEATURE_LESS_MAXLINES=0
|
||||
# CONFIG_FEATURE_LESS_BRACKETS is not set
|
||||
# CONFIG_FEATURE_LESS_FLAGS is not set
|
||||
# CONFIG_FEATURE_LESS_MARKS is not set
|
||||
# CONFIG_FEATURE_LESS_REGEXP is not set
|
||||
# CONFIG_FEATURE_LESS_WINCH is not set
|
||||
# CONFIG_FEATURE_LESS_ASK_TERMINAL is not set
|
||||
# CONFIG_FEATURE_LESS_DASHCMD is not set
|
||||
# CONFIG_FEATURE_LESS_LINENUMS is not set
|
||||
CONFIG_LESS=y
|
||||
CONFIG_FEATURE_LESS_MAXLINES=16384
|
||||
CONFIG_FEATURE_LESS_BRACKETS=y
|
||||
CONFIG_FEATURE_LESS_FLAGS=y
|
||||
CONFIG_FEATURE_LESS_MARKS=y
|
||||
CONFIG_FEATURE_LESS_REGEXP=y
|
||||
CONFIG_FEATURE_LESS_WINCH=y
|
||||
CONFIG_FEATURE_LESS_ASK_TERMINAL=y
|
||||
CONFIG_FEATURE_LESS_DASHCMD=y
|
||||
CONFIG_FEATURE_LESS_LINENUMS=y
|
||||
# CONFIG_NANDWRITE is not set
|
||||
# CONFIG_NANDDUMP is not set
|
||||
CONFIG_SETSERIAL=y
|
||||
@ -904,7 +904,7 @@ CONFIG_FEATURE_TOP_SMP_PROCESS=y
|
||||
CONFIG_FEATURE_TOPMEM=y
|
||||
CONFIG_UPTIME=y
|
||||
# CONFIG_FEATURE_UPTIME_UTMP_SUPPORT is not set
|
||||
# CONFIG_FREE is not set
|
||||
CONFIG_FREE=y
|
||||
CONFIG_FUSER=y
|
||||
CONFIG_KILL=y
|
||||
CONFIG_KILLALL=y
|
||||
|
@ -25,7 +25,7 @@ PKG_ARCH="any"
|
||||
PKG_LICENSE="GPL"
|
||||
PKG_SITE="http://www.busybox.net"
|
||||
PKG_URL="http://busybox.net/downloads/$PKG_NAME-$PKG_VERSION.tar.bz2"
|
||||
PKG_DEPENDS="kexec-tools hdparm dosfstools e2fsprogs speedcontrol zip pciutils usbutils less procps-ng"
|
||||
PKG_DEPENDS="kexec-tools hdparm dosfstools e2fsprogs speedcontrol zip pciutils usbutils"
|
||||
PKG_BUILD_DEPENDS="toolchain busybox-hosttools"
|
||||
PKG_PRIORITY="required"
|
||||
PKG_SECTION="system"
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
wait_for_dbus () {
|
||||
while [ ! -e /var/run/dbus/system_bus_socket ]; do
|
||||
usleep 200000
|
||||
usleep 1000000
|
||||
done
|
||||
}
|
||||
|
||||
|
@ -1,37 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
################################################################################
|
||||
# This file is part of OpenELEC - http://www.openelec.tv
|
||||
# Copyright (C) 2013 Dag Wieers (dag@wieers.com)
|
||||
#
|
||||
# This Program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This Program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenELEC.tv; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
|
||||
# http://www.gnu.org/copyleft/gpl.html
|
||||
################################################################################
|
||||
|
||||
. config/options $1
|
||||
|
||||
cd $PKG_BUILD
|
||||
|
||||
# make sourcefiles writable and run autotools
|
||||
find . -type f -exec chmod +w "{}" ";"
|
||||
do_autoreconf
|
||||
|
||||
./configure --host=$TARGET_NAME \
|
||||
--build=$HOST_NAME \
|
||||
--prefix=/usr \
|
||||
--bindir=/usr/bin \
|
||||
|
||||
make
|
||||
|
@ -1,27 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
################################################################################
|
||||
# This file is part of OpenELEC - http://www.openelec.tv
|
||||
# Copyright (C) 2013 Dag Wieers (dag@wieers.com)
|
||||
#
|
||||
# This Program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This Program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenELEC.tv; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
|
||||
# http://www.gnu.org/copyleft/gpl.html
|
||||
################################################################################
|
||||
|
||||
. config/options $1
|
||||
|
||||
mkdir -p $INSTALL/usr/bin/
|
||||
cp $PKG_BUILD/less $INSTALL/usr/bin/
|
||||
|
@ -1,35 +0,0 @@
|
||||
################################################################################
|
||||
# This file is part of OpenELEC - http://www.openelec.tv
|
||||
# Copyright (C) 2013 (dag@wieers.com)
|
||||
#
|
||||
# This Program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This Program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenELEC.tv; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
|
||||
# http://www.gnu.org/copyleft/gpl.html
|
||||
################################################################################
|
||||
|
||||
PKG_NAME="less"
|
||||
PKG_VERSION="451"
|
||||
PKG_REV="1"
|
||||
PKG_ARCH="any"
|
||||
PKG_LICENSE="GPL"
|
||||
PKG_URL="http://www.greenwoodsoftware.com/less/$PKG_NAME-$PKG_VERSION.tar.gz"
|
||||
PKG_DEPENDS="ncurses"
|
||||
PKG_BUILD_DEPENDS="toolchain ncurses"
|
||||
PKG_PRIORITY="optional"
|
||||
PKG_SECTION="system"
|
||||
PKG_SHORTDESC="less: free, open-source file pager"
|
||||
PKG_LONGDESC="Less is a free, open-source file pager. It can be found on most versions of Linux, Unix and Mac OS, as well as on many other operating systems."
|
||||
PKG_IS_ADDON="no"
|
||||
|
||||
PKG_AUTORECONF="no"
|
@ -1,37 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
################################################################################
|
||||
# This file is part of OpenELEC - http://www.openelec.tv
|
||||
# Copyright (C) 2013 Dag Wieers (dag@wieers.com)
|
||||
#
|
||||
# This Program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This Program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenELEC.tv; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
|
||||
# http://www.gnu.org/copyleft/gpl.html
|
||||
################################################################################
|
||||
|
||||
. config/options $1
|
||||
|
||||
export CFLAGS="$CFLAGS -I$SYSROOT_PREFIX/usr/include/ncurses"
|
||||
export LIBS="-ltinfo"
|
||||
|
||||
cd $PKG_BUILD
|
||||
ac_cv_func_malloc_0_nonnull=yes \
|
||||
ac_cv_func_realloc_0_nonnull=yes \
|
||||
./configure --host=$TARGET_NAME \
|
||||
--build=$HOST_NAME \
|
||||
--prefix=/usr \
|
||||
--disable-skill \
|
||||
--disable-kill
|
||||
|
||||
make
|
@ -1,35 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
################################################################################
|
||||
# This file is part of OpenELEC - http://www.openelec.tv
|
||||
# Copyright (C) 2013 Dag Wieers (dag@wieers.com)
|
||||
#
|
||||
# This Program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This Program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenELEC.tv; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
|
||||
# http://www.gnu.org/copyleft/gpl.html
|
||||
################################################################################
|
||||
|
||||
. config/options $1
|
||||
|
||||
mkdir -p $INSTALL/usr/lib/
|
||||
cp -P $PKG_BUILD/proc/.libs/libprocps.so* $INSTALL/usr/lib/
|
||||
|
||||
mkdir -p $INSTALL/usr/bin/
|
||||
cp $PKG_BUILD/.libs/free $INSTALL/usr/bin/
|
||||
cp $PKG_BUILD/.libs/pgrep $INSTALL/usr/bin/
|
||||
ln -sf pgrep $INSTALL/usr/bin/pkill
|
||||
cp $PKG_BUILD/.libs/pmap $INSTALL/usr/bin/
|
||||
cp $PKG_BUILD/.libs/slabtop $INSTALL/usr/bin/
|
||||
cp $PKG_BUILD/.libs/vmstat $INSTALL/usr/bin/
|
||||
cp $PKG_BUILD/.libs/watch $INSTALL/usr/bin/
|
@ -1,36 +0,0 @@
|
||||
################################################################################
|
||||
# This file is part of OpenELEC - http://www.openelec.tv
|
||||
# Copyright (C) 2013 Dag Wieers (dag@wieers.com)
|
||||
#
|
||||
# This Program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This Program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenELEC.tv; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
|
||||
# http://www.gnu.org/copyleft/gpl.html
|
||||
################################################################################
|
||||
|
||||
PKG_NAME="procps-ng"
|
||||
PKG_VERSION="3.3.8"
|
||||
PKG_REV="1"
|
||||
PKG_ARCH="any"
|
||||
PKG_LICENSE="GPL"
|
||||
PKG_SITE="http://gitorious.org/procps/procps"
|
||||
PKG_URL="$SOURCEFORGE_SRC/procps-ng/Production/$PKG_NAME-$PKG_VERSION.tar.xz"
|
||||
PKG_DEPENDS="ncurses"
|
||||
PKG_BUILD_DEPENDS="toolchain ncurses"
|
||||
PKG_PRIORITY="optional"
|
||||
PKG_SECTION="debug"
|
||||
PKG_SHORTDESC="procps: Small useful utilities that give information about processes"
|
||||
PKG_LONGDESC="procps is the package that has a bunch of small useful utilities that give information about processes using the /proc filesystem. The package includes the programs ps, top, vmstat, w, kill, free, slabtop, and skill."
|
||||
PKG_IS_ADDON="no"
|
||||
|
||||
PKG_AUTORECONF="yes"
|
330
packages/sysutils/udevil/config/udevil.conf
Normal file
330
packages/sysutils/udevil/config/udevil.conf
Normal file
@ -0,0 +1,330 @@
|
||||
##############################################################################
|
||||
#
|
||||
# udevil configuration file /etc/udevil/udevil.conf
|
||||
#
|
||||
# This file controls what devices, networks, and files users may mount and
|
||||
# unmount via udevil (set suid).
|
||||
#
|
||||
# IMPORTANT: IT IS POSSIBLE TO CREATE SERIOUS SECURITY PROBLEMS IF THIS FILE
|
||||
# IS MISCONFIGURED - EDIT WITH CARE
|
||||
#
|
||||
# Note: For greater control for specific users, including root, copy this
|
||||
# file to /etc/udevil/udevil-user-USERNAME.conf replacing USERNAME with the
|
||||
# desired username (eg /etc/udevil/udevil-user-jim.conf).
|
||||
#
|
||||
# Format:
|
||||
# OPTION = VALUE[, VALUE, ...]
|
||||
#
|
||||
# DO NOT USE QUOTES except literally
|
||||
# Lines beginning with # are ignored
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
||||
# To log all uses of udevil, set log_file to a file path:
|
||||
# log_file = /var/log/udevil.log
|
||||
|
||||
# Approximate number of days to retain log entries (0=forever, max=60):
|
||||
log_keep_days = 10
|
||||
|
||||
|
||||
# allowed_types determines what fstypes can be passed by a user to the u/mount
|
||||
# program, what device filesystems may be un/mounted implicitly, and what
|
||||
# network filesystems may be un/mounted.
|
||||
# It may also include the 'file' keyword, indicating that the user is allowed
|
||||
# to mount files (eg an ISO file). The $KNOWN_FILESYSTEMS variable may
|
||||
# be included to include common local filesystems as well as those listed in
|
||||
# /etc/filesystems and /proc/filesystems.
|
||||
# allowed_types_USERNAME, if present, is used to override allowed_types for
|
||||
# the specific user 'USERNAME'. For example, to allow user 'jim' to mount
|
||||
# only vfat filesystems, add:
|
||||
# allowed_types_jim = vfat
|
||||
# Setting allowed_types = * does NOT allow all types, as this is a security
|
||||
# risk, but does allow all recognized types.
|
||||
# allowed_types = $KNOWN_FILESYSTEMS, file, cifs, smbfs, nfs, curlftpfs, ftpfs, sshfs, davfs, tmpfs, ramfs
|
||||
allowed_types = $KNOWN_FILESYSTEMS, hfsplus, hfs
|
||||
|
||||
|
||||
# allowed_users is a list of users permitted to mount and unmount with udevil.
|
||||
# Wildcards (* or ?) may be used in the usernames. To allow all users,
|
||||
# specify "allowed_users=*". UIDs may be included using the form UID=1000.
|
||||
# For example: allowed_users = carl, UID=1000, pre*
|
||||
# Also note that permission to execute udevil may be limited to users belonging
|
||||
# to the group that owns /usr/bin/udevil, such as 'plugdev' or 'storage',
|
||||
# depending on installation.
|
||||
# allowed_users_FSTYPE, if present, is used to override allowed_users when
|
||||
# mounting or unmounting a specific fstype (eg nfs, ext3, file).
|
||||
# Note that when mounting a file, fstype will always be 'file' regardless of
|
||||
# the internal fstype of the file.
|
||||
# For example, to allow only user 'bob' to mount nfs shares, add:
|
||||
# allowed_users_nfs = bob
|
||||
# The root user is NOT automatically allowed to use udevil in some cases unless
|
||||
# listed here (except for unmounting anything or mounting fstab devices).
|
||||
allowed_users = *
|
||||
|
||||
|
||||
# allowed_groups is a list of groups permitted to mount and unmount with
|
||||
# udevil. The user MUST belong to at least one of these groups. Wildcards
|
||||
# or GIDs may NOT be used in group names, but a single * may be used to allow
|
||||
# all groups.
|
||||
# Also note that permission to execute udevil may be limited to users belonging
|
||||
# to the group that owns /usr/bin/udevil, such as 'plugdev' or 'storage',
|
||||
# depending on installation.
|
||||
# allowed_groups_FSTYPE, if present, is used to override allowed_groups when
|
||||
# mounting or unmounting a specific fstype (eg nfs, ext3, file). For example,
|
||||
# to allow only members of the 'network' group to mount smb and nfs shares,
|
||||
# use both of these lines:
|
||||
# allowed_groups_smbfs = network
|
||||
# allowed_groups_nfs = network
|
||||
# The root user is NOT automatically allowed to use udevil in some cases unless
|
||||
# listed here (except for unmounting anything or mounting fstab devices).
|
||||
allowed_groups = *
|
||||
|
||||
|
||||
# allowed_media_dirs specifies the media directories in which user mount points
|
||||
# may be located. The first directory which exists and does not contain a
|
||||
# wildcard will be used as the default media directory (normally /media or
|
||||
# /run/media/$USER).
|
||||
# The $USER variable, if included, will be replaced with the username of the
|
||||
# user running udevil. Wildcards may also be used in any directory EXCEPT the
|
||||
# default. Wildcards will not match a /
|
||||
# allowed_media_dirs_FSTYPE, if present, is used to override allowed_media_dirs
|
||||
# when mounting or unmounting a specific fstype (eg ext2, nfs). For example,
|
||||
# to cause /media/network to be used as the default media directory for
|
||||
# nfs and ftpfs mounts, use these two lines:
|
||||
# allowed_media_dirs_nfs = /media/network, /media, /run/media/$USER
|
||||
# allowed_media_dirs_ftpfs = /media/network, /media, /run/media/$USER
|
||||
# NOTE: If you want only the user who mounted a device to have access to it
|
||||
# and be allowed to unmount it, specify /run/media/$USER as the first
|
||||
# allowed media directory.
|
||||
# IMPORTANT: If an allowed file is mounted to a media directory, the user may
|
||||
# be permitted to unmount its associated loop device even though internal.
|
||||
# INCLUDING /MNT HERE IS NOT RECOMMENDED. ALL ALLOWED MEDIA DIRECTORIES
|
||||
# SHOULD BE OWNED AND WRITABLE ONLY BY ROOT.
|
||||
allowed_media_dirs = /media, /run/media/$USER
|
||||
|
||||
|
||||
# allowed_devices is the first criteria for what block devices users may mount
|
||||
# or unmount. If a device is not listed in allowed_devices, it cannot be
|
||||
# un/mounted (unless in fstab). However, even if a device is listed, other
|
||||
# factors may prevent its use. For example, access to system internal devices
|
||||
# will be denied to normal users even if they are included in allowed_devices.
|
||||
# allowed_devices_FSTYPE, if present, is used to override allowed_devices when
|
||||
# mounting or unmounting a specific fstype (eg ext3, ntfs). For example, to
|
||||
# prevent all block devices containing an ext4 filesystem from being
|
||||
# un/mounted use:
|
||||
# allowed_devices_ext4 =
|
||||
# Note: Wildcards may be used, but a wildcard will never match a /, except
|
||||
# for "allowed_devices=*" which allows any device. The recommended setting is
|
||||
# allowed_devices = /dev/*
|
||||
# WARNING: ALLOWING USERS TO MOUNT DEVICES OUTSIDE OF /dev CAN CAUSE SERIOUS
|
||||
# SECURITY PROBLEMS. DO NOT ALLOW DEVICES IN /dev/shm
|
||||
allowed_devices = /dev/*
|
||||
|
||||
|
||||
# allowed_internal_devices causes udevil to treat any listed block devices as
|
||||
# removable, thus allowing normal users to un/mount them (providing they are
|
||||
# also listed in allowed_devices).
|
||||
# allowed_internal_devices_FSTYPE, if present, is used to override
|
||||
# allowed_internal_devices when mounting or unmounting a specific fstype
|
||||
# (eg ext3, ntfs). For example, to allow block devices containing a vfat
|
||||
# filesystem to be un/mounted even if they are system internal devices, use:
|
||||
# allowed_internal_devices_vfat = /dev/sdb*
|
||||
# Some removable esata drives look like internal drives to udevil. To avoid
|
||||
# this problem, they can be treated as removable with this setting.
|
||||
# WARNING: SETTING A SYSTEM DEVICE HERE CAN CAUSE SERIOUS SECURITY PROBLEMS.
|
||||
# allowed_internal_devices = /dev/sd*
|
||||
|
||||
|
||||
# allowed_internal_uuids and allowed_internal_uuids_FSTYPE work similarly to
|
||||
# allowed_internal_devices, except that UUIDs are specified instead of devices.
|
||||
# For example, to allow un/mounting of an internal filesystem based on UUID:
|
||||
# allowed_internal_uuids = cc0c4489-8def-1e5b-a304-ab87c3cb626c0
|
||||
# WARNING: SETTING A SYSTEM DEVICE HERE CAN CAUSE SERIOUS SECURITY PROBLEMS.
|
||||
# allowed_internal_uuids =
|
||||
|
||||
|
||||
# forbidden_devices is used to prevent block devices from being un/mounted
|
||||
# even if other settings would allow them (except devices in fstab).
|
||||
# forbidden_devices_FSTYPE, if present, is used to override
|
||||
# forbidden_devices when mounting or unmounting a specific fstype
|
||||
# (eg ext3, ntfs). For example, to prevent device /dev/sdd1 from being
|
||||
# mounted when it contains an ntfs filesystem, use:
|
||||
# forbidden_devices_ntfs = /dev/sdd1
|
||||
# NOTE: device node paths are canonicalized before being tested, so forbidding
|
||||
# a link to a device will have no effect.
|
||||
forbidden_devices =
|
||||
|
||||
|
||||
# allowed_networks determines what hosts may be un/mounted by udevil users when
|
||||
# using nfs, cifs, smbfs, curlftpfs, ftpfs, or sshfs. Hosts may be specified
|
||||
# using a hostname (eg myserver.com) or IP address (192.168.1.100).
|
||||
# Wildcards may be used in hostnames and IP addresses, but CIDR notation
|
||||
# (192.168.1.0/16) is NOT supported. IP v6 is supported. For example:
|
||||
# allowed_networks = 127.0.0.1, 192.168.1.*, 10.0.0.*, localmachine, *.okay.com
|
||||
# Or, to prevent un/mounting of any network shares, set:
|
||||
# allowed_networks =
|
||||
# allowed_networks_FSTYPE, if present, is used to override allowed_networks
|
||||
# when mounting or unmounting a specific network fstype (eg nfs, cifs, sshfs,
|
||||
# curlftpfs). For example, to limit nfs and samba shares to only local
|
||||
# networks, use these two lines:
|
||||
# allowed_networks_nfs = 192.168.1.*, 10.0.0.*
|
||||
# allowed_networks_cifs = 192.168.1.*, 10.0.0.*
|
||||
allowed_networks = *
|
||||
|
||||
|
||||
# forbidden_networks and forbidden_networks_FSTYPE are used to specify networks
|
||||
# that are never allowed, even if other settings allow them (except fstab).
|
||||
# NO REVERSE LOOKUP IS PERFORMED, so including bad.com will only have an effect
|
||||
# if the user uses that hostname. IP lookup is always performed, so forbidding
|
||||
# an IP address will also forbid all corresponding hostnames.
|
||||
forbidden_networks =
|
||||
|
||||
|
||||
# allowed_files is used to determine what files in what directories may be
|
||||
# un/mounted. A user must also have read permission on a file to mount it.
|
||||
# Note: Wildcards may be used, but a wildcard will never match a /, except
|
||||
# for "allowed_files=*" which allows any file. For example, to allow only
|
||||
# files in the /share directory to be mounted, use:
|
||||
# allowed_files = /share/*
|
||||
# NOTE: Specifying allowed_files_FSTYPE will NOT work because the fstype of
|
||||
# files is always 'file'.
|
||||
allowed_files = *
|
||||
|
||||
|
||||
# forbidden_files is used to specify files that are never allowed, even if
|
||||
# other settings allow them (except fstab). Specify a full path.
|
||||
# Note: Wildcards may be used, but a wildcard will never match a /, except
|
||||
# for "forbidden_files = *".
|
||||
# NOTE: file paths are canonicalized before being tested, so forbidding
|
||||
# a link to a file will have no effect.
|
||||
forbidden_files =
|
||||
|
||||
|
||||
# default_options specifies what options are always included when performing
|
||||
# a mount, in addition to any options the user may specify.
|
||||
# Note: When a device is present in /etc/fstab, and the user does not specify
|
||||
# a mount point, the device is mounted with normal user permissions using
|
||||
# the fstab entry, without these options.
|
||||
# default_options_FSTYPE, if present, is used to override default_options
|
||||
# when mounting a specific fstype (eg ext2, nfs).
|
||||
# The variables $USER, $UID, and $GID are changed to the user's username, UID,
|
||||
# and GID.
|
||||
# FOR GOOD SECURITY, default_options SHOULD ALWAYS INCLUDE: nosuid,noexec,nodev
|
||||
# WARNING: OPTIONS PRESENT OR MISSING CAN CAUSE SERIOUS SECURITY PROBLEMS.
|
||||
default_options = nosuid, noexec, nodev, noatime
|
||||
default_options_file = nosuid, noexec, nodev, noatime, uid=$UID, gid=$GID, ro
|
||||
# mount iso9660 with 'ro' to prevent mount read-only warning
|
||||
default_options_iso9660 = nosuid, noexec, nodev, noatime, uid=$UID, gid=$GID, ro, utf8
|
||||
default_options_udf = nosuid, noexec, nodev, noatime, uid=$UID, gid=$GID
|
||||
default_options_vfat = nosuid, noexec, nodev, noatime, fmask=0022, dmask=0022, uid=$UID, gid=$GID, utf8
|
||||
default_options_msdos = nosuid, noexec, nodev, noatime, fmask=0022, dmask=0022, uid=$UID, gid=$GID
|
||||
default_options_umsdos = nosuid, noexec, nodev, noatime, fmask=0022, dmask=0022, uid=$UID, gid=$GID
|
||||
default_options_ntfs = nosuid, noexec, nodev, noatime, uid=$UID, gid=$GID, utf8
|
||||
default_options_cifs = nosuid, noexec, nodev, uid=$UID, gid=$GID
|
||||
default_options_smbfs = nosuid, noexec, nodev, uid=$UID, gid=$GID
|
||||
default_options_sshfs = nosuid, noexec, nodev, noatime, uid=$UID, gid=$GID, nonempty, allow_other
|
||||
default_options_curlftpfs = nosuid, noexec, nodev, noatime, uid=$UID, gid=$GID, nonempty, allow_other
|
||||
default_options_ftpfs = nosuid, noexec, nodev, noatime, uid=$UID, gid=$GID
|
||||
default_options_davfs = nosuid, noexec, nodev, uid=$UID, gid=$GID
|
||||
default_options_tmpfs = nosuid, noexec, nodev, noatime, uid=$UID, gid=$GID
|
||||
default_options_ramfs = nosuid, noexec, nodev, noatime, uid=$UID, gid=$GID
|
||||
|
||||
|
||||
# allowed_options determines all options that a user may specify when mounting.
|
||||
# All the options used in default_options above must be included here too, or
|
||||
# they will be rejected. If the user attempts to use an option not included
|
||||
# here, an error will result. Wildcards may be used.
|
||||
# allowed_options_FSTYPE, if present, is used to override allowed_options
|
||||
# when mounting a specific fstype (eg ext2, nfs).
|
||||
# The variables $USER, $UID, and $GID are changed to the user's username, UID,
|
||||
# and GID.
|
||||
# If you want to forbid remounts, remove 'remount' from here.
|
||||
# WARNING: OPTIONS HERE CAN CAUSE SERIOUS SECURITY PROBLEMS - CHOOSE CAREFULLY
|
||||
allowed_options = nosuid, noexec, nodev, noatime, fmask=0022, dmask=0022, uid=$UID, gid=$GID, ro, rw, sync, flush, iocharset=*, utf8, remount
|
||||
allowed_options_nfs = nosuid, noexec, nodev, noatime, ro, rw, sync, remount, port=*, rsize=*, wsize=*, hard, proto=*, timeo=*, retrans=*
|
||||
allowed_options_cifs = nosuid, noexec, nodev, ro, rw, remount, port=*, user=*, username=*, pass=*, password=*, guest, domain=*, uid=$UID, gid=$GID, credentials=*
|
||||
allowed_options_smbfs = nosuid, noexec, nodev, ro, rw, remount, port=*, user=*, username=*, pass=*, password=*, guest, domain=*, uid=$UID, gid=$GID, credentials=*
|
||||
allowed_options_sshfs = nosuid, noexec, nodev, noatime, ro, rw, uid=$UID, gid=$GID, nonempty, allow_other, idmap=user, BatchMode=yes, port=*
|
||||
allowed_options_curlftpfs = nosuid, noexec, nodev, noatime, ro, rw, uid=$UID, gid=$GID, nonempty, allow_other, user=*
|
||||
allowed_options_ftpfs = nosuid, noexec, nodev, noatime, ro, rw, port=*, user=*, pass=*, ip=*, root=*, uid=$UID, gid=$GID
|
||||
|
||||
|
||||
# mount_point_mode, if present and set to a non-empty value, will cause udevil
|
||||
# to set the mode (permissions) on the moint point after mounting If not
|
||||
# specified or if left empty, the mode is not changed. Mode must be octal
|
||||
# starting with a zero (0755).
|
||||
# mount_point_mode_FSTYPE, if present, is used to override mount_point_mode
|
||||
# when mounting a specific fstype (eg ext2, nfs).
|
||||
# NOT SETTING A MODE CAN HAVE SECURITY IMPLICATIONS FOR SOME FSTYPES
|
||||
mount_point_mode = 0755
|
||||
# don't set a mode for some types:
|
||||
mount_point_mode_sshfs =
|
||||
mount_point_mode_curlftpfs =
|
||||
mount_point_mode_ftpfs =
|
||||
|
||||
|
||||
# Use the settings below to change the default locations of programs used by
|
||||
# udevil, or (advanced topic) to redirect commands to your scripts.
|
||||
# When substituting scripts, make sure they are root-owned and accept the
|
||||
# options used by udevil (for example, the mount_program must accept --fake,
|
||||
# -o, -v, and other options valid to mount.)
|
||||
# Be sure to specify the full path and include NO OPTIONS or other arguments.
|
||||
# These programs may also be specified as configure options when building
|
||||
# udevil.
|
||||
# THESE PROGRAMS ARE RUN AS ROOT
|
||||
# mount_program = /bin/mount
|
||||
# umount_program = /bin/umount
|
||||
# losetup_program = /sbin/losetup
|
||||
# setfacl_program = /usr/bin/setfacl
|
||||
|
||||
|
||||
# validate_exec specifies a program or script which provides additional
|
||||
# validation of a mount or unmount command, beyond the checks performed by
|
||||
# udevil. The program is run as a normal user (if root runs udevil,
|
||||
# validate_exec will NOT be run). The program is NOT run if the user is
|
||||
# mounting a device without root priviledges (a device in fstab).
|
||||
# The program is passed the username, a printable description of what is
|
||||
# happening, and the entire udevil command line as the first three arguments.
|
||||
# The program must return an exit status of 0 to allow the mount or unmount
|
||||
# to proceed. If it returns non-zero, the user will be denied permission.
|
||||
# For example, validate_exec might specify a script which notifies you
|
||||
# of the command being run, or performs additional steps to authenticate the
|
||||
# user.
|
||||
# Specify a full path to the program, with NO options or arguments.
|
||||
# validate_exec =
|
||||
|
||||
|
||||
# validate_rootexec works similarly to validate_exec, except that the program
|
||||
# is run as root. validate_rootexec will also be run if the root user runs
|
||||
# udevil. If both validate_exec and validate_rootexec are specified,
|
||||
# validate_rootexec will run first, followed by validate_exec.
|
||||
# The program must return an exit status of 0 to allow the mount or unmount
|
||||
# to proceed. If it returns non-zero, the user will be denied permission.
|
||||
# Unless you are familiar with writing root scripts, it is recommended that
|
||||
# rootexec settings NOT be used, as it is easy to inadvertently open exploits.
|
||||
# THIS PROGRAM IS ALWAYS RUN AS ROOT, even if the user running udevil is not.
|
||||
# validate_rootexec =
|
||||
|
||||
|
||||
# success_exec is run after a successful mount, remount, or unmount. The
|
||||
# program is run as a normal user (if root runs udevil, success_exec
|
||||
# will NOT be run).
|
||||
# The program is passed the username, a printable description of what action
|
||||
# was taken, and the entire udevil command line as the first three arguments.
|
||||
# The program's exit status is ignored.
|
||||
# For example, success_exec might run a script which informs you of what action
|
||||
# was taken, and might perform further actions.
|
||||
# Specify a full path to the program, with NO options or arguments.
|
||||
# success_exec =
|
||||
|
||||
|
||||
# success_rootexec works similarly to success_exec, except that the program is
|
||||
# run as root. success_rootexec will also be run if the root user runs udevil.
|
||||
# If both success_exec and success_rootexec are specified, success_rootexec
|
||||
# will run first, followed by success_exec.
|
||||
# Unless you are familiar with writing root scripts, it is recommended that
|
||||
# rootexec settings NOT be used, as it is easy to inadvertently open exploits.
|
||||
# THIS PROGRAM IS ALWAYS RUN AS ROOT, even if the user running udevil is not.
|
||||
# success_rootexec =
|
||||
|
54
packages/sysutils/udevil/package.mk
Normal file
54
packages/sysutils/udevil/package.mk
Normal file
@ -0,0 +1,54 @@
|
||||
################################################################################
|
||||
# This file is part of OpenELEC - http://www.openelec.tv
|
||||
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
|
||||
#
|
||||
# This Program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This Program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenELEC.tv; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
|
||||
# http://www.gnu.org/copyleft/gpl.html
|
||||
################################################################################
|
||||
|
||||
PKG_NAME="udevil"
|
||||
PKG_VERSION="77e0ba0"
|
||||
PKG_REV="1"
|
||||
PKG_ARCH="any"
|
||||
PKG_LICENSE="GPL"
|
||||
PKG_SITE="https://github.com/IgnorantGuru/udevil"
|
||||
PKG_URL="$DISTRO_SRC/$PKG_NAME-$PKG_VERSION.tar.xz"
|
||||
PKG_DEPENDS="systemd glib"
|
||||
PKG_BUILD_DEPENDS_TARGET="toolchain systemd glib"
|
||||
PKG_PRIORITY="optional"
|
||||
PKG_SECTION="system"
|
||||
PKG_SHORTDESC="udevil: Mounts and unmounts removable devices and networks without a password."
|
||||
PKG_LONGDESC="udevil Mounts and unmounts removable devices and networks without a password (set suid), shows device info, monitors device changes. Emulates mount's and udisks's command line usage and udisks v1's output. Includes the devmon automounting daemon."
|
||||
|
||||
PKG_IS_ADDON="no"
|
||||
PKG_AUTORECONF="yes"
|
||||
|
||||
PKG_CONFIGURE_OPTS_TARGET="--disable-systemd \
|
||||
--with-mount-prog=/bin/mount \
|
||||
--with-umount-prog=/bin/umount \
|
||||
--with-losetup-prog=/sbin/losetup \
|
||||
--with-setfacl-prog=/usr/bin/setfacl"
|
||||
|
||||
makeinstall_target() {
|
||||
: # nothing to install
|
||||
}
|
||||
|
||||
post_makeinstall_target() {
|
||||
mkdir -p $INSTALL/etc/udevil
|
||||
cp $PKG_DIR/config/udevil.conf $INSTALL/etc/udevil
|
||||
|
||||
mkdir -p $INSTALL/usr/bin
|
||||
cp -PR src/udevil $INSTALL/usr/bin
|
||||
}
|
12
packages/sysutils/udevil/udev.d/95-udevil-mount.rules
Normal file
12
packages/sysutils/udevil/udev.d/95-udevil-mount.rules
Normal file
@ -0,0 +1,12 @@
|
||||
# Mount blockdevices, /dev/sd* and partitions only
|
||||
SUBSYSTEM!="block", KERNEL!="sd*", ENV{DEVTYPE}!="partition", GOTO="exit"
|
||||
|
||||
# Mount the device
|
||||
ACTION=="add", RUN+="/usr/bin/udevil --mount /dev/%k"
|
||||
|
||||
# Clean up after removal
|
||||
ACTION=="remove", RUN+="/usr/bin/udevil --umount /dev/%k"
|
||||
|
||||
# Exit
|
||||
LABEL="exit"
|
||||
|
@ -26,7 +26,7 @@ PKG_LICENSE="GPL"
|
||||
PKG_SITE="http://sources.redhat.com/autoconf/"
|
||||
PKG_URL="http://ftp.gnu.org/gnu/autoconf/$PKG_NAME-$PKG_VERSION.tar.xz"
|
||||
PKG_DEPENDS=""
|
||||
PKG_BUILD_DEPENDS="ccache m4 gettext"
|
||||
PKG_BUILD_DEPENDS="ccache m4 gettext:host"
|
||||
PKG_PRIORITY="optional"
|
||||
PKG_SECTION="toolchain/devel"
|
||||
PKG_SHORTDESC="autoconf: A GNU tool for automatically configuring source code"
|
||||
|
@ -19,18 +19,22 @@
|
||||
################################################################################
|
||||
|
||||
PKG_NAME="gettext"
|
||||
PKG_VERSION="0.18.3"
|
||||
PKG_VERSION="0.18.3.1"
|
||||
PKG_REV="1"
|
||||
PKG_ARCH="any"
|
||||
PKG_LICENSE="GPL"
|
||||
PKG_SITE="http://www.gnu.org/s/gettext/"
|
||||
PKG_URL="http://ftp.gnu.org/pub/gnu/gettext/$PKG_NAME-$PKG_VERSION.tar.gz"
|
||||
PKG_DEPENDS=""
|
||||
PKG_BUILD_DEPENDS="ccache"
|
||||
PKG_BUILD_DEPENDS_HOST="ccache"
|
||||
PKG_PRIORITY="optional"
|
||||
PKG_SECTION="toolchain/devel"
|
||||
PKG_SHORTDESC="gettext: A program internationalization library and tools"
|
||||
PKG_LONGDESC="This is the GNU gettext package. It is interesting for authors or maintainers of other packages or programs which they want to see internationalized. As one step the handling of messages in different languages should be implemented. For this task GNU gettext provides the needed tools and library functions."
|
||||
PKG_IS_ADDON="no"
|
||||
|
||||
PKG_IS_ADDON="no"
|
||||
PKG_AUTORECONF="no"
|
||||
|
||||
PKG_CONFIGURE_OPTS_HOST="--disable-rpath \
|
||||
--with-gnu-ld \
|
||||
--without-emacs"
|
@ -26,7 +26,7 @@ PKG_LICENSE="GPL"
|
||||
PKG_SITE="http://www.freedesktop.org/software/pkgconfig/"
|
||||
PKG_URL="http://pkgconfig.freedesktop.org/releases/$PKG_NAME-$PKG_VERSION.tar.gz"
|
||||
PKG_DEPENDS=""
|
||||
PKG_BUILD_DEPENDS="ccache gettext"
|
||||
PKG_BUILD_DEPENDS="ccache gettext:host"
|
||||
PKG_PRIORITY="optional"
|
||||
PKG_SECTION="toolchain/devel"
|
||||
PKG_SHORTDESC="pkg-config: A library configuration management system"
|
||||
|
@ -39,7 +39,6 @@ if [ "$TARGET_ARCH" = "i386" -o "$TARGET_ARCH" = "x86_64" ]; then
|
||||
PKG_DEPENDS="$PKG_DEPENDS flashrom"
|
||||
fi
|
||||
|
||||
|
||||
make_target() {
|
||||
: # nothing to make here
|
||||
}
|
||||
|
@ -222,6 +222,11 @@
|
||||
# in the mediacenter also automount internally drives at boottime (yes / no)
|
||||
UDISKS="yes"
|
||||
|
||||
# build and install diskmounter support (udevil)
|
||||
# this service provide auto mounting support for external drives in the
|
||||
# mediacenter also automount internally drives at boottime via udev (yes / no)
|
||||
UDEVIL="no"
|
||||
|
||||
# build and install exFAT fuse support (yes / no)
|
||||
EXFAT="yes"
|
||||
|
||||
|
@ -222,6 +222,11 @@
|
||||
# in the mediacenter also automount internally drives at boottime (yes / no)
|
||||
UDISKS="yes"
|
||||
|
||||
# build and install diskmounter support (udevil)
|
||||
# this service provide auto mounting support for external drives in the
|
||||
# mediacenter also automount internally drives at boottime via udev (yes / no)
|
||||
UDEVIL="no"
|
||||
|
||||
# build and install exFAT fuse support (yes / no)
|
||||
EXFAT="yes"
|
||||
|
||||
|
@ -222,6 +222,11 @@
|
||||
# in the mediacenter also automount internally drives at boottime (yes / no)
|
||||
UDISKS="yes"
|
||||
|
||||
# build and install diskmounter support (udevil)
|
||||
# this service provide auto mounting support for external drives in the
|
||||
# mediacenter also automount internally drives at boottime via udev (yes / no)
|
||||
UDEVIL="no"
|
||||
|
||||
# build and install exFAT fuse support (yes / no)
|
||||
EXFAT="yes"
|
||||
|
||||
|
@ -222,6 +222,11 @@
|
||||
# in the mediacenter also automount internally drives at boottime (yes / no)
|
||||
UDISKS="yes"
|
||||
|
||||
# build and install diskmounter support (udevil)
|
||||
# this service provide auto mounting support for external drives in the
|
||||
# mediacenter also automount internally drives at boottime via udev (yes / no)
|
||||
UDEVIL="no"
|
||||
|
||||
# build and install exFAT fuse support (yes / no)
|
||||
EXFAT="yes"
|
||||
|
||||
|
@ -222,6 +222,11 @@
|
||||
# in the mediacenter also automount internally drives at boottime (yes / no)
|
||||
UDISKS="yes"
|
||||
|
||||
# build and install diskmounter support (udevil)
|
||||
# this service provide auto mounting support for external drives in the
|
||||
# mediacenter also automount internally drives at boottime via udev (yes / no)
|
||||
UDEVIL="no"
|
||||
|
||||
# build and install exFAT fuse support (yes / no)
|
||||
EXFAT="yes"
|
||||
|
||||
|
@ -222,6 +222,11 @@
|
||||
# in the mediacenter also automount internally drives at boottime (yes / no)
|
||||
UDISKS="yes"
|
||||
|
||||
# build and install diskmounter support (udevil)
|
||||
# this service provide auto mounting support for external drives in the
|
||||
# mediacenter also automount internally drives at boottime via udev (yes / no)
|
||||
UDEVIL="no"
|
||||
|
||||
# build and install exFAT fuse support (yes / no)
|
||||
EXFAT="yes"
|
||||
|
||||
|
@ -222,6 +222,11 @@
|
||||
# in the mediacenter also automount internally drives at boottime (yes / no)
|
||||
UDISKS="yes"
|
||||
|
||||
# build and install diskmounter support (udevil)
|
||||
# this service provide auto mounting support for external drives in the
|
||||
# mediacenter also automount internally drives at boottime via udev (yes / no)
|
||||
UDEVIL="no"
|
||||
|
||||
# build and install exFAT fuse support (yes / no)
|
||||
EXFAT="yes"
|
||||
|
||||
|
@ -222,6 +222,11 @@
|
||||
# in the mediacenter also automount internally drives at boottime (yes / no)
|
||||
UDISKS="yes"
|
||||
|
||||
# build and install diskmounter support (udevil)
|
||||
# this service provide auto mounting support for external drives in the
|
||||
# mediacenter also automount internally drives at boottime via udev (yes / no)
|
||||
UDEVIL="no"
|
||||
|
||||
# build and install exFAT fuse support (yes / no)
|
||||
EXFAT="yes"
|
||||
|
||||
|
@ -217,6 +217,11 @@
|
||||
# in the mediacenter also automount internally drives at boottime (yes / no)
|
||||
UDISKS="yes"
|
||||
|
||||
# build and install diskmounter support (udevil)
|
||||
# this service provide auto mounting support for external drives in the
|
||||
# mediacenter also automount internally drives at boottime via udev (yes / no)
|
||||
UDEVIL="no"
|
||||
|
||||
# build and install exFAT fuse support (yes / no)
|
||||
EXFAT="yes"
|
||||
|
||||
|
@ -120,6 +120,7 @@ IMAGE_NAME="$DISTRONAME-$TARGET_VERSION"
|
||||
|
||||
# Automounter support
|
||||
[ "$UDISKS" = "yes" ] && $SCRIPTS/install udisks
|
||||
[ "$UDEVIL" = "yes" ] && $SCRIPTS/install udevil
|
||||
|
||||
# NTFS 3G support
|
||||
[ "$EXFAT" = "yes" ] && $SCRIPTS/install fuse-exfat
|
||||
|
@ -1,5 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
################################################################################
|
||||
# This file is part of OpenELEC - http://www.openelec.tv
|
||||
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
|
||||
@ -20,20 +19,26 @@
|
||||
# http://www.gnu.org/copyleft/gpl.html
|
||||
################################################################################
|
||||
|
||||
. config/options $1
|
||||
echo "getting sources..."
|
||||
if [ ! -d udevil.git ]; then
|
||||
git clone git@github.com:IgnorantGuru/udevil.git -b master udevil.git
|
||||
fi
|
||||
|
||||
setup_toolchain host
|
||||
cd udevil.git
|
||||
git pull
|
||||
GIT_REV=`git log -n1 --format=%h`
|
||||
cd ..
|
||||
|
||||
cd $PKG_BUILD
|
||||
./configure --host=$HOST_NAME \
|
||||
--build=$HOST_NAME \
|
||||
--target=$TARGET_NAME \
|
||||
--prefix=$ROOT/$TOOLCHAIN \
|
||||
--enable-shared \
|
||||
--disable-static \
|
||||
--disable-rpath \
|
||||
--with-gnu-ld \
|
||||
--without-emacs
|
||||
echo "copying sources..."
|
||||
rm -rf udevil-$GIT_REV
|
||||
cp -R udevil.git udevil-$GIT_REV
|
||||
|
||||
make
|
||||
make install
|
||||
echo "cleaning sources..."
|
||||
rm -rf udevil-$GIT_REV/.git
|
||||
rm -rf udevil-$GIT_REV/packages
|
||||
|
||||
echo "packing sources..."
|
||||
tar cvJf udevil-$GIT_REV.tar.xz udevil-$GIT_REV
|
||||
|
||||
echo "remove temporary sourcedir..."
|
||||
rm -rf udevil-$GIT_REV
|
Loading…
x
Reference in New Issue
Block a user