From b828d67c8c429c2b1bf87d2f890607c378d55200 Mon Sep 17 00:00:00 2001 From: Lennart Johansson Date: Thu, 20 Oct 2016 10:04:03 +0200 Subject: Extract list of targets from manifest, instead of hardcoded This list was hardcoded in Makefile before. Do this by cloning the manifest repo to see the targets. Support both ref/tags/ and hashvalue i.e. same as the repo command supports. Signed-off-by: Lennart Johansson --- doc/Makefile | 82 +++++++++++++++------- .../doc/about_release.xml | 34 +++++---- 2 files changed, 73 insertions(+), 43 deletions(-) diff --git a/doc/Makefile b/doc/Makefile index ebb086c..c7569e9 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -2,12 +2,12 @@ SUBSYSROOT := $(shell pwd) # NOTE: MANIFESTHASH in manifest_conf.mk needs to be the final release tag before a release -# The manifest_conf.mk defines MANIFESTHASH and MANIFESTURL and PROFILE_NAME +# The manifest_conf.mk defines MANIFESTHASH and MANIFESTURL and PROFILE_NAME(on front+footers) include manifest_conf.mk +MANIFESTDIR := $(shell echo "$(MANIFESTURL)" | sed 's/.*\///;s/\.git//') -# An alternative is to clone the manifest repository and extract the list of target manifest files from that +# Further down we extract the list of target manifest file names from the manifest itself # We need all to get all README, but only first in alphabetic list is used to extract info from poky/ -TARGETDEFAULTXMLS := p2041rdb/default.xml # ***************** Generic docbuild.git auto-clone + s_docbuild symlink *** @@ -22,6 +22,7 @@ NAME_TARGETS := targets DOCBASEDIR=$(shell pwd) REPODIR=$(DOCBASEDIR)/.. TMPCLONEROOT_TARGETS := $(TMPCLONEROOT)/$(NAME_TARGETS) +TMPCLONEROOT_MANIFEST := $(TMPCLONEROOT)/manifest # ******************* AutoGenerated chapter from template and target READMEs ******* @@ -70,29 +71,34 @@ VALIDATE = no # Export all parameters including those on the command line export -.PHONY: doc books docusage init initbuild inittargets initpardoc initbuildboot dist +.PHONY: doc books docusage init initbuild initmanifest inittargets initpardoc initbuildboot dist docusage: @echo 'make docusage #Shows this help text' @echo ' DOCBOOK_TOOLS_VERSIONS=yes #Displays DocBook tools versions in this machine' - @echo 'make doc #Builds the userdoc, does automatically also init if needed' - @echo 'make dist BOOK_DIST_DIR=xx/doc #Builds doc and copies results to BOOK_DIST_DIR' - @echo ' #Does not work with DOCBOOK_TO_BOOKDIR or BOOK_BUILD_DIR' - @echo ' #Currently EclipseHelp formated doc will not be in BOOK_DIST_DIR' + @echo 'make doc #Builds doc. ALSO automatically does all inits if needed' + @echo 'make dist BOOK_DIST_DIR=xx/doc #Builds doc as above and copies results to BOOK_DIST_DIR' + @echo ' # Does not work with DOCBOOK_TO_BOOKDIR or BOOK_BUILD_DIR' + @echo ' BOOK_DIST_ECLIPSE=yes #Currently EclipseHelp formated doc will not be in BOOK_DIST_DIR' @echo ' # unless BOOK_DIST_ECLIPSE is set to yes' @echo 'make init #Init all needed init* below' @echo 'make initbuild #Init s_docbuild Docbook build system and central files' - @echo 'make inittargets #Init s_targets using repo tool Targets in this distro with poky' - @echo 'make initpardoc #Init s_docsrc_common using info from poky/' + @echo 'make initmanifest #Init s_manifest by cloning, to detect which targets are included' + @echo 'make inittargets #Init s_targets using repo tool. Targets in this distro with poky' + @echo 'make initpardoc #Init s_docsrc_common with extracted parameters/' @echo 'make initbuildboot #Init build_boot chapter from READMEs and template in release info' + @echo 'make initissues #Init known issues section from Jira' + @echo ' MANIFESTHASH=xxxxx #Option for all inits above to use nondefault manifest version' + @echo ' #It shall either be ref/tags/ or a hashvalue' + @echo ' #Configured tag or hashvalue $(MANIFESTHASH)' + @echo ' #Configured MANIFESTURL $(MANIFESTURL)' + @echo ' #Configured PROFILE_NAME $(PROFILE_NAME)' @echo ' DOCBOOK_CLEANTMP=no #Option to keep temp files in doc/ and tmp/' @echo ' BOOK_GLOBALCLONEROOT=yes #Option for all init above to clone all outside the doc directory' @echo ' BOOK_GLOBALCLONEROOT=otherpath #Option for all init above to clone all to given path' - @echo ' MANIFESTHASH=xxxxx #Option for all init above to use nondefault MANIFEST in repo cmd' @echo 'make pullbuild #git pull in s_docbuild' - @echo 'make pulltargets #git pull in s_targets. You need also initpardoc initbuildboot' - @echo 'make clean #Clean. Also clean s_* but not any external clones' + @echo 'make clean #Clean results and all s_*, but not any external clones' @echo '' @echo 'Optional parameters for make doc:' @echo ' COMP= #Component (book) to build. Book component names are book-*' @@ -121,7 +127,7 @@ docusage: @echo ' make doc COMP=book-xxxx FORMAT=html' @echo ' make doc COMP=book-xxxx FORMAT=pdf' @echo ' make doc BL_LABEL="Version 1.2.3" Creates all with version in footers and front' - + @echo '' @echo ' Requires docbook-xsl-1.76.1 or later, docbook-xml 4.2, svg1.1, fop-1.0 + fop-hyph.jar' @echo ' fop + the separate fop-hyph can be found together in package "libfop-java"' @echo ' otherwise fetch fop-hyph.jar and place in same place as fop.jar' @@ -135,8 +141,8 @@ ifeq ($(DOCBOOK_TOOLS_VERSIONS),yes) endif # We rely on make doing these in order left to right -init: initbuild inittargets initpardoc initbuildboot initpkgdiff initissues -pullall: pullbuild pulltargets +init: initbuild initmanifest inittargets initpardoc initbuildboot initpkgdiff initissues +pullall: pullbuild # If no COMP, iterate over books-* in COMPONENTS with make doc ifeq ($(COMP),) @@ -193,8 +199,9 @@ ifeq ($(DOCBOOK_CLEANTMP),yes) endif endif -# cleaninit cleans ALL tmpcommon and all s_* and generated build_boot chapter xml +# cleaninit cleans ALL tmpcommon and all s_* clean: cleaninit cleanbuildboot cleanpkgdiff cleanissues + @echo "Cleaning build results and temporary files" $(VERB)rm -rf doc tmp 2>/dev/null ifneq ($(filter book-%, $(COMPONENTS)),) $(VERB)for comp in $(filter book-%, $(COMPONENTS)); do \ @@ -206,26 +213,45 @@ endif # ****************************************************************** # ****************** SUPPORT FOR TARGETS *************************** +initmanifest: s_manifest inittargets: s_targets -pulltargets: - $(VERB)if [ ! -d s_targets ]; then echo "ERROR: No s_targets exists?" ; exit 10 ; fi - $(VERB)cd s_targets; for targ in *; do ( cd $targ ; git pull ) # ----------------------------------------- +# We only clone the manifest to be able to autodetect which targets are in it +# git clone requires only the tag string e.g. EL6, not the entire ref/tags/EL6 that repo requires +# git clone -b hashvalue is not supported. We must first clone, then git checkout hashvalue +# These steps work also for a tag so we could use the same stepwise code + +s_manifest: $(TMPCLONEROOT_MANIFEST) + $(VERB)rm s_manifest 2>/dev/null; ln -s $(TMPCLONEROOT_MANIFEST) s_manifest -# Use repo to auto-clone each target separately - VERY LARGE if there are many targets (5 targets => about 1.3 Gytes) +$(TMPCLONEROOT_MANIFEST): + $(VERB)if [ ! -d "$(TMPCLONEROOT)" ] ; then mkdir -p "$(TMPCLONEROOT)" ; fi + $(VERB)if [ ! -d "$(TMPCLONEROOT_MANIFEST)" ]; then mkdir -p "$(TMPCLONEROOT_MANIFEST)" ; fi + $(VERB) MBRANCH=`echo "$(MANIFESTHASH)" | sed 's/.*\///'`; \ + echo "**** Cloning manifest version $$MBRANCH of $(MANIFESTURL) in $(TMPCLONEROOT_MANIFEST)" ; \ + cd "$(TMPCLONEROOT_MANIFEST)"; git clone $(MANIFESTURL) ; cd $(MANIFESTDIR) ; git checkout $(MANIFESTHASH) + $(VERB)if [ ! -d "$(TMPCLONEROOT_MANIFEST)/$(MANIFESTDIR)" ]; then echo "ERROR: Missing $(TMPCLONEROOT_MANIFEST)/$(MANIFESTDIR)"; exit 10 ; fi ; \ + TARGETDEFAULTXMLS=`cd $(TMPCLONEROOT_MANIFEST)/$(MANIFESTDIR); ls -1 */default.xml 2>/dev/null` ; \ + echo "$$TARGETDEFAULTXMLS" | tr '\n' ' ' >$(TMPCLONEROOT_MANIFEST)/targetdefaultxmls.txt ; \ + echo "$$TARGETDEFAULTXMLS" | sed 's/\/.*//' | tr '\n' ' ' >$(TMPCLONEROOT_MANIFEST)/targetids.txt + +# ----------------------------------------- +# Use repo to auto-clone each target separately - VERY LARGE if there are many targets (5 targets => about 1.3 Gbytes) s_targets: $(TMPCLONEROOT_TARGETS) $(VERB)rm s_targets 2>/dev/null; ln -s $(TMPCLONEROOT_TARGETS) s_targets -$(TMPCLONEROOT_TARGETS): +$(TMPCLONEROOT_TARGETS): s_manifest $(VERB)if [ ! -d "$(TMPCLONEROOT)" ] ; then mkdir -p "$(TMPCLONEROOT)" ; fi $(VERB)if [ ! -d $(TMPCLONEROOT_TARGETS) ]; then mkdir -p $(TMPCLONEROOT_TARGETS) ; fi @echo "**** Cloning all targets using repo tool into $(TMPCLONEROOT_TARGETS)" - @echo "TARGETDEFAULTXMLS is <$(TARGETDEFAULTXMLS)>" - $(VERB)for target_default_xml in $(TARGETDEFAULTXMLS); \ + $(VERB)if [ ! -f "$(TMPCLONEROOT_MANIFEST)/targetdefaultxmls.txt" ]; then echo "ERROR: Missing $(TMPCLONEROOT_MANIFEST)/targetdefaultxmls.txt"; exit 10; fi + $(VERB)TARGETDEFAULTXMLS=`cat "$(TMPCLONEROOT_MANIFEST)/targetdefaultxmls.txt" 2>/dev/null` ; \ + echo "Info: TARGETDEFAULTXMLS is $$TARGETDEFAULTXMLS" ; \ + for target_default_xml in $$TARGETDEFAULTXMLS; \ do \ TARGDIR=$(TMPCLONEROOT_TARGETS)/`dirname $$target_default_xml` ; \ echo "TARGDIR=<$$TARGDIR>" ; \ @@ -248,6 +274,7 @@ TMPPARDOC := $(TMPCLONEROOT_DOCSRC_COMMON)/pardoc-distro.xml initpardoc: s_docsrc_common cleanpardoc: + @echo "Cleaning dynamic parameters" $(VERB)rm -rf $(TMPCLONEROOT_DOCSRC_COMMON) ; rm s_docsrc_common s_docsrc_common: $(TMPCLONEROOT_DOCSRC_COMMON) @@ -258,8 +285,10 @@ $(TMPCLONEROOT_DOCSRC_COMMON): s_targets $(VERB)if [ ! -d $(TMPCLONEROOT_DOCSRC_COMMON) ]; then mkdir -p $(TMPCLONEROOT_DOCSRC_COMMON) ; fi @echo "**** Copy and patch docsrc_common/ files to $(TMPCLONEROOT_DOCSRC_COMMON)" @echo "*** Add parameters from first target's enea.conf and add manifest parameters" - $(VERB)FIRSTTARGET=`ls -1 s_targets/ | head -1`; \ + $(VERB)FIRSTTARGET=`ls -1 s_targets/ 2>/dev/null | head -1`; \ + if [ "$$FIRSTTARGET" = "" ]; then echo "ERROR: No targets?" ; exit 10; fi ; \ ENEACONF=s_targets/$$FIRSTTARGET/poky/meta-el-common/conf/distro/enea.conf ; \ + if [ ! -f "$$ENEACONF" ]; then echo "ERROR: No $$ENEACONF?" ; exit 10; fi ; \ DISTRO_VERSION_MAJOR=`egrep '^DISTRO_VERSION_MAJOR' $$ENEACONF | sed 's/^[^"]*"//;s/".*//'` ; \ DISTRO_VERSION_MINOR=`egrep '^DISTRO_VERSION_MINOR' $$ENEACONF | sed 's/^[^"]*"//;s/".*//'` ; \ cat docsrc_common/pardoc-distro.xml | sed '/<\/section>/d' | \ @@ -278,6 +307,7 @@ $(TMPCLONEROOT_DOCSRC_COMMON): s_targets initbuildboot: $(BUILDBOOT_XML) cleanbuildboot: + @echo "Cleaning generated build-boot command document file" $(VERB)rm -f $(BUILDBOOT_XML) 2>/dev/null @@ -296,6 +326,7 @@ $(BUILDBOOT_XML): s_targets $(BUILDBOOT_TEMPLATE) initpkgdiff: $(PKGDIFF_GEN_XML) cleanpkgdiff: + @echo "Cleaning generated package diff document file" $(VERB)rm -f $(PKGDIFF_GEN_XML) 2>/dev/null $(PKGDIFF_GEN_XML): @@ -313,6 +344,7 @@ $(PKGDIFF_GEN_XML): initissues: $(JIRA_ISSUES_GEN_XML) cleanissues: + @echo "Cleaning generated known issues document file" $(VERB)rm -f $(JIRA_ISSUES_GEN_XML) 2>/dev/null $(JIRA_ISSUES_GEN_XML): diff --git a/doc/book-enea-linux-release-info/doc/about_release.xml b/doc/book-enea-linux-release-info/doc/about_release.xml index 3e5bcd6..6907507 100644 --- a/doc/book-enea-linux-release-info/doc/about_release.xml +++ b/doc/book-enea-linux-release-info/doc/about_release.xml @@ -131,19 +131,16 @@ Poky - - Git commit id: - 75ca53211488a3e268037a44ee2a7ac5c7181bd2 - - - - The auto-fetched version is not correct unless the EL release is - based on a Yocto release tag. - Git commit id: + 75ca53211488a3e268037a44ee2a7ac5c7181bd2Problem: + Unfortunately the poky version in poky.ent is not correct unless + the EL release would be based on a Yocto release, so we can not + use that here. This is a problem because we don't want to manually + edit the git commit ID in this file? The poky version in poky.ent + is just now INFO: Auto-fetched from - poky.ent via pardoc-distro.xml - + xpointer="element(Poky_VER/1)" /> @@ -310,8 +307,8 @@ - Enea Linux - Networking Profile Guide + Enea Linux Networking + Profile Guide @@ -329,13 +326,14 @@ - Enea Linux 6 Test Report + Enea Linux 6 Test + Report - Enea Linux Real-Time Guide can be read at - http://linuxrealtime.org. + Enea Linux Real-Time + Guide can be read at http://linuxrealtime.org. -- cgit v1.2.3-54-g00ecf