diff options
author | Riku Nomoto <riku_nomoto@mail.toyota.co.jp> | 2020-12-19 20:41:59 +0900 |
---|---|---|
committer | Shuhei Aketa <shuhei.aketa@woven-planet.global> | 2021-01-06 12:14:11 +0000 |
commit | dd1c0ebcad53357f6451813c6a0e10ba6b164f27 (patch) | |
tree | 9a2be7326ddcf3e4245f31ce1f2e2d0b6164b7c4 /agl-basefiles | |
parent | f4c5a9b8e9d563ec16e65e3dafb97f18e12d7002 (diff) |
Organized dependencies of xpath
This patch should be merged after 25841 has been merged.
https://gerrit.automotivelinux.org/gerrit/c/AGL/meta-agl-devel/+/25841
xpath is used in launch_xml2cfg.sh. launch_xml2cfg.sh converts xml to cfg.
Originally, agl.mk was running launch_xml2cfg.sh. Only SystemManager uses
launch_xml2cfg.sh. Therefore, I changed launch_xml2cfg.sh from agl.mk to
SystemManager's Makefile.
Signed-off-by: Riku Nomoto <riku_nomoto@mail.toyota.co.jp>
Change-Id: Ib4c5813c89573222217a6df971b720f9be35fc3f
Diffstat (limited to 'agl-basefiles')
-rw-r--r-- | agl-basefiles/bin/launch_xml2cfg.sh | 26 | ||||
-rw-r--r-- | agl-basefiles/share/agl.mk | 20 | ||||
-rw-r--r-- | agl-basefiles/share/system_launcher_main.xml | 40 |
3 files changed, 12 insertions, 74 deletions
diff --git a/agl-basefiles/bin/launch_xml2cfg.sh b/agl-basefiles/bin/launch_xml2cfg.sh index dfa1fa9..54bb1cc 100644 --- a/agl-basefiles/bin/launch_xml2cfg.sh +++ b/agl-basefiles/bin/launch_xml2cfg.sh @@ -22,17 +22,17 @@ main_file=system_launcher_main.xml body_file=system_launcher_body.xml -#check xmllint is exist +#check xmllint is exist if ! which xmllint > /dev/null ; then echo "It need xmllint. Please install it." exit 1; -fi +fi -#check xpath is exist +#check xpath is exist if ! which xpath > /dev/null ; then echo "It need xpath Please install it." exit 1; -fi +fi #arg check if ! [[ "$infile" =~ .+\.xml ]] ;then @@ -43,10 +43,9 @@ elif ! [ -e $infile ];then exit 1 fi -cp -f `dirname $0`/$main_file `dirname $1` cp -f $infile $body_file -#check xml vaild +#check xml vaild if ! xmllint --noout --valid $main_file ;then echo "XML is Invalid. " exit 1; @@ -64,7 +63,7 @@ group_num=`echo $xmem | xpath -e /system_launcher/group 2>&1 | grep Found | cut l_idx=1 cur_group=1 -until [ $cur_group -gt $group_num ]; +until [ $cur_group -gt $group_num ]; do #LAUNCH LOOP group_text=`echo $xmem | xpath -q -e /system_launcher/group[$cur_group]` #ALL XML text for group @@ -76,11 +75,11 @@ do # echo $g_name $g_wait_time $g_trigger l_launch_num=`echo $xmem | xpath -e /system_launcher/group[$cur_group]/launch 2>&1 | grep Found | cut -d ' ' -f2` - - cur_launch=1; + + cur_launch=1; until [ $cur_launch -gt $l_launch_num ]; do - launch_text=`echo $xmem | xpath -q -e /system_launcher/group[$cur_group]/launch[$cur_launch]` - + launch_text=`echo $xmem | xpath -q -e /system_launcher/group[$cur_group]/launch[$cur_launch]` + l_attr="Launch${l_idx}=$g_name|$cur_group|$g_wait_time|$g_trigger" l_attr+="|"`echo $launch_text | sed 's/\(.* name="\)\([^"]*\)\(.*\)/\2/g'` l_attr+="|"`echo $launch_text | sed 's/\(.* path="\)\([^"]*\)\(.*\)/\2/g'` @@ -115,7 +114,7 @@ do else l_attr+="|" fi - + if echo "$launch_text" | grep -sq 'cpu_assign=' ; then l_attr+="|"`echo $launch_text | sed 's/\(.* cpu_assign="\)\([^"]*\)\(.*\)/\2/g'` else @@ -133,6 +132,3 @@ done rm $body_file -rm $main_file - - diff --git a/agl-basefiles/share/agl.mk b/agl-basefiles/share/agl.mk index 176bac8..3723ead 100644 --- a/agl-basefiles/share/agl.mk +++ b/agl-basefiles/share/agl.mk @@ -266,7 +266,6 @@ CLEAN_SOBJS := $(foreach lib,$(INST_SHLIBS) $(INST_TEST_MOCK_SHLIBS),$(call DEL_ CLEAN_GCDA := $(foreach lib,$(INST_LIBS) $(INST_SHLIBS) $(NOINST_LIBS) $(INST_PROGS) $(INST_ITV2_TESTPROGS) $(INST_TESTPROGS),$(call DEL_GCDA,$(lib))) CLEAN_GCNO := $(foreach lib,$(INST_LIBS) $(INST_SHLIBS) $(NOINST_LIBS) $(INST_PROGS) $(INST_ITV2_TESTPROGS) $(INST_TESTPROGS),$(call DEL_GCNO,$(lib))) CLEAN_GCOV := $(foreach lib,$(INST_LIBS) $(INST_SHLIBS) $(NOINST_LIBS) $(INST_PROGS) $(INST_ITV2_TESTPROGS) $(INST_TESTPROGS),$(call DEL_GCOV,$(lib))) -CLEAN_CFG := $(INST_UT_SMCONF:%=%.cfg) $(INST_IT_SMCONF:%=%.cfg) CLEAN_INFO := $(sort $(foreach lib,$(INST_LIBS) $(INST_SHLIBS) $(INST_TEST_MOCK_LIBS) $(INST_TEST_MOCK_SHLIBS) $(NOINST_LIBS) $(INST_PROGS) $(INST_ITV2_TESTPROGS) $(INST_TESTPROGS),$(call DEL_INFO,$(lib)))) @@ -320,7 +319,6 @@ CLEAN_FILES += $(IPC_API_RULES) $(CLEAN_IPC_API_SRCS) $(IPC_API_DEPS) CLEAN_FILES += $(INST_DATAINITOBJ) CLEAN_FILES += $(CLEAN_INFO) CLEAN_FILES += $(CLEAN_GCNO) $(CLEAN_GCDA) $(CLEAN_GCOV) -CLEAN_FILES += $(CLEAN_CFG) ifneq ($(AEXT),) CLEAN_FILES += $(foreach lib,$(INST_SHLIBS) $(INST_PROGS),$(if $(lib),$(lib).map$(AEXT))) endif @@ -338,7 +336,6 @@ SUBDIRS := $(filter-out mock,$(SUBDIRS)) .PHONY: build-prog $(SUBDIRS:%=build-prog-%) .PHONY: build-shlib $(SUBDIRS:%=build-shlib-%) .PHONY: build-arlib $(SUBDIRS:%=build-arlib-%) -.PHONY: build-cfg .PHONY: install-header $(SUBDIRS:%=install-header-%) .PHONY: install-lib .PHONY: install-shlib $(SUBDIRS:%=install-shlib-%) @@ -365,9 +362,7 @@ lint: @set -e;\ $(MAKE) lint-exec - -#all: build-lib build-prog build-test-mock-lib build-cfg all-subdirs -all: build-lib build-prog build-cfg all-subdirs +all: build-lib build-prog all-subdirs all-subdirs: @set -e;\ @@ -438,19 +433,6 @@ ifneq ($(strip $(INST_HEADERS)),) install -m 0644 $< $(HEADER_INSTALL_DIR) endif - - -HOST_LAUNCH_XML2CFG = /usr/share/basesystem/launch_xml2cfg.sh -CONF_H = /usr/include/basesystem/sm_launch_conf.h - -%.cfg: %.xml - set -e; \ - cpp -P -include $(CONF_H) $< > $<.tmp ; \ - cd $(dir $<.tmp); \ - $(HOST_LAUNCH_XML2CFG) $(notdir $<.tmp) > $@ ; \ - rm -f $<.tmp ; - - install-data: $(INST_PIXMAPS:%=$(PIXMAP_INSTALL_DIR)/%) $(INST_UCODE:%=$(UCODE_INSTALL_DIR)/%) $(INST_DATAINITOBJ:%=$(DATAINITOBJ_INSTALL_DIR)/%) $(OBJ_COPY_LIST:%=$(OBJ_COPY_INSTALL_DIR)/%) $(INST_CONFBIN:%=$(CONFBIN_INSTALL_DIR)/%) diff --git a/agl-basefiles/share/system_launcher_main.xml b/agl-basefiles/share/system_launcher_main.xml deleted file mode 100644 index ac34d29..0000000 --- a/agl-basefiles/share/system_launcher_main.xml +++ /dev/null @@ -1,40 +0,0 @@ -<?xml version="1.0" ?> - -<!DOCTYPE system_launcher [ - <!ELEMENT system_launcher (group+) > - - <!ELEMENT group (launch+) > - <!ATTLIST group - name CDATA #REQUIRED - wait_time CDATA #REQUIRED - trigger (True|False) #REQUIRED - > - - <!ELEMENT launch EMPTY > - <!ATTLIST launch - name CDATA #REQUIRED - path CDATA #REQUIRED - priority CDATA #REQUIRED - critical CDATA #REQUIRED - retry_cnt CDATA #REQUIRED - arguments CDATA #REQUIRED - logging_mask CDATA "NULL" - restart (me|NULL) #REQUIRED - is_start_required (True|False) #REQUIRED - shutdown_critical CDATA #REQUIRED - shutdown_wait_time CDATA #REQUIRED - fast_shutdown_wait_time CDATA #REQUIRED - user_name CDATA #REQUIRED - is_agl_unit (True|False) #IMPLIED - disable_agl_resethistory (True|False) #IMPLIED - disable_nonagl_resethistory (True|False) #IMPLIED - env_cond CDATA #IMPLIED - cpu_assign CDATA #IMPLIED - > - - <!ENTITY system_launcher_body SYSTEM "system_launcher_body.xml"> -]> - -<system_launcher> - &system_launcher_body; -</system_launcher> |