Signed-off-by: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com>
8.0 KiB
Build Guide (mockbuild-all.pl)
This guide explains how to use mockbuild-all.pl to build, validate, and package xCAT dependencies and optional xCAT packages into a unified EL10 repository layout.
It also documents the operational flags for controlling build, install-check, collection, and packaging behavior.
Purpose
mockbuild-all.pl is the top-level build orchestrator for generating a unified xCAT repository.
It builds required dependency RPMs and, by default, xCAT RPMs, then assembles:
- a binary RPM repo tree with repodata
- an SRPM repo tree with repodata
- one binary repo tarball and one SRPM repo tarball
Historical Context
Historically, the deployment flow used separate repositories:
xcat-corefor xCAT packagesxcat-depfor dependency packages
The current flow produces a single unified xcat repository containing all required packages together.
Placeholder Conventions
This guide uses the following placeholders consistently:
<REPO_ROOT>: xcat-dep repository root (example:/root/xcat-dep)<XCAT_SOURCE>: xCAT source root (example:<REPO_ROOT>/xcat-source-code)<ARCH>: output ofuname -m(for example:x86_64,ppc64le)<OS_ID>:IDfield from/etc/os-release(for example:rhel,rocky)<REL>: integer major release fromVERSION_IDin/etc/os-release(for example:10)<TARGET>:<OS_ID>+epel-<REL>-<ARCH><RUN_ID>: build run identifier (auto-generated if omitted)
Build Pipeline Overview
mockbuild-all.pl orchestrates these build components in parallel:
<REPO_ROOT>/elilo/mockbuild.pl<REPO_ROOT>/grub2-xcat/mockbuild.pl<REPO_ROOT>/ipmitool/mockbuild.pl<REPO_ROOT>/syslinux/mockbuild.pl<REPO_ROOT>/goconserver/mockbuild.pl<REPO_ROOT>/mockbuild-perl-packages.pl<XCAT_SOURCE>/buildrpms.pl(unless--skip-xcatis set)
Each build path uses mock for chroot isolation. Top-level steps are parallelized by mockbuild-all.pl, and perl dependency builds are also parallelized internally by mockbuild-perl-packages.pl.
mockbuild-all.pl does more than building RPMs. In a default run it performs these stages:
- Optional chroot cleanup (
--scrub-all-chroots) - Parallel build execution
- Optional install/smoke checks inside child builders (disabled with
--skip-install) - Binary RPM collection into
repo/<ARCH>/ - Source RPM collection into
repo-src/ createrepo --updateon both repo trees- Tarball creation for both repo trees
- Summary generation (
summary.txt)
Skip and Control Flags
Use these flags to skip specific operations:
--skip-install- Skips install/smoke checks performed by child builder scripts after RPM build.
--skip-xcat- Skips
<XCAT_SOURCE>/buildrpms.pl(xCAT package build step).
- Skips
--skip-xcat-dep- Skips non-perl xcat-dep package builders (
elilo,grub2-xcat,ipmitool-xcat,syslinux-xcat,goconserver).
- Skips non-perl xcat-dep package builders (
--skip-perl- Skips
<REPO_ROOT>/mockbuild-perl-packages.pl.
- Skips
--skip-build- Skips all build steps; only runs collection/repo/tarball stages from existing artifact roots.
--skip-createrepo- Skips
createrepo --update.
- Skips
--skip-tarball- Skips tarball creation for both binary and SRPM repos.
--scrub-all-chroots- Runs
mock -r <TARGET> --scrub=allbefore build and collection.
- Runs
--collect-dir <PATH>- Adds extra artifact roots to the collection phase (repeatable).
--dry-run- Prints planned actions without executing them.
Prerequisites
- Run as
root. mockbuild-all.pland package sources present under<REPO_ROOT>.- xCAT sources present under
<XCAT_SOURCE>.
Install baseline tooling:
dnf -y install perl perl-Parallel-ForkManager mock createrepo tar rpm-build rpmdevtools dnf-plugins-core wget git
If you will build xCAT packages (that is, you will not use --skip-xcat), install xCAT build dependencies:
cd <XCAT_SOURCE>
perl buildrpms.pl --install_deps
Validate mock config availability:
mock -r <TARGET> --print-root-path
Target Resolution
--target is optional.
If --target is omitted, mockbuild-all.pl derives <TARGET> from:
/etc/os-release(ID,VERSION_ID)uname -m
Equivalent derivation:
<TARGET> = <OS_ID>+epel-<REL>-<ARCH>
<TARGET> is also passed to mock as the chroot/config identifier:
mock -r <TARGET> ...
Build Full Unified Repository (xCAT + Dependencies)
Use this mode to build dependency packages and xCAT packages together.
cd /root/xcat-dep
perl ./mockbuild-all.pl \
--repo-root /root/xcat-dep \
--xcat-source /root/xcat-dep/xcat-source-code \
--scrub-all-chroots
Notes:
- Install/smoke checks run by default inside child builders.
- Add
--skip-installto skip those checks. <RUN_ID>is optional; when omitted it is timestamp-based.
Build Unified Repository Without xCAT (--skip-xcat)
Use this mode to build dependency packages only and skip invoking /root/xcat-dep/xcat-source-code/buildrpms.pl.
cd /root/xcat-dep
perl ./mockbuild-all.pl \
--repo-root /root/xcat-dep \
--xcat-source /root/xcat-dep/xcat-source-code \
--scrub-all-chroots \
--skip-xcat \
--skip-install
Important behavior:
--skip-xcatskips the xCAT build step, but collection still scans:<XCAT_SOURCE>/dist/<TARGET>/rpms
- If that path already has xCAT RPMs, they are included in the resulting unified repo.
Common Build Modes
Full unified repo (xCAT + dependencies, with install/smoke checks):
cd <REPO_ROOT>
perl ./mockbuild-all.pl \
--repo-root <REPO_ROOT> \
--xcat-source <XCAT_SOURCE> \
--scrub-all-chroots
Full unified repo (xCAT + dependencies, skip install/smoke checks):
cd <REPO_ROOT>
perl ./mockbuild-all.pl \
--repo-root <REPO_ROOT> \
--xcat-source <XCAT_SOURCE> \
--scrub-all-chroots \
--skip-install
Dependency-only repo (skip xCAT package build):
cd <REPO_ROOT>
perl ./mockbuild-all.pl \
--repo-root <REPO_ROOT> \
--xcat-source <XCAT_SOURCE> \
--scrub-all-chroots \
--skip-xcat \
--skip-install
Collection-only pass from existing build artifacts:
cd <REPO_ROOT>
perl ./mockbuild-all.pl \
--repo-root <REPO_ROOT> \
--xcat-source <XCAT_SOURCE> \
--skip-build
Output Artifacts and Paths
For each run:
- Binary repo path:
<REPO_ROOT>/build-output/mockbuild-all/<RUN_ID>/repo/<ARCH>/
- SRPM repo path:
<REPO_ROOT>/build-output/mockbuild-all/<RUN_ID>/repo-src/
- Run summary:
<REPO_ROOT>/build-output/mockbuild-all/<RUN_ID>/summary.txt
- Binary repo tarball:
<REPO_ROOT>/build-output/mockbuild-all/mockbuild-all-<TARGET>-<RUN_ID>.tar.gz
- SRPM repo tarball:
<REPO_ROOT>/build-output/mockbuild-all/mockbuild-all-<TARGET>-<RUN_ID>-srpm.tar.gz
Architecture Requirements
mockbuild-all.pl derives architecture from the build host:
<ARCH> = $(uname -m)
Because of this, to build ppc64le artifacts you must run mockbuild-all.pl on a Power host where:
uname -mreturnsppc64le- a matching mock config exists for
<TARGET>(for examplerocky+epel-10-ppc64le)
In short: build ppc64le packages on a Power machine.
Validation Commands
cat <REPO_ROOT>/build-output/mockbuild-all/<RUN_ID>/summary.txt
ls -1 <REPO_ROOT>/build-output/mockbuild-all/<RUN_ID>/repo/<ARCH>/
ls -1 <REPO_ROOT>/build-output/mockbuild-all/<RUN_ID>/repo-src/
ls -1 <REPO_ROOT>/build-output/mockbuild-all/mockbuild-all-<TARGET>-<RUN_ID>.tar.gz
ls -1 <REPO_ROOT>/build-output/mockbuild-all/mockbuild-all-<TARGET>-<RUN_ID>-srpm.tar.gz
find <REPO_ROOT>/build-output/mockbuild-all/<RUN_ID>/build-logs -type f | sort
Common Issues
Missing xCAT build script: .../buildrpms.pl- Ensure
<XCAT_SOURCE>points to a valid xCAT source tree.
- Ensure
WARN: missing dep builder script, skipping: ...- Sync the repository; one or more package build scripts are missing.
mock target not found- Validate with
mock -r <TARGET> --print-root-pathand install the required mock config packages.
- Validate with