SELinux Buildroot Additions
v2 cover SELinux Buildroot Additions
This is Round 2 for the SELinux package additions.
General changes in this version
- General formatting cleanup on all files to match the buildroot standard.
- Reworked the Python selects and dependencies to be a little simpler. Now, when Python is enabled, all Python bindings are built for the SELinux packages.
- Moved all of the SELinux libraries to a Libraries -> Security folder.
- More information on SELinux and how to enable it (see below).
Per Thomas Petazzoni's <[email protected]> email, here is a brief overview of SELinux and how I have implemented it in buildroot.
SELinux is made up of several packages and Linux kernel configurations. The best reference, at least the most complete, is probably the SELinux Notebook at the link below. The notebook details how SELinux works and gives very good examples on how to implement SELinux policies.
http://www.freetechbooks.com/the-selinux-notebook-the-foundations-t785.html
Packages:
libsepol
libselinux
libsemanage
checkpolicy
sepolgen
setools
policycoreutils
refpolicy
For this implementation, I have added a package hierarchy that will allow for both a debugging and a paired down release version. The debugging version required Python support, and is therefore much larger while the release version does not. To enable the release version, simply select the refpolicy package (BR2_PACKAGE_REFPOLICY) and it selects all of the necessary packages to enable SELinux. For the debugging version, select the policycoreutils debugging configure option (BR2_PACKAGE_POLICYCOREUTILS_POLICY_DEBUGGING). This will pull in Python and a bunch of other packages into the build to debug the SELinux policy on target.
Caveats:
1. The Linux kernel config will need to be changed to enable SELinux support and extended attribute support on the file systems
2. The busybox config will need to be changed to remove some packages or to build each executable as a stand-alone package. The busybox symlinks don't work well with the default refpolicy.
3. The audit package will need to be enabled to log issues with the SELinux policy, especially if it is in enforcing mode.
4. If a modular SELinux policy is selected, BR2_PACKAGE_REFPOLICY_MONOLITHIC = n, then the policy will be compiled on target during the first boot which will take a long time (about a half hour on a pandaboard).
Clayton Shotwell (17):
libsepol: new package
libselinux: new package
ustr: new package
libsemanage: new package
checkpolicy: new package
sepolgen: new package
setools: new package
libcgroup: new package
policycoreutils: new package
python-pyxml: new package
refpolicy: new package
python-pyparsing: Add host build option
audit: new package
shadow: new package
pcre: Add host build support
bzip2: Add host build shared library installation
sqlite: Add host build support
package/Config.in | 20 + package/Config.in.host | 1 + package/audit/Config.in | 10 + package/audit/S14auditd | 172 +++ .../audit-0001-crossCompileHeaderCreationFix.patch | 1420 ++++++++++++++++++++ package/audit/audit-0002-remove-zos-plugin.patch | 35 + package/audit/audit.mk | 58 + package/bzip2/bzip2.mk | 2 + package/checkpolicy/Config.in.host | 10 + package/checkpolicy/checkpolicy.mk | 30 + package/libcgroup/Config.in | 4 + package/libcgroup/libcgroup.mk | 38 + package/libselinux/Config.in | 13 + package/libselinux/libselinux.mk | 93 ++ package/libsemanage/Config.in | 14 + .../libsemanage-0001-execptionLibPathFix.patch | 14 + package/libsemanage/libsemanage.mk | 80 ++ package/libsepol/Config.in | 7 + package/libsepol/libsepol.mk | 48 + package/pcre/pcre.mk | 1 + package/policycoreutils/Config.in | 69 + package/policycoreutils/S15restorecond | 85 ++ .../policycoreutils-0001-crossCompileFixes.patch | 332 +++++ package/policycoreutils/policycoreutils.mk | 230 ++++ package/python-pyparsing/python-pyparsing.mk | 47 +- package/python-pyxml/Config.in | 11 + package/python-pyxml/python-xml.mk | 58 + package/refpolicy/Config.in | 88 ++ package/refpolicy/S12selinux | 134 ++ package/refpolicy/config | 10 + .../refpolicy-0001-gentoo_hardened_fixes.patch | 1250 +++++++++++++++++ package/refpolicy/refpolicy.mk | 86 ++ package/sepolgen/Config.in | 8 + package/sepolgen/sepolgen.mk | 35 + package/setools/Config.in | 16 + .../setools/setools-0001-cross_compile_fixes.patch | 121 ++ .../setools-0002-swig_typedef_python_fixes.patch | 1014 ++++++++++++++ package/setools/setools.mk | 85 ++ package/shadow/Config.in | 13 + package/shadow/shadow.mk | 49 + package/sqlite/sqlite.mk | 1 + package/ustr/Config.in | 6 + .../ustr/ustr-0001-crossCompileModifications.patch | 144 ++ package/ustr/ustr.mk | 55 + 44 files changed, 6004 insertions(+), 13 deletions(-) create mode 100644 package/audit/Config.in create mode 100755 package/audit/S14auditd create mode 100644 package/audit/audit-0001-crossCompileHeaderCreationFix.patch create mode 100644 package/audit/audit-0002-remove-zos-plugin.patch create mode 100644 package/audit/audit.mk create mode 100644 package/checkpolicy/Config.in.host create mode 100644 package/checkpolicy/checkpolicy.mk create mode 100644 package/libcgroup/Config.in create mode 100644 package/libcgroup/libcgroup.mk create mode 100644 package/libselinux/Config.in create mode 100644 package/libselinux/libselinux.mk create mode 100644 package/libsemanage/Config.in create mode 100644 package/libsemanage/libsemanage-0001-execptionLibPathFix.patch create mode 100644 package/libsemanage/libsemanage.mk create mode 100644 package/libsepol/Config.in create mode 100644 package/libsepol/libsepol.mk create mode 100644 package/policycoreutils/Config.in create mode 100755 package/policycoreutils/S15restorecond create mode 100644 package/policycoreutils/policycoreutils-0001-crossCompileFixes.patch create mode 100644 package/policycoreutils/policycoreutils.mk create mode 100644 package/python-pyxml/Config.in create mode 100644 package/python-pyxml/python-xml.mk create mode 100644 package/refpolicy/Config.in create mode 100644 package/refpolicy/S12selinux create mode 100755 package/refpolicy/config create mode 100644 package/refpolicy/refpolicy-0001-gentoo_hardened_fixes.patch create mode 100644 package/refpolicy/refpolicy.mk create mode 100644 package/sepolgen/Config.in create mode 100644 package/sepolgen/sepolgen.mk create mode 100644 package/setools/Config.in create mode 100644 package/setools/setools-0001-cross_compile_fixes.patch create mode 100644 package/setools/setools-0002-swig_typedef_python_fixes.patch create mode 100644 package/setools/setools.mk create mode 100644 package/shadow/Config.in create mode 100644 package/shadow/shadow.mk create mode 100644 package/ustr/Config.in create mode 100644 package/ustr/ustr-0001-crossCompileModifications.patch create mode 100644 package/ustr/ustr.mk
PATCH v2 1/17 libsepol: new package
---
Changes v1 -> v2:
- Move Config.in entry into the libraries section since this is a library.
- General cleanup to the mk file to conform to the standard format.
- Fixed the license version to be LGPLv2.1+ to match the headers in the source files (suggested by Thomas)
package/Config.in | 4 +++ package/libsepol/Config.in | 7 ++++++ package/libsepol/libsepol.mk | 48 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 0 deletions(-) create mode 100644 package/libsepol/Config.in create mode 100644 package/libsepol/libsepol.mk
package/Config.in +4 -0
@@ -689,6 +689,10 @@ source "package/liblog4c-localtime/Config.in" source "package/tzdata/Config.in" endmenu +menu "Security" +source "package/libsepol/Config.in" +endmenu + menu "Text and terminal handling" source "package/enchant/Config.in" source "package/libfribidi/Config.in"
package/libsepol/Config.in new file +7 -0
@@ -0,0 +1,7 @@ +config BR2_PACKAGE_LIBSEPOL + bool "libsepol" + help + Libsepol is the binary policy manipulation library. It doesn't + depend upon or use any of the other SELinux components. + + http://selinuxproject.org/page/Main_Page
package/libsepol/libsepol.mk new file +48 -0
48 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH v2 1/17 libsepol: new package
Dear Clayton Shotwell,
Quoted 2 lines · Clayton Shotwell
Signed-off-by Clayton Shotwell <[email protected]>
I've tested this with a minimal uClibc toolchain, and it builds fine, I believe this patch can be applied now.
Thanks,
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH v2 1/17 libsepol: new package
In reply to Clayton ShotwellQuoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Clayton" == Clayton Shotwell <[email protected]> writes:
Clayton> Signed-off-by: Clayton Shotwell <[email protected]> Clayton> ---
Clayton> Changes v1 -> v2:
Clayton> - Move Config.in entry into the libraries section since this is a
Clayton> library.
Clayton> - General cleanup to the mk file to conform to the standard format.
Clayton> - Fixed the license version to be LGPLv2.1+ to match the headers in
Clayton> the source files (suggested by Thomas)
Committed with some minor whitespace fixes, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH v2 2/17 libselinux: new package
In reply to Clayton Shotwell---
Changes v1 -> v2:
- Move Config.in entry into the libraries section since this is a library.
- General cleanup to the mk file to conform to the standard format.
- Removed a dependency on the Linux kernel.
- Changed the original Python select in the Config.in to be a check in the libselinux.mk file.
- Added a select for libsepol and pcre in the menuconfig instead of just having package dependencies.
- Removed building the python bindings in the host configuration.
package/Config.in | 1 + package/libselinux/Config.in | 13 +++++ package/libselinux/libselinux.mk | 93 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 107 insertions(+), 0 deletions(-) create mode 100644 package/libselinux/Config.in create mode 100644 package/libselinux/libselinux.mk
package/Config.in +1 -0
@@ -690,6 +690,7 @@ source "package/tzdata/Config.in" endmenu menu "Security" +source "package/libselinux/Config.in" source "package/libsepol/Config.in" endmenu
package/libselinux/Config.in new file +13 -0
@@ -0,0 +1,13 @@ +config BR2_PACKAGE_LIBSELINUX + bool "libselinux" + select BR2_PACKAGE_LIBSEPOL + select BR2_PACKAGE_PCRE + help + libselinux is the runtime SELinux library that provides interfaces + (e.g. library functions for the SELinux kernel APIs like getcon(), + other support functions like getseuserbyname()) to SELinux-aware + applications. libselinux may use the shared libsepol to manipulate + the binary policy if necessary (e.g. to downgrade the policy format + to an older version supported by the kernel) when loading policy. + + http://selinuxproject.org/page/Main_Page
package/libselinux/libselinux.mk new file +93 -0
93 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH v2 2/17 libselinux: new package
Dear Clayton Shotwell,
Quoted 2 lines · Clayton Shotwell
Signed-off-by Clayton Shotwell <[email protected]>
After testing this package, it turns out that:
*) By default it needs large file support, because src/Makefile forces -D_FILE_OFFSET_BITS=64. If you remove this from the Makefile, then it builds fine with a toolchain that does not have large file support. So your options are: remove this flag from the Makefile, or make the package (and all its reverse dependencies depend on large file support).
*) It needs thread support. So you should add a 'depends on BR2_TOOLCHAIN_HAS_THREADS', a comment when no thread support is available, and propagate this to all the reverse dependencies of libselinux.
Best regards,
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH v2 3/17 ustr: new package
In reply to Clayton Shotwell---
Changes v1 -> v2:
- General cleanup to the mk file to conform to the standard format.
- Fixed the patch naming to avoid using the version number.
- Cleaned up the patch to include a signed-off-by line.
- Added a check to only build static libraries if selected.
package/Config.in | 1 + package/ustr/Config.in | 6 + .../ustr/ustr-0001-crossCompileModifications.patch | 144 ++++++++++++++++++++ package/ustr/ustr.mk | 55 ++++++++ 4 files changed, 206 insertions(+), 0 deletions(-) create mode 100644 package/ustr/Config.in create mode 100644 package/ustr/ustr-0001-crossCompileModifications.patch create mode 100644 package/ustr/ustr.mk
package/Config.in +1 -0
@@ -707,6 +707,7 @@ source "package/pcre/Config.in" source "package/popt/Config.in" source "package/readline/Config.in" source "package/slang/Config.in" +source "package/ustr/Config.in" endmenu menu "JSON/XML"
package/ustr/Config.in new file +6 -0
@@ -0,0 +1,6 @@ +config BR2_PACKAGE_USTR + bool "ustr" + help + A small, safe string library. + + http://www.and.org/ustr/
package/ustr/ustr-0001-crossCompileModifications.patch new file +144 -0
144 lines not on this page · raw message
package/ustr/ustr.mk new file +55 -0
55 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH v2 3/17 ustr: new package
Dear Clayton Shotwell,
Quoted 1 line · Clayton Shotwell
.../ustr/ustr-0001-crossCompileModifications.patch | 144 ++++++++++++++++++++
Please name the patch:
ustr-0001-cross-compile-modifications.patch
The naming of patch files should be fixed globally in the patch series. We use lower case names, with '-' as the separator between words in the patch description.
Also, this package doesn't build properly when the toolchain does not have large file support. Just like libselinux, the Makefile hardcodes -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE. Your options are either to make ustr depend on large file support in the toolchain, or to modify the Makefile.
Other than that, looks good.
Thanks!
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH v2 3/17 ustr: new package
Thomas,
Thomas Petazzoni <[email protected]> wrote on 09/12/2013 02:34:30 PM:
Quoted 6 lines
The naming of patch files should be fixed globally in the patch series.
We use lower case names, with '-' as the separator between words in the
patch description.
Quoted 10 lines
Also, this package doesn't build properly when the toolchain does not
have large file support. Just like libselinux, theMakefilehardcodes
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE. Your options are either to
make ustr depend on large file support in the toolchain, or to modify
theMakefile.
I will correct all of the patch names since I forgot to make that change in my last revision. I will also add the large file support dependency where needed and get a new set of patches sent out. Do I need to continue sending out all of the patches until they are all submitted even if they have no changes?
Thanks,
Clayton
Clayton Shotwell
Software Engineer
clshotwe at rockwellcollins.com
www.rockwellcollins.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20130917/7cc3498a/attachment.html>
PATCH v2 3/17 ustr: new package
Clayton,
Quoted 5 lines · clshotwe at rockwellcollins.com
I will correct all of the patch names since I forgot to make that change in my last revision. I will also add the large file support dependency where needed and get a new set of patches sent out. Do I need to continue sending out all of the patches until they are all submitted even if they have no changes?
I do still have a bunch of comments to make on the remaining patches of the series, just haven't had the time to come to that (busy giving a training this week). But this doesn't prevent you from resending the patch series entirely, so that we could potentially start applying the first patches.
Best regards,
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH v2 4/17 libsemanage: new package
In reply to Clayton Shotwell---
Changes v1 -> v2:
- Move Config.in entry into the libraries section since this is a library.
- General cleanup to the mk file to conform to the standard format.
- Fixed the patch naming to avoid using the version number.
- Cleaned up the patch to include a signed-off-by line.
- Changed package dependencies into selects in the config.
- Changed the original Python select in the Config.in to be a check in the mk file.
- Removed building the python bindings in the host configuration.
package/Config.in | 1 + package/libsemanage/Config.in | 14 ++++ .../libsemanage-0001-execptionLibPathFix.patch | 14 ++++ package/libsemanage/libsemanage.mk | 80 ++++++++++++++++++++ 4 files changed, 109 insertions(+), 0 deletions(-) create mode 100644 package/libsemanage/Config.in create mode 100644 package/libsemanage/libsemanage-0001-execptionLibPathFix.patch create mode 100644 package/libsemanage/libsemanage.mk
package/Config.in +1 -0
@@ -691,6 +691,7 @@ endmenu menu "Security" source "package/libselinux/Config.in" +source "package/libsemanage/Config.in" source "package/libsepol/Config.in" endmenu
package/libsemanage/Config.in new file +14 -0
@@ -0,0 +1,14 @@ +config BR2_PACKAGE_LIBSEMANAGE + bool "libsemanage" + select BR2_PACKAGE_LIBSELINUX + select BR2_PACKAGE_USTR + select BR2_PACKAGE_BZIP2 + help + libsemanage is the policy management library. It uses libsepol for binary + policy manipulation and libselinux for interacting with the SELinux + system. It also exec's helper programs for loading policy and for checking + whether the file_contexts configuration is valid (load_policy and + setfiles from policycoreutils) presently, although this may change at + least for the bootstrapping case (for rpm). + + http://selinuxproject.org/page/Main_Page
package/libsemanage/libsemanage-0001-execptionLibPathFix.patch new file +14 -0
@@ -0,0 +1,14 @@ +Patch to correct a missing header file issue. + +Signed-off-by Clayton Shotwell <[email protected]> + +--- a/src/exception.sh 2011-12-21 11:46:04.000000000 -0600 ++++ b/src/exception.sh 2012-08-27 11:29:58.000000000 -0500 +@@ -9,6 +9,6 @@ + } + " + } +-gcc -x c -c - -aux-info temp.aux < ../include/semanage/semanage.h ++gcc -x c -c - -aux-info temp.aux -I../include < ../include/semanage/semanage.h + for i in `awk '/extern int/ { print $6 }' temp.aux`; do except $i ; done + rm -f -- temp.aux -.o
package/libsemanage/libsemanage.mk new file +80 -0
80 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH v2 5/17 checkpolicy: new package
In reply to Clayton Shotwell---
Changes v1 -> v2:
- General cleanup to the mk file to conform to the standard format.
- Removed the option to do a target build because it should never be needed during normal operation.
- Added checkpolicy as a host package. (Suggested by Arnout)
package/checkpolicy/checkpolicy.mk | 30 ++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 0 deletions(-) create mode 100644 package/checkpolicy/Config.in.host create mode 100644 package/checkpolicy/checkpolicy.mk
package/Config.in.host +1 -0
@@ -1,5 +1,6 @@ menu "Host utilities" +source "package/checkpolicy/Config.in.host" source "package/dfu-util/Config.in.host" source "package/dosfstools/Config.in.host" source "package/e2fsprogs/Config.in.host"
package/checkpolicy/Config.in.host new file +10 -0
@@ -0,0 +1,10 @@ +config BR2_PACKAGE_HOST_CHECKPOLICY + bool "host checkpolicy" + help + checkpolicy is the policy compiler. It uses libsepol to + generate the binary policy. checkpolicy uses the static + libsepol since it deals with low level details of the policy + that have not been encapsulated/abstracted by a proper + shared library interface. + + http://selinuxproject.org/page/Main_Page
package/checkpolicy/checkpolicy.mk new file +30 -0
@@ -0,0 +1,30 @@ +################################################################################ +# +# checkpolicy +# +################################################################################ + +CHECKPOLICY_VERSION = 2.1.12 +CHECKPOLICY_SITE = http://userspace.selinuxproject.org/releases/20130423/ +CHECKPOLICY_LICENSE = GPLv2 +CHECKPOLICY_LICENSE_FILES = COPYING + +HOST_CHECKPOLICY_DEPENDENCIES = host-libselinux host-flex host-bison + +HOST_CHECKPOLICY_MAKE_OPTS = $(HOST_CONFIGURE_OPTS) \ + LEX="$(HOST_DIR)/usr/bin/flex" \ + YACC="$(HOST_DIR)/usr/bin/bison -y" + +define HOST_CHECKPOLICY_BUILD_CMDS + $(MAKE) -C $(@D) $(HOST_CHECKPOLICY_MAKE_OPTS) DESTDIR=$(HOST_DIR) +endef + +define HOST_CHECKPOLICY_INSTALL_CMDS + $(MAKE) -C $(@D) install $(HOST_CHECKPOLICY_MAKE_OPTS) DESTDIR=$(HOST_DIR) +endef + +define HOST_CHECKPOLICY_CLEAN_CMDS + $(MAKE) -C $(@D) clean +endef + +$(eval $(host-generic-package))
Signature · 1 line
1.7.1
PATCH v2 6/17 sepolgen: new package
In reply to Clayton Shotwell---
Changes v1 -> v2:
- General cleanup to the mk file to conform to the standard format.
- Changed package dependencies into selects in the config.
package/Config.in | 4 ++++ package/sepolgen/Config.in | 8 ++++++++ package/sepolgen/sepolgen.mk | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 0 deletions(-) create mode 100644 package/sepolgen/Config.in create mode 100644 package/sepolgen/sepolgen.mk
package/Config.in +4 -0
@@ -905,6 +905,10 @@ source "package/xenomai/Config.in" source "package/rtai/Config.in" endmenu +menu "Security" +source "package/sepolgen/Config.in" +endmenu + menu "Shell and utilities" source "package/at/Config.in" if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
package/sepolgen/Config.in new file +8 -0
@@ -0,0 +1,8 @@ +config BR2_PACKAGE_SEPOLGEN + bool "sepolgen" + select BR2_PACKAGE_PYTHON + help + sepolgen is a python module/library that forms the core + of the modern audit2allow (a rewrite). + + http://selinuxproject.org/page/Main_Page
package/sepolgen/sepolgen.mk new file +35 -0
@@ -0,0 +1,35 @@ +################################################################################ +# +# sepolgen +# +################################################################################ + +SEPOLGEN_VERSION = 1.1.9 +SEPOLGEN_SITE = http://userspace.selinuxproject.org/releases/20130423/ +SEPOLGEN_LICENSE = GPLv2 +SEPOLGEN_LICENSE_FILES = COPYING + +SEPOLGEN_DEPENDENCIES = python + +SEPOLGEN_INSTALL_STAGING = YES + +SEPOLGEN_MAKE_CMDS = $(TARGET_CONFIGURE_OPTS) \ + PYTHONLIBDIR=/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages + +define SEPOLGEN_BUILD_CMDS + $(MAKE) -C $(@D) $(SEPOLGEN_MAKE_CMDS) DESTDIR=$(STAGING_DIR) +endef + +define SEPOLGEN_INSTALL_STAGING_CMDS + $(MAKE) -C $(@D) install $(SEPOLGEN_MAKE_CMDS) DESTDIR=$(STAGING_DIR) +endef + +define SEPOLGEN_INSTALL_TARGET_CMDS + $(MAKE) -C $(@D) install $(SEPOLGEN_MAKE_CMDS) DESTDIR=$(TARGET_DIR) +endef + +define SEPOLGEN_CLEAN_CMDS + $(MAKE) -C $(@D) clean +endef + +$(eval $(generic-package))
Signature · 1 line
1.7.1
PATCH v2 7/17 setools: new package
In reply to Clayton Shotwell---
Changes v1 -> v2:
- General cleanup to the mk file to conform to the standard format.
- Cleaned up the patch to include a signed-off-by line.
- Changed package dependencies into selects in the config.
- Changed the original Python select in the Config.in to be a check in the mk file.
package/Config.in | 1 + package/setools/Config.in | 16 + .../setools/setools-0001-cross_compile_fixes.patch | 121 +++ .../setools-0002-swig_typedef_python_fixes.patch | 1014 ++++++++++++++++++++ package/setools/setools.mk | 85 ++ 5 files changed, 1237 insertions(+), 0 deletions(-) create mode 100644 package/setools/Config.in create mode 100644 package/setools/setools-0001-cross_compile_fixes.patch create mode 100644 package/setools/setools-0002-swig_typedef_python_fixes.patch create mode 100644 package/setools/setools.mk
package/Config.in +1 -0
@@ -907,6 +907,7 @@ endmenu menu "Security" source "package/sepolgen/Config.in" +source "package/setools/Config.in" endmenu menu "Shell and utilities"
package/setools/Config.in new file +16 -0
@@ -0,0 +1,16 @@ +config BR2_PACKAGE_SETOOLS + bool "setools" + select BR2_PACKAGE_LIBSELINUX + select BR2_PACKAGE_SQLITE + select BR2_PACKAGE_LIBXML2 + select BR2_PACKAGE_BZIP2 + help + SETools is an open source project designed to facilitate SELinux policy + analysis. The primary tools are: + + apol - analyze a SELinux policy. + seaudit - analyze audit messages from SELinux. + seaudit-report - generate highly-customized audit log reports. + sechecker - command line tool for performing modular checks on an SELinux policy. + sediff - semantic policy difference tool for SELinux. + secmds - command-line tools to analyze and search SELinux policy.
package/setools/setools-0001-cross_compile_fixes.patch new file +121 -0
121 lines not on this page · raw message
package/setools/setools-0002-swig_typedef_python_fixes.patch new file +1014 -0
1,014 lines not on this page · raw message
package/setools/setools.mk new file +85 -0
85 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH v2 8/17 libcgroup: new package
In reply to Clayton Shotwell---
Changes v1 -> v2:
- General cleanup to the mk file to conform to the standard format.
- Corrected the license version and license file to be correct.
- Cleaned up the configure options to enable options for static libraries and linux-pam if they are selected in the configuration.
package/Config.in | 1 + package/libcgroup/Config.in | 4 ++++ package/libcgroup/libcgroup.mk | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 0 deletions(-) create mode 100644 package/libcgroup/Config.in create mode 100644 package/libcgroup/libcgroup.mk
package/Config.in +1 -0
@@ -654,6 +654,7 @@ source "package/libatomic_ops/Config.in" source "package/libbsd/Config.in" source "package/libcap/Config.in" source "package/libcap-ng/Config.in" +source "package/libcgroup/Config.in" source "package/libdaemon/Config.in" source "package/libelf/Config.in" source "package/libevent/Config.in"
package/libcgroup/Config.in new file +4 -0
@@ -0,0 +1,4 @@ +config BR2_PACKAGE_LIBCGROUP + bool "libcgroup" + help + libcgroup is a library that abstracts the control group file system in Linux.
package/libcgroup/libcgroup.mk new file +38 -0
@@ -0,0 +1,38 @@ +################################################################################ +# +# libcgroup +# +################################################################################ + +LIBCGROUP_VERSION = 0.38 +LIBCGROUP_SOURCE = libcgroup-$(LIBCGROUP_VERSION).tar.bz2 +LIBCGROUP_SITE = http://sourceforge.net/projects/libcg/files/latest/download +LIBCGROUP_LICENSE = LGPLv2.1 +LIBCGROUP_LICENSE_FILES = COPYING + +LIBCGROUP_INSTALL_STAGING = YES + +# Undefining _FILE_OFFSET_BITS here because of a "bug" with glibc fts.h +# large file support. See https://bugzilla.redhat.com/show_bug.cgi?id=574992 +# for more information. +LIBCGROUP_CONF_ENV = \ + CXXFLAGS+="-U_FILE_OFFSET_BITS" \ + CFLAGS+="-U_FILE_OFFSET_BITS" + +LIBCGROUP_CONF_OPT = \ + --disable-tools \ + --disable-daemon \ + --disable-initscript-install + +ifeq ($(BR2_PREFER_STATIC_LIB),y) + LIBCGROUP_CONF_OPT += --enable-static --disable-shared +endif + +ifeq ($(BR2_PACKAGE_LINUX_PAM),y) + LIBCGROUP_DEPENDENCIES += linux-pam + LIBCGROUP_CONF_OPT += --enable-pam +else + LIBCGROUP_CONF_OPT += --disable-pam +endif + +$(eval $(autotools-package))
Signature · 1 line
1.7.1
PATCH v2 9/17 policycoreutils: new package
In reply to Clayton Shotwell---
Changes v1 -> v2:
- General cleanup to the mk file to conform to the standard format.
- Fixed the patch naming to avoid using the version number.
- Cleaned up the patch to include a signed-off-by line.
- Changed package dependencies into selects in the config.
package/Config.in | 1 + package/policycoreutils/Config.in | 69 ++++ package/policycoreutils/S15restorecond | 85 +++++ .../policycoreutils-0001-crossCompileFixes.patch | 332 ++++++++++++++++++++ package/policycoreutils/policycoreutils.mk | 230 ++++++++++++++ 5 files changed, 717 insertions(+), 0 deletions(-) create mode 100644 package/policycoreutils/Config.in create mode 100755 package/policycoreutils/S15restorecond create mode 100644 package/policycoreutils/policycoreutils-0001-crossCompileFixes.patch create mode 100644 package/policycoreutils/policycoreutils.mk
package/Config.in +1 -0
@@ -907,6 +907,7 @@ source "package/rtai/Config.in" endmenu menu "Security" +source "package/policycoreutils/Config.in" source "package/sepolgen/Config.in" source "package/setools/Config.in" endmenu
package/policycoreutils/Config.in new file +69 -0
69 lines not on this page · raw message
package/policycoreutils/S15restorecond new file +85 -0
85 lines not on this page · raw message
package/policycoreutils/policycoreutils-0001-crossCompileFixes.patch new file +332 -0
332 lines not on this page · raw message
package/policycoreutils/policycoreutils.mk new file +230 -0
230 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH v2 10/17 python-pyxml: new package
In reply to Clayton Shotwell---
Changes v1 -> v2:
- General cleanup to the mk file to conform to the standard format.
package/Config.in | 1 + package/python-pyxml/Config.in | 11 +++++++ package/python-pyxml/python-xml.mk | 58 ++++++++++++++++++++++++++++++++++++ 3 files changed, 70 insertions(+), 0 deletions(-) create mode 100644 package/python-pyxml/Config.in create mode 100644 package/python-pyxml/python-xml.mk
package/Config.in +1 -0
@@ -394,6 +394,7 @@ source "package/python-protobuf/Config.in" source "package/python-pygame/Config.in" source "package/python-pyparsing/Config.in" source "package/python-pyro/Config.in" +source "package/python-pyxml/Config.in" source "package/python-serial/Config.in" source "package/python-setuptools/Config.in" source "package/python-thrift/Config.in"
package/python-pyxml/Config.in new file +11 -0
@@ -0,0 +1,11 @@ +config BR2_PACKAGE_PYTHON_PYXML + bool "python-pyxml" + depends on BR2_PACKAGE_PYTHON + help + This is the Python XML package. The distribution contains a + validating XML parser, an implementation of the SAX and DOM + programming interfaces, an interface to the Expat parser (and the + Expat parser itself), and a C helper module that can speed up + xmllib.py by a factor of 5. There's even documentation! + + http://pyxml.sourceforge.net/topics/index.html
package/python-pyxml/python-xml.mk new file +58 -0
58 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH v2 11/17 refpolicy: new package
In reply to Clayton Shotwell---
Changes v1 -> v2:
- General cleanup to the mk file to conform to the standard format.
- Fixed the patch naming to match the standard 4 digit numbering.
- Changed package dependencies into selects in the config.
package/Config.in | 1 + package/refpolicy/Config.in | 88 ++ package/refpolicy/S12selinux | 134 +++ package/refpolicy/config | 10 + .../refpolicy-0001-gentoo_hardened_fixes.patch | 1250 ++++++++++++++++++++ package/refpolicy/refpolicy.mk | 86 ++ 6 files changed, 1569 insertions(+), 0 deletions(-) create mode 100644 package/refpolicy/Config.in create mode 100644 package/refpolicy/S12selinux create mode 100755 package/refpolicy/config create mode 100644 package/refpolicy/refpolicy-0001-gentoo_hardened_fixes.patch create mode 100644 package/refpolicy/refpolicy.mk
package/Config.in +1 -0
@@ -909,6 +909,7 @@ endmenu menu "Security" source "package/policycoreutils/Config.in" +source "package/refpolicy/Config.in" source "package/sepolgen/Config.in" source "package/setools/Config.in" endmenu
package/refpolicy/Config.in new file +88 -0
88 lines not on this page · raw message
package/refpolicy/S12selinux new file +134 -0
134 lines not on this page · raw message
package/refpolicy/config new file +10 -0
@@ -0,0 +1,10 @@ +# This file controls the state of SELinux on the system. +# SELINUX= can take one of these three values: +# enforcing - SELinux security policy is enforced. +# permissive - SELinux prints warnings instead of enforcing. +# disabled - No SELinux policy is loaded. +SELINUX=permissive +# SELINUXTYPE= can take one of these two values: +# targeted - Targeted processes are protected, +# mls - Multi Level Security protection. +SELINUXTYPE=refpolicy
package/refpolicy/refpolicy-0001-gentoo_hardened_fixes.patch new file +1250 -0
1,250 lines not on this page · raw message
package/refpolicy/refpolicy.mk new file +86 -0
86 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH v2 11/17 refpolicy: new package
Dear Clayton Shotwell,
package/refpolicy/Config.in line 20
Quoted 7 lines · Clayton Shotwell
package/refpolicy/Config.in new file +7
-0+config BR2_PACKAGE_REFPOLICY_PATCH_FOLDER + string "Build specific refpolicy patches folder" + default "" + help + A path to a folder containing board specific + configuration patch files. These will get applied + after the patches in the package folder.
We already have the BR2_GLOBAL_PATCH_DIR mechanism to allow people to provide custom patches for all packages. See
http://buildroot.org/downloads/manual/manual.html#_global_patch_directory.
So there shouldn't be a need to add a refpolicy specific mechanism for this.
Quoted 35 lines
package/refpolicy/Config.in new file +35
-0+choice + prompt "SELinux policy type" + default BR2_PACKAGE_REFPOLICY_TYPE_STANDARD + + config BR2_PACKAGE_REFPOLICY_TYPE_STANDARD + bool "Standard" + help + Standard SELinux policy + + config BR2_PACKAGE_REFPOLICY_TYPE_MCS + bool "MCS" + help + SELinux policy with multi-catagory support + + config BR2_PACKAGE_REFPOLICY_TYPE_MLS + bool "MLS" + help + SELinux policy with multi-catagory and multi-level support +endchoice + +config BR2_PACKAGE_REFPOLICY_TYPE + string + default "standard" if BR2_PACKAGE_REFPOLICY_TYPE_STANDARD + default "mcs" if BR2_PACKAGE_REFPOLICY_TYPE_MCS + default "mls" if BR2_PACKAGE_REFPOLICY_TYPE_MLS + +choice + prompt "SELinux Policy Distribution" + default BR2_PACKAGE_REFPOLICY_DIST_REDHAT + + config BR2_PACKAGE_REFPOLICY_DIST_REDHAT + bool "redhat" + + config BR2_PACKAGE_REFPOLICY_DIST_GENTOO + bool "gentoo"
package/refpolicy/Config.in line 66
Quoted 10 lines
package/refpolicy/Config.in new file +10
-0+ + config BR2_PACKAGE_REFPOLICY_DIST_DEBIAN + bool "debian" + + config BR2_PACKAGE_REFPOLICY_DIST_SUSE + bool "suse" + + config BR2_PACKAGE_REFPOLICY_DIST_REDHAT14 + bool "redhat 14" +endchoice
Do we really need to provide a distribution choice here? Isn't 'Buildroot' considered a distribution? I must admit that as a Buildroot user, I would be somewhat confused by a choice that allows me to select between debian, suse, gentoo, redhat, etc. This Buildroot is "sort" of a distribution, shouldn't we just make one choice that happens to work for Buildroot ?
package/refpolicy/Config.in line 82
Quoted 7 lines
package/refpolicy/Config.in new file +7
-0+config BR2_PACKAGE_REFPOLICY_MONOLITHIC + bool "Build a monolithic SELinux policy" + default y + help + Select Y to build a monolithic SELinux policy otherwise + a modular policy will be built. Note, this is suggested + for embedded systems.
For a non-english speaker, the wording of "Note, this is suggested for embedded systems" might suggest that what is recommended is to build a modular policy.
Also, what about inverting the logic of this option? I.e:
config BR2_PACKAGE_REFPOLICY_MODULAR
bool "Build a modular SELinux policy"
help
Select Y to build a modular SELinux policy. By default, SELinux builds a monolithic policy, which is the best solution for embedded systems for space/performance reasons (FIXME), but building a modular policy might be useful in (FIXME).
package/refpolicy/Config.in line 86
Quoted 3 lines
package/refpolicy/Config.in new file +3
-0+config BR2_PACKAGE_REFPOLICY_NAME + string "Name for the SELinux policy" + default "refpolicy"
Is this something that is actually useful to change?
Quoted 7 lines
(quoted diff) +1
-0+endifpackage/refpolicy/S12selinux new file +0
-0
package/refpolicy/S12selinux line 8
Quoted 8 lines
package/refpolicy/S12selinux new file +8
-0@@ -0,0 +1,134 @@ +#!/bin/sh +################################################################################ +# +# This file labels the security contexts of memory based filesystems such as +# /dev/ and checks for auto relabel request if '/.autorelabel' file exists. +# The 'stop' argument drops the security mode to 'permissive'. +# +# This script is a heavily stripped down and modified version of the one use
Minor nit: use -> used
Quoted 6 lines
package/refpolicy/config new file +0
-0
package/refpolicy/config line 10
Quoted 10 lines
package/refpolicy/config new file +10
-0@@ -0,0 +1,10 @@ +# This file controls the state of SELinux on the system. +# SELINUX= can take one of these three values: +# enforcing - SELinux security policy is enforced. +# permissive - SELinux prints warnings instead of enforcing. +# disabled - No SELinux policy is loaded. +SELINUX=permissive +# SELINUXTYPE= can take one of these two values: +# targeted - Targeted processes are protected, +# mls - Multi Level Security protection. +SELINUXTYPE=refpolicy
So the default value for SELINUXTYPE is not one of the two accepted values? Seems odd.
package/refpolicy/refpolicy-0001-gentoo_hardened_fixes.patch line 6
Quoted 12 lines
package/refpolicy/refpolicy-0001-gentoo_hardened_fixes.patch new file +6
-0@@ -0,0 +1,1250 @@ +From: Dominick Grift <[email protected]> +Date: Fri, 16 Aug 2013 07:07:37 +0000 (+0200) +Subject: Fix monolithic built +X-Git-Url: http://git.overlays.gentoo.org/gitweb/?p=proj%2Fhardened-refpolicy.git;a=commitdiff_plain;h=86500de7 + +Fix monolithic built
Do we have a chance of getting this patch merged upstream? We don't like to carry feature patches in Buildroot, so if a feature doesn't exist upstream, or is so broken upstream and never going to be fixed, then we prefer to not support it at all.
If fixing this upstream is an on-going effort, then no problem to carry the patch in Buildroot.
Quoted 10 lines
package/refpolicy/refpolicy.mk new file +7
-0@@ -0,0 +1,86 @@ +################################################################################ +# +# refpolicy +# +################################################################################ + +REFPOLICY_VERSION = 2.20130424
package/refpolicy/refpolicy.mk line 17
Quoted 10 lines
package/refpolicy/refpolicy.mk new file +10
-0+REFPOLICY_SOURCE = refpolicy-$(REFPOLICY_VERSION).tar.bz2 +REFPOLICY_SITE = http://oss.tresys.com/files/refpolicy/ +REFPOLICY_LICENSE = GPLv2 +REFPOLICY_LICENSE_FILES = COPYING + +# Cannot use multiple threads to build the reference policy +REFPOLICY_MAKE=$(MAKE1) + +REFPOLICY_DEPENDENCIES = host-m4 host-checkpolicy host-policycoreutils \ + host-setools host-python-pyxml policycoreutils
Do we really need all those dependencies? I've tried to draw a diagram of all the host and target dependencies between all these SELinux packages, but I must admit I get a bit lost. If you could give some general comments on why the various target/host variants of each package are needed, that'd be really great.
package/refpolicy/refpolicy.mk line 28
Quoted 11 lines
package/refpolicy/refpolicy.mk new file +11
-0+ +REFPOLICY_INSTALL_STAGING = YES + +define REFPOLICY_BUILD_SPECIFIC_PATCH_CMDS + @echo "Applying board specific patches" + $(ifneq $(BR2_PACKAGE_REFPOLICY_PATCH_FOLDER) "", \ + toolchain/patch-kernel.sh $(@D) \ + $(call qstrip,$(BR2_PACKAGE_REFPOLICY_PATCH_FOLDER)) refpolicy-\*.patch) +endef + +REFPOLICY_POST_PATCH_HOOKS += REFPOLICY_BUILD_SPECIFIC_PATCH_CMDS
This part would become unneeded, as per the above suggestions.
package/refpolicy/refpolicy.mk line 33
Quoted 4 lines
package/refpolicy/refpolicy.mk new file +4
-0+# Pointing to the host compiled SELinux applications while using the target +# cross compiler. Note, the TEST_TOOLCHAIN option will also set the +# LD_LIBRARY_PATH at run time. +REFPOLICY_MAKE_CMDS = $(HOST_CONFIGURE_OPTS) \
I'm not really a big fan of passing $(HOST_CONFIGURE_OPTS) when building a target package. If all you need is that the PATH contains output/host/usr/bin so that the host SELinux applications are used, then just use $(TARGET_MAKE_ENV) :
$(TARGET_MAKE_ENV) $(MAKE1) ...
package/refpolicy/refpolicy.mk line 36
Quoted 3 lines
package/refpolicy/refpolicy.mk new file +3
-0+ TEST_TOOLCHAIN="$(HOST_DIR)" \ + PYTHON="$(HOST_DIR)/usr/bin/python" \ + M4="$(HOST_DIR)/usr/bin/m4"
Those two last lines should then be unneeded.
package/refpolicy/refpolicy.mk line 39
Quoted 2 lines
package/refpolicy/refpolicy.mk new file +2
-0+define REFPOLICY_CONFIGURE_CMDS + $(REFPOLICY_MAKE) -C $(@D) bare $(REFPOLICY_MAKE_CMDS) DESTDIR=$(STAGING_DIR)
so:
$(TARGET_MAKE_ENV) -C $(@D) bare $(REFPOLICY_MAKE_CMDS) ...
package/refpolicy/refpolicy.mk line 43
Quoted 4 lines
package/refpolicy/refpolicy.mk new file +4
-0+ sed -i "/TYPE/c\TYPE = $(BR2_PACKAGE_REFPOLICY_TYPE)" $(@D)/build.conf + sed -i "/NAME/c\NAME = $(BR2_PACKAGE_REFPOLICY_NAME)" $(@D)/build.conf + sed -i "/DISTRO/c\DISTRO = $(BR2_PACKAGE_REFPOLICY_DIST)" $(@D)/build.conf + sed -i "/MONOLITHIC/c\MONOLITHIC = $(BR2_PACKAGE_REFPOLICY_MONOLITHIC)" $(@D)/build.conf
Use $(SED) instead of sed -i
Quoted 9 lines
package/refpolicy/refpolicy.mk new file +9
-0+ $(REFPOLICY_MAKE) -C $(@D) conf $(REFPOLICY_MAKE_CMDS) DESTDIR=$(STAGING_DIR) +endef + +define REFPOLICY_BUILD_CMDS + $(REFPOLICY_MAKE) -C $(@D) $(REFPOLICY_MAKE_CMDS) DESTDIR=$(STAGING_DIR) +endef + +define REFPOLICY_CLEAN_CMDS + $(REFPOLICY_MAKE) -C $(@D) clean $(REFPOLICY_MAKE_CMDS) DESTDIR=$(STAGING_DIR)
package/refpolicy/refpolicy.mk line 62
Quoted 10 lines
package/refpolicy/refpolicy.mk new file +10
-0+endef + +define REFPOLICY_INSTALL_STAGING_CMDS + $(REFPOLICY_MAKE) -C $(@D) install-src install-headers install-docs \ + $(REFPOLICY_MAKE_CMDS) DESTDIR=$(STAGING_DIR) +endef + +define REFPOLICY_INSTALL_TARGET_CMDS + $(REFPOLICY_MAKE) -C $(@D) install $(REFPOLICY_MAKE_CMDS) DESTDIR=$(TARGET_DIR) + $(INSTALL) -m 0755 package/refpolicy/config $(TARGET_DIR)/etc/selinux/
Use -D and specify the destination path entirely.
package/refpolicy/refpolicy.mk line 63
Quoted 1 line
package/refpolicy/refpolicy.mk new file +1
-0+ sed -i "/^SELINUXTYPE/c\SELINUXTYPE=$(BR2_PACKAGE_REFPOLICY_NAME)" $(TARGET_DIR)/etc/selinux/config
$(SED).
package/refpolicy/refpolicy.mk line 64
Quoted 1 line
package/refpolicy/refpolicy.mk new file +1
-0+ $(INSTALL) -m 0755 package/refpolicy/S12selinux $(TARGET_DIR)/etc/init.d/
Should be using the INIT_SYSV mechanism (look at other packages and/or documentation), use -D and specific the destination path entirely.
package/refpolicy/refpolicy.mk line 73
Quoted 9 lines
package/refpolicy/refpolicy.mk new file +9
-0+endef + +define REFPOLICY_POLICY_COMPILE + $(INSTALL) -d -m 0755 $(TARGET_DIR)/etc/selinux/$(BR2_PACKAGE_REFPOLICY_NAME)/policy + $(INSTALL) -d -m 0755 $(TARGET_DIR)/etc/selinux/$(BR2_PACKAGE_REFPOLICY_NAME)/modules/active/modules + if [ ! -f $(TARGET_DIR)/etc/selinux/$(BR2_PACKAGE_REFPOLICY_NAME)/contexts/files/file_contexts.local ]; \ + then \ + touch $(TARGET_DIR)/etc/selinux/$(BR2_PACKAGE_REFPOLICY_NAME)/contexts/files/file_contexts.local; \ + fi
Why not just touch it? If it exists, it will just update its timestamp, so no big deal.
package/refpolicy/refpolicy.mk line 80
Quoted 7 lines
package/refpolicy/refpolicy.mk new file +7
-0+ # Currently, semodule is unabled to compile the policy during the build so + # the modules must be compiled into the policy during the first boot. This + # is done by the S12selinux startup script. + #( export PATH=$(TARGET_PATH); \ + # $(HOST_DIR)/usr/sbin/semodule -v -n -p $(TARGET_DIR) -s $(BR2_PACKAGE_REFPOLICY_NAME) \ + # -b $(@D)/base.pp -i $(shell ls $(@D)/*.pp | grep -v base); \ + #)
So if this was done at build time, we could avoid having a bunch of tools on the target?
Quoted 6 lines
package/refpolicy/refpolicy.mk new file +6
-0+endef +ifeq ($(BR2_PACKAGE_REFPOLICY_MONOLITHIC),) + REFPOLICY_POST_INSTALL_TARGET_HOOKS += REFPOLICY_POLICY_COMPILE +endif + +$(eval $(generic-package))
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH v2 11/17 refpolicy: new package
Thomas,
Thomas Petazzoni <[email protected]> wrote on 09/18/2013 12:18:04 AM:
Quoted 8 lines
We already have the
BR2_GLOBAL_PATCH_DIRmechanism to allow people to
provide custom patches for all packages. See
http://buildroot.org/downloads/manual/
manual.html#_global_patch_directory.
So there shouldn't be a need to add a refpolicy specific mechanism for
this.
I will go ahead and remove this option from the config.
Quoted 10 lines
Do we really need to provide a distribution choice here? Isn't 'Buildroot' considered a distribution? I must admit that as a Buildroot
user, I would be somewhat confused by a choice that allows me to select
between debian, suse, gentoo, redhat, etc. This Buildroot is "sort" of
a distribution, shouldn't we just make one choice that happens to work
for Buildroot ?
The different distributions add a few changes that are specific to the distribution. I looked through the distributions and none of them really fit with the way buildroot works so I am going to remove this option from the config.
Quoted 8 lines
For a non-english speaker, the wording of "Note, this is suggested for
embedded systems" might suggest that what is recommended is to build a
modular policy.Also, what about inverting the logic of this option? I.e:
Quoted 9 lines
config
BR2_PACKAGE_REFPOLICY_MODULAR
bool "Build a modular SELinux policy"
help
Select Y to build a modular SELinux policy. By default, SELinux builds a monolithic policy, which is the best solution for embedded systems for space/performance reasons (FIXME), but building a modular policy might be useful in (FIXME).
That would clean things up quite a bit. I'll switch the logic and change the comment.
Quoted 6 lines
package/refpolicy/Config.in line 86
Quoted 3 lines
package/refpolicy/Config.in new file +3
-0+config BR2_PACKAGE_REFPOLICY_NAME + string "Name for the SELinux policy" + default "refpolicy"Is this something that is actually useful to change?
Not really. I'll remove it.
Quoted 11 lines
Quoted 11 lines
package/refpolicy/config new file +5
-0@@ -0,0 +1,10 @@ +# This file controls the state of SELinux on the system. +# SELINUX= can take one of these three values: +# enforcing - SELinux security policy is enforced. +# permissive - SELinux prints warnings instead of enforcing. +# disabled - No SELinux policy is loaded.
Quoted 8 lines
package/refpolicy/config line 10
Quoted 5 lines
package/refpolicy/config new file +5
-0+SELINUX=permissive +# SELINUXTYPE= can take one of these two values: +# targeted - Targeted processes are protected, +# mls - Multi Level Security protection. +SELINUXTYPE=refpolicySo the default value for SELINUXTYPE is not one of the two accepted values? Seems odd.
I corrected the comment to accurately represent what is doing.
Quoted 11 lines
Review
Quoted 2 lines
(quoted diff) +0
-0gentoo_hardened_fixes.patch b/package/refpolicy/
refpolicy-0001-gentoo_hardened_fixes.patchDo we have a chance of getting this patch merged upstream? We don't like to carry feature patches in Buildroot, so if a feature doesn't exist upstream, or is so broken upstream and never going to be fixed,
then we prefer to not support it at all.
Quoted 3 lines
If fixing this upstream is an on-going effort, then no problem to carry
the patch in Buildroot.
There has been work on the upstream in relation to these fixes. I have pulled down the latest upstream software and it builds without any problems. This patch will be able to be removed when the next version is released. There are many changes that need to be made for things to work with buildroot that I have not made yet. I don't have the resources to customize the refpolicy to work completely, as is, with buildroot. Currently, a lot of the paths listed in the policy do not match the way buildroot works. This is especially true with the init scripts. Would it be best to make a bunch of modifications to the refpolicy to make it work for buildroot? I'm not sure the best way to proceed with this.
Quoted 10 lines
Quoted 1 line
+REFPOLICY_DEPENDENCIES = host-m4 host-checkpolicy host-
policycoreutils \
Quoted 1 line
+ host-setools host-python-pyxml policycoreutils
Do we really need all those dependencies? I've tried to draw a diagram
of all the host and target dependencies between all these SELinux packages, but I must admit I get a bit lost. If you could give some general comments on why the various target/host variants of each package are needed, that'd be really great.
I will create a diagram and submit it with the documentation that needs to be created. Hopefully that will be done by the end of the week but I am pretty busy with several things right now.
Quoted 11 lines
package/refpolicy/config
Quoted 5 lines
package/refpolicy/config new file +5
-0+define REFPOLICY_BUILD_SPECIFIC_PATCH_CMDS + @echo "Applying board specific patches" + $(ifneq $(BR2_PACKAGE_REFPOLICY_PATCH_FOLDER) "", \ + toolchain/patch-kernel.sh $(@D) \ + $(call qstrip,$(
BR2_PACKAGE_REFPOLICY_PATCH_FOLDER)) refpolicy-\*.patch)package/refpolicy/config
Quoted 3 lines
package/refpolicy/config new file +3
-0+endef + +REFPOLICY_POST_PATCH_HOOKS += REFPOLICY_BUILD_SPECIFIC_PATCH_CMDSThis part would become unneeded, as per the above suggestions.
I'll remove it.
Quoted 12 lines
Quoted 1 line
+# Pointing to the host compiled SELinux applications
while using the target
Quoted 1 line
+# cross compiler. Note, the
TEST_TOOLCHAINoption willalso set the
package/refpolicy/config
Quoted 2 lines
package/refpolicy/config new file +2
-0+# LD_LIBRARY_PATH at run time. +REFPOLICY_MAKE_CMDS = $(HOST_CONFIGURE_OPTS) \I'm not really a big fan of passing $(HOST_CONFIGURE_OPTS) when building a target package. If all you need is that the PATH contains output/host/usr/bin so that the host SELinux applications are used, then just use $(TARGET_MAKE_ENV) :
Quoted 1 line
$(TARGET_MAKE_ENV) $(MAKE1) ...
I'll add that to the REFPOLICY_MAKE variable and change the HOST_CONFIGURE_OPTS to TARGET_CONFIGURE_OPTS.
Quoted 5 lines
package/refpolicy/config
Quoted 3 lines
package/refpolicy/config new file +3
-0+ TEST_TOOLCHAIN="$(HOST_DIR)" \ + PYTHON="$(HOST_DIR)/usr/bin/python" \ + M4="$(HOST_DIR)/usr/bin/m4"Those two last lines should then be unneeded.
I'll remove them
Quoted 10 lines
Quoted 1 line
+ sed -i "/TYPE/c\TYPE = $
(
BR2_PACKAGE_REFPOLICY_TYPE)" $(@D)/build.confQuoted 1 line
+ sed -i "/NAME/c\NAME = $
(
BR2_PACKAGE_REFPOLICY_NAME)" $(@D)/build.confQuoted 1 line
+ sed -i "/DISTRO/c\DISTRO = $
(
BR2_PACKAGE_REFPOLICY_DIST)" $(@D)/build.confQuoted 1 line
+ sed -i "/MONOLITHIC/c\MONOLITHIC = $
(
BR2_PACKAGE_REFPOLICY_MONOLITHIC)" $(@D)/build.confUse $(SED) instead of sed -i
Agreed.
Quoted 7 lines
package/refpolicy/config
Quoted 2 lines
package/refpolicy/config new file +2
-0+define REFPOLICY_INSTALL_TARGET_CMDS + $(REFPOLICY_MAKE) -C $(@D) install $(
REFPOLICY_MAKE_CMDS) DESTDIR=$(TARGET_DIR)Quoted 1 line
+ $(INSTALL) -m 0755 package/refpolicy/config $
(TARGET_DIR)/etc/selinux/
Use -D and specify the destination path entirely.
I'll make that change.
Quoted 6 lines
Quoted 1 line
+ $(INSTALL) -m 0755 package/refpolicy/S12selinux $
(TARGET_DIR)/etc/init.d/
Should be using the
INIT_SYSVmechanism (look at other packages and/or
documentation), use -D and specific the destination path entirely.
Agreed.
Quoted 10 lines
Quoted 1 line
+ if [ ! -f $(TARGET_DIR)/etc/selinux/$
(BR2_PACKAGE_REFPOLICY_NAME)/contexts/files/file_contexts.local ]; \
package/refpolicy/config
Quoted 2 lines
package/refpolicy/config new file +2
-0+ then \ + touch $(TARGET_DIR)/etc/selinux/$(BR2_PACKAGE_REFPOLICY_NAME)/contexts/files/file_contexts.local; \
Quoted 1 line
+ fi
Why not just touch it? If it exists, it will just update its timestamp,
so no big deal.
Good point. I'll make that change.
Quoted 7 lines
Quoted 1 line
+ # Currently, semodule is unabled to compile the
policy during the build so
Quoted 1 line
+ # the modules must be compiled into the policy
during the first boot. This
package/refpolicy/config
Quoted 3 lines
package/refpolicy/config new file +3
-0+ # is done by the S12selinux startup script. + #( export PATH=$(TARGET_PATH); \ + # $(HOST_DIR)/usr/sbin/semodule -v -n -p $
Quoted 7 lines
(
TARGET_DIR) -s $(BR2_PACKAGE_REFPOLICY_NAME) \Quoted 1 line
+ # -b $(@D)/base.pp -i $(shell ls $(@D)/*.pp |
grep -v base); \
Quoted 1 line
+ #)
So if this was done at build time, we could avoid having a bunch of tools on the target?
This is only for the modular policy. The monolithic policy will be completely built on the host and saved to the target. I could probably go through and pair down a bunch of dependencies based on that. I'll look into that and make some changes.
Thanks,
Clayton
Clayton Shotwell
Software Engineer
clshotwe at rockwellcollins.com
www.rockwellcollins.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20130923/45ea7681/attachment-0001.html>
PATCH v2 11/17 refpolicy: new package
Dear Clayton Shotwell,
Quoted 4 lines · Clayton Shotwell
The different distributions add a few changes that are specific to the distribution. I looked through the distributions and none of them really fit with the way buildroot works so I am going to remove this option from the config.
Ok.
Quoted 6 lines
Quoted 6 lines
Do we have a chance of getting this patch merged upstream? We don't like to carry feature patches in Buildroot, so if a feature doesn't exist upstream, or is so broken upstream and never going to be fixed,
then we prefer to not support it at all.
Quoted 8 lines
Quoted 3 lines
If fixing this upstream is an on-going effort, then no problem to carry
the patch in Buildroot.There has been work on the upstream in relation to these fixes. I have pulled down the latest upstream software and it builds without any problems. This patch will be able to be removed when the next version is released.
Ok, perfect.
Quoted 8 lines
There are many changes that need to be made for
things to work with buildroot that I have not made yet. I don't have the resources to customize the refpolicy to work completely, as is, with buildroot. Currently, a lot of the paths listed in the policy do not match the way buildroot works. This is especially true with the init scripts. Would it be best to make a bunch of modifications to the refpolicy to make it work for buildroot? I'm not sure the best way to proceed with this.
I believe we can merge the refpolicy in its current state (i.e not fully perfect for Buildroot usage), with a clear comment in the Config.in that says so. And then you can continue the development and add more fixes to the refpolicy package as you progress towards making it fully usable in a Buildroot environment.
The thing I'm more worried about is that if we need Buildroot-specific changes, will we have to keep them as patches within Buildroot forever?
Quoted 10 lines
Quoted 6 lines
Do we really need all those dependencies? I've tried to draw a diagram
of all the host and target dependencies between all these SELinux packages, but I must admit I get a bit lost. If you could give some general comments on why the various target/host variants of each package are needed, that'd be really great.I will create a diagram and submit it with the documentation that needs to be created. Hopefully that will be done by the end of the week but I am pretty busy with several things right now.
No problem. Note that I had a look at the SELinux handbook (but it's *very* long), and especially the diagram that they have. It was certainly helpful, but it does not clarify an aspect that is essential in a Buildroot context: what component is used on the target, what component is used only on the build machine.
Quoted 12 lines
Quoted 12 lines
Quoted 1 line
+ # Currently, semodule is unabled to compile the
policy during the build so
Quoted 1 line
+ # the modules must be compiled into the policy
during the first boot. This
package/refpolicy/refpolicy.mk
Quoted 3 lines
package/refpolicy/refpolicy.mk new file +3
-0+ # is done by the S12selinux startup script. + #( export PATH=$(TARGET_PATH); \ + # $(HOST_DIR)/usr/sbin/semodule -v -n -p $(
TARGET_DIR) -s $(BR2_PACKAGE_REFPOLICY_NAME) \Quoted 1 line
+ # -b $(@D)/base.pp -i $(shell ls $(@D)/*.pp |
grep -v base); \
Quoted 1 line
+ #)
Quoted 7 lines
Quoted 2 lines
So if this was done at build time, we could avoid having a bunch of tools on the target?
This is only for the modular policy. The monolithic policy will be completely built on the host and saved to the target. I could probably go through and pair down a bunch of dependencies based on that. I'll look into that and make some changes.
That'd be great, I believe. Especially since you're stating earlier that the monolithic policy is the most efficient one, and recommended for usage on embedded systems, I believe it'd be good to not have the tools to build policies on the target if they are not needed.
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v2 11/17 refpolicy: new package
Thomas,
Thomas Petazzoni <[email protected]> wrote on 09/24/2013 01:30:28 AM:
Quoted 8 lines
I believe we can merge the refpolicy in its current state (i.e not fully perfect for Buildroot usage), with a clear comment in the Config.in that says so. And then you can continue the development and
add more fixes to the refpolicy package as you progress towards making
it fully usable in a Buildroot environment.
Quoted 4 lines
The thing I'm more worried about is that if we need Buildroot-specific
changes, will we have to keep them as patches within Buildroot forever?
We might be able to work with the refpolicy maintainers to add a "buildroot" distro to the build system. I think a lot of that will depend on how extensive the changes are. I'll start making the changes and see how bad it is before I contact the maintainers.
Thanks,
Clayton
Clayton Shotwell
Software Engineer
clshotwe at rockwellcollins.com
www.rockwellcollins.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20130924/a06833e0/attachment.html>
PATCH v2 11/17 refpolicy: new package
Dear Clayton Shotwell,
Quoted 13 lines · Clayton Shotwell
Quoted 8 lines
I believe we can merge the refpolicy in its current state (i.e not fully perfect for Buildroot usage), with a clear comment in the Config.in that says so. And then you can continue the development and
add more fixes to the refpolicy package as you progress towards making
it fully usable in a Buildroot environment.Quoted 4 lines
The thing I'm more worried about is that if we need Buildroot-specific
changes, will we have to keep them as patches within Buildroot forever?
Quoted 4 lines
We might be able to work with the refpolicy maintainers to add a "buildroot" distro to the build system. I think a lot of that will depend on how extensive the changes are. I'll start making the changes and see how bad it is before I contact the maintainers.
Ok. The problem is that the "Buildroot" distribution is not something that exists really. Depending on the Buildroot configuration, the contents of the filesystem and the base system can be very different. It could be Busybox based, or Systemd+coreutils based, or something else. How does it work in real distributions? Is each package coming with the SELinux rules for itself? Or should be in the context of Buildroot just provide the tools and leave it entirely to the user to write the proper SELinux policy?
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v2 11/17 refpolicy: new package
Thomas,
Thomas Petazzoni <[email protected]> wrote on 09/24/2013 10:18:26 AM:
Quoted 10 lines
Ok. The problem is that the "Buildroot" distribution is not something
that exists really. Depending on the Buildroot configuration, the contents of the filesystem and the base system can be verydifferent. It could be Busybox based, or Systemd+coreutils based, or something else. How does it work in real distributions? Is each package coming with the SELinux rules for itself? Or should be in the context of Buildroot just provide the tools and leave it entirely to the user to
write the proper SELinux policy?
Most distributions provide the base refpolicy that is customized to work with the distribution. Fedora, for instance, applies a 166450 line patch file to the refpolicy to make it work with all of the Fedora packages. The refpolicy always seem to be constantly evolving package in these distributions that always has bugs against it. I would like to see Buildroot just supply the ability to build a SELinux policy and maybe support for a select few packages. It will be a huge undertaking to make sure all of the policy is able to work with all of the package in Buildroot. During my development, I will work to get a base, minimal configuration working in enforcing mode right out of the box. I think this would be a reasonable place to start that would hopefully allow other people to expand the functionality.
Thanks,
Clayton
Clayton Shotwell
Software Engineer
clshotwe at rockwellcollins.com
www.rockwellcollins.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20130924/4a5c67d9/attachment.html>
PATCH v2 12/17 python-pyparsing: Add host build option
In reply to Clayton Shotwell---
Changes v1 -> v2:
- No changes.
package/python-pyparsing/python-pyparsing.mk | 47 ++++++++++++++++++------- 1 files changed, 34 insertions(+), 13 deletions(-)
package/python-pyparsing/python-pyparsing.mk +34 -13
@@ -14,25 +14,46 @@ PYTHON_PYPARSING_DEPENDENCIES = python # Shamelessly vampirised from python-pygame ;-) define PYTHON_PYPARSING_BUILD_CMDS - (cd $(@D); \ - CC="$(TARGET_CC)" \ - CFLAGS="$(TARGET_CFLAGS)" \ - LDSHARED="$(TARGET_CROSS)gcc -shared" \ - CROSS_COMPILING=yes \ - _python_sysroot=$(STAGING_DIR) \ - _python_srcdir=$(BUILD_DIR)/python$(PYTHON_VERSION) \ - _python_prefix=/usr \ - _python_exec_prefix=/usr \ - $(HOST_DIR)/usr/bin/python setup.py build \ + (cd $(@D); \ + CC="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS)" \ + LDSHARED="$(TARGET_CROSS)gcc -shared" \ + CROSS_COMPILING=yes \ + _python_sysroot=$(STAGING_DIR) \ + _python_srcdir=$(BUILD_DIR)/python$(PYTHON_VERSION) \ + _python_prefix=/usr \ + _python_exec_prefix=/usr \ + $(HOST_DIR)/usr/bin/python setup.py build \ ) endef # Shamelessly vampirised from python-pygame ;-) define PYTHON_PYPARSING_INSTALL_TARGET_CMDS - (cd $(@D); \ - $(HOST_DIR)/usr/bin/python setup.py install \ - --prefix=$(TARGET_DIR)/usr \ + (cd $(@D); \ + $(HOST_DIR)/usr/bin/python setup.py install \ + --prefix=$(TARGET_DIR)/usr \ + ) +endef + +HOST_PYTHON_PYPARSING_DEPENDENCIES = host-python + +define HOST_PYTHON_PYPARSING_BUILD_CMDS + (cd $(@D); \ + _python_sysroot=$(HOST_DIR) \ + _python_srcdir=$(BUILD_DIR)/host-python$(PYTHON_VERSION) \ + _python_prefix=/usr \ + _python_exec_prefix=/usr \ + $(HOST_DIR)/usr/bin/python setup.py build \ + ) +endef + +define HOST_PYTHON_PYPARSING_INSTALL_CMDS + (cd $(@D); \ + $(HOST_DIR)/usr/bin/python setup.py install \ + --prefix=$(HOST_DIR)/usr \ ) endef $(eval $(generic-package)) +$(eval $(host-generic-package)) +
Signature · 1 line
1.7.1
PATCH v2 13/17 audit: new package
In reply to Clayton Shotwell---
Changes v1 -> v2:
- General cleanup to the mk file to conform to the standard format.
- Fixed the patch naming to avoid using the version number.
- Cleaned up the patch to include a signed-off-by line.
- Changed the original Python select in the Config.in to be a check in the mk file.
package/Config.in | 1 + package/audit/Config.in | 10 + package/audit/S14auditd | 172 +++ .../audit-0001-crossCompileHeaderCreationFix.patch | 1420 ++++++++++++++++++++ package/audit/audit-0002-remove-zos-plugin.patch | 35 + package/audit/audit.mk | 58 + 6 files changed, 1696 insertions(+), 0 deletions(-) create mode 100644 package/audit/Config.in create mode 100755 package/audit/S14auditd create mode 100644 package/audit/audit-0001-crossCompileHeaderCreationFix.patch create mode 100644 package/audit/audit-0002-remove-zos-plugin.patch create mode 100644 package/audit/audit.mk
package/Config.in +1 -0
@@ -940,6 +940,7 @@ endmenu menu "System tools" source "package/acl/Config.in" source "package/attr/Config.in" +source "package/audit/Config.in" if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS source "package/bootutils/Config.in" endif
package/audit/Config.in new file +10 -0
@@ -0,0 +1,10 @@ +config BR2_PACKAGE_AUDIT + bool "audit" + help + The audit package contains the user space utilities for + storing and searching the audit records generate by + the audit subsystem in the Linux 2.6 kernel + + Note: The z/OS remote plugin is disabled in this package + + http://people.redhat.com/sgrubb/audit/
package/audit/S14auditd new file +172 -0
172 lines not on this page · raw message
package/audit/audit-0001-crossCompileHeaderCreationFix.patch new file +1420 -0
1,420 lines not on this page · raw message
package/audit/audit-0002-remove-zos-plugin.patch new file +35 -0
@@ -0,0 +1,35 @@ +Removed the step to build the zos-remote. + +Signed-off-by Clayton Shotwell <[email protected]> +--- +--- a/audisp/plugins/Makefile.am 2012-08-28 10:33:03.582396601 -0500 ++++ b/audisp/plugins/Makefile.am 2012-08-28 10:33:14.162399662 -0500 +@@ -22,7 +22,7 @@ + + CONFIG_CLEAN_FILES = *.loT *.rej *.orig + +-SUBDIRS = builtins zos-remote remote ++SUBDIRS = builtins remote + #SUBDIRS = builtins zos-remote + if HAVE_PRELUDE + SUBDIRS += prelude +--- a/audisp/plugins/Makefile.in 2012-08-28 10:33:03.592380390 -0500 ++++ b/audisp/plugins/Makefile.in 2012-08-28 10:35:38.482397668 -0500 +@@ -84,7 +84,7 @@ + distdir + ETAGS = etags + CTAGS = ctags +-DIST_SUBDIRS = builtins zos-remote remote prelude ++DIST_SUBDIRS = builtins remote prelude + DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + am__relativize = \ + dir0=`pwd`; \ +@@ -242,7 +242,7 @@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + CONFIG_CLEAN_FILES = *.loT *.rej *.orig +-SUBDIRS = builtins zos-remote remote $(am__append_1) ++SUBDIRS = builtins remote $(am__append_1) + all: all-recursive + + .SUFFIXES:
package/audit/audit.mk new file +58 -0
58 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH v2 13/17 audit: new package
Dear Clayton Shotwell,
package/audit/audit-0001-crossCompileHeaderCreationFix.patch line 7
Quoted 13 lines · Clayton Shotwell
package/audit/audit-0001-crossCompileHeaderCreationFix.patch new file +7
-0@@ -0,0 +1,1420 @@ +Rework the build system to generate the required header files using a +Python script rather than compiling executables. This change has +to be made because the executables that are generated are built for +the target architecture and are generally not compilable on the host +build machine. + +Signed-off-by Clayton Shotwell <[email protected]>
In this patch for 'audit', you are replacing a nice C program by a Python script, with the argument that it helps cross-compilation. I must say I quite disagree with that: building a small C program for the host has always been easier than programs that require executing a Python script at build time.
Why not keeping the existing C program, and just adjust the way it is built to get it built by the native compiler?
There is a fairly standardized way of doing that with the autotools, that consists in using the CC_FOR_BUILD variable instead of CC to build this tool. In native compilation, CC_FOR_BUILD == CC == gcc, while in cross-compilation, CC_FOR_BUILD == gcc and CC == <arch-tuple>-gcc.
See http://www.sourceware.org/autobook/autobook/autobook_270.html.
There is apparently even an existing m4 macro to define CC_FOR_BUILD:
http://ac-archive.sourceforge.net/ac-archive/ac_prog_cc_for_build.html.
Or maybe the Python script approach is something that has been agreed upon with the audit/SELinux community?
Best regards,
Thomas Petazzoni
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH v2 13/17 audit: new package
Thomas,
Thomas Petazzoni <[email protected]> wrote on 09/18/2013 12:00:20 AM:
Quoted 20 lines
In this patch for 'audit', you are replacing a nice C program by a Python script, with the argument that it helps cross-compilation. I must say I quite disagree with that: building a small C program for the
host has always been easier than programs that require executing a Python script at build time.Why not keeping the existing C program, and just adjust the way it is
built to get it built by the native compiler?There is a fairly standardized way of doing that with the autotools, that consists in using the
CC_FOR_BUILDvariable instead of CC to build
this tool. In native compilation,CC_FOR_BUILD== CC == gcc, while in
cross-compilation,CC_FOR_BUILD== gcc and CC == <arch-tuple>-gcc.See http://www.sourceware.org/autobook/autobook/autobook_270.html.
Quoted 8 lines
There is apparently even an existing m4 macro to define
CC_FOR_BUILD:
http://ac-archive.sourceforge.net/ac-archive/
ac_prog_cc_for_build.html.Or maybe the Python script approach is something that has been agreed
upon with the audit/SELinux community?
I have been working with the audit community to get this patch accepted. There is an issue with the C program not pulling in the correct headers when you build it for this host. The python script is able to get around this issue.
Thanks,
Clayton
Clayton Shotwell
Software Engineer
clshotwe at rockwellcollins.com
www.rockwellcollins.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20130924/de93ba9d/attachment.html>
PATCH v2 13/17 audit: new package
Dear Clayton Shotwell,
Quoted 4 lines · Clayton Shotwell
I have been working with the audit community to get this patch accepted. There is an issue with the C program not pulling in the correct headers when you build it for this host. The python script is able to get around this issue.
Hum this is strange because with CFLAGS_FOR_BUILD, you're supposed to receive the correct -I arguments even for building host tools. I really believe adding Python as a build dependency for something that already has a nice C program to be built is not the nicest move. Of course, if that's upstream choice, then we'll follow it, but I believe it's not the best choice.
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v2 13/17 audit: new package
Thomas,
Thomas Petazzoni <[email protected]> wrote on 09/24/2013 04:57:15 PM:
Quoted 6 lines
Hum this is strange because with
CFLAGS_FOR_BUILD, you're supposed to receive the correct -I arguments even for building host tools. I really believe adding Python as a build dependency for something that already has a nice C program to be built is not the nicest move. Of course, if that's upstream choice, then we'll follow it, but I believe it's not the best choice.
I guess I should give a little more detail on what the C program is doing.
That program takes kernel syscall numbers and generates lookup tables to
reference the number to a string. This is used in decoding the audit log information and presenting it in a method that is human readable. The issue I am seeing with building it for the host is incorrect tables are generated. I do not know of a way to get a C program to compile using different kernel headers and preprocessor values. Do you know of a way to do this?
Thanks,
Clayton
Clayton Shotwell
Software Engineer
clshotwe at rockwellcollins.com
www.rockwellcollins.com
PATCH v2 14/17 shadow: new package
In reply to Clayton Shotwell---
Changes v1 -> v2:
- General cleanup to the mk file to conform to the standard format.
package/Config.in | 3 ++ package/shadow/Config.in | 13 ++++++++++++ package/shadow/shadow.mk | 49 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 65 insertions(+), 0 deletions(-) create mode 100644 package/shadow/Config.in create mode 100644 package/shadow/shadow.mk
package/Config.in +3 -0
@@ -929,6 +929,9 @@ source "package/lockfile-progs/Config.in" source "package/logrotate/Config.in" source "package/logsurfer/Config.in" source "package/screen/Config.in" +if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS +source "package/shadow/Config.in" +endif source "package/sudo/Config.in" if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS source "package/time/Config.in"
package/shadow/Config.in new file +13 -0
@@ -0,0 +1,13 @@ +config BR2_PACKAGE_SHADOW + bool "shadow" + help + The shadow-utils package includes the necessary programs for + converting UNIX password files to the shadow password format, plus + programs for managing user and group accounts. The pwconv command + converts passwords to the shadow password format. The pwunconv command + unconverts shadow passwords and generates an npasswd file (a standard + UNIX password file). The pwck command checks the integrity of password + and shadow files. The lastlog command prints out the last login times + for all users. The useradd, userdel, and usermod commands are used for + managing user accounts. The groupadd, groupdel, and groupmod commands + are used for managing group accounts.
package/shadow/shadow.mk new file +49 -0
49 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH v2 15/17 pcre: Add host build support
In reply to Clayton Shotwell---
Changes v1 -> v2:
- No changes
package/pcre/pcre.mk | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
package/pcre/pcre.mk +1 -0
@@ -21,3 +21,4 @@ PCRE_CONF_OPT += $(if $(BR2_PACKAGE_PCRE_16),--enable-pcre16,--disable-pcre16) PCRE_CONF_OPT += $(if $(BR2_PACKAGE_PCRE_32),--enable-pcre32,--disable-pcre32) $(eval $(autotools-package)) +$(eval $(host-autotools-package))
Signature · 1 line
1.7.1
PATCH v2 15/17 pcre: Add host build support
Dear Clayton Shotwell,
Quoted 14 lines · Clayton Shotwell
Signed-off-by Clayton Shotwell <[email protected]>---
Changes v1 -> v2:
- No changespackage/pcre/pcre.mk | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)package/pcre/pcre.mk +0
-0
package/pcre/pcre.mk PCRE_CONF_OPT += $(if $(BR2_PACKAGE_PCRE_16),--enable-pcre16,--disable-pcre16) · line 24
Quoted 4 lines
package/pcre/pcre.mk +1
-0@@ -21,3 +21,4 @@ PCRE_CONF_OPT += $(if $(BR2_PACKAGE_PCRE_16),--enable-pcre16,--disable-pcre16) PCRE_CONF_OPT += $(if $(BR2_PACKAGE_PCRE_32),--enable-pcre32,--disable-pcre32) $(eval $(autotools-package)) +$(eval $(host-autotools-package))
This comment applies to patches 15, 16 and 17. Since the host variant of those packages are used by earlier patches in your series, then these patches should appear before they are used. Otherwise, your patch series is not bisectable.
Thanks,
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH v2 15/17 pcre: Add host build support
Thomas,
Thomas Petazzoni <[email protected]> wrote on 09/18/2013 12:18:54 AM:
Quoted 5 lines
This comment applies to patches 15, 16 and 17. Since the host variant
of those packages are used by earlier patches in your series, then these patches should appear before they are used. Otherwise, your patch series is not bisectable.
I will reorder the patches to they apply in the order of dependence.
Thanks,
Clayton
Clayton Shotwell
Software Engineer
clshotwe at rockwellcollins.com
www.rockwellcollins.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20130923/a8c15553/attachment.html>
PATCH v2 16/17 bzip2: Add host build shared library installation
In reply to Clayton Shotwell---
Changes v1 -> v2:
- No changes
package/bzip2/bzip2.mk | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
package/bzip2/bzip2.mk +2 -0
@@ -71,6 +71,8 @@ endef define HOST_BZIP2_INSTALL_CMDS $(HOST_MAKE_ENV) \ $(MAKE) PREFIX=$(HOST_DIR)/usr -C $(@D) install + $(HOST_MAKE_ENV) $(MAKE) \ + -f Makefile-libbz2_so PREFIX=$(HOST_DIR)/usr -C $(@D) install endef $(eval $(generic-package))
Signature · 1 line
1.7.1
PATCH v2 17/17 sqlite: Add host build support
In reply to Clayton Shotwell---
Changes v1 -> v2:
- No changes
package/sqlite/sqlite.mk | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
package/sqlite/sqlite.mk +1 -0
@@ -68,3 +68,4 @@ define SQLITE_UNINSTALL_STAGING_CMDS endef $(eval $(autotools-package)) +$(eval $(host-autotools-package))
Signature · 1 line
1.7.1