Pull request #4: add the coreos-doc recipes and rename oe-init-build-env to coreos-init-build-env

Merge in ICO/coreos from feat/docs-build to master

* commit '3951c217d1a1c2a51e23e2c7f6e673086218b6a9':
  feat: add the coreos-doc script
  refactor: oe-init-build-env renamed to coreos-init-build-env
  coreos-doc: recipe added
This commit is contained in:
Samuel Dolt 2022-10-05 12:13:27 +02:00
commit a462310df9
5 changed files with 50 additions and 4 deletions

View File

@ -1,7 +1,7 @@
#!/bin/sh
# This script is used to setup the OE Build Envrionment
# Normally this is called as '. ./oe-init-build-env <builddir>'
# Normally this is called as '. ./core-init-build-env <builddir>'
# On some shell, we can get the path of this script when sources. Otherwise we
# use the current directory as a fallback
@ -42,3 +42,14 @@ fi
# Call the oe-init-build-env scripts of openembedded-core
. "${OEROOT}/oe-init-build-env" "${1:-$CORE_OS_ROOT/build}"
# Add the scripts directory of CoreOS to the path
# Make sure our paths are at the beginning of $PATH
for newpath in "${CORE_OS_ROOT}/scripts"; do
# Remove any existences of $newpath from $PATH
PATH=$(echo $PATH | sed -re "s#(^|:)$newpath(:|$)#\2#g;s#^:##")
# Add $newpath to $PATH
PATH="$newpath:$PATH"
done
unset newpath
export PATH

View File

@ -72,12 +72,12 @@ Building an image
Before building an image, we have to first configure the build.
To create a build folder with our default configuration, you can run the `oe-init-build-env`
script:
To create a build folder with our default configuration, you can run the
`coreos-init-build-env` script:
.. code-block:: sh
~/core-os$ source oe-init-build-env
~/core-os$ source coreos-init-build-env
.. note::

View File

@ -0,0 +1,29 @@
DESCRIPTION = "CoreOS Documentation"
SECTION = "devtool"
LICENSE = "CLOSED"
PV = "0.0.1+git${METADATA_REVISION}"
inherit externalsrc
inherit allarch
EXTERNALSRC := "${THISDIR}/../../../../documentation"
DEPENDS += "python3-sphinx python3-sphinx-rtd-theme"
do_compile() {
python3 -m sphinx.cmd.build -b html ${S} ${B}
}
# Ensure the doc is in the coreos-doc package and not in coreos-doc-doc
FILES:${PN} += "${docdir}/coreos"
PACKAGES:remove = "${PN}-doc"
do_install() {
install -d ${D}${docdir}
cp --no-preserve=ownership -r ${B} ${D}${docdir}/coreos
}
# Deploy to build/tmp/deploy/documentation
do_deploy() {
cp --no-preserve=ownership -r ${B} ${DEPLOY_DIR}/documentation
}
addtask deploy after do_compile

4
scripts/coreos-doc Executable file
View File

@ -0,0 +1,4 @@
#!/usr/bin/env sh
bitbake coreos-doc
xdg-open ${BBPATH}/tmp/deploy/documentation/index.html

View File

@ -21,3 +21,5 @@ Other commonly useful commands are:
- 'devtool' and 'recipetool' handle common recipe tasks
- 'bitbake-layers' handles common layer tasks
- 'oe-pkgdata-util' handles common target package tasks
You can open the CoreOS documentation by running the 'coreos-doc' command.