Initial Commit
- initial default booting image
This commit is contained in:
28
package/usbguard/Config.in
Normal file
28
package/usbguard/Config.in
Normal file
@@ -0,0 +1,28 @@
|
||||
config BR2_PACKAGE_USBGUARD
|
||||
bool "usbguard"
|
||||
depends on BR2_PACKAGE_PROTOBUF_ARCH_SUPPORTS # protobuf
|
||||
depends on BR2_INSTALL_LIBSTDCPP # protobuf
|
||||
depends on BR2_TOOLCHAIN_HAS_THREADS # libqb, protobuf
|
||||
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_8 # protobuf, C++17 filesystem
|
||||
depends on !BR2_STATIC_LIBS # libqb, protobuf
|
||||
depends on !BR2_TOOLCHAIN_HAS_GCC_BUG_64735 # std::future
|
||||
select BR2_PACKAGE_PROTOBUF
|
||||
select BR2_PACKAGE_LIBQB
|
||||
select BR2_PACKAGE_LIBSODIUM if !BR2_PACKAGE_LIBGCRYPT && !BR2_PACKAGE_LIBOPENSSL
|
||||
help
|
||||
The USBGuard software framework
|
||||
|
||||
Install a custom accept/deny list in /etc/usbguard/rules.conf
|
||||
(e.g. using an overlay). This file can be generated on the
|
||||
target using "usbguard generate-policy".
|
||||
|
||||
https://usbguard.github.io/
|
||||
|
||||
comment "usbguard needs a toolchain w/ C++, threads, dynamic library, gcc >= 8"
|
||||
depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS \
|
||||
|| BR2_STATIC_LIBS || !BR2_TOOLCHAIN_GCC_AT_LEAST_8
|
||||
depends on BR2_PACKAGE_PROTOBUF_ARCH_SUPPORTS
|
||||
|
||||
comment "usbguard needs a toolchain not affected by GCC bug 64735"
|
||||
depends on BR2_PACKAGE_PROTOBUF_ARCH_SUPPORTS
|
||||
depends on BR2_TOOLCHAIN_HAS_GCC_BUG_64735
|
||||
37
package/usbguard/S20usbguard
Normal file
37
package/usbguard/S20usbguard
Normal file
@@ -0,0 +1,37 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Start psplash
|
||||
#
|
||||
|
||||
PIDFILE=/var/run/$NAME.pid
|
||||
|
||||
start() {
|
||||
printf "Starting usbguard daemon: "
|
||||
test -d /var/log/usbguard || mkdir -p /var/log/usbguard
|
||||
start-stop-daemon -b -S -q -m -p $PIDFILE --exec /usr/sbin/usbguard-daemon -- -f -s -c /etc/usbguard/usbguard-daemon.conf
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
}
|
||||
|
||||
stop() {
|
||||
printf "Stopping usbguard daemon: "
|
||||
start-stop-daemon -K -q -p $PIDFILE
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
restart|reload)
|
||||
stop
|
||||
start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit $?
|
||||
5
package/usbguard/usbguard.hash
Normal file
5
package/usbguard/usbguard.hash
Normal file
@@ -0,0 +1,5 @@
|
||||
# From https://github.com/USBGuard/usbguard/releases/download/usbguard-1.1.4/usbguard-1.1.4.tar.gz.sum
|
||||
sha256 7d76b75e779e3c9e6c2fc10e7389dfa34056864c9f0c6eaca722687b7e75893c usbguard-1.1.4.tar.gz
|
||||
|
||||
# Locally calculated
|
||||
sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 LICENSE
|
||||
65
package/usbguard/usbguard.mk
Normal file
65
package/usbguard/usbguard.mk
Normal file
@@ -0,0 +1,65 @@
|
||||
################################################################################
|
||||
#
|
||||
## usbguard
|
||||
#
|
||||
################################################################################
|
||||
|
||||
USBGUARD_VERSION = 1.1.4
|
||||
USBGUARD_SITE = https://github.com/USBGuard/usbguard/releases/download/usbguard-$(USBGUARD_VERSION)
|
||||
USBGUARD_LICENSE = GPL-2.0+
|
||||
USBGUARD_LICENSE_FILES = LICENSE
|
||||
USBGUARD_CPE_ID_VALID = YES
|
||||
USBGUARD_SELINUX_MODULES = usbguard
|
||||
USBGUARD_CONF_ENV = ac_cv_prog_A2X=""
|
||||
USBGUARD_CONF_OPTS = \
|
||||
--with-bundled-catch \
|
||||
--with-bundled-pegtl \
|
||||
--disable-debug-build \
|
||||
--without-dbus \
|
||||
--without-polkit \
|
||||
--disable-umockdev
|
||||
|
||||
USBGUARD_DEPENDENCIES += libqb protobuf
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBSODIUM),y)
|
||||
USBGUARD_CONF_OPTS += --with-crypto-library=sodium
|
||||
USBGUARD_DEPENDENCIES += libsodium
|
||||
else ifeq ($(BR2_PACKAGE_LIBOPENSSL),y)
|
||||
USBGUARD_CONF_OPTS += --with-crypto-library=openssl
|
||||
USBGUARD_DEPENDENCIES += libopenssl
|
||||
else ifeq ($(BR2_PACKAGE_LIBGCRYPT),y)
|
||||
USBGUARD_CONF_ENV += \
|
||||
ac_cv_path_LIBGCRYPT_CONFIG=$(STAGING_DIR)/usr/bin/libgcrypt-config
|
||||
USBGUARD_CONF_OPTS += --with-crypto-library=gcrypt
|
||||
USBGUARD_DEPENDENCIES += libgcrypt
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_SYSTEMD),y)
|
||||
USBGUARD_CONF_OPTS += --enable-systemd
|
||||
USBGUARD_DEPENDENCIES += systemd
|
||||
else
|
||||
USBGUARD_CONF_OPTS += --disable-systemd
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBSECCOMP),y)
|
||||
USBGUARD_CONF_OPTS += --enable-seccomp
|
||||
USBGUARD_DEPENDENCIES += libseccomp
|
||||
else
|
||||
USBGUARD_CONF_OPTS += --disable-seccomp
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBCAP_NG),y)
|
||||
USBGUARD_CONF_OPTS += --enable-libcapng
|
||||
USBGUARD_DEPENDENCIES += libcap-ng
|
||||
endif
|
||||
|
||||
define USBGUARD_INSTALL_INIT_SYSV
|
||||
$(INSTALL) -m 0755 -D package/usbguard/S20usbguard \
|
||||
$(TARGET_DIR)/etc/init.d/S20usbguard
|
||||
endef
|
||||
|
||||
define USBGUARD_PERMISSIONS
|
||||
/etc/usbguard/rules.conf f 0600 0 0 - - - - -
|
||||
endef
|
||||
|
||||
$(eval $(autotools-package))
|
||||
Reference in New Issue
Block a user