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

102 Commits

Author SHA1 Message Date
Vinícius Ferrão 0c9860fcfa fix(netboot): build and pack openEuler riscv64 diskless images
genimage and packimage admit openEuler images only for x86_64 and
ppc64le. For the riscv64 osimage that copycds creates, genimage stops with
"Unsupported openEuler release or architecture" and packimage with
"Unsupported openEuler image release or architecture".

Admit riscv64 in both commands.
2026-11-02 17:48:53 -03:00
Daniel Hilst cf170b36c4 Merge pull request #7942 from VersatusHPC/feat/rootimg-sha256
feat(netboot): check the root image against its SHA-256 checksum
2026-10-16 18:18:10 -03:00
Vinícius Ferrão 6660ca7a06 feat(packimage): publish the SHA-256 checksum of the root image archive
A node could not tell a damaged root image download from a good one,
because packimage published nothing to check it against.

packimage now writes rootimg.<suffix>.sha256 in sha256sum format next to
the archive. It builds the checksum in the temporary directory with the
archive, and publish_rootimg publishes both under the publication lock.
A pack that fails before publication keeps the previous archive and
checksum. When packimage removes the other formats, it keeps their
checksums, so a node that already downloads one can still check it.

Until the archive is replaced, the checksum file lists the new and the
previous archive. publish_rootimg computes the line of a previous
archive that has none. The published archive then matches a line of it
at each step, also when the publisher is killed. The previous metainfo
leaves first, so it never describes the new archive. publish_rootimg
keeps a link to the previous archive, or a copy with its mode without
hard links. When a step fails, the previous archive, checksum and
metainfo stay or come back. When it can keep the previous archive in
neither way, it publishes nothing. When it cannot put the previous
archive back, it keeps it in a .rootimg-previous-* directory and names
that directory in the error.

The new site.rootimgchecksum attribute is yes by default, and the
rootimgchecksum attribute of an osimage overrides it. They tell nodeset
whether nodes check the archive. packimage publishes the checksum
whatever their value, because nodes with older boot entries can still
check.
2026-10-13 15:29:20 -03:00
Vinícius Ferrão bc69dedf64 refactor(packimage): move root image staging and publication to SvrUtils
imgimport must replace a root image the way packimage does. Move the
host-scoped temporary directory and the locked publication from
packimage to xCAT::SvrUtils, so both commands can share them. The
publication still covers the archive and its metainfo. The behavior of
packimage does not change.
2026-10-13 12:00:11 -03:00
Vinícius Ferrão 1a71d9d33c fix(packimage): refuse an image directory that the shell would split
packimage passes the image directory to shell commands without quotes,
such as the rm -rf of the xcatpost directory. It finds its abandoned
stages with glob. For an image directory such as
"/install/custom images/node", the shell and glob split the path at the
space, so packimage removed /install/custom with the images in it.

packimage now refuses an image directory whose path has a space or a
shell character, before it runs any command.
2026-10-13 11:38:51 -03:00
Vinícius Ferrão 49ffae9862 fix(packimage): replace the root image archive only after a complete pack
packimage deleted every rootimg.* file before it packed, and wrote the new
cpio or tar archive under its final name with mode 0600. Until the pack
finished, a node that booted got HTTP 403 for its image. When the pack
failed, the image was gone or left truncated, and no node could boot until
a later pack succeeded.

Build every archive in a temporary directory inside the image directory,
and rename the archive over the final name only after the pack succeeds,
as the openEuler path already did with a temporary file. With --tracker,
ctorrent builds the metainfo in the same directory, from the new archive
under its final name. The previous metainfo is removed before the archive
is renamed, and the new metainfo is renamed after it, so no failure
leaves a metainfo that describes another archive. The other rootimg.*
files are removed after the rename. The next pack on the same host
removes a temporary directory that an interrupted pack left. Image locks
are per host, so temporary directories of other hosts that share the
directory stay.

A pack now also fails when find cannot list the image or cpio cannot read
a file, as on the openEuler path. Before, only the compressor status
counted, and such a pack published an incomplete archive.

Every failure after packimage switches a StateLite tree to stateless files
now switches it back. That includes a failure to create the temporary
directory or the squashfs staging directory, which File::Temp reports
with die. packimage records each file that it moves and checks each move. When
a file cannot be moved back, the original stays in .statebackup,
packimage reports it, and the next pack refuses to run until the files
are restored. The new archive replaces the previous one only after the
StateLite files are back. Before, a failed pack left the tree switched,
and a retry overwrote the saved StateLite files.

