From fb4838e2b6bb0dcb94a120239b8edae639ab551a Mon Sep 17 00:00:00 2001 From: Samuel Dolt Date: Tue, 4 Oct 2022 15:17:54 +0200 Subject: [PATCH 1/3] coreos-doc: recipe added --- .../recipes-devtool/core-os/coreos-doc.bb | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 layers/meta-belden-coreos/recipes-devtool/core-os/coreos-doc.bb diff --git a/layers/meta-belden-coreos/recipes-devtool/core-os/coreos-doc.bb b/layers/meta-belden-coreos/recipes-devtool/core-os/coreos-doc.bb new file mode 100644 index 0000000..11c0c3c --- /dev/null +++ b/layers/meta-belden-coreos/recipes-devtool/core-os/coreos-doc.bb @@ -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 From c6a32c397c730392d5707c20614b568037ce7935 Mon Sep 17 00:00:00 2001 From: Samuel Dolt Date: Tue, 4 Oct 2022 15:18:41 +0200 Subject: [PATCH 2/3] refactor: oe-init-build-env renamed to coreos-init-build-env --- oe-init-build-env => coreos-init-build-env | 13 ++++++++++++- documentation/quick-build.rst | 6 +++--- 2 files changed, 15 insertions(+), 4 deletions(-) rename oe-init-build-env => coreos-init-build-env (76%) diff --git a/oe-init-build-env b/coreos-init-build-env similarity index 76% rename from oe-init-build-env rename to coreos-init-build-env index a6b2ca3..a9e039c 100755 --- a/oe-init-build-env +++ b/coreos-init-build-env @@ -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 ' +# Normally this is called as '. ./core-init-build-env ' # 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 diff --git a/documentation/quick-build.rst b/documentation/quick-build.rst index 76e957b..ce729eb 100644 --- a/documentation/quick-build.rst +++ b/documentation/quick-build.rst @@ -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:: From 3951c217d1a1c2a51e23e2c7f6e673086218b6a9 Mon Sep 17 00:00:00 2001 From: Samuel Dolt Date: Tue, 4 Oct 2022 15:19:33 +0200 Subject: [PATCH 3/3] feat: add the coreos-doc script --- scripts/coreos-doc | 4 ++++ templates/conf-notes.txt | 2 ++ 2 files changed, 6 insertions(+) create mode 100755 scripts/coreos-doc diff --git a/scripts/coreos-doc b/scripts/coreos-doc new file mode 100755 index 0000000..632d701 --- /dev/null +++ b/scripts/coreos-doc @@ -0,0 +1,4 @@ +#!/usr/bin/env sh + +bitbake coreos-doc +xdg-open ${BBPATH}/tmp/deploy/documentation/index.html \ No newline at end of file diff --git a/templates/conf-notes.txt b/templates/conf-notes.txt index c2ae69b..1d0e5f6 100644 --- a/templates/conf-notes.txt +++ b/templates/conf-notes.txt @@ -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.