2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-11-21 01:42:15 +00:00
Commit Graph

5 Commits

Author SHA1 Message Date
Daniel Hilst 6980a71de5 fix(xcat-core): Genesis node stops at "Getting initial certificate"
openssl req reads the config file at OPENSSLDIR/openssl.cnf and exits 1 when it is
absent. install() in xCAT-genesis-base/dracut_105/{ubuntu,el}/module-setup.sh runs
dracut_install openssl, which copies the program and its shared libraries and nothing
else. OPENSSLDIR is /usr/lib/ssl on Ubuntu and /etc/pki/tls on EL, so the one file
doxcat writes serves EL alone, and getcert loops on openssl req until it gives up.

Measured on an Ubuntu compute node: /usr/lib/ssl did not exist, the image carried
/etc/pki/tls/openssl.cnf, and the key verified "RSA key ok". Supplying a config turned
the same command into a 1602 byte certificate request.

Each module now installs the config file that its own openssl names, and the image
build stops when that file is absent. getcert reports what openssl printed beside the
key it used, and reads the file with bash builtins so it needs no external command.

Two mutations, each failing only the cases that name it: dropping the install call
fails both module cases and keeps the other four; restoring the old message fails the
message case alone.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-26 08:51:23 -03:00
Daniel Hilst 772f11c257 fix(xcat-core): the el10 Genesis image carries no openssl, so getcert never returns
A compute node that boots the legacy Genesis image built on el10 stops after
"Getting initial certificate --> <mn>:3001". /etc/xcat is empty, getdestiny never runs and
the node reports no destiny, so xcatd leaves nodelist.status at powering-on. On the node,
openssl reports "command not found" and the getcert process stays alive.

xCAT-genesis-base.spec never build-requires openssl. el8 and el9 hold /usr/bin/openssl in
the build root as a dependency of another package, and el10 does not, so dracut_install in
dracut_105/el/module-setup.sh installed nothing and reported nothing. getcert line 8 waits
for openssl with no bound, which turns the missing command into a wait instead of an error.

The spec now build-requires openssl on every release. verify-genesis-payload reads the
command names back from the dracut module with --commands-from and requires each one in the
payload, so the next name the build root does not supply fails the build. getcert reports a
missing openssl and stops, and bounds the wait for /etc/xcat/certkey.pem at 600 seconds,
which is far longer than the background 4096 bit key needs.

The spec read %{_target_cpu} after BuildArch: noarch, where rpm has already set it to
noarch, so the dmidecode and efibootmgr build-requires never applied and a sed deleted their
dracut_install line on every architecture. Every shipped image lacks both. The spec now
reads %{tarch}, and the dracut module installs whichever of the two the build root carries,
because ppc64le packages neither.

xCAT-test/unit/genesis_getcert_missing_openssl.t, genesis_payload_verification.t and
genesis_base_spec_buildrequires.t fail on the test commit before this one.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-04 23:50:47 -03:00
Vinícius Ferrão e239e04843 genesis-scripts: improve shell quoting and syntax hygiene
Replace backtick command substitutions with $(), quote variable
expansions to prevent word splitting, replace useless cat pipes with
redirections, use grep -q instead of redirecting to /dev/null, and use
bash parameter expansion for case conversion.

Based on the work from PR #6366, rebased and adapted to current master.
Shebangs already merged separately via df64bf8fe are excluded.

Co-Authored-By: Samveen <samveen@yahoo.com>
2026-05-07 18:17:00 -03:00
GONG Jie 642d9daa3d Remove trailing spaces in file xCAT-genesis-scripts/usr/bin/getcert 2017-12-31 23:59:59 +00:00
Samveen Gulati 63a3efe8bb move /*bin to /usr/ to fix path conflict of genesis base and scripts
RH7/Centos7 and recent versions of fedora relocate `/*bin/*` into `/usr/*bin/`. This causes
conflicts for upgrades against xCAT-genesis-scripts-* packages which expect the `/bin` a to be
a directory while `xCAT-genesis-base-*` packages provide a link. Relocating all files into `/usr`
fixes that conflict and allows a clean upgrade from all old versions.
2018-01-12 06:06:25 +00:00