The image lock is per host, and service nodes mount a shared image
directory without NFS locks. So a pack also holds the directory
.packimage-publish while it replaces the archive and removes the other
formats. mkdir is atomic for every host, also on NFS without locks. When
the lock is older than 60 seconds, or stays held for 60 seconds, the pack
fails, names the holder, and keeps the previous archive. packimage does
not take the lock over, because its holder can still be running.

A ctorrent failure now fails the pack, and the previous archive and
metainfo stay. Before, a failed ctorrent left a partial metainfo, and
nodeset pointed nodes at it.
2026-10-12 12:15:51 -03:00
Vinícius Ferrão c0e66721d7 feat(openeuler): provision installed and diskless images
Add native compute and service profiles, installer dispatch and partition
defaults. Use strict DNF image creation. Check stateless boot-file and
archive publication. Preserve native image customizations on reimport.
Restore missing image records during reimport.
2026-09-15 01:12:21 -03:00
Vinícius Ferrão 2a3af4c34a fix(packimage): report the missing image name instead of a rejected option
packimage rejects -o, -p and -a before anything else runs, which leaves three
things below it that cannot be reached. The branch handling a missing image
name asks for -o and reports "Please specify a os version with the -o flag",
so passing the option is rejected and omitting it is reported as the option
being absent. The check for those options alongside an image name re-tests a
condition already rejected, and the block that built an image from them can no
longer be entered.

