summaryrefslogtreecommitdiffstats
path: root/templates
AgeCommit message (Expand)AuthorFilesLines
2020-03-18Support Salvator-X/XS boardDuy Dang13-1/+75
2020-02-21Merge remote-tracking branch 'agl/next'Jan-Simon Möller2-17/+48
2020-02-18Update archiver feature regexpJan-Simon Moeller2-0/+2
2020-02-17agl-sota: Set initramfs fstype to cpio.gzLeon Anavi1-0/+1
2020-02-17zeus updates for dragonboard-410cScott Murray1-1/+1
2020-02-12Fix SOTA build for build other than qemuRonan Le Martret2-1/+24
2020-01-29templates/feature/agl-compositor: Allow to test experimental agl-compositorMarius Vlad1-0/+14
2020-01-27Update base local.conf.sampleScott Murray1-16/+47
2019-12-17Add agl-virt-xen featureJérémy Fanguède2-0/+4
2019-12-17Add agl-virt featureJérémy Fanguède2-0/+6
2019-12-06meta-agl-profile-graphical-html5: remove layer and AGL featureJacobo Aragunde Pérez3-19/+0
2019-12-05Follow move of agl-image-ivi-crosssdk to meta-agl-demoJan-Simon Moeller2-2/+2
2019-12-04Move packages from agl-core to agl-iviRonan Le Martret1-9/+18
2019-11-26agl-compositor: Add DISTRO_FEATURE to enable compositorDaniel Stone2-0/+14
2019-11-19raspberrypi4/50_local.conf.inc: Use Image formatLeon Anavi1-0/+5
2019-11-19ebisu: Update setup.sh to adopt multiple zip fileHarunobu Kurokawa1-1/+4
2019-11-05raspberrypi*/50_local.conf.inc: Update rpi 3/4Leon Anavi2-9/+0
2019-09-19raspberrypi*/50_local.conf.inc: Set Mesa versionLeon Anavi2-0/+7
2019-09-17Remove pulseaudio feature, not relevant any moreRonan Le Martret2-11/+0
2019-09-05Add nogfx build for h3ulcbJan-Simon Moeller3-0/+20
2019-09-04Revert "Add nogfx build for h3ulcb"Jan-Simon Moeller3-20/+0
2019-09-03Add nogfx build for h3ulcbJan-Simon Moeller3-0/+20
2019-08-2750_local.conf.inc: Extend DISTRO_FEATURES for sotaLeon Anavi1-0/+2
2019-08-06machine: Add readme for ebisuPierre Marzin1-0/+44
2019-07-24templates: Add templates for Raspberry Pi 4Leon Anavi2-0/+6
2019-07-24add markdown documentation for all machines and featuresStéphane Desneux46-8/+474
2019-07-23ebisu: Add the support of a custom setup scriptPierre Marzin1-5/+10
2019-07-23ebisu: Use a specified path to integrate binariesPierre Marzin1-4/+19
2019-07-23ebisu: Update setup fragment to copy binariesPierre Marzin1-4/+16
2019-07-23machine: Add new ebisu machinePierre Marzin3-0/+19
2019-06-26agl-hmi-framework: remove virtual/navigation over-rideScott Murray1-1/+0
2019-06-20Add cubox-i and nitrogen6x i.MX6 machinesScott Murray6-0/+23
2019-06-11Import aglsetup templates and config for BBEPaul Barker2-0/+7
2019-06-11Merge "feature/agl-ci-*: include agl-pipewire instead of agl-audio-4a-framework"Jan-Simon Moeller4-4/+4
2019-06-10Changes to support the repo clone reworkJan-Simon Möller18-34/+34
2019-06-10feature/agl-ci-*: include agl-pipewire instead of agl-audio-4a-frameworkGeorge Kiagiadakis4-4/+4
2019-05-23Move hmi-framework and eg-virt from meta-agl-devel to meta-aglJan-Simon Möller2-0/+14
2019-05-21Remove the 64bit rpi3 targetJan-Simon Möller2-4/+0
2019-04-29Merge "Add ARC HSDK board support"Jan-Simon Moeller2-0/+4
2019-04-29Merge "Remove inactive devices"Jan-Simon Moeller10-29/+0
2019-04-29Remove inactive devicesJan-Simon Möller10-29/+0
2019-04-26Add ARC HSDK board supportEvgeniy Didin2-0/+4
2019-04-23Fix imx6qdlsabreauto machine configurationBechir Mghirbi4-6/+4
2019-03-22Fix the wrong comment of base template fileKazumasa Mitsunari1-1/+1
2019-03-11Add initial feature for license scanning integrationJan-Simon Möller3-0/+7
2019-03-07Remove unused isafw featureJan-Simon Möller2-2/+0
2018-12-20Add instrument cluster profile definitionsScott Murray4-0/+8
2018-11-22Add ptest to ci and snapshot buildsJan-Simon Möller4-4/+4
2018-10-02Create a feature to activate pulseaudio in AGLRonan Le Martret1-0/+2
2018-10-02Fix image build with PR timestampRonan Le Martret1-2/+2
ss="o">*prefix) { // search for default dispatch config file json_object* responseJ = CtlConfigScan (dirList, prefix); if(responseJ) return ConfigSearch(apiHandle, responseJ); return NULL; } static int DispatchRequireOneApi(AFB_ApiT apiHandle, json_object * bindindJ) { const char* requireBinding = json_object_get_string(bindindJ); int err = AFB_RequireApi(apiHandle, requireBinding, 1); if (err) { AFB_ApiWarning(apiHandle, "CTL-LOAD-CONFIG:REQUIRE Fail to get=%s", requireBinding); } return err; } /** * @brief Best effort to initialise everything before starting * Call afb_require_api at the first call or if there was an error because * the CtlConfigExec could be called anywhere and not in binding init. * So you could call this function at init time. * * @param apiHandle : a afb_daemon api handle, see AFB_ApiT in afb_definitions.h * @param requireJ : json_object array of api name required. */ void DispatchRequireApi(AFB_ApiT apiHandle, json_object * requireJ) { static int init = 0, err = 0; int idx; if ( (! init || err) && requireJ) { if (json_object_get_type(requireJ) == json_type_array) { for (idx = 0; idx < json_object_array_length(requireJ); idx++) { err += DispatchRequireOneApi(apiHandle, json_object_array_get_idx(requireJ, idx)); } } else { err += DispatchRequireOneApi(apiHandle, requireJ); } } init = 1; } int CtlConfigExec(AFB_ApiT apiHandle, CtlConfigT *ctlConfig) { DispatchRequireApi(apiHandle, ctlConfig->requireJ); #ifdef CONTROL_SUPPORT_LUA // load static LUA utilities LuaConfigExec(apiHandle); #endif // Loop on every section and process config int errcount=0; for (int idx = 0; ctlConfig->sections[idx].key != NULL; idx++) { if (!ctlConfig->sections[idx].loadCB) AFB_ApiNotice(apiHandle, "CtlConfigLoad: notice empty section '%s'", ctlConfig->sections[idx].key); else if (json_object_object_get_ex(ctlConfig->configJ, ctlConfig->sections[idx].key, NULL)) errcount += ctlConfig->sections[idx].loadCB(apiHandle, &ctlConfig->sections[idx], NULL); } return errcount; } CtlConfigT *CtlLoadMetaDataJson(AFB_ApiT apiHandle, json_object *ctlConfigJ, const char *prefix) { json_object *metadataJ; CtlConfigT *ctlHandle=NULL; int err; int done = json_object_object_get_ex(ctlConfigJ, "metadata", &metadataJ); if (done) { ctlHandle = calloc(1, sizeof (CtlConfigT)); err = wrap_json_unpack(metadataJ, "{ss,ss,ss,s?s,s?o,s?s,s?s !}", "uid", &ctlHandle->uid, "version", &ctlHandle->version, "api", &ctlHandle->api, "info", &ctlHandle->info, "require", &ctlHandle->requireJ, "author", &ctlHandle->author, "date", &ctlHandle->date); if (err) { AFB_ApiError(apiHandle, "CTL-LOAD-CONFIG:METADATA Missing something uid|api|version|[info]|[require]|[author]|[date] in:\n-- %s", json_object_get_string(metadataJ)); free(ctlHandle); return NULL; } } ctlHandle->configJ = ctlConfigJ; ctlHandle->prefix = prefix; return ctlHandle; } CtlConfigT *CtlLoadMetaDataUsingPrefix(AFB_ApiT apiHandle,const char* filepath, const char *prefix) { json_object *ctlConfigJ; // Load JSON file ctlConfigJ = json_object_from_file(filepath); if (!ctlConfigJ) { AFB_ApiError(apiHandle, "CTL-LOAD-CONFIG Not invalid JSON %s ", filepath); return NULL; } AFB_ApiInfo(apiHandle, "CTL-LOAD-CONFIG: loading config filepath=%s", filepath); return CtlLoadMetaDataJson(apiHandle, ctlConfigJ, prefix); } void wrap_json_array_add(void* array, json_object *val) { json_object_array_add(array, (json_object*)val); } json_object* LoadAdditionalsFiles(AFB_ApiT apiHandle, CtlConfigT *ctlHandle, const char *key, json_object *sectionJ); json_object* CtlUpdateSectionConfig(AFB_ApiT apiHandle, CtlConfigT *ctlHandle, const char *key, json_object *sectionJ, json_object *filesJ) { json_object *sectionArrayJ; char *oneFile = NULL; const char *bindingPath = GetBindingDirPath(apiHandle); if(! json_object_is_type(sectionJ, json_type_array)) { sectionArrayJ = json_object_new_array(); if(json_object_object_length(sectionJ) > 0) json_object_array_add(sectionArrayJ, sectionJ); } else sectionArrayJ = sectionJ; json_object_get(sectionJ); json_object_object_del(ctlHandle->configJ, key); json_object_object_add(ctlHandle->configJ, key, sectionArrayJ); if (json_object_get_type(filesJ) == json_type_array) { int length = (int)json_object_array_length(filesJ); for (int idx=0; idx < length; idx++) { json_object *oneFileJ = json_object_array_get_idx(filesJ, idx); json_object *responseJ = ScanForConfig(CONTROL_CONFIG_PATH ,CTL_SCAN_RECURSIVE, json_object_get_string(oneFileJ), ".json"); responseJ = responseJ ? responseJ: ScanForConfig(bindingPath, CTL_SCAN_RECURSIVE, json_object_get_string(oneFileJ), ".json"); if(!responseJ) { AFB_ApiError(apiHandle, "No config files found in search path. No changes has been made\n -- %s\n -- %s", CONTROL_CONFIG_PATH, bindingPath); return sectionArrayJ; } oneFile = ConfigSearch(apiHandle, responseJ); if (oneFile) { json_object *newSectionJ, *newFileJ = json_object_from_file(oneFile); json_object_object_get_ex(newFileJ, key, &newSectionJ); json_object_get(newSectionJ); json_object_put(newFileJ); LoadAdditionalsFiles(apiHandle, ctlHandle, key, newSectionJ); json_object_object_get_ex(ctlHandle->configJ, key, &sectionArrayJ); wrap_json_optarray_for_all(newSectionJ, wrap_json_array_add, sectionArrayJ); } } } else { json_object *responseJ = ScanForConfig(CONTROL_CONFIG_PATH ,CTL_SCAN_RECURSIVE, json_object_get_string(filesJ), ".json"); responseJ = responseJ ? responseJ: ScanForConfig(bindingPath, CTL_SCAN_RECURSIVE, json_object_get_string(filesJ), ".json"); if(!responseJ) { AFB_ApiError(apiHandle, "No config files found in search path. No changes has been made\n -- %s\n -- %s", CONTROL_CONFIG_PATH, bindingPath); return sectionArrayJ; } oneFile = ConfigSearch(apiHandle, responseJ); json_object *newSectionJ = json_object_from_file(oneFile); LoadAdditionalsFiles(apiHandle, ctlHandle, key, newSectionJ); wrap_json_optarray_for_all(newSectionJ, wrap_json_array_add, sectionArrayJ); } free(oneFile); return sectionArrayJ; } json_object* LoadAdditionalsFiles(AFB_ApiT apiHandle, CtlConfigT *ctlHandle, const char *key, json_object *sectionJ) { json_object *filesJ, *filesArrayJ = json_object_new_array(); if (json_object_get_type(sectionJ) == json_type_array) { int length = (int)json_object_array_length(sectionJ); for (int idx=0; idx < length; idx++) { json_object *obj = json_object_array_get_idx(sectionJ, idx); int hasFiles = json_object_object_get_ex(obj, "files", &filesJ); if(hasFiles) { // Clean files key as we don't want to make infinite loop json_object_get(filesJ); json_object_object_del(obj, "files"); if(json_object_is_type(filesJ, json_type_array)) wrap_json_array_for_all(filesJ, wrap_json_array_add, filesArrayJ); else json_object_array_add(filesArrayJ, filesJ); } } } else { int hasFiles = json_object_object_get_ex(sectionJ, "files", &filesJ); if(hasFiles) { // Clean files key as we don't want to make infinite loop json_object_get(filesJ); json_object_object_del(sectionJ, "files"); if(json_object_is_type(filesJ, json_type_array)) filesArrayJ = filesJ; else json_object_array_add(filesArrayJ, filesJ); } } if(json_object_array_length(filesArrayJ) > 0) sectionJ = CtlUpdateSectionConfig(apiHandle, ctlHandle, key, sectionJ, filesArrayJ); json_object_put(filesArrayJ); return sectionJ; } int CtlLoadSections(AFB_ApiT apiHandle, CtlConfigT *ctlHandle, CtlSectionT *sections) { int err; #ifdef CONTROL_SUPPORT_LUA err= LuaConfigLoad(apiHandle, ctlHandle->prefix); if (err) return 1; #endif err = 0; ctlHandle->sections = sections; for (int idx = 0; sections[idx].key != NULL; idx++) { json_object * sectionJ; int done = json_object_object_get_ex(ctlHandle->configJ, sections[idx].key, &sectionJ); if (done) { sections[idx].prefix = ctlHandle->prefix; json_object* updatedSectionJ = LoadAdditionalsFiles(apiHandle, ctlHandle, sections[idx].key, sectionJ); err += sections[idx].loadCB(apiHandle, &sections[idx], updatedSectionJ); } } if (err) return 1; return 0; }