mirror of
https://github.com/home-assistant/operating-system.git
synced 2025-11-14 05:09:27 +00:00
* Update buildroot-patches for 2020.11-rc1 buildroot * Update buildroot to 2020.11-rc1 Signed-off-by: Stefan Agner <stefan@agner.ch> * Don't rely on sfdisk --list-free output The --list-free (-F) argument does not allow machine readable mode. And it seems that the output format changes over time (different spacing, using size postfixes instead of raw blocks). Use sfdisk json output and calculate free partition space ourselfs. This works for 2.35 and 2.36 and is more robust since we rely on output which is meant for scripts to parse. * Migrate defconfigs for Buildroot 2020.11-rc1 In particular, rename BR2_TARGET_UBOOT_BOOT_SCRIPT(_SOURCE) to BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT(_SOURCE). * Rebase/remove systemd patches for systemd 246 * Drop apparmor/libapparmor from buildroot-external * hassos-persists: use /run as directory for lockfiles The U-Boot tools use /var/lock by default which is not created any more by systemd by default (it is under tmpfiles legacy.conf, which we no longer install). * Disable systemd-update-done.service The service is not suited for pure read-only systems. In particular the service needs to be able to write a file in /etc and /var. Remove the service. Note: This is a static service and cannot be removed using systemd-preset. * Disable apparmor.service for now The service loads all default profiles. Some might actually cause problems. E.g. the profile for ping seems not to match our setup for /etc/resolv.conf: [85503.634653] audit: type=1400 audit(1605286002.684:236): apparmor="DENIED" operation="open" profile="ping" name="/run/resolv.conf" pid=27585 comm="ping" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
109 lines
3.9 KiB
Diff
109 lines
3.9 KiB
Diff
From df7c95b4ceecf390b961d843a556c470ac9080b2 Mon Sep 17 00:00:00 2001
|
|
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
|
Date: Wed, 22 Feb 2017 16:33:22 -0800
|
|
Subject: [PATCH] Add infrastructure to disable the build of certain extensions
|
|
|
|
Some of the extensions part of the Python core have dependencies on
|
|
external libraries (sqlite, tk, etc.) or are relatively big and not
|
|
necessarly always useful (CJK codecs for example). By extensions, we
|
|
mean part of Python modules that are written in C and therefore
|
|
compiled to binary code.
|
|
|
|
Therefore, we introduce a small infrastructure that allows to disable
|
|
some of those extensions. This can be done inside the configure.ac by
|
|
adding values to the DISABLED_EXTENSIONS variable (which is a
|
|
word-separated list of extensions).
|
|
|
|
The implementation works as follow :
|
|
|
|
* configure.ac defines a DISABLED_EXTENSIONS variable, which is
|
|
substituted (so that when Makefile.pre is generated from
|
|
Makefile.pre.in, the value of the variable is substituted). For
|
|
now, this DISABLED_EXTENSIONS variable is empty, later patches will
|
|
use it.
|
|
|
|
* Makefile.pre.in passes the DISABLED_EXTENSIONS value down to the
|
|
variables passed in the environment when calling the setup.py
|
|
script that actually builds and installs those extensions.
|
|
|
|
* setup.py is modified so that the existing "disabled_module_list" is
|
|
filled with those pre-disabled extensions listed in
|
|
DISABLED_EXTENSIONS.
|
|
|
|
Patch ported to python2.7 by Maxime Ripard <ripard@archos.com>, and
|
|
then extended by Thomas Petazzoni
|
|
<thomas.petazzoni@free-electrons.com>.
|
|
|
|
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
|
[ Andrey Smirnov: ported to Python 3.6 ]
|
|
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
|
|
---
|
|
Makefile.pre.in | 6 +++++-
|
|
configure.ac | 2 ++
|
|
setup.py | 5 ++++-
|
|
3 files changed, 11 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/Makefile.pre.in b/Makefile.pre.in
|
|
index 0c809f3d8a..7c3dde8dd4 100644
|
|
--- a/Makefile.pre.in
|
|
+++ b/Makefile.pre.in
|
|
@@ -213,6 +213,8 @@ FILEMODE= 644
|
|
# configure script arguments
|
|
CONFIG_ARGS= @CONFIG_ARGS@
|
|
|
|
+# disabled extensions
|
|
+DISABLED_EXTENSIONS= @DISABLED_EXTENSIONS@
|
|
|
|
# Subdirectories with code
|
|
SRCDIRS= @SRCDIRS@
|
|
@@ -629,6 +631,7 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o
|
|
esac; \
|
|
echo "$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
|
|
_TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
|
|
+ DISABLED_EXTENSIONS="$(DISABLED_EXTENSIONS)" \
|
|
$(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build"; \
|
|
$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
|
|
_TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
|
|
@@ -1674,7 +1677,8 @@ libainstall: @DEF_MAKE_RULE@ python-config
|
|
# Install the dynamically loadable modules
|
|
# This goes into $(exec_prefix)
|
|
sharedinstall: sharedmods
|
|
- $(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \
|
|
+ $(RUNSHARED) DISABLED_EXTENSIONS="$(DISABLED_EXTENSIONS)" \
|
|
+ $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \
|
|
--prefix=$(prefix) \
|
|
--install-scripts=$(BINDIR) \
|
|
--install-platlib=$(DESTSHARED) \
|
|
diff --git a/configure.ac b/configure.ac
|
|
index c2445edc88..73d66167de 100644
|
|
--- a/configure.ac
|
|
+++ b/configure.ac
|
|
@@ -3052,6 +3052,8 @@ LIBS="$withval $LIBS"
|
|
|
|
PKG_PROG_PKG_CONFIG
|
|
|
|
+AC_SUBST(DISABLED_EXTENSIONS)
|
|
+
|
|
# Check for use of the system expat library
|
|
AC_MSG_CHECKING(for --with-system-expat)
|
|
AC_ARG_WITH(system_expat,
|
|
diff --git a/setup.py b/setup.py
|
|
index 770866bca7..b6c829b3a5 100644
|
|
--- a/setup.py
|
|
+++ b/setup.py
|
|
@@ -43,7 +43,10 @@ from distutils.spawn import find_executable
|
|
TEST_EXTENSIONS = True
|
|
|
|
# This global variable is used to hold the list of modules to be disabled.
|
|
-DISABLED_MODULE_LIST = []
|
|
+try:
|
|
+ DISABLED_MODULE_LIST = sysconfig.get_config_var("DISABLED_EXTENSIONS").split(" ")
|
|
+except KeyError:
|
|
+ DISABLED_MODULE_LIST = list()
|
|
|
|
|
|
def get_platform():
|
|
--
|
|
2.25.1
|
|
|