diff options
| author | Antonin Godard <antonin.godard@bootlin.com> | 2025-10-09 09:26:32 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-10-14 11:36:58 +0100 |
| commit | 7b7aa8c4cca383563c2af3d004fc5414197b0aec (patch) | |
| tree | c1130d304527424da8ed56e83367ddda3b8f96cc /documentation/tools | |
| parent | 51ae02fc0dc50b3a108c2b05d61592b803c710c5 (diff) | |
| download | poky-7b7aa8c4cca383563c2af3d004fc5414197b0aec.tar.gz | |
tools/build-docs-container: add option to install essential packages
The script currently only installs the files necessary to build the
docs. Since we also have the essential packages listed it can be useful
to include them in the containers, at least to validate that these
successfully install.
Add an env variable for including these packages in the container. The
default is to not include these, so the current behavior is unchanged.
(From yocto-docs rev: 723e531ea442df96fd592635a2fbfba73e737886)
Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation/tools')
| -rw-r--r-- | documentation/tools/Containerfile.apt | 4 | ||||
| -rw-r--r-- | documentation/tools/Containerfile.dnf | 4 | ||||
| -rw-r--r-- | documentation/tools/Containerfile.zypper | 4 | ||||
| -rwxr-xr-x | documentation/tools/build-docs-container | 17 |
4 files changed, 29 insertions, 0 deletions
diff --git a/documentation/tools/Containerfile.apt b/documentation/tools/Containerfile.apt index 5e30b65eb8..a573786f06 100644 --- a/documentation/tools/Containerfile.apt +++ b/documentation/tools/Containerfile.apt | |||
| @@ -1,6 +1,8 @@ | |||
| 1 | ARG ARG_FROM=debian:12 # default value to avoid warning | 1 | ARG ARG_FROM=debian:12 # default value to avoid warning |
| 2 | FROM $ARG_FROM | 2 | FROM $ARG_FROM |
| 3 | 3 | ||
| 4 | ARG INCLUDE_ESSENTIAL_PACKAGES=0 | ||
| 5 | ARG ESSENTIAL=ubuntu_essential.sh | ||
| 4 | ARG DOCS=ubuntu_docs.sh | 6 | ARG DOCS=ubuntu_docs.sh |
| 5 | ARG DOCS_PDF=ubuntu_docs_pdf.sh | 7 | ARG DOCS_PDF=ubuntu_docs_pdf.sh |
| 6 | 8 | ||
| @@ -8,12 +10,14 @@ ENV DEBIAN_FRONTEND=noninteractive | |||
| 8 | ARG TZ=Europe/Vienna | 10 | ARG TZ=Europe/Vienna |
| 9 | 11 | ||
| 10 | # relative to the location of the dockerfile | 12 | # relative to the location of the dockerfile |
| 13 | COPY --chmod=777 ${ESSENTIAL} /temp/host_packages_essential.sh | ||
| 11 | COPY --chmod=777 ${DOCS} /temp/host_packages_docs.sh | 14 | COPY --chmod=777 ${DOCS} /temp/host_packages_docs.sh |
| 12 | COPY --chmod=777 ${DOCS_PDF} /temp/host_packages_docs_pdf.sh | 15 | COPY --chmod=777 ${DOCS_PDF} /temp/host_packages_docs_pdf.sh |
| 13 | 16 | ||
| 14 | RUN ln -fs "/usr/share/zoneinfo/$TZ" /etc/localtime \ | 17 | RUN ln -fs "/usr/share/zoneinfo/$TZ" /etc/localtime \ |
| 15 | && apt-get update \ | 18 | && apt-get update \ |
| 16 | && apt-get install -y sudo \ | 19 | && apt-get install -y sudo \ |
| 20 | && if [ "$INCLUDE_ESSENTIAL_PACKAGES" = "1" ]; then yes | /temp/host_packages_essential.sh; fi \ | ||
| 17 | && yes | /temp/host_packages_docs.sh \ | 21 | && yes | /temp/host_packages_docs.sh \ |
| 18 | && yes | /temp/host_packages_docs_pdf.sh \ | 22 | && yes | /temp/host_packages_docs_pdf.sh \ |
| 19 | && apt-get --yes autoremove \ | 23 | && apt-get --yes autoremove \ |
diff --git a/documentation/tools/Containerfile.dnf b/documentation/tools/Containerfile.dnf index 3dae744455..65c5267054 100644 --- a/documentation/tools/Containerfile.dnf +++ b/documentation/tools/Containerfile.dnf | |||
| @@ -1,17 +1,21 @@ | |||
| 1 | ARG ARG_FROM=fedora:40 # default value to avoid warning | 1 | ARG ARG_FROM=fedora:40 # default value to avoid warning |
| 2 | FROM $ARG_FROM | 2 | FROM $ARG_FROM |
| 3 | 3 | ||
| 4 | ARG INCLUDE_ESSENTIAL_PACKAGES=0 | ||
| 5 | ARG ESSENTIAL=fedora_essential.sh | ||
| 4 | ARG DOCS=fedora_docs.sh | 6 | ARG DOCS=fedora_docs.sh |
| 5 | ARG DOCS_PDF=fedora_docs_pdf.sh | 7 | ARG DOCS_PDF=fedora_docs_pdf.sh |
| 6 | ARG PIP3=pip3_docs.sh | 8 | ARG PIP3=pip3_docs.sh |
| 7 | 9 | ||
| 8 | # relative to the location of the dockerfile | 10 | # relative to the location of the dockerfile |
| 11 | COPY --chmod=777 ${ESSENTIAL} /temp/host_packages_essential.sh | ||
| 9 | COPY --chmod=777 ${DOCS} /temp/host_packages_docs.sh | 12 | COPY --chmod=777 ${DOCS} /temp/host_packages_docs.sh |
| 10 | COPY --chmod=777 ${DOCS_PDF} /temp/host_packages_docs_pdf.sh | 13 | COPY --chmod=777 ${DOCS_PDF} /temp/host_packages_docs_pdf.sh |
| 11 | COPY --chmod=777 ${PIP3} /temp/pip3_docs.sh | 14 | COPY --chmod=777 ${PIP3} /temp/pip3_docs.sh |
| 12 | 15 | ||
| 13 | RUN dnf update -y \ | 16 | RUN dnf update -y \ |
| 14 | && dnf install -y sudo \ | 17 | && dnf install -y sudo \ |
| 18 | && if [ "$INCLUDE_ESSENTIAL_PACKAGES" = "1" ]; then yes | /temp/host_packages_essential.sh; fi \ | ||
| 15 | && yes | /temp/host_packages_docs.sh \ | 19 | && yes | /temp/host_packages_docs.sh \ |
| 16 | && yes | /temp/host_packages_docs_pdf.sh \ | 20 | && yes | /temp/host_packages_docs_pdf.sh \ |
| 17 | && yes | /temp/pip3_docs.sh \ | 21 | && yes | /temp/pip3_docs.sh \ |
diff --git a/documentation/tools/Containerfile.zypper b/documentation/tools/Containerfile.zypper index f27ad1b476..3850b9ff9e 100644 --- a/documentation/tools/Containerfile.zypper +++ b/documentation/tools/Containerfile.zypper | |||
| @@ -1,11 +1,14 @@ | |||
| 1 | ARG ARG_FROM=opensuse/leap:15.4 # default value to avoid warning | 1 | ARG ARG_FROM=opensuse/leap:15.4 # default value to avoid warning |
| 2 | FROM $ARG_FROM | 2 | FROM $ARG_FROM |
| 3 | 3 | ||
| 4 | ARG INCLUDE_ESSENTIAL_PACKAGES=0 | ||
| 5 | ARG ESSENTIAL=opensuse_essential.sh | ||
| 4 | ARG DOCS=opensuse_docs.sh | 6 | ARG DOCS=opensuse_docs.sh |
| 5 | ARG DOCS_PDF=opensuse_docs_pdf.sh | 7 | ARG DOCS_PDF=opensuse_docs_pdf.sh |
| 6 | ARG PIP3=pip3_docs.sh | 8 | ARG PIP3=pip3_docs.sh |
| 7 | 9 | ||
| 8 | # relative to the location of the dockerfile | 10 | # relative to the location of the dockerfile |
| 11 | COPY --chmod=777 ${ESSENTIAL} /temp/host_packages_essential.sh | ||
| 9 | COPY --chmod=777 ${DOCS} /temp/host_packages_docs.sh | 12 | COPY --chmod=777 ${DOCS} /temp/host_packages_docs.sh |
| 10 | COPY --chmod=777 ${DOCS_PDF} /temp/host_packages_docs_pdf.sh | 13 | COPY --chmod=777 ${DOCS_PDF} /temp/host_packages_docs_pdf.sh |
| 11 | COPY --chmod=777 ${PIP3} /temp/pip3_docs.sh | 14 | COPY --chmod=777 ${PIP3} /temp/pip3_docs.sh |
| @@ -20,6 +23,7 @@ RUN for script in /temp/*.sh; do \ | |||
| 20 | 23 | ||
| 21 | RUN zypper update -y \ | 24 | RUN zypper update -y \ |
| 22 | && zypper install -y sudo \ | 25 | && zypper install -y sudo \ |
| 26 | && if [ "$INCLUDE_ESSENTIAL_PACKAGES" = "1" ]; then yes | /temp/host_packages_essential.sh; fi \ | ||
| 23 | && yes | /temp/host_packages_docs.sh \ | 27 | && yes | /temp/host_packages_docs.sh \ |
| 24 | && yes | /temp/host_packages_docs_pdf.sh \ | 28 | && yes | /temp/host_packages_docs_pdf.sh \ |
| 25 | && yes | /temp/pip3_docs.sh \ | 29 | && yes | /temp/pip3_docs.sh \ |
diff --git a/documentation/tools/build-docs-container b/documentation/tools/build-docs-container index 70e05f295f..615e83d6cf 100755 --- a/documentation/tools/build-docs-container +++ b/documentation/tools/build-docs-container | |||
| @@ -24,6 +24,7 @@ SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) | |||
| 24 | CONTAINERCMD=${CONTAINERCMD:-docker} | 24 | CONTAINERCMD=${CONTAINERCMD:-docker} |
| 25 | DOCS_DIR="$SCRIPT_DIR/../.." | 25 | DOCS_DIR="$SCRIPT_DIR/../.." |
| 26 | SH_DIR="$SCRIPT_DIR/host_packages_scripts" | 26 | SH_DIR="$SCRIPT_DIR/host_packages_scripts" |
| 27 | INCLUDE_ESSENTIAL_PACKAGES=${INCLUDE_ESSENTIAL_PACKAGES:-0} | ||
| 27 | 28 | ||
| 28 | function usage() | 29 | function usage() |
| 29 | { | 30 | { |
| @@ -49,6 +50,16 @@ $0 OCI_IMAGE [make arguments...] | |||
| 49 | documentation/Makefile, see that file for what's supported. This is typically | 50 | documentation/Makefile, see that file for what's supported. This is typically |
| 50 | intended to be used to provide specific make targets. | 51 | intended to be used to provide specific make targets. |
| 51 | Default: publish | 52 | Default: publish |
| 53 | |||
| 54 | Environment variables: | ||
| 55 | |||
| 56 | - CONTAINERCMD can be set to 'docker' or 'podman' to select the | ||
| 57 | container engine (default: 'docker'). | ||
| 58 | |||
| 59 | - INCLUDE_ESSENTIAL_PACKAGES can be set to 0 or 1 to also include essential | ||
| 60 | packages listed in documentation/tools/host_packages_scripts/*_essential.sh. | ||
| 61 | This is not required to build the documentation but can be useful to validate | ||
| 62 | the installation of packages listed in these files (default: 0). | ||
| 52 | " | 63 | " |
| 53 | } | 64 | } |
| 54 | 65 | ||
| @@ -85,6 +96,7 @@ main () | |||
| 85 | "debian:12"*|\ | 96 | "debian:12"*|\ |
| 86 | "debian:13"*) | 97 | "debian:13"*) |
| 87 | containerfile=Containerfile.debian | 98 | containerfile=Containerfile.debian |
| 99 | essential=ubuntu_essential.sh | ||
| 88 | docs=ubuntu_docs.sh | 100 | docs=ubuntu_docs.sh |
| 89 | docs_pdf=ubuntu_docs_pdf.sh | 101 | docs_pdf=ubuntu_docs_pdf.sh |
| 90 | ;; | 102 | ;; |
| @@ -93,6 +105,7 @@ main () | |||
| 93 | "fedora:41"*|\ | 105 | "fedora:41"*|\ |
| 94 | "fedora:42"*) | 106 | "fedora:42"*) |
| 95 | containerfile=Containerfile.fedora | 107 | containerfile=Containerfile.fedora |
| 108 | essential=fedora_essential.sh | ||
| 96 | docs=fedora_docs.sh | 109 | docs=fedora_docs.sh |
| 97 | docs_pdf=fedora_docs_pdf.sh | 110 | docs_pdf=fedora_docs_pdf.sh |
| 98 | pip3=pip3_docs.sh | 111 | pip3=pip3_docs.sh |
| @@ -119,6 +132,7 @@ main () | |||
| 119 | # "leap:15.6"*) | 132 | # "leap:15.6"*) |
| 120 | image=opensuse/leap:$version | 133 | image=opensuse/leap:$version |
| 121 | containerfile=Containerfile.zypper | 134 | containerfile=Containerfile.zypper |
| 135 | essential=opensuse_essential.sh | ||
| 122 | docs=opensuse_docs.sh | 136 | docs=opensuse_docs.sh |
| 123 | docs_pdf=opensuse_docs_pdf.sh | 137 | docs_pdf=opensuse_docs_pdf.sh |
| 124 | pip3=pip3_docs.sh | 138 | pip3=pip3_docs.sh |
| @@ -129,6 +143,7 @@ main () | |||
| 129 | "ubuntu:24.04"*|\ | 143 | "ubuntu:24.04"*|\ |
| 130 | "ubuntu:25.04"*) | 144 | "ubuntu:25.04"*) |
| 131 | containerfile=Containerfile.ubuntu | 145 | containerfile=Containerfile.ubuntu |
| 146 | essential=ubuntu_essential.sh | ||
| 132 | docs=ubuntu_docs.sh | 147 | docs=ubuntu_docs.sh |
| 133 | docs_pdf=ubuntu_docs_pdf.sh | 148 | docs_pdf=ubuntu_docs_pdf.sh |
| 134 | ;; | 149 | ;; |
| @@ -142,6 +157,8 @@ main () | |||
| 142 | $OCI build \ | 157 | $OCI build \ |
| 143 | --tag "yocto-docs-$sanitized_dockername:latest" \ | 158 | --tag "yocto-docs-$sanitized_dockername:latest" \ |
| 144 | --build-arg ARG_FROM="docker.io/$image" \ | 159 | --build-arg ARG_FROM="docker.io/$image" \ |
| 160 | --build-arg INCLUDE_ESSENTIAL_PACKAGES="${INCLUDE_ESSENTIAL_PACKAGES}" \ | ||
| 161 | --build-arg ESSENTIAL="$essential" \ | ||
| 145 | --build-arg DOCS="$docs" \ | 162 | --build-arg DOCS="$docs" \ |
| 146 | --build-arg DOCS_PDF="$docs_pdf" \ | 163 | --build-arg DOCS_PDF="$docs_pdf" \ |
| 147 | --build-arg PIP3="${pip3:-}" \ | 164 | --build-arg PIP3="${pip3:-}" \ |