Report the missing image name instead, and drop the parts that cannot run.
Passing -o, -p or -a is rejected exactly as before, and packing a named image
is unchanged.
2026-08-08 01:08:52 -03:00
Vinícius Ferrão 5aa1cda179 feat: add openSUSE Leap 15 provisioning support 2026-05-02 16:57:46 -03:00
Markus Hilger 2643c1edd6 Remove useless executable bit 2024-05-07 16:19:25 +02:00
Mark Gurevich 92e12302b4 Improve packimage time zone handling with no exlist 2023-01-30 11:49:52 -05:00
besawn de7ba39286 Modifed packimage timezone logic to preserve two levels of links 2021-12-08 09:32:41 -05:00
besawn 7e6303a85b Print warning from packimage when timezone setup fails 2021-12-01 09:14:37 -05:00
besawn d86b454baf Print informational message from packimage when site table timezone is not set 2021-11-30 13:13:02 -05:00
besawn 85a5df22f5 Modified packimage to always include the local zoneinfo time zone file 2021-11-30 12:44:58 -05:00
Mark Gurevich 16ea67622b Make /etc/localtime a link 2021-09-13 14:27:54 -04:00
cxhong 1e62c7f2ec Use xcat runcmd instead of system() call for mksquash command 2020-07-22 18:15:10 -04:00
Mark Gurevich be359b1899 Testcase and packimage fixes for squashfs 2020-04-30 13:58:35 -04:00
Mark Gurevich 53d3d915d1 Make sure squashfs installed on SLES for squashfs testcase 2020-04-29 14:17:51 -04:00
Mark Gurevich 72cf0e15d3 Fix flags for squashfs for centos 2020-04-21 09:37:23 -04:00
GONG Jie 6a60514ce2 Remove trailing spaces in file xCAT-server/lib/xcat/plugins/packimage.pm 2017-12-31 23:59:59 +00:00
cxhong dcaa21aa13 Support multiple syncfile list for packimage process (#5524) 2018-08-17 11:01:55 +08:00
yangsong c49e41da99 support environment variables in osimage customized files (#5281)
* * osimage table schema change: add a "environvar" col in osimage table to hold environment variables used in osimage customized files
* osimage object schema change: add a environvar attribute, which refers to  osimage.environvar
* the environment variables specified in "environvar" attribute will be exported during invocation of postinstall scripts in genimage

* support variables in synclists

* support environment variables in genimage,mkinstall,getpostscript

* support environment variables for xdcp -i -F in packimage
2018-06-15 14:51:41 +08:00
Bin Xu 18c5afc0f4 support secure root method (#5286)
- support xcat_secure_pw:<user> API in credential plugin
 - for diskless, if enabled secure root, packimage will not write root password into image
 - for stateful, if enabled secure root, nodeset will not write root password into config file
 - and 'remoteshell' will update shadow file accordingly
2018-06-15 10:28:51 +08:00
Bin Xu 7a69c9b779 using --nosyncfiles to bypass syncing files to root image directory (#5229) 2018-05-22 12:47:37 +08:00
yangsbj dad1f72fdc fix issue Non-root user can not run ping on ubuntu 14.4.4 diskless #5227 2018-05-21 00:51:32 -04:00
yangsong 668a00bd71 Revert "[CUSTOMER] Ping not working for non root users on Diskless PowerKVM guests (rhels7.2) #922: use tar as the default archive method instead of cpio (#5187)" (#5221)
This reverts commit 2bf5dc57f9.
2018-05-17 11:20:55 +08:00
yangsong 2bf5dc57f9 [CUSTOMER] Ping not working for non root users on Diskless PowerKVM guests (rhels7.2) #922: use tar as the default archive method instead of cpio (#5187) 2018-05-10 16:26:42 +08:00
immarvin 873b58ee7a remove the /etc/localtime before copy timezone file 2017-12-14 00:57:10 -05:00
Yuan Bai f61a794da8 enhance packimage (#3919) 2017-09-14 17:34:24 +08:00
immarvin 8686edb86d fix issue [CUSTOMER] Stale rootimg.gz file left in the rootimg dir caused node boot failed. #2225 2016-11-29 21:54:18 -05:00
yangsong 223b3305ef Merge pull request #2168 from chenglch/cryptmethod
Load the cryptmethod in the passwd table to generate the password
2016-11-22 00:14:17 -06:00
chenglch 69fff6a31e Load the cryptmethod in the passwd table to generate the password
sha256 and sha512 crypt methods are supported from glibc 2.7 version.
This patch enable the crypt feature on linux system and encrypt the
password with sha256 by default.

implement: #1890
2016-11-22 13:10:41 +08:00
immarvin 907c4971a9 fix issue [CUSTOMER] the old diskless image built by xCAT can not be used after xcat 2.12.2 #2130 2016-11-17 03:31:30 -05:00
immarvin 1ebdb5d96c add lock in rh/genimage to avoid multiple genimage processes on same rootimg directory;add guard code before umount/remove mount points under rootimg directory 2016-11-03 03:32:12 -04:00
penguhyang 6d0bf02cfa fix return code is 0 when there are errors (#1763) 2016-08-25 14:48:23 +08:00
penguhyang fd747d5fc6 give warnings and return when use -o -p -a for packimage (#1757) 2016-08-25 11:10:27 +08:00
penguhyang c93b215c2c fix sles11.4 packimage return error when use tar compress method (#1743) 2016-08-24 12:13:36 +08:00
penguhyang c4a536a18f use the same way to promote error msg (#1749) 2016-08-22 00:39:09 -05:00
penguhyang d4a397adce support tar for redhat6.8 2016-08-15 02:40:23 -04:00
immarvin be77e5f43f fix issue [DEV] it is ambiguous to determine which compressed rootimg to use among rootimg.tar.gz,rootimg.cpio.gz,rootimg.tar.xz... #1695; update the manpage and usage info of packimage 2016-08-13 02:53:05 -04:00
immarvin e1775355f5 refine the tar options 2016-08-12 21:11:48 -04:00
penguhyang d44176f1d1 update code of packimage (#1685) 2016-08-12 01:46:52 -05:00
penguhyang 79426ad21e add new option to indicate compress method (#1669) 2016-08-11 03:09:43 -05:00
penguhyang 180c3fc0c7 add more output msg for packimage (#1622) 2016-08-03 13:59:07 +08:00
penguhyang 5cd203cdf5 enhance packimage -m txc (#1602) 2016-08-02 16:45:31 +08:00
Mark Gurevich db9a71750e Fix sytax errors reported by perltidy 2016-07-25 08:56:18 -04:00
Mark Gurevich 0a3fbd8d51 perltidy all perl files 2016-07-20 11:40:27 -04:00
penguhyang 5d46d48f6a Fix issue of packimage -m txc (#1554)
* redefine the code to make distint

* fix issue of packimage -m txc
2016-07-20 07:06:33 -05:00
Casandra Qiu 3b9eddc6d2 Add uuid into /opt/xcat/xcatinfo 2016-06-13 14:40:50 -04:00