From a5a9bf47a5793bed32c44ee0b1f19bfd63a76724 Mon Sep 17 00:00:00 2001 From: Michael Cobb michael.cobb@iceotope.com Date: Wed, 21 Aug 2024 10:54:42 +0100 Subject: [meta-morello-distro][PATCH 0/2] Yocto recipes for DBus
These patches contain Yocto/Bitbake recipes for DBus 1.15.0 and libexpat 2.5.0
Michael Cobb (2): expat: C64 initial commit dbus: C64 initial commit
recipes-core/dbus/dbus-morello_1.15.0.bb | 190 ++++++++ recipes-core/dbus/dbus/dbus-1.init | 123 +++++ recipes-core/dbus/dbus/tmpdir.patch | 44 ++ recipes-core/expat/expat-morello_2.5.0.bb | 32 ++ ...CVE-2023-52426-backported-from-expat.patch | 420 ++++++++++++++++++ 5 files changed, 809 insertions(+) create mode 100644 recipes-core/dbus/dbus-morello_1.15.0.bb create mode 100644 recipes-core/dbus/dbus/dbus-1.init create mode 100644 recipes-core/dbus/dbus/tmpdir.patch create mode 100644 recipes-core/expat/expat-morello_2.5.0.bb create mode 100644 recipes-core/expat/files/0001-Apply-patch-for-CVE-2023-52426-backported-from-expat.patch
From f5b048741189bf0a6db759bc51b2507400a428be Mon Sep 17 00:00:00 2001 From: Michael Cobb michael.cobb@iceotope.com Date: Fri, 16 Aug 2024 15:28:53 +0100 Subject: [PATCH 1/2] expat: C64 initial commit
Initial commit of expat C64 recipes
Signed-off-by: Michael Cobb michael.cobb@iceotope.com --- recipes-core/expat/expat-morello_2.5.0.bb | 32 ++ ...CVE-2023-52426-backported-from-expat.patch | 420 ++++++++++++++++++ 2 files changed, 452 insertions(+) create mode 100644 recipes-core/expat/expat-morello_2.5.0.bb create mode 100644 recipes-core/expat/files/0001-Apply-patch-for-CVE-2023-52426-backported-from-expat.patch
diff --git a/recipes-core/expat/expat-morello_2.5.0.bb b/recipes-core/expat/expat-morello_2.5.0.bb new file mode 100644 index 0000000..92d9966 --- /dev/null +++ b/recipes-core/expat/expat-morello_2.5.0.bb @@ -0,0 +1,32 @@ +inherit cmake lib_package purecap-sysroot + +MORELLO_SRC = "poky/meta/recipes-core/expat/expat_2.5.0.bb" + +SUMMARY = "A stream-oriented XML parser library" +DESCRIPTION = "Expat is an XML parser library written in C. It is a stream-oriented parser in which an application registers handlers for things the parser might find in the XML document (like start tags)" +HOMEPAGE = "https://github.com/libexpat/libexpat" +SECTION = "libs" +LICENSE = "MIT" + +LIC_FILES_CHKSUM = "file://COPYING;md5=7b3b078238d0901d3b339289117cb7fb" + +VERSION_TAG = "${@d.getVar('PV').replace('.', '_')}" + +SRC_URI = "https://github.com/libexpat/libexpat/releases/download/R_%24%7BVERSION_TAG%7... \ + file://0001-Apply-patch-for-CVE-2023-52426-backported-from-expat.patch \ + " + +S = "${WORKDIR}/expat-${PV}" + +TOOLCHAIN = "${MORELLO_TOOLCHAIN}" +CC:remove = "${CC_PURECAP_FLAGS}" + +UPSTREAM_CHECK_URI = "https://github.com/libexpat/libexpat/releases/" + +SRC_URI[sha256sum] = "6f0e6e01f7b30025fa05c85fdad1e5d0ec7fd35d9f61b22f34998de11969ff67" + +do_configure() { + cmake -S ${S} -B ${B} -DEXPAT_BUILD_TESTS:BOOL=OFF -DCMAKE_CXX_COMPILER_WORKS="1" -DCMAKE_INSTALL_PREFIX="${prefix}" -DCMAKE_C_COMPILER="${CC}" -DCMAKE_C_FLAGS="${CC_PURECAP_FLAGS}" -DCMAKE_C_LINK_FLAGS="${LD_PURECAP_FLAGS}" +} + +CVE_PRODUCT = "expat libexpat" diff --git a/recipes-core/expat/files/0001-Apply-patch-for-CVE-2023-52426-backported-from-expat.patch b/recipes-core/expat/files/0001-Apply-patch-for-CVE-2023-52426-backported-from-expat.patch new file mode 100644 index 0000000..38478bd --- /dev/null +++ b/recipes-core/expat/files/0001-Apply-patch-for-CVE-2023-52426-backported-from-expat.patch @@ -0,0 +1,420 @@ +From 44aa460dd59ae1ca8ac7013f3bf07fe5d8e8f2d4 Mon Sep 17 00:00:00 2001 +From: Michael Cobb michael.cobb@iceotope.com +Date: Wed, 14 Aug 2024 15:16:21 +0100 +Subject: [PATCH] Apply patch for CVE-2023-52426, backported from expat-2.6.0 +Patch for CVE-2023-52426 by Sebastian Pipping sebastian@pipping.org (https://github.com/libexpat/libexpat/commit/0f075ec8ecb5e43f8fdca5182f8cca47...) +--- + CMakeLists.txt | 8 ++++- + lib/expat.h | 8 +++-- + lib/internal.h | 2 +- + lib/libexpat.def.cmake | 4 +-- + lib/xmlparse.c | 71 ++++++++++++++++++++++-------------------- + xmlwf/xmlwf.c | 18 ++++++----- + 6 files changed, 62 insertions(+), 49 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2b4c13c..44ec2e9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -381,7 +381,13 @@ if(EXPAT_SHARED_LIBS) + endif() + endmacro() + +- _expat_def_file_toggle(EXPAT_DTD _EXPAT_COMMENT_DTD) ++ if(EXPAT_DTD OR EXPAT_GE) ++ set(_EXPAT_DTD_OR_GE TRUE) ++ else() ++ set(_EXPAT_DTD_OR_GE FALSE) ++ endif() ++ ++ _expat_def_file_toggle(_EXPAT_DTD_OR_GE _EXPAT_COMMENT_DTD_OR_GE) + _expat_def_file_toggle(EXPAT_ATTR_INFO _EXPAT_COMMENT_ATTR_INFO) + + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/lib/libexpat.def.cmake" "${CMAKE_CURRENT_BINARY_DIR}/lib/libexpat.def") +diff --git a/lib/expat.h b/lib/expat.h +index 1c83563..33c94af 100644 +--- a/lib/expat.h ++++ b/lib/expat.h +@@ -1038,13 +1038,15 @@ typedef struct { + XMLPARSEAPI(const XML_Feature *) + XML_GetFeatureList(void); + +-#ifdef XML_DTD +-/* Added in Expat 2.4.0. */ ++#if defined(XML_DTD) || XML_GE == 1 ++/* Added in Expat 2.4.0 for XML_DTD defined and ++ * added in Expat 2.6.0 for XML_GE == 1. */ + XMLPARSEAPI(XML_Bool) + XML_SetBillionLaughsAttackProtectionMaximumAmplification( + XML_Parser parser, float maximumAmplificationFactor); + +-/* Added in Expat 2.4.0. */ ++/* Added in Expat 2.4.0 for XML_DTD defined and ++ * added in Expat 2.6.0 for XML_GE == 1. */ + XMLPARSEAPI(XML_Bool) + XML_SetBillionLaughsAttackProtectionActivationThreshold( + XML_Parser parser, unsigned long long activationThresholdBytes); +diff --git a/lib/internal.h b/lib/internal.h +index e09f533..1851925 100644 +--- a/lib/internal.h ++++ b/lib/internal.h +@@ -154,7 +154,7 @@ extern "C" { + void _INTERNAL_trim_to_complete_utf8_characters(const char *from, + const char **fromLimRef); + +-#if defined(XML_DTD) ++#if defined(XML_DTD) || XML_GE == 1 + unsigned long long testingAccountingGetCountBytesDirect(XML_Parser parser); + unsigned long long testingAccountingGetCountBytesIndirect(XML_Parser parser); + const char *unsignedCharToPrintable(unsigned char c); +diff --git a/lib/libexpat.def.cmake b/lib/libexpat.def.cmake +index cf434a2..61a4f00 100644 +--- a/lib/libexpat.def.cmake ++++ b/lib/libexpat.def.cmake +@@ -75,5 +75,5 @@ EXPORTS + XML_SetHashSalt @67 + ; internal @68 removed with version 2.3.1 + ; added with version 2.4.0 +-@_EXPAT_COMMENT_DTD@ XML_SetBillionLaughsAttackProtectionActivationThreshold @69 +-@_EXPAT_COMMENT_DTD@ XML_SetBillionLaughsAttackProtectionMaximumAmplification @70 ++@_EXPAT_COMMENT_DTD_OR_GE@ XML_SetBillionLaughsAttackProtectionActivationThreshold @69 ++@_EXPAT_COMMENT_DTD_OR_GE@ XML_SetBillionLaughsAttackProtectionMaximumAmplification @70 +diff --git a/lib/xmlparse.c b/lib/xmlparse.c +index b6c2eca..acc1db9 100644 +--- a/lib/xmlparse.c ++++ b/lib/xmlparse.c +@@ -408,7 +408,7 @@ enum XML_Account { + XML_ACCOUNT_NONE /* i.e. do not account, was accounted already */ + }; + +-#ifdef XML_DTD ++#if defined(XML_DTD) || XML_GE == 1 + typedef unsigned long long XmlBigCount; + typedef struct accounting { + XmlBigCount countBytesDirect; +@@ -424,7 +424,7 @@ typedef struct entity_stats { + unsigned int maximumDepthSeen; + int debugLevel; + } ENTITY_STATS; +-#endif /* XML_DTD */ ++#endif /* defined(XML_DTD) || XML_GE == 1 */ + + typedef enum XML_Error PTRCALL Processor(XML_Parser parser, const char *start, + const char *end, const char **endPtr); +@@ -562,7 +562,7 @@ static XML_Parser parserCreate(const XML_Char *encodingName, + + static void parserInit(XML_Parser parser, const XML_Char *encodingName); + +-#ifdef XML_DTD ++#if defined(XML_DTD) || XML_GE == 1 + static float accountingGetCurrentAmplification(XML_Parser rootParser); + static void accountingReportStats(XML_Parser originParser, const char *epilog); + static void accountingOnAbort(XML_Parser originParser); +@@ -585,7 +585,7 @@ static void entityTrackingOnClose(XML_Parser parser, ENTITY *entity, + + static XML_Parser getRootParserOf(XML_Parser parser, + unsigned int *outLevelDiff); +-#endif /* XML_DTD */ ++#endif /* defined(XML_DTD) || XML_GE == 1 */ + + static unsigned long getDebugLevel(const char *variableName, + unsigned long defaultDebugLevel); +@@ -703,7 +703,7 @@ struct XML_ParserStruct { + enum XML_ParamEntityParsing m_paramEntityParsing; + #endif + unsigned long m_hash_secret_salt; +-#ifdef XML_DTD ++#if defined(XML_DTD) || XML_GE == 1 + ACCOUNTING m_accounting; + ENTITY_STATS m_entity_stats; + #endif +@@ -1163,7 +1163,7 @@ parserInit(XML_Parser parser, const XML_Char *encodingName) { + #endif + parser->m_hash_secret_salt = 0; + +-#ifdef XML_DTD ++#if defined(XML_DTD) || XML_GE == 1 + memset(&parser->m_accounting, 0, sizeof(ACCOUNTING)); + parser->m_accounting.debugLevel = getDebugLevel("EXPAT_ACCOUNTING_DEBUG", 0u); + parser->m_accounting.maximumAmplificationFactor +@@ -2522,8 +2522,9 @@ XML_GetFeatureList(void) { + #ifdef XML_ATTR_INFO + {XML_FEATURE_ATTR_INFO, XML_L("XML_ATTR_INFO"), 0}, + #endif +-#ifdef XML_DTD +- /* Added in Expat 2.4.0. */ ++#if defined(XML_DTD) || XML_GE == 1 ++ /* Added in Expat 2.4.0 for XML_DTD defined and ++ * added in Expat 2.6.0 for XML_GE == 1. */ + {XML_FEATURE_BILLION_LAUGHS_ATTACK_PROTECTION_MAXIMUM_AMPLIFICATION_DEFAULT, + XML_L("XML_BLAP_MAX_AMP"), + (long int) +@@ -2537,7 +2538,7 @@ XML_GetFeatureList(void) { + return features; + } + +-#ifdef XML_DTD ++#if defined(XML_DTD) || XML_GE == 1 + XML_Bool XMLCALL + XML_SetBillionLaughsAttackProtectionMaximumAmplification( + XML_Parser parser, float maximumAmplificationFactor) { +@@ -2559,7 +2560,7 @@ XML_SetBillionLaughsAttackProtectionActivationThreshold( + parser->m_accounting.activationThresholdBytes = activationThresholdBytes; + return XML_TRUE; + } +-#endif /* XML_DTD */ ++#endif /* defined(XML_DTD) || XML_GE == 1 */ + + /* Initially tag->rawName always points into the parse buffer; + for those TAG instances opened while the current parse buffer was +@@ -2645,13 +2646,13 @@ externalEntityInitProcessor2(XML_Parser parser, const char *start, + int tok = XmlContentTok(parser->m_encoding, start, end, &next); + switch (tok) { + case XML_TOK_BOM: +-#ifdef XML_DTD ++#if defined(XML_DTD) || XML_GE == 1 + if (! accountingDiffTolerated(parser, tok, start, next, __LINE__, + XML_ACCOUNT_DIRECT)) { + accountingOnAbort(parser); + return XML_ERROR_AMPLIFICATION_LIMIT_BREACH; + } +-#endif /* XML_DTD */ ++#endif /* defined(XML_DTD) || XML_GE == 1 */ + + /* If we are at the end of the buffer, this would cause the next stage, + i.e. externalEntityInitProcessor3, to pass control directly to +@@ -2765,7 +2766,7 @@ doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc, + for (;;) { + const char *next = s; /* XmlContentTok doesn't always set the last arg */ + int tok = XmlContentTok(enc, s, end, &next); +-#ifdef XML_DTD ++#if defined(XML_DTD) || XML_GE == 1 + const char *accountAfter + = ((tok == XML_TOK_TRAILING_RSQB) || (tok == XML_TOK_TRAILING_CR)) + ? (haveMore ? s /* i.e. 0 bytes */ : end) +@@ -2831,14 +2832,14 @@ doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc, + XML_Char ch = (XML_Char)XmlPredefinedEntityName( + enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); + if (ch) { +-#ifdef XML_DTD ++#if defined(XML_DTD) || XML_GE == 1 + /* NOTE: We are replacing 4-6 characters original input for 1 character + * so there is no amplification and hence recording without + * protection. */ + accountingDiffTolerated(parser, tok, (char *)&ch, + ((char *)&ch) + sizeof(XML_Char), __LINE__, + XML_ACCOUNT_ENTITY_EXPANSION); +-#endif /* XML_DTD */ ++#endif /* defined(XML_DTD) || XML_GE == 1 */ + if (parser->m_characterDataHandler) + parser->m_characterDataHandler(parser->m_handlerArg, &ch, 1); + else if (parser->m_defaultHandler) +@@ -4040,7 +4041,7 @@ doCdataSection(XML_Parser parser, const ENCODING *enc, const char **startPtr, + for (;;) { + const char *next = s; /* in case of XML_TOK_NONE or XML_TOK_PARTIAL */ + int tok = XmlCdataSectionTok(enc, s, end, &next); +-#ifdef XML_DTD ++#if defined(XML_DTD) || XML_GE == 1 + if (! accountingDiffTolerated(parser, tok, s, next, __LINE__, account)) { + accountingOnAbort(parser); + return XML_ERROR_AMPLIFICATION_LIMIT_BREACH; +@@ -4192,7 +4193,7 @@ doIgnoreSection(XML_Parser parser, const ENCODING *enc, const char **startPtr, + *eventPP = s; + *startPtr = NULL; + tok = XmlIgnoreSectionTok(enc, s, end, &next); +-# ifdef XML_DTD ++# if defined(XML_DTD) || XML_GE == 1 + if (! accountingDiffTolerated(parser, tok, s, next, __LINE__, + XML_ACCOUNT_DIRECT)) { + accountingOnAbort(parser); +@@ -4284,7 +4285,7 @@ processXmlDecl(XML_Parser parser, int isGeneralTextEntity, const char *s, + const XML_Char *storedversion = NULL; + int standalone = -1; + +-#ifdef XML_DTD ++#if defined(XML_DTD) || XML_GE == 1 + if (! accountingDiffTolerated(parser, XML_TOK_XML_DECL, s, next, __LINE__, + XML_ACCOUNT_DIRECT)) { + accountingOnAbort(parser); +@@ -4491,7 +4492,7 @@ entityValueInitProcessor(XML_Parser parser, const char *s, const char *end, + */ + else if (tok == XML_TOK_BOM && next == end + && ! parser->m_parsingStatus.finalBuffer) { +-# ifdef XML_DTD ++# if defined(XML_DTD) || XML_GE == 1 + if (! accountingDiffTolerated(parser, tok, s, next, __LINE__, + XML_ACCOUNT_DIRECT)) { + accountingOnAbort(parser); +@@ -4707,11 +4708,13 @@ doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end, + } + } + role = XmlTokenRole(&parser->m_prologState, tok, s, next, enc); +-#ifdef XML_DTD ++#if defined(XML_DTD) || XML_GE == 1 + switch (role) { + case XML_ROLE_INSTANCE_START: // bytes accounted in contentProcessor + case XML_ROLE_XML_DECL: // bytes accounted in processXmlDecl +- case XML_ROLE_TEXT_DECL: // bytes accounted in processXmlDecl ++# ifdef XML_DTD ++ case XML_ROLE_TEXT_DECL: // bytes accounted in processXmlDecl ++# endif + break; + default: + if (! accountingDiffTolerated(parser, tok, s, next, __LINE__, account)) { +@@ -5648,7 +5651,7 @@ epilogProcessor(XML_Parser parser, const char *s, const char *end, + for (;;) { + const char *next = NULL; + int tok = XmlPrologTok(parser->m_encoding, s, end, &next); +-#ifdef XML_DTD ++#if defined(XML_DTD) || XML_GE == 1 + if (! accountingDiffTolerated(parser, tok, s, next, __LINE__, + XML_ACCOUNT_DIRECT)) { + accountingOnAbort(parser); +@@ -5728,7 +5731,7 @@ processInternalEntity(XML_Parser parser, ENTITY *entity, XML_Bool betweenDecl) { + return XML_ERROR_NO_MEMORY; + } + entity->open = XML_TRUE; +-#ifdef XML_DTD ++#if defined(XML_DTD) || XML_GE == 1 + entityTrackingOnOpen(parser, entity, __LINE__); + #endif + entity->processed = 0; +@@ -5762,9 +5765,9 @@ processInternalEntity(XML_Parser parser, ENTITY *entity, XML_Bool betweenDecl) { + entity->processed = (int)(next - textStart); + parser->m_processor = internalEntityProcessor; + } else { +-#ifdef XML_DTD ++#if defined(XML_DTD) || XML_GE == 1 + entityTrackingOnClose(parser, entity, __LINE__); +-#endif /* XML_DTD */ ++#endif /* defined(XML_DTD) || XML_GE == 1 */ + entity->open = XML_FALSE; + parser->m_openInternalEntities = openEntity->next; + /* put openEntity back in list of free instances */ +@@ -5813,7 +5816,7 @@ internalEntityProcessor(XML_Parser parser, const char *s, const char *end, + return result; + } + +-#ifdef XML_DTD ++#if defined(XML_DTD) || XML_GE == 1 + entityTrackingOnClose(parser, entity, __LINE__); + #endif + entity->open = XML_FALSE; +@@ -5892,7 +5895,7 @@ appendAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata, + const char *next + = ptr; /* XmlAttributeValueTok doesn't always set the last arg */ + int tok = XmlAttributeValueTok(enc, ptr, end, &next); +-#ifdef XML_DTD ++#if defined(XML_DTD) || XML_GE == 1 + if (! accountingDiffTolerated(parser, tok, ptr, next, __LINE__, account)) { + accountingOnAbort(parser); + return XML_ERROR_AMPLIFICATION_LIMIT_BREACH; +@@ -5957,14 +5960,14 @@ appendAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata, + XML_Char ch = (XML_Char)XmlPredefinedEntityName( + enc, ptr + enc->minBytesPerChar, next - enc->minBytesPerChar); + if (ch) { +-#ifdef XML_DTD ++#if defined(XML_DTD) || XML_GE == 1 + /* NOTE: We are replacing 4-6 characters original input for 1 character + * so there is no amplification and hence recording without + * protection. */ + accountingDiffTolerated(parser, tok, (char *)&ch, + ((char *)&ch) + sizeof(XML_Char), __LINE__, + XML_ACCOUNT_ENTITY_EXPANSION); +-#endif /* XML_DTD */ ++#endif /* defined(XML_DTD) || XML_GE == 1 */ + if (! poolAppendChar(pool, ch)) + return XML_ERROR_NO_MEMORY; + break; +@@ -6042,14 +6045,14 @@ appendAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata, + enum XML_Error result; + const XML_Char *textEnd = entity->textPtr + entity->textLen; + entity->open = XML_TRUE; +-#ifdef XML_DTD ++#if defined(XML_DTD) || XML_GE == 1 + entityTrackingOnOpen(parser, entity, __LINE__); + #endif + result = appendAttributeValue(parser, parser->m_internalEncoding, + isCdata, (const char *)entity->textPtr, + (const char *)textEnd, pool, + XML_ACCOUNT_ENTITY_EXPANSION); +-#ifdef XML_DTD ++#if defined(XML_DTD) || XML_GE == 1 + entityTrackingOnClose(parser, entity, __LINE__); + #endif + entity->open = XML_FALSE; +@@ -6105,7 +6108,7 @@ storeEntityValue(XML_Parser parser, const ENCODING *enc, + = entityTextPtr; /* XmlEntityValueTok doesn't always set the last arg */ + int tok = XmlEntityValueTok(enc, entityTextPtr, entityTextEnd, &next); + +-#ifdef XML_DTD ++#if defined(XML_DTD) || XML_GE == 1 + if (! accountingDiffTolerated(parser, tok, entityTextPtr, next, __LINE__, + account)) { + accountingOnAbort(parser); +@@ -7651,7 +7654,7 @@ copyString(const XML_Char *s, const XML_Memory_Handling_Suite *memsuite) { + return result; + } + +-#ifdef XML_DTD ++#if defined(XML_DTD) || XML_GE == 1 + + static float + accountingGetCurrentAmplification(XML_Parser rootParser) { +@@ -8382,7 +8385,7 @@ unsignedCharToPrintable(unsigned char c) { + assert(0); /* never gets here */ + } + +-#endif /* XML_DTD */ ++#endif /* defined(XML_DTD) || XML_GE == 1 */ + + static unsigned long + getDebugLevel(const char *variableName, unsigned long defaultDebugLevel) { +diff --git a/xmlwf/xmlwf.c b/xmlwf/xmlwf.c +index 471f2a2..be23f5a 100644 +--- a/xmlwf/xmlwf.c ++++ b/xmlwf/xmlwf.c +@@ -1062,9 +1062,10 @@ tmain(int argc, XML_Char **argv) { + " (needs a floating point number greater or equal than 1.0)")); + exit(XMLWF_EXIT_USAGE_ERROR); + } +-#ifndef XML_DTD +- ftprintf(stderr, T("Warning: Given amplification limit ignored") T( +- ", xmlwf has been compiled without DTD support.\n")); ++#if ! defined(XML_DTD) && XML_GE == 0 ++ ftprintf(stderr, ++ T("Warning: Given amplification limit ignored") ++ T(", xmlwf has been compiled without DTD/GE support.\n")); + #endif + break; + } +@@ -1083,9 +1084,10 @@ tmain(int argc, XML_Char **argv) { + exit(XMLWF_EXIT_USAGE_ERROR); + } + attackThresholdGiven = XML_TRUE; +-#ifndef XML_DTD +- ftprintf(stderr, T("Warning: Given attack threshold ignored") T( +- ", xmlwf has been compiled without DTD support.\n")); ++#if ! defined(XML_DTD) && XML_GE == 0 ++ ftprintf(stderr, ++ T("Warning: Given attack threshold ignored") ++ T(", xmlwf has been compiled without DTD/GE support.\n")); + #endif + break; + } +@@ -1120,13 +1122,13 @@ tmain(int argc, XML_Char **argv) { + } + + if (attackMaximumAmplification != -1.0f) { +-#ifdef XML_DTD ++#if defined(XML_DTD) || XML_GE == 1 + XML_SetBillionLaughsAttackProtectionMaximumAmplification( + parser, attackMaximumAmplification); + #endif + } + if (attackThresholdGiven) { +-#ifdef XML_DTD ++#if defined(XML_DTD) || XML_GE == 1 + XML_SetBillionLaughsAttackProtectionActivationThreshold( + parser, attackThresholdBytes); + #else
From a5a9bf47a5793bed32c44ee0b1f19bfd63a76724 Mon Sep 17 00:00:00 2001 From: Michael Cobb michael.cobb@iceotope.com Date: Fri, 16 Aug 2024 15:30:32 +0100 Subject: [PATCH 2/2] dbus: C64 initial commit
Initial commit of dbus C64 recipes
Signed-off-by: Michael Cobb michael.cobb@iceotope.com --- recipes-core/dbus/dbus-morello_1.15.0.bb | 190 +++++++++++++++++++++++ recipes-core/dbus/dbus/dbus-1.init | 123 +++++++++++++++ recipes-core/dbus/dbus/tmpdir.patch | 44 ++++++ 3 files changed, 357 insertions(+) create mode 100644 recipes-core/dbus/dbus-morello_1.15.0.bb create mode 100644 recipes-core/dbus/dbus/dbus-1.init create mode 100644 recipes-core/dbus/dbus/tmpdir.patch
diff --git a/recipes-core/dbus/dbus-morello_1.15.0.bb b/recipes-core/dbus/dbus-morello_1.15.0.bb new file mode 100644 index 0000000..8a3451e --- /dev/null +++ b/recipes-core/dbus/dbus-morello_1.15.0.bb @@ -0,0 +1,190 @@ +inherit autotools pkgconfig gettext upstream-version-is-even purecap-sysroot purecap-useradd update-rc.d systemd logging + +SUMMARY = "D-Bus message bus" +DESCRIPTION = "D-Bus is a message bus system, a simple way for applications to talk to one another. In addition to interprocess communication, D-Bus helps coordinate process lifecycle; it makes it simple and reliable to code a "single instance" application or daemon, and to launch applications and daemons on demand when their services are needed." +HOMEPAGE = "https://dbus.freedesktop.org" +SECTION = "base" + +MORELLO_SRC = "poky/meta/recipes-core/dbus/*" + +LICENSE = "AFL-2.1 | GPL-2.0-or-later" + +LIC_FILES_CHKSUM = "file://COPYING;md5=a11183c1ba65ef542fd09be2fcc53e52 \ + file://dbus/dbus.h;beginline=6;endline=20;md5=866739837ccd835350af94dccd6457d8 \ + " + +FILESEXTRAPATHS:append := "${THISDIR}/dbus:" + +S = "${WORKDIR}/dbus-${PV}" + +TOOLCHAIN = "${MORELLO_TOOLCHAIN}" + +CC:remove = "${CC_PURECAP_FLAGS}" +CFLAGS:append = "${CC_PURECAP_FLAGS}" +LDFLAGS:append = "${LD_PURECAP_FLAGS}" + +SRC_URI = "https://dbus.freedesktop.org/releases/dbus/dbus-%24%7BPV%7D.tar.xz \ + file://tmpdir.patch \ + file://dbus-1.init \ + " + +SRC_URI[sha256sum] = "5073c8cb9ad20226647bb38f4965182b762a6e1f595ccdc8e59411014bfd640a" + +EXTRA_OECONF += " --disable-xml-docs \ + --disable-doxygen-docs \ + --enable-largefile \ + --with-system-socket=/run/dbus/system_bus_socket \ + --disable-tests \ + --enable-checks \ + --enable-asserts \ + --runstatedir=/run \ + --enable-shared \ + --disable-static \ + " + +CONFIGUREOPTS += " CFLAGS='${CFLAGS} -XCClinker --target=${GLOBAL_ARCH_TRIPLE}' \ + " + +EXTRA_OECONF:append:class-target = " SYSTEMCTL=${base_bindir}/systemctl" + +PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd x11', d)} \ + user-session \ + " + +PACKAGECONFIG[systemd] = "--enable-systemd --with-systemdsystemunitdir=${systemd_system_unitdir},--disable-systemd --without-systemdsystemunitdir,systemd" +PACKAGECONFIG[x11] = "--enable-x11-autolaunch,--without-x --disable-x11-autolaunch, virtual/libx11 libsm" +PACKAGECONFIG[user-session] = "--enable-user-session --with-systemduserunitdir=${systemd_user_unitdir},--disable-user-session" +PACKAGECONFIG[verbose-mode] = "--enable-verbose-mode,,," +PACKAGECONFIG[audit] = "--enable-libaudit,--disable-libaudit,audit" +PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux" + +# Disable these options for Purecap +PACKAGECONFIG:remove = "systemd" +PACKAGECONFIG:remove = "x11" + +DEPENDS += "expat-morello virtual/libintl autoconf-archive-native systemd" +RDEPENDS:${PN} += " ${PN}-common ${PN}-tools ${PN}-lib expat-morello " + +INITSCRIPT_NAME = "dbus-1" +INITSCRIPT_PARAMS = "start 02 5 3 2 . stop 20 0 1 6 ." + +python __anonymous() { + if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d): + d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1") +} + +PACKAGES =+ " ${PN}-lib ${PN}-common ${PN}-tools" + +USERADD_PACKAGES = "${PN}-common" +USERADD_PARAM:${PN}-common = "--system --home ${localstatedir}/lib/dbus \ + --no-create-home --shell /bin/false \ + --user-group messagebus" + +CONFFILES:${PN} = "${sysconfdir}/dbus-1/system.conf ${sysconfdir}/dbus-1/session.conf" + +DEBIANNAME:${PN} = "dbus-1-morello" + +OLDPKGNAME = "dbus-x11-morello" + +# for compatibility +RPROVIDES:${PN} = "${OLDPKGNAME}" +RREPLACES:${PN} += "${OLDPKGNAME}" + +FILES:${PN} = "${bindir}/dbus-daemon* \ + ${bindir}/dbus-cleanup-sockets \ + ${bindir}/dbus-launch \ + ${bindir}/dbus-run-session \ + ${libexecdir}/dbus* \ + ${sysconfdir} \ + ${localstatedir} \ + ${systemd_system_unitdir} \ + ${systemd_user_unitdir} \ + ${nonarch_libdir}/tmpfiles.d/dbus.conf \ +" +FILES:${PN}-common = "${sysconfdir}/dbus-1 \ + ${datadir}/dbus-1/services \ + ${datadir}/dbus-1/system-services \ + ${datadir}/dbus-1/session.d \ + ${datadir}/dbus-1/session.conf \ + ${datadir}/dbus-1/system.d \ + ${datadir}/dbus-1/system.conf \ + ${systemd_system_unitdir}/dbus.socket \ + ${systemd_system_unitdir}/sockets.target.wants \ + ${systemd_user_unitdir}/dbus.socket \ + ${systemd_user_unitdir}/sockets.target.wants \ + ${nonarch_libdir}/sysusers.d/dbus.conf \ +" +FILES:${PN}-tools = "${bindir}/dbus-uuidgen \ + ${bindir}/dbus-send \ + ${bindir}/dbus-monitor \ + ${bindir}/dbus-update-activation-environment \ +" +FILES:${PN}-lib = "${libdir}/lib*.so.*" +RRECOMMENDS:${PN}-lib = "${PN}" + +FILES:${PN}-dev += "${libdir}/dbus-1.0/include ${bindir}/dbus-test-tool ${datadir}/xml/dbus-1" + +PACKAGE_WRITE_DEPS += "${@bb.utils.contains('DISTRO_FEATURES','systemd sysvinit','systemd-systemctl-native','',d)}" + +pkg_postinst:dbus() { + # If both systemd and sysvinit are enabled, mask the dbus-1 init script + if ${@bb.utils.contains('DISTRO_FEATURES','systemd sysvinit','true','false',d)}; then + if [ -n "$D" ]; then + OPTS="--root=$D" + fi + systemctl $OPTS mask dbus-1.service + fi + + if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then + /etc/init.d/populate-volatile.sh update + fi +} + +pkg_postinst_ontarget:${PN}() { + chown messagebus:messagebus ${D}${localstatedir}/lib/dbus + chown root:messagebus ${D}${libexecdir}/dbus-daemon-launch-helper +} + +move_systemd_unit_files() { + rm -rf ${D}/lib/ +} + +do_install() { + autotools_do_install + + if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then + install -d ${D}${sysconfdir}/init.d + sed 's:@bindir@:${bindir}:' < ${WORKDIR}/dbus-1.init >${WORKDIR}/dbus-1.init.sh + install -m 0755 ${WORKDIR}/dbus-1.init.sh ${D}${sysconfdir}/init.d/dbus-1 + install -d ${D}${sysconfdir}/default/volatiles + echo "d messagebus messagebus 0755 /run/dbus none" \ + > ${D}${sysconfdir}/default/volatiles/99_dbus + fi + + if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then + for i in dbus.target.wants sockets.target.wants multi-user.target.wants; do \ + install -d ${D}${systemd_system_unitdir}/$i; done + install -m 0644 ${B}/bus/dbus.service ${B}/bus/dbus.socket ${D}${systemd_system_unitdir}/ + ln -fs ../dbus.socket ${D}${systemd_system_unitdir}/dbus.target.wants/dbus.socket + ln -fs ../dbus.socket ${D}${systemd_system_unitdir}/sockets.target.wants/dbus.socket + ln -fs ../dbus.service ${D}${systemd_system_unitdir}/multi-user.target.wants/dbus.service + fi + + install -d ${D}${localstatedir}/lib/dbus + + chmod 4755 ${D}${libexecdir}/dbus-daemon-launch-helper + + # Remove Red Hat initscript + rm -rf ${D}${sysconfdir}/rc.d + + # Remove empty testexec directory as we don't build tests + rm -rf ${D}${libdir}/dbus-1.0/test + + # Remove /var/run as it is created on startup + rm -rf ${D}${localstatedir}/run + + # move files that conflict with non-purecap dbus + move_systemd_unit_files +} + +CVE_PRODUCT += "d-bus_project:d-bus" diff --git a/recipes-core/dbus/dbus/dbus-1.init b/recipes-core/dbus/dbus/dbus-1.init new file mode 100644 index 0000000..90e167e --- /dev/null +++ b/recipes-core/dbus/dbus/dbus-1.init @@ -0,0 +1,123 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: dbus +# Required-Start: $remote_fs $syslog +# Required-Stop: $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 1 +# Short-Description: D-Bus systemwide message bus +# Description: D-Bus is a simple interprocess messaging system, used +# for sending messages between applications. +### END INIT INFO +# +# -*- coding: utf-8 -*- +# Debian init.d script for D-BUS +# Copyright © 2003 Colin Walters walters@debian.org + +# set -e + +# Source function library. +. /etc/init.d/functions + +DAEMON=@bindir@/dbus-daemon +NAME=dbus +DAEMONUSER=messagebus # must match /usr/share/dbus-1/system.conf +PIDFILE=/var/run/dbus/pid # must match /usr/share/dbus-1/system.conf +UUIDDIR=/var/lib/dbus +DESC="system message bus" +EVENTDIR=/etc/dbus-1/event.d + +test -x $DAEMON || exit 0 + +# Source defaults file; edit that file to configure this script. +ENABLED=1 +PARAMS="" +if [ -e /etc/default/dbus ]; then + . /etc/default/dbus +fi + +test "$ENABLED" != "0" || exit 0 + +start_it_up() +{ + mkdir -p "`dirname $PIDFILE`" + if [ -e $PIDFILE ]; then + PIDDIR=/proc/$(cat $PIDFILE) + if [ -d ${PIDDIR} -a "$(readlink -f ${PIDDIR}/exe)" = "${DAEMON}" ]; then + echo "$DESC already started; not starting." + else + echo "Removing stale PID file $PIDFILE." + rm -f $PIDFILE + fi + fi + + if [ ! -d $UUIDDIR ]; then + mkdir -p $UUIDDIR + chown $DAEMONUSER $UUIDDIR + chgrp $DAEMONUSER $UUIDDIR + fi + + dbus-uuidgen --ensure + + echo -n "Starting $DESC: " + start-stop-daemon -o --start --quiet --pidfile $PIDFILE \ + --user $DAEMONUSER --exec $DAEMON -- --system $PARAMS + echo "$NAME." + if [ -d $EVENTDIR ]; then + run-parts --arg=start $EVENTDIR + fi +} + +shut_it_down() +{ + if [ -d $EVENTDIR ]; then + # TODO: --reverse when busybox supports it + run-parts --arg=stop $EVENTDIR + fi + echo -n "Stopping $DESC: " + start-stop-daemon -o --stop --quiet --pidfile $PIDFILE \ + --user $DAEMONUSER + # We no longer include these arguments so that start-stop-daemon + # can do its job even given that we may have been upgraded. + # We rely on the pidfile being sanely managed + # --exec $DAEMON -- --system $PARAMS + echo "$NAME." + rm -f $PIDFILE +} + +reload_it() +{ + echo -n "Reloading $DESC config: " + dbus-send --print-reply --system --type=method_call \ + --dest=org.freedesktop.DBus \ + / org.freedesktop.DBus.ReloadConfig > /dev/null + # hopefully this is enough time for dbus to reload it's config file. + echo "done." +} + +case "$1" in + start) + start_it_up + ;; + stop) + shut_it_down + ;; + status) + status $DAEMON + exit $? + ;; + reload|force-reload) + reload_it + ;; + restart) + shut_it_down + sleep 1 + start_it_up + ;; + *) + echo "Usage: /etc/init.d/$NAME {start|stop|status|restart|reload|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/recipes-core/dbus/dbus/tmpdir.patch b/recipes-core/dbus/dbus/tmpdir.patch new file mode 100644 index 0000000..bf086e1 --- /dev/null +++ b/recipes-core/dbus/dbus/tmpdir.patch @@ -0,0 +1,44 @@ +From 5105fedd7fa13dadd2d0d864fb77873b83b79a4b Mon Sep 17 00:00:00 2001 +From: Koen Kooi koen@dominion.thruhere.net +Date: Thu, 23 Jun 2011 13:52:09 +0200 +Subject: [PATCH] buildsys: hardcode socketdir to /tmp + +the TMPDIR env var isn't always pointing to the right target path + +Upstream-Status: Inappropriate [embedded] + +Signed-off-by: Koen Kooi koen@dominion.thruhere.net + +Original comment: + + avoid to check tmp dir at build time. instead uses hard coded /tmp here + comment added by Kevin Tian kevin.tian@intel.com +--- + configure.ac | 11 +---------- + 1 files changed, 1 insertions(+), 10 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 408054b..6d26180 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1483,16 +1483,7 @@ AC_SUBST(TEST_LAUNCH_HELPER_BINARY) + AC_DEFINE_UNQUOTED(DBUS_TEST_LAUNCH_HELPER_BINARY, "$TEST_LAUNCH_HELPER_BINARY", + [Full path to the launch helper test program in the builddir]) + +-#### Find socket directories +-if ! test -z "$TMPDIR" ; then +- DEFAULT_SOCKET_DIR=$TMPDIR +-elif ! test -z "$TEMP" ; then +- DEFAULT_SOCKET_DIR=$TEMP +-elif ! test -z "$TMP" ; then +- DEFAULT_SOCKET_DIR=$TMP +-else +- DEFAULT_SOCKET_DIR=/tmp +-fi ++DEFAULT_SOCKET_DIR=/tmp + + DEFAULT_SOCKET_DIR=`echo $DEFAULT_SOCKET_DIR | sed 's/+/%2B/g'` + +-- +1.6.6.1 +
Hi Michael,
Thanks for the patches ! LGTM will add to kirkstone. Kind regards, Pawel
On Wed, 21 Aug 2024 at 11:16, michael.cobb@iceotope.com wrote:
From a5a9bf47a5793bed32c44ee0b1f19bfd63a76724 Mon Sep 17 00:00:00 2001
From: Michael Cobb michael.cobb@iceotope.com Date: Fri, 16 Aug 2024 15:30:32 +0100 Subject: [PATCH 2/2] dbus: C64 initial commit
Initial commit of dbus C64 recipes
Signed-off-by: Michael Cobb michael.cobb@iceotope.com
recipes-core/dbus/dbus-morello_1.15.0.bb | 190 +++++++++++++++++++++++ recipes-core/dbus/dbus/dbus-1.init | 123 +++++++++++++++ recipes-core/dbus/dbus/tmpdir.patch | 44 ++++++ 3 files changed, 357 insertions(+) create mode 100644 recipes-core/dbus/dbus-morello_1.15.0.bb create mode 100644 recipes-core/dbus/dbus/dbus-1.init create mode 100644 recipes-core/dbus/dbus/tmpdir.patch
diff --git a/recipes-core/dbus/dbus-morello_1.15.0.bb b/recipes-core/dbus/ dbus-morello_1.15.0.bb new file mode 100644 index 0000000..8a3451e --- /dev/null +++ b/recipes-core/dbus/dbus-morello_1.15.0.bb @@ -0,0 +1,190 @@ +inherit autotools pkgconfig gettext upstream-version-is-even purecap-sysroot purecap-useradd update-rc.d systemd logging
+SUMMARY = "D-Bus message bus" +DESCRIPTION = "D-Bus is a message bus system, a simple way for applications to talk to one another. In addition to interprocess communication, D-Bus helps coordinate process lifecycle; it makes it simple and reliable to code a "single instance" application or daemon, and to launch applications and daemons on demand when their services are needed." +HOMEPAGE = "https://dbus.freedesktop.org" +SECTION = "base"
+MORELLO_SRC = "poky/meta/recipes-core/dbus/*"
+LICENSE = "AFL-2.1 | GPL-2.0-or-later"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a11183c1ba65ef542fd09be2fcc53e52 \
file://dbus/dbus.h;beginline=6;endline=20;md5=866739837ccd835350af94dccd6457d8 \
"
+FILESEXTRAPATHS:append := "${THISDIR}/dbus:"
+S = "${WORKDIR}/dbus-${PV}"
+TOOLCHAIN = "${MORELLO_TOOLCHAIN}"
+CC:remove = "${CC_PURECAP_FLAGS}" +CFLAGS:append = "${CC_PURECAP_FLAGS}" +LDFLAGS:append = "${LD_PURECAP_FLAGS}"
+SRC_URI = "https://dbus.freedesktop.org/releases/dbus/dbus-%24%7BPV%7D.tar.xz \
file://tmpdir.patch \
file://dbus-1.init \
"
+SRC_URI[sha256sum] = "5073c8cb9ad20226647bb38f4965182b762a6e1f595ccdc8e59411014bfd640a"
+EXTRA_OECONF += " --disable-xml-docs \
--disable-doxygen-docs \
--enable-largefile \
--with-system-socket=/run/dbus/system_bus_socket \
--disable-tests \
--enable-checks \
--enable-asserts \
--runstatedir=/run \
--enable-shared \
--disable-static \
"
+CONFIGUREOPTS += " CFLAGS='${CFLAGS} -XCClinker --target=${GLOBAL_ARCH_TRIPLE}' \
"
+EXTRA_OECONF:append:class-target = " SYSTEMCTL=${base_bindir}/systemctl"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd x11', d)} \
user-session \
"
+PACKAGECONFIG[systemd] = "--enable-systemd --with-systemdsystemunitdir=${systemd_system_unitdir},--disable-systemd --without-systemdsystemunitdir,systemd" +PACKAGECONFIG[x11] = "--enable-x11-autolaunch,--without-x --disable-x11-autolaunch, virtual/libx11 libsm" +PACKAGECONFIG[user-session] = "--enable-user-session --with-systemduserunitdir=${systemd_user_unitdir},--disable-user-session" +PACKAGECONFIG[verbose-mode] = "--enable-verbose-mode,,," +PACKAGECONFIG[audit] = "--enable-libaudit,--disable-libaudit,audit" +PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux"
+# Disable these options for Purecap +PACKAGECONFIG:remove = "systemd" +PACKAGECONFIG:remove = "x11"
+DEPENDS += "expat-morello virtual/libintl autoconf-archive-native systemd" +RDEPENDS:${PN} += " ${PN}-common ${PN}-tools ${PN}-lib expat-morello "
+INITSCRIPT_NAME = "dbus-1" +INITSCRIPT_PARAMS = "start 02 5 3 2 . stop 20 0 1 6 ."
+python __anonymous() {
- if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False,
d):
d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
+}
+PACKAGES =+ " ${PN}-lib ${PN}-common ${PN}-tools"
+USERADD_PACKAGES = "${PN}-common" +USERADD_PARAM:${PN}-common = "--system --home ${localstatedir}/lib/dbus \
--no-create-home --shell /bin/false \
--user-group messagebus"
+CONFFILES:${PN} = "${sysconfdir}/dbus-1/system.conf ${sysconfdir}/dbus-1/session.conf"
+DEBIANNAME:${PN} = "dbus-1-morello"
+OLDPKGNAME = "dbus-x11-morello"
+# for compatibility +RPROVIDES:${PN} = "${OLDPKGNAME}" +RREPLACES:${PN} += "${OLDPKGNAME}"
+FILES:${PN} = "${bindir}/dbus-daemon* \
${bindir}/dbus-cleanup-sockets \
${bindir}/dbus-launch \
${bindir}/dbus-run-session \
${libexecdir}/dbus* \
${sysconfdir} \
${localstatedir} \
${systemd_system_unitdir} \
${systemd_user_unitdir} \
${nonarch_libdir}/tmpfiles.d/dbus.conf \
+" +FILES:${PN}-common = "${sysconfdir}/dbus-1 \
${datadir}/dbus-1/services \
${datadir}/dbus-1/system-services \
${datadir}/dbus-1/session.d \
${datadir}/dbus-1/session.conf \
${datadir}/dbus-1/system.d \
${datadir}/dbus-1/system.conf \
${systemd_system_unitdir}/dbus.socket \
${systemd_system_unitdir}/sockets.target.wants \
${systemd_user_unitdir}/dbus.socket \
${systemd_user_unitdir}/sockets.target.wants \
${nonarch_libdir}/sysusers.d/dbus.conf \
+" +FILES:${PN}-tools = "${bindir}/dbus-uuidgen \
${bindir}/dbus-send \
${bindir}/dbus-monitor \
${bindir}/dbus-update-activation-environment \
+" +FILES:${PN}-lib = "${libdir}/lib*.so.*" +RRECOMMENDS:${PN}-lib = "${PN}"
+FILES:${PN}-dev += "${libdir}/dbus-1.0/include ${bindir}/dbus-test-tool ${datadir}/xml/dbus-1"
+PACKAGE_WRITE_DEPS += "${@bb.utils.contains('DISTRO_FEATURES','systemd sysvinit','systemd-systemctl-native','',d)}"
+pkg_postinst:dbus() {
# If both systemd and sysvinit are enabled, mask the dbus-1 init
script
if ${@bb.utils.contains('DISTRO_FEATURES','systemd
sysvinit','true','false',d)}; then
if [ -n "$D" ]; then
OPTS="--root=$D"
fi
systemctl $OPTS mask dbus-1.service
fi
if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then
/etc/init.d/populate-volatile.sh update
fi
+}
+pkg_postinst_ontarget:${PN}() {
- chown messagebus:messagebus ${D}${localstatedir}/lib/dbus
- chown root:messagebus ${D}${libexecdir}/dbus-daemon-launch-helper
+}
+move_systemd_unit_files() {
- rm -rf ${D}/lib/
+}
+do_install() {
- autotools_do_install
if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true',
'false', d)}; then
install -d ${D}${sysconfdir}/init.d
sed 's:@bindir@:${bindir}:' < ${WORKDIR}/dbus-1.init
${WORKDIR}/dbus-1.init.sh
install -m 0755 ${WORKDIR}/dbus-1.init.sh
${D}${sysconfdir}/init.d/dbus-1
install -d ${D}${sysconfdir}/default/volatiles
echo "d messagebus messagebus 0755 /run/dbus none" \
> ${D}${sysconfdir}/default/volatiles/99_dbus
fi
if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true',
'false', d)}; then
for i in dbus.target.wants sockets.target.wants
multi-user.target.wants; do \
install -d ${D}${systemd_system_unitdir}/$i; done
install -m 0644 ${B}/bus/dbus.service ${B}/bus/dbus.socket
${D}${systemd_system_unitdir}/
ln -fs ../dbus.socket
${D}${systemd_system_unitdir}/dbus.target.wants/dbus.socket
ln -fs ../dbus.socket
${D}${systemd_system_unitdir}/sockets.target.wants/dbus.socket
ln -fs ../dbus.service
${D}${systemd_system_unitdir}/multi-user.target.wants/dbus.service
fi
install -d ${D}${localstatedir}/lib/dbus
chmod 4755 ${D}${libexecdir}/dbus-daemon-launch-helper
# Remove Red Hat initscript
rm -rf ${D}${sysconfdir}/rc.d
# Remove empty testexec directory as we don't build tests
rm -rf ${D}${libdir}/dbus-1.0/test
# Remove /var/run as it is created on startup
rm -rf ${D}${localstatedir}/run
- # move files that conflict with non-purecap dbus
- move_systemd_unit_files
+}
+CVE_PRODUCT += "d-bus_project:d-bus" diff --git a/recipes-core/dbus/dbus/dbus-1.init b/recipes-core/dbus/dbus/dbus-1.init new file mode 100644 index 0000000..90e167e --- /dev/null +++ b/recipes-core/dbus/dbus/dbus-1.init @@ -0,0 +1,123 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: dbus +# Required-Start: $remote_fs $syslog +# Required-Stop: $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 1 +# Short-Description: D-Bus systemwide message bus +# Description: D-Bus is a simple interprocess messaging system, used +# for sending messages between applications. +### END INIT INFO +# +# -*- coding: utf-8 -*- +# Debian init.d script for D-BUS +# Copyright © 2003 Colin Walters walters@debian.org
+# set -e
+# Source function library. +. /etc/init.d/functions
+DAEMON=@bindir@/dbus-daemon +NAME=dbus +DAEMONUSER=messagebus # must match /usr/share/dbus-1/system.conf +PIDFILE=/var/run/dbus/pid # must match /usr/share/dbus-1/system.conf +UUIDDIR=/var/lib/dbus +DESC="system message bus" +EVENTDIR=/etc/dbus-1/event.d
+test -x $DAEMON || exit 0
+# Source defaults file; edit that file to configure this script. +ENABLED=1 +PARAMS="" +if [ -e /etc/default/dbus ]; then
- . /etc/default/dbus
+fi
+test "$ENABLED" != "0" || exit 0
+start_it_up() +{
- mkdir -p "`dirname $PIDFILE`"
- if [ -e $PIDFILE ]; then
- PIDDIR=/proc/$(cat $PIDFILE)
- if [ -d ${PIDDIR} -a "$(readlink -f ${PIDDIR}/exe)" = "${DAEMON}" ];
then
echo "$DESC already started; not starting."
- else
echo "Removing stale PID file $PIDFILE."
rm -f $PIDFILE
- fi
- fi
- if [ ! -d $UUIDDIR ]; then
- mkdir -p $UUIDDIR
- chown $DAEMONUSER $UUIDDIR
- chgrp $DAEMONUSER $UUIDDIR
- fi
- dbus-uuidgen --ensure
- echo -n "Starting $DESC: "
- start-stop-daemon -o --start --quiet --pidfile $PIDFILE \
- --user $DAEMONUSER --exec $DAEMON -- --system $PARAMS
- echo "$NAME."
- if [ -d $EVENTDIR ]; then
run-parts --arg=start $EVENTDIR
- fi
+}
+shut_it_down() +{
- if [ -d $EVENTDIR ]; then
# TODO: --reverse when busybox supports it
run-parts --arg=stop $EVENTDIR
- fi
- echo -n "Stopping $DESC: "
- start-stop-daemon -o --stop --quiet --pidfile $PIDFILE \
- --user $DAEMONUSER
- # We no longer include these arguments so that start-stop-daemon
- # can do its job even given that we may have been upgraded.
- # We rely on the pidfile being sanely managed
- # --exec $DAEMON -- --system $PARAMS
- echo "$NAME."
- rm -f $PIDFILE
+}
+reload_it() +{
- echo -n "Reloading $DESC config: "
- dbus-send --print-reply --system --type=method_call \
--dest=org.freedesktop.DBus \
/ org.freedesktop.DBus.ReloadConfig > /dev/null
- # hopefully this is enough time for dbus to reload it's config file.
- echo "done."
+}
+case "$1" in
- start)
- start_it_up
- ;;
- stop)
- shut_it_down
- ;;
- status)
- status $DAEMON
- exit $?
- ;;
- reload|force-reload)
- reload_it
- ;;
- restart)
- shut_it_down
- sleep 1
- start_it_up
- ;;
- *)
- echo "Usage: /etc/init.d/$NAME
{start|stop|status|restart|reload|force-reload}" >&2
- exit 1
- ;;
+esac
+exit 0 diff --git a/recipes-core/dbus/dbus/tmpdir.patch b/recipes-core/dbus/dbus/tmpdir.patch new file mode 100644 index 0000000..bf086e1 --- /dev/null +++ b/recipes-core/dbus/dbus/tmpdir.patch @@ -0,0 +1,44 @@ +From 5105fedd7fa13dadd2d0d864fb77873b83b79a4b Mon Sep 17 00:00:00 2001 +From: Koen Kooi koen@dominion.thruhere.net +Date: Thu, 23 Jun 2011 13:52:09 +0200 +Subject: [PATCH] buildsys: hardcode socketdir to /tmp
+the TMPDIR env var isn't always pointing to the right target path
+Upstream-Status: Inappropriate [embedded]
+Signed-off-by: Koen Kooi koen@dominion.thruhere.net
+Original comment:
avoid to check tmp dir at build time. instead uses hard coded /tmp
here
comment added by Kevin Tian <kevin.tian@intel.com>
+---
- configure.ac | 11 +----------
- 1 files changed, 1 insertions(+), 10 deletions(-)
+diff --git a/configure.ac b/configure.ac +index 408054b..6d26180 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1483,16 +1483,7 @@ AC_SUBST(TEST_LAUNCH_HELPER_BINARY)
- AC_DEFINE_UNQUOTED(DBUS_TEST_LAUNCH_HELPER_BINARY,
"$TEST_LAUNCH_HELPER_BINARY",
[Full path to the launch helper test program in the
builddir])
+-#### Find socket directories +-if ! test -z "$TMPDIR" ; then +- DEFAULT_SOCKET_DIR=$TMPDIR +-elif ! test -z "$TEMP" ; then +- DEFAULT_SOCKET_DIR=$TEMP +-elif ! test -z "$TMP" ; then +- DEFAULT_SOCKET_DIR=$TMP +-else +- DEFAULT_SOCKET_DIR=/tmp +-fi ++DEFAULT_SOCKET_DIR=/tmp
- DEFAULT_SOCKET_DIR=`echo $DEFAULT_SOCKET_DIR | sed 's/+/%2B/g'`
+-- +1.6.6.1
-- 2.40.1 _______________________________________________ linux-morello-distros mailing list -- linux-morello-distros@op-lists.linaro.org To unsubscribe send an email to linux-morello-distros-leave@op-lists.linaro.org
linux-morello-distros@op-lists.linaro.org