diff --git a/perl-xCAT/xCAT/Schema.pm b/perl-xCAT/xCAT/Schema.pm index e1317827d..50dde765c 100644 --- a/perl-xCAT/xCAT/Schema.pm +++ b/perl-xCAT/xCAT/Schema.pm @@ -751,7 +751,7 @@ passed as argument rather than by table value', descriptions => { node => 'The node name or group name.', os => 'The operating system deployed on this node. Valid values: AIX, rhels*,rhelc*, rhas*,centos*, alma*, rocky*,SL*, fedora*, sles* (where * is the version #). As a special case, if this is set to "boottarget", then it will use the initrd/kernel/parameters specified in the row in the boottarget table in which boottarget.bprofile equals nodetype.profile.', - arch => 'The hardware architecture of this node. Valid values: x86_64, ppc64, x86, ia64, aarch64, riscv64.', + arch => 'The hardware architecture of this node. Valid values: x86_64, ppc64, x86, ia64, aarch64, riscv64, s390x.', profile => 'The string to use to locate a kickstart or autoyast template to use for OS deployment of this node. If the provmethod attribute is set to an osimage name, that takes precedence, and profile need not be defined. Otherwise, the os, profile, and arch are used to search for the files in /install/custom first, and then in /opt/xcat/share/xcat.', provmethod => 'The provisioning method for node deployment. The valid values are install, netboot, statelite or an os image name from the osimage table. If an image name is specified, the osimage definition stored in the osimage table and the linuximage table (for Linux) or nimimage table (for AIX) are used to locate the files for templates, pkglists, syncfiles, etc. On Linux, if install, netboot or statelite is specified, the os, profile, and arch are used to search for the files in /install/custom first, and then in /opt/xcat/share/xcat.', supportedarchs => 'Comma delimited list of architectures this node can execute.', @@ -795,7 +795,7 @@ passed as argument rather than by table value', profile => 'The node usage category. For example compute, service.', osname => 'Operating system name- AIX or Linux.', osvers => 'The Linux operating system deployed on this node. Valid values: rhels*,rhelc*, rhas*,centos*,alma*, rocky*,SL*, fedora*, sles* (where * is the version #).', - osarch => 'The hardware architecture of this node. For netboot/statelite images, QEMU emulation for non-native architectures is used if qemu-user-static is installed and configured via systemd-binfmt. Valid values: x86_64, ppc64, x86, ia64, aarch64, riscv64.', + osarch => 'The hardware architecture of this node. For netboot/statelite images, QEMU emulation for non-native architectures is used if qemu-user-static is installed and configured via systemd-binfmt. Valid values: x86_64, ppc64, x86, ia64, aarch64, riscv64, s390x.', synclists => 'The fully qualified name of a file containing a list of files to synchronize on the nodes. Can be a comma separated list of multiple synclist files. The synclist generated by PCM named /install/osimages//synclist.cfm is reserved for use only by PCM and should not be edited by the admin.', postscripts => 'Comma separated list of scripts that should be run on this image after diskful installation or diskless boot. For installation of RedHat, CentOS, Fedora, the scripts will be run before the reboot. For installation of SLES, the scripts will be run after the reboot but before the init.d process. For diskless deployment, the scripts will be run at the init.d time, and xCAT will automatically add the list of scripts from the postbootscripts attribute to run after postscripts list. For installation of AIX, the scripts will run after the reboot and acts the same as the postbootscripts attribute. For AIX, use the postbootscripts attribute. See the site table runbootscripts attribute.', postbootscripts => 'Comma separated list of scripts that should be run on this after diskful installation or diskless boot. On AIX these scripts are run during the processing of /etc/inittab. On Linux they are run at the init.d time. xCAT automatically adds the scripts in the xcatdefaults.postbootscripts attribute to run first in the list. See the site table runbootscripts attribute.', diff --git a/xCAT-genesis-builder/oe/meta-xcat-genesis/recipes-core/xcat-genesis-console/files/xcat-genesis-console/src/state.c b/xCAT-genesis-builder/oe/meta-xcat-genesis/recipes-core/xcat-genesis-console/files/xcat-genesis-console/src/state.c index d9a8cdcd3..776cb6296 100644 --- a/xCAT-genesis-builder/oe/meta-xcat-genesis/recipes-core/xcat-genesis-console/files/xcat-genesis-console/src/state.c +++ b/xCAT-genesis-builder/oe/meta-xcat-genesis/recipes-core/xcat-genesis-console/files/xcat-genesis-console/src/state.c @@ -302,11 +302,9 @@ void xcat_load_console_state(struct console_state *state) { char path[VALUE_SIZE * 2]; char release_name[64] = "xCAT Genesis"; char release_version[32] = ""; -#ifdef XCAT_CONSOLE_TEST - const char *test_architecture = getenv("XCAT_TEST_ARCH"); -#endif bool xcat_configured; bool interface_selected; + bool s390_system; bool s390_ccw_boot; memset(state, 0, sizeof(*state)); @@ -347,13 +345,13 @@ void xcat_load_console_state(struct console_state *state) { xcat_set_text(state->architecture, sizeof(state->architecture), "unknown"); xcat_set_text(state->kernel, sizeof(state->kernel), "unknown"); } -#ifdef XCAT_CONSOLE_TEST - if (test_architecture != NULL) - xcat_set_text(state->architecture, sizeof(state->architecture), "%s", - test_architecture); -#endif + snprintf(path, sizeof(path), "%s/sysinfo", proc_root); + s390_system = strcmp(state->architecture, "s390x") == 0 || + access(path, F_OK) == 0; + if (s390_system) + xcat_set_text(state->architecture, sizeof(state->architecture), "s390x"); - s390_ccw_boot = strcmp(state->architecture, "s390x") == 0 && + s390_ccw_boot = s390_system && xcat_cmdline_value(cmdline_text, "xcat.bootloader", value, sizeof(value)) && strcmp(value, "s390-ccw") == 0; @@ -370,7 +368,7 @@ void xcat_load_console_state(struct console_state *state) { access(path, F_OK) == 0 ? "UEFI" : "Device Tree"); } else if (strncmp(state->architecture, "riscv", 5) == 0) { xcat_set_text(state->firmware, sizeof(state->firmware), "OpenSBI"); - } else if (strcmp(state->architecture, "s390x") == 0) { + } else if (s390_system) { xcat_set_text(state->firmware, sizeof(state->firmware), "%s", s390_ccw_boot ? "s390-ccw BIOS" : "not reported"); } else { @@ -394,7 +392,7 @@ void xcat_load_console_state(struct console_state *state) { xcat_set_text(state->serial, sizeof(state->serial), "not reported"); snprintf(path, sizeof(path), "%s/class/dmi/id/product_uuid", sys_root); xcat_read_line(path, state->uuid, sizeof(state->uuid)); - if (strcmp(state->architecture, "s390x") == 0) { + if (s390_system) { xcat_set_text(state->serial, sizeof(state->serial), "not reported"); set_s390_identity(proc_root, state); } diff --git a/xCAT-genesis-builder/oe/meta-xcat-genesis/recipes-xcat/xcat-genesis-discovery/files/genesis-discover b/xCAT-genesis-builder/oe/meta-xcat-genesis/recipes-xcat/xcat-genesis-discovery/files/genesis-discover index 8346b4c06..82526fe29 100755 --- a/xCAT-genesis-builder/oe/meta-xcat-genesis/recipes-xcat/xcat-genesis-discovery/files/genesis-discover +++ b/xCAT-genesis-builder/oe/meta-xcat-genesis/recipes-xcat/xcat-genesis-discovery/files/genesis-discover @@ -175,26 +175,19 @@ case "$system_vendor $product_name" in esac [[ -z $s390_virtual ]] || node_type=virtual -cpu_count=$(awk ' - /^processor([[:space:]]+[0-9]+)?[[:space:]]*:/ {processors++} - /^cpu[[:space:]]*:/ {cpus++} - END {print (processors > 0 ? processors : cpus + 0)}' \ - "$proc_root/cpuinfo" 2>/dev/null || printf '0') -cpu_type=$(awk -F ':' ' - /^model name[[:space:]]*:/ && model == "" { - sub(/^[[:space:]]+/, "", $2); model = $2 - } - /^cpu[[:space:]]*:/ && cpu == "" { - sub(/^[[:space:]]+/, "", $2); cpu = $2 - } - /^vendor_id[[:space:]]*:/ && vendor == "" { - sub(/^[[:space:]]+/, "", $2); vendor = $2 - } - END { - if (model != "") print model - else if (cpu != "") print cpu - else if (vendor != "") print vendor - }' "$proc_root/cpuinfo" 2>/dev/null || true) +if [[ $architecture == s390x ]]; then + cpu_count=$(awk '/^processor[[:space:]]+[0-9]+[[:space:]]*:/ {count++} END {print count + 0}' \ + "$proc_root/cpuinfo" 2>/dev/null || printf '0') + cpu_type=$(awk -F ':' \ + '/^vendor_id[[:space:]]*:/ {sub(/^[[:space:]]+/, "", $2); print $2; exit}' \ + "$proc_root/cpuinfo" 2>/dev/null || true) +else + cpu_count=$(awk '/^(processor|cpu)[[:space:]]*:/ {count++} END {print count + 0}' \ + "$proc_root/cpuinfo" 2>/dev/null || printf '0') + cpu_type=$(awk -F ':' \ + '/^(model name|cpu)[[:space:]]*:/ {sub(/^[[:space:]]+/, "", $2); print $2; exit}' \ + "$proc_root/cpuinfo" 2>/dev/null || true) +fi memory=$(awk '/^MemTotal:/ {printf "%.0fMB", $2 / 1024; exit}' \ "$proc_root/meminfo" 2>/dev/null || true) disk_size=$(lsblk -b -dn -o NAME,SIZE,TYPE 2>/dev/null \