Initial Commit

- initial default booting image
This commit is contained in:
2026-11-06 20:45:42 +01:00
commit b8783708ae
15201 changed files with 602532 additions and 0 deletions

View File

@@ -0,0 +1,113 @@
From ae84e5ef59bb24d5b8fd17e6756952f42c2d5c36 Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Thu, 23 Feb 2017 08:17:07 +0100
Subject: [PATCH] Do not export/use setools.InfoFlowAnalysis and
setools.DomainTransitionAnalysis
dta and infoflow modules require networkx which brings lot of dependencies.
These dependencies are not necessary for setools module itself as it's
used in policycoreutils.
Therefore it's better to use setools.infoflow.InfoFlowAnalysis and
setools.dta.DomainTransitionAnalysis and let the package containing
sedta and seinfoflow to require python3-networkx
Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
[Refreshed for 4.3.0]
Signed-off-by: Adam Duskett <aduskett@gmail.com>
[Refreshed for 4.5.1]
Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com>
---
sedta | 3 ++-
seinfoflow | 5 +++--
setools/__init__.py | 2 +-
tests/test_dta.py | 2 +-
tests/test_infoflow.py | 2 +-
5 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/sedta b/sedta
index 9b580fc..bec89d4 100755
--- a/sedta
+++ b/sedta
@@ -12,6 +12,7 @@ import warnings
import networkx as nx
import setools
+import setools.dta
signal.signal(signal.SIGPIPE, signal.SIG_DFL)
@@ -68,7 +69,7 @@ else:
try:
p = setools.SELinuxPolicy(args.policy)
- g = setools.DomainTransitionAnalysis(p, exclude=args.exclude)
+ g = setools.dta.DomainTransitionAnalysis(p, exclude=args.exclude)
pathnum: int = 0
path: setools.DTAPath
diff --git a/seinfoflow b/seinfoflow
index b4ad328..61f1ef5 100755
--- a/seinfoflow
+++ b/seinfoflow
@@ -13,6 +13,7 @@ from typing import Dict, Optional
import networkx as nx
import setools
+import setools.infoflow
signal.signal(signal.SIGPIPE, signal.SIG_DFL)
@@ -104,8 +105,8 @@ elif args.booleans is not None:
try:
p = setools.SELinuxPolicy(args.policy)
m = setools.PermissionMap(args.map)
- g = setools.InfoFlowAnalysis(p, m, min_weight=args.min_weight, exclude=args.exclude,
- booleans=booleans)
+ g = setools.infoflow.InfoFlowAnalysis(p, m, min_weight=args.min_weight, exclude=args.exclude,
+ booleans=booleans)
flownum: int = 0
flow: setools.InfoFlowPath
diff --git a/setools/__init__.py b/setools/__init__.py
index 1efd2cc..fe54ab2 100644
--- a/setools/__init__.py
+++ b/setools/__init__.py
@@ -81,7 +81,7 @@ from .infoflow import *
from .permmap import PermissionMap, RuleWeight, Mapping
# Domain Transition Analysis
-from .dta import *
+# from .dta import *
# Policy difference
from .diff import PolicyDifference
diff --git a/tests/test_dta.py b/tests/test_dta.py
index 2398b3f..b943bd6 100644
--- a/tests/test_dta.py
+++ b/tests/test_dta.py
@@ -5,7 +5,7 @@
import os
import unittest
-from setools import DomainTransitionAnalysis
+from setools.dta import DomainTransitionAnalysis
from setools import TERuletype as TERT
from setools.exception import InvalidType
from setools.policyrep import Type
diff --git a/tests/test_infoflow.py b/tests/test_infoflow.py
index ba2983f..9cd6ab3 100644
--- a/tests/test_infoflow.py
+++ b/tests/test_infoflow.py
@@ -5,7 +5,7 @@
import os
import unittest
-from setools import InfoFlowAnalysis
+from setools.infoflow import InfoFlowAnalysis
from setools import TERuletype as TERT
from setools.exception import InvalidType
from setools.permmap import PermissionMap
--
2.46.0

30
package/setools/Config.in Normal file
View File

@@ -0,0 +1,30 @@
config BR2_PACKAGE_SETOOLS
bool "setools"
depends on !BR2_STATIC_LIBS
depends on BR2_TOOLCHAIN_HAS_THREADS
depends on BR2_USE_WCHAR
depends on BR2_USE_MMU
depends on BR2_PACKAGE_PYTHON3
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_5 # libselinux -> libsepol
select BR2_PACKAGE_PYTHON_NETWORKX # runtime
select BR2_PACKAGE_PYTHON_SETUPTOOLS
select BR2_PACKAGE_LIBSELINUX
help
SETools is an open source project designed to facilitate
SELinux policy analysis. The primary tools are:
* apol - analyze a SELinux policy. (requires python-qt5)
* sediff - semantic policy difference tool for SELinux.
* sedta - Perform domain transition analyses
* seinfoflow - information flow analysis for SELinux
* sesearch - Search rules (allow, type_transition, etc.)
https://github.com/SELinuxProject/setools/
comment "setools needs a toolchain w/ threads, wchar, dynamic library, gcc >= 5"
depends on BR2_USE_MMU
depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS || \
!BR2_USE_WCHAR || !BR2_TOOLCHAIN_GCC_AT_LEAST_5
comment "setools needs python3"
depends on BR2_USE_MMU
depends on !BR2_PACKAGE_PYTHON3

View File

@@ -0,0 +1,5 @@
# Locally computed
sha256 3fc1d663bbe00e3e2c3f97b371ff55b468e70d7965908cfde35ccc8e55bb2491 setools-4.5.1.tar.gz
sha256 0e58d74751e394f39748c7b7b4039d6a883b5def9711160668ba962b52e69e01 COPYING
sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 COPYING.GPL
sha256 dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551 COPYING.LGPL

View File

@@ -0,0 +1,51 @@
################################################################################
#
# setools
#
################################################################################
SETOOLS_VERSION = 4.5.1
SETOOLS_SITE = $(call github,SELinuxProject,setools,$(SETOOLS_VERSION))
SETOOLS_DEPENDENCIES = libselinux libsepol python-setuptools host-bison host-flex host-python-cython host-swig
SETOOLS_INSTALL_STAGING = YES
SETOOLS_LICENSE = GPL-2.0+, LGPL-2.1+
SETOOLS_LICENSE_FILES = COPYING COPYING.GPL COPYING.LGPL
SETOOLS_CPE_ID_VENDOR = selinuxproject
SETOOLS_SETUP_TYPE = setuptools
HOST_SETOOLS_DEPENDENCIES = host-python-cython host-libselinux host-libsepol host-python-networkx
define SETOOLS_FIX_SETUP
# By default, setup.py will look for libsepol.a in the host machines
# /usr/lib directory. This needs to be changed to the staging directory.
$(SED) "s@lib_dirs =.*@lib_dirs = ['$(STAGING_DIR)/usr/lib']@g" \
$(@D)/setup.py
endef
SETOOLS_POST_PATCH_HOOKS += SETOOLS_FIX_SETUP
define HOST_SETOOLS_FIX_SETUP
# By default, setup.py will look for libsepol.a in the host machines
# /usr/lib directory. This needs to be changed to the host directory.
$(SED) "s@lib_dirs =.*@lib_dirs = ['$(HOST_DIR)/lib']@g" \
$(@D)/setup.py
endef
HOST_SETOOLS_POST_PATCH_HOOKS += HOST_SETOOLS_FIX_SETUP
# apol requires pyqt5. However, the setools installation
# process will install apol even if pyqt5 is missing.
# Remove these scripts from the target it pyqt5 is not selected.
ifeq ($(BR2_PACKAGE_PYTHON_PYQT5),)
define SETOOLS_REMOVE_QT_SCRIPTS
$(RM) $(TARGET_DIR)/usr/bin/apol
$(RM) -r $(TARGET_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages/setoolsgui/
endef
SETOOLS_POST_INSTALL_TARGET_HOOKS += SETOOLS_REMOVE_QT_SCRIPTS
endif
# pyqt5 is not a host-package, remove apol from the host directory.
define HOST_SETOOLS_REMOVE_BROKEN_SCRIPTS
$(RM) $(HOST_DIR)/bin/apol
endef
HOST_SETOOLS_POST_INSTALL_HOOKS += HOST_SETOOLS_REMOVE_BROKEN_SCRIPTS
$(eval $(python-package))
$(eval $(host-python-package))