Initial Commit
- initial default booting image
This commit is contained in:
22
package/restorecond/Config.in
Normal file
22
package/restorecond/Config.in
Normal file
@@ -0,0 +1,22 @@
|
||||
config BR2_PACKAGE_RESTORECOND
|
||||
bool "restorecond"
|
||||
depends on BR2_USE_MMU # libglib2
|
||||
depends on BR2_USE_WCHAR # libglib2
|
||||
depends on BR2_TOOLCHAIN_HAS_THREADS # libglib2
|
||||
depends on !BR2_STATIC_LIBS # libselinux
|
||||
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_5 # libsepol
|
||||
select BR2_PACKAGE_DBUS
|
||||
select BR2_PACKAGE_DBUS_GLIB
|
||||
select BR2_PACKAGE_LIBGLIB2
|
||||
select BR2_PACKAGE_LIBSELINUX
|
||||
select BR2_PACKAGE_LIBSEPOL
|
||||
help
|
||||
restorecond is a daemon that watches for file creation and
|
||||
then sets the default SELinux file context for that file.
|
||||
|
||||
https://github.com/SELinuxProject/selinux/wiki/Releases
|
||||
|
||||
comment "restorecond needs a toolchain w/ wchar, threads, dynamic library, gcc >= 5"
|
||||
depends on BR2_USE_MMU
|
||||
depends on !BR2_TOOLCHAIN_HAS_THREADS || !BR2_USE_WCHAR || \
|
||||
BR2_STATIC_LIBS || !BR2_TOOLCHAIN_GCC_AT_LEAST_5
|
||||
54
package/restorecond/S02restorecond
Normal file
54
package/restorecond/S02restorecond
Normal file
@@ -0,0 +1,54 @@
|
||||
#!/bin/sh
|
||||
|
||||
DAEMON=restorecond
|
||||
PIDFILE=/var/run/$DAEMON.pid
|
||||
|
||||
RESTORECOND_ARGS=""
|
||||
|
||||
# shellcheck source=/dev/null
|
||||
[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON"
|
||||
|
||||
start()
|
||||
{
|
||||
printf 'Starting %s: ' "$DAEMON"
|
||||
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/sbin/$DAEMON" \
|
||||
-- $RESTORECOND_ARGS
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
}
|
||||
|
||||
stop()
|
||||
{
|
||||
printf 'Stopping %s: ' "$DAEMON"
|
||||
start-stop-daemon -K -q -p $PIDFILE -R TERM/30/KILL/5 -n $DAEMON
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
rm -f "$PIDFILE"
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
}
|
||||
|
||||
restart()
|
||||
{
|
||||
stop
|
||||
sleep 1
|
||||
start
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start|stop|restart)
|
||||
"$1";;
|
||||
reload)
|
||||
restart;;
|
||||
*)
|
||||
echo $"Usage: $0 {start|stop|restart|reload}"
|
||||
exit 1
|
||||
esac
|
||||
5
package/restorecond/restorecond.hash
Normal file
5
package/restorecond/restorecond.hash
Normal file
@@ -0,0 +1,5 @@
|
||||
# https://github.com/SELinuxProject/selinux/wiki/Releases
|
||||
sha256 a1ae64084d4a9dd550669301cc456873879f49fe77f71ee2fca9f9d3a16646a0 restorecond-3.10.tar.gz
|
||||
|
||||
# Hash for license file
|
||||
sha256 204d8eff92f95aac4df6c8122bc1505f468f3a901e5a4cc08940e0ede1938994 LICENSE
|
||||
47
package/restorecond/restorecond.mk
Normal file
47
package/restorecond/restorecond.mk
Normal file
@@ -0,0 +1,47 @@
|
||||
################################################################################
|
||||
#
|
||||
# restorecond
|
||||
#
|
||||
################################################################################
|
||||
|
||||
RESTORECOND_VERSION = 3.10
|
||||
RESTORECOND_SITE = https://github.com/SELinuxProject/selinux/releases/download/$(RESTORECOND_VERSION)
|
||||
RESTORECOND_LICENSE = GPL-2.0
|
||||
RESTORECOND_LICENSE_FILES = LICENSE
|
||||
|
||||
RESTORECOND_DEPENDENCIES = libglib2 libsepol libselinux dbus-glib
|
||||
|
||||
RESTORECOND_MAKE_OPTS += \
|
||||
$(TARGET_CONFIGURE_OPTS) \
|
||||
ARCH="$(BR2_ARCH)"
|
||||
|
||||
# We need to pass DESTDIR at build time because it's used by
|
||||
# restorecond build system to find headers and libraries.
|
||||
define RESTORECOND_BUILD_CMDS
|
||||
$(MAKE) -C $(@D) $(RESTORECOND_MAKE_OPTS) DESTDIR=$(STAGING_DIR) all
|
||||
endef
|
||||
|
||||
define RESTORECOND_INSTALL_INIT_SYSV
|
||||
$(INSTALL) -m 0755 -D package/restorecond/S02restorecond \
|
||||
$(TARGET_DIR)/etc/init.d/S02restorecond
|
||||
endef
|
||||
|
||||
define RESTORECOND_INSTALL_INIT_SYSTEMD
|
||||
$(INSTALL) -m 0644 -D $(@D)/restorecond.service \
|
||||
$(TARGET_DIR)/usr/lib/systemd/system/restorecond.service
|
||||
|
||||
mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
|
||||
ln -fs ../../../../usr/lib/systemd/system/restorecond.service \
|
||||
$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/restorecond.service
|
||||
|
||||
$(INSTALL) -m 0600 -D $(@D)/org.selinux.Restorecond.service \
|
||||
$(TARGET_DIR)/etc/systemd/system/org.selinux.Restorecond.service
|
||||
endef
|
||||
|
||||
define RESTORECOND_INSTALL_TARGET_CMDS
|
||||
$(INSTALL) -m 0644 -D $(@D)/restorecond.conf $(TARGET_DIR)/etc/selinux/restorecond.conf
|
||||
$(INSTALL) -m 0644 -D $(@D)/restorecond_user.conf $(TARGET_DIR)/etc/selinux/restorecond_user.conf
|
||||
$(INSTALL) -m 0755 -D $(@D)/restorecond $(TARGET_DIR)/usr/sbin/restorecond
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
||||
Reference in New Issue
Block a user