Commit Graph

1762 Commits

Author SHA1 Message Date
Marcus Schäfer
69dafcdd3c
Fixed access issue to etc/kernel for sdboot
In case of an overlayroot setup we have to make sure
that etc/kernel is writable. This is done by a bind
mount of the ESP
2025-05-08 22:07:04 +02:00
Marcus Schäfer
bea1223d50
Allow initrd updates on read-only devices
Move initrd to ESP for boot loaders that reads data
from there
2025-05-08 22:07:04 +02:00
Marcus Schäfer
4238293513
Switch to dracut-kiwi-verity
So far no luck with the systemd verity generator. This
commit adds the parsing of /etc/veritytab in the existing
kiwi-verity dracut module and uses it in the overlayroot
integration test.
2025-05-08 22:07:04 +02:00
Marcus Schäfer
1753b85e12
Add support for selecting the overlay read-only fs
Add new overlayroot_readonly_filesystem attribute which allows
to select for either squashfs or erofs as the read-only filesystem
in an OEM overlay disk setup.
2025-05-08 22:07:04 +02:00
Marcus Schäfer
d5a4715a71
Fixed root setup for verity overlay disk
When building an image with overlayroot set to true and
activated verity data, the root= parameter must be
set to root=overlay:MAPPER=verityroot instead of the standard
overlay:PARTUUID mapping.
2025-05-08 22:07:04 +02:00
Marcus Schäfer
a9ce5324f9
Make sure the verity record has a superblock 2025-05-08 22:07:04 +02:00
Marcus Schäfer
d086c50adf
Drop distro specific runtime check
The check_efi_mode_for_disk_overlay_correctly_setup exists because
shim-install does not work on read-only devices. However, shim-install
is a SUSE only tool that runs a SUSE specific secure boot setup.
For other secure boot processes this runtime check is not useful.
As runtime checks aims to be generally useful, this one gets
dropped.
2025-05-08 22:07:04 +02:00
Marcus Schäfer
f67a728147
Merge pull request #2691 from glaubitz/loongarch64
Add support for loongarch64
2025-05-06 16:12:31 +02:00
Marcus Schäfer
e9c1568904
Fix root clone size setup
If the root_clone attribute is specified without providing a
fixed size for the system, kiwi estimates the size needed for
the root part and assigns the rest to the clone. This leads to
different partition sizes for the root clones. As per definition
of a clone the expectation is that the size is the same, this
commit changes the behavior such that the calculated size for
the system is applied to the origin root and all its clones.
As a consequence this can leave unpartitioned space free in
the image. This Fixes #2463
2025-05-06 09:25:06 +02:00
Marcus Schäfer
43ea22c9fd
Fix reencryption master key passphrase
Make sure to use the correct passphrase for the master
key such that it can be decrypted with the same credentials
as before. The credentials reset is a subsequent task
after reencryption.
2025-05-02 21:28:53 +02:00
Neal Gompa (ニール・ゴンパ)
34130b8ffa
Merge pull request #2797 from OSInside/support_gpt_on_s390
Add support for GPT targettype on s390
2025-04-30 06:52:10 -04:00
Marcus Schäfer
2c9409f765
Fixed default bls value setup
Fixed get_build_type_bootloader_bls behavior in case the bls
attribute is not set. In this case get_bls() returns a None value
which was returned. However in this case the attribute value
should not be taken into account and the method defined default
value for bls should be returned. This Fixes #2542
2025-04-30 12:47:59 +02:00
Marcus Schäfer
2111bb567d
Add support for GPT targettype on s390
Allow to build s390 images using GPT instead of the old DOS
partition table. zipl has added support to read from GPT.
This Fixes #2694
2025-04-30 12:34:27 +02:00
Marcus Schäfer
7bf437956d
Add --no-compress option to bundler
Allow to skip the compression for bundle files marked
to become compressed. This Fixes #2736
2025-04-30 12:12:51 +02:00
Neal Gompa (ニール・ゴンパ)
5f368bd8ea
Merge pull request #2792 from OSInside/fix_use_disk_password_for_random_keys
Fix setup of use_disk_password for random secret
2025-04-28 05:45:08 -04:00
Marcus Schäfer
944998b239
Fix setup of use_disk_password for random secret
When using luks="random" in combination with use_disk_password="true"
the resulting cryptomount call in grub is wrong. This commit fixes it
2025-04-28 10:04:08 +02:00
Neal Gompa
76dedc5532 Drop copying GRUB2 modules to /boot with Secure Boot UEFI images
Copying the modules creates a situation where future updates
applied to a running system can cause GRUB to crash due to mixed
modules and GRUB EFI binaries.

It is not needed anyway since GRUB EFI binaries for Secure Boot have
all modules compiled into the binaries.

Fixes: https://github.com/OSInside/kiwi/issues/2790
2025-04-27 17:14:23 -04:00
Marcus Schäfer
d4324cebff
Fix overlayroot builds for EFI path
make sure to keep boot/efi mountpoint directories
in the read-only area as they can't be created later
2025-04-27 19:14:19 +02:00
Marcus Schäfer
82622eff68
Fixed mount of image system for volume managers
The ImageSystem.mount() method implemented its own handling
for mounting the volumes of a volume manager based system.
First and foremost this duplicates code that already exists
in the respective VolumeManager implementation and second
the code behaved wrong in case of btrfs when there is no
default subvolume configured
2025-04-27 16:46:14 +02:00
Marcus Schäfer
37dc3d85ff
Handle grub fix functions less strict
If called on full read-only systems, log the information
that the files can't be modified but do not fail. On
such systems the expectation is that no fix code must
be applied and as such the fix function can be considered
an optional step.
2025-04-27 16:36:56 +02:00
Marcus Schäfer
f80b9df5a1
Fixed root setup for encrypted overlay disk
When building an image with overlayroot set to true and
activated luks encryption, the root= parameter must be
set to root=overlay:MAPPER=luks instead of the standard
overlay:PARTUUID mapping. This Fixes #2776
2025-04-25 14:22:41 +02:00
Marcus Schäfer
cf5f01a8be
Update LOADER_TYPE setup for grub
If the bootloader attribute: bls is set to true, make sure
the LOADER_TYPE changes to grub2-bls. This is related to
Issue #2773
2025-04-24 12:50:11 +02:00
Marcus Schäfer
67ab6b3a2d
Fix key slot selection for luks reencrypt
Depending on the type setup for a luks encrypted image, there
might be one or two key slots available. When kiwi is requested
to perform the reencryption process at least one key-slot and
the proper keyfile/passphrase must be provided. This commit
stores the information about the key-slot number for which
a decryption information exists in the initrd. In addition to
the code change also the corresponding integration test image
was updated.
2025-04-22 14:53:39 +02:00
Neal Gompa (ニール・ゴンパ)
bd6d1b471d
Merge pull request #2778 from OSInside/efifatfileimage-filter
Add support for filtering out files from the ESP image for GRUB
2025-04-16 16:04:01 -04:00
Neal Gompa
22190cfb74 Add support for filtering out files from the ESP image for GRUB
Prior to this change, KIWI blindly synced the ESP directory into the
embedded ESP image. Depending on the distribution and packages included
for the created image, this can have undesirable side-effects.

For image builds that need some more fine-grained control over the
creation of the embedded ESP image (particularly for ISO images),
this change introduces the ability to inject an exclusion list
similar to what is used to filter out files for the root filesystem.

Fixes: https://github.com/OSInside/kiwi/issues/2008
Fixes: https://github.com/OSInside/kiwi/issues/2777
2025-04-16 15:59:30 -04:00
Neal Gompa
cdd0b28531 Fix bundle extension for container types
When building result files that use container types like oci or docker,
kiwi creates them as archive tarballs with an extension prefix to
indicate the special nature of the archive. However, the bundler
code does not retain the prefix, which results in the wrong file
extension for these archives.

This change adds exceptions for these types and refactors the
exception handling to unify it with the Vagrant image filename
handling, which operates similarly.

Fixes: https://github.com/OSInside/kiwi/issues/2628
2025-04-13 12:12:22 -04:00
Marcus Schäfer
313f296587
Added <oem-ramdisk-size> element
So far it was only possible to specify the size of the ramdisk
via the kernel commandline option: ramdisk_size. In a remote
deployment it was therefore required to carry this size as a
mandatory information to the deployment server. With this commit
we allow to specify the size for the ramdisk to be configured as
part of the image configuration which makes this information
also available inside of the initrd. If provided the ramdisk_size
kernel commandline option still takes precedence over the
<oem-ramdisk-size> setting to avoid any behavior change and to
still allow dynamic overrides of the ramdisk size.
2025-04-09 18:17:32 +02:00
Marcus Schäfer
9b6c121957
reinstall bootstrap packs in image phase for apt
Due to the special bootstrap process, the packages unpacked
during bootstrap are not properly listed in the apt index.
Therefore the bootstrap packages are added to the install
phase which causes an install of this packages again to
fix the apt index and provide a consistent system from
an apt perspective. This Fixes #2768
2025-04-08 20:04:58 +02:00
Marcus Schäfer
5018b58e86
Add support for Alpine
Add apk repository and package manager support and provide
an integration test build for the Alpine distribution
2025-04-01 10:44:41 +02:00
Marcus Schäfer
48d3ccfd05
Support sourcetype setting on the commandline
Allow to specifiy the sourcetype(metalink|baseurl|mirrorlist)
also on the commandline via --set-repo/--add-repo options. So
far this was only possible as part of the kiwi description file
2025-03-25 11:35:09 +01:00
Marcus Schäfer
265b0d8e76 Allow stderr data in CommandProcess
Enhance poll_show_progress() method to allow polling on
stderr data too. The new parameter with_stderr is used
together with the dnf5 package manager. dnf5 has changed
in a way that a lot of useful information during the
install of packages is printed to stderr. From my perspective
a clear regression to former behavior but we can fix this
in kiwi to poll on both channels. This Fixes #2748
2025-03-24 14:29:51 -04:00
Marcus Schäfer
8223834da8
Lookup CHRP loader instead of using a static name
On ppc the CHRP loader name can vary between distributions.
This commit adds a search method to lookup different ELF
loader names. In addition an integration test image for
Fedora was added. This Fixes #2741
2025-02-28 11:52:08 +01:00
Marcus Schäfer
786faf44f6
Fix profile env variable name regression
In the effort of adapting to the latest snapper in Issue #2697
we overlooked the after effect of a different variable name
in the profile environment with regards to $kiwi_btrfs_root_is_snapshot
and $kiwi_btrfs_root_is_snapper_snapshot. Image builds that
references the former variable name would be broken by the change.
This commit makes sure no regression is introduced by providing
both variants. This Fixes bsc#1237772
2025-02-26 16:17:40 +01:00
Marcus Schäfer
d0e58643c5
Fix grub mkimage call for the ppc platform
The list of modules used to create a grub platform image for
ppc was the same list as used for the x86 bios platform.
This commit fixes this and also cleans up the inconsistency
and misleading names used for creating platform specific
output. This Fixes #2738
2025-02-25 11:51:49 +01:00
Neal Gompa (ニール・ゴンパ)
30356e2317
Merge pull request #2728 from OSInside/parallel_setfiles
Allow to run setfiles multi threaded
2025-01-30 16:56:49 -05:00
Marcus Schäfer
92cd8fc793
Allow to run setfiles multi threaded
Use option -T0 for newer setfiles version.
This Fixes #2719
2025-01-30 22:50:28 +01:00
Neal Gompa (ニール・ゴンパ)
af9272fe18
Merge pull request #2725 from OSInside/fix_loosing_label_of_grub2-install
Make sure copy actions does not drop context
2025-01-30 16:48:22 -05:00
Marcus Schäfer
5e8fd3e3b2
Make sure copy actions does not drop context
Use shutil.copy2 to copy files preserving their
attributes in the grub BootLoader space.
This Fixes #2709
2025-01-30 22:10:39 +01:00
Marcus Schäfer
60becf931f
Improve unit test for archive target_dir
Add a test case with absolute path in the target_dir
to make sure we never unpack the archive to the host
system. The actual issue was resolved together with
the implementation in #1953 and commit
78238a993c
This Fixes #2701
2025-01-30 21:26:00 +01:00
Marcus Schäfer
0eb2d2713e
Added disk validation for duplicate installs
Installing the same image to different storage disks on the
same machine creates device conflicts with unexpected side
effects. This commit adds a validation based on the PTUUID
of the disk image to check if another device on the system
has the same ID and if yes, does not allow to install the
image again including a message which device takes the same
identifier. This references bsc#1228741
2025-01-20 18:13:02 +01:00
Marcus Schäfer
5c217afa00
Add support for reading optional pkgmgr env file
If there is a file .kiwi.package_manager.env in the root of
the image tree it will be read and put into the caller environment for
the selected package and repository manager. There are features
in e.g zypper which can only be used via env variables.
This Fixes bsc#1235448
2025-01-13 15:53:54 +01:00
Marcus Schäfer
927b24f598
Auto convert unit test XML data to schema v8.3 2025-01-13 10:24:04 +01:00
Marcus Schäfer
2edcfed120
Rename btrfs_root_is_snapshot
Rename btrfs_root_is_snapshot to btrfs_root_is_snapper_snapshot.
This happens in preparation for the changes suggested in #2697
where we want to get rid of snapper specific btrfs code which
will be available in snapper natively soon. To make sure a btrfs
layout specific to snapper(and SUSE), the implicitly used attribute
named btrfs_root_is_snapshot now becomes explicit and its new
name will indicate that snapper sits behind it. Along with the
rename a XSLT stylesheet to automatically convert the old name
into the new name for schema v8.3 will be performed.
2025-01-13 10:22:55 +01:00
Marcus Schäfer
2252087593
Added LUKS reencryption support
Added rd.kiwi.oem.luks.reencrypt boot option consumed by the
kiwi-repart dracut module. For OEM LUKS2 encrypted disk images.
If set, reencrypts the disk prior an eventual resize and therefore
creates a new key pool and master key. The reencryption is advisable
if the image binary is not protected. With access to the image
binary it's possible to extract the luks header which then allows to
decrypt the data unless it was reencrypted. The reencryption process
only runs if the checksum of the luks header still matches the one
from the original disk image. Be aware that the reencryption will
ask for the passphrase if the image has been built with an initial
luks passphrase.
2025-01-10 15:12:24 +01:00
Marcus Schäfer
d2062872e0
Fix genprotimg for s390 builds
A recent change on genprotimg now forbids to use --cert in
combination with --no-verify, even though this was allowed
before.
2024-12-31 13:02:55 +01:00
Marcus Schäfer
d4d39e481a
Drop insecure and unsupported md5 digest
Decommission the Checksum.md5() method and move all places
in code to sha256(). The md5 digest is considered insecure
and has also been removed from hashlib as a supported digest.
This Fixes #2696
2024-12-19 11:26:07 +01:00
Marcus Schäfer
9c7fbe0774
Changed systemfiles provider
Instead of providing a static list of filenames, provide a list
of package names. It is expected that the pilot of flake-pilot
resolves this list against the local package database to build
up the filelist for provisioning
2024-12-16 11:36:07 +01:00
Neal Gompa (ニール・ゴンパ)
8b14c13806
Merge pull request #2695 from AdamWill/live-gpt-test
xorriso: respect efiparttable and gpt_hybrid_mbr
2024-12-13 20:30:00 +01:00
Adam Williamson
75c9939f84 xorriso: respect efiparttable and gpt_hybrid_mbr
This should make the xorriso-based ISO build path respect the
'efiparttable' and 'gpt_hybrid_mbr' settings when building a
UEFI-compatible image, making it write a GPT disk label by default
instead of an MBR (msdos) one. If it's building an image that is not
UEFI-compatible it will always write an MBR label, regardless of
this setting.

If 'gpt_hybrid_mbr' is set, xorriso will write an Ubuntu-style
MBR/GPT hybrid partition table, where the MBR partition table
includes a partition with type 00 and the bootable flag, as well
as the partition with type ee required by the UEFI spec. This
mildly violates the UEFI spec but may make the image bootable on
native BIOS or CSM firmwares which refuse to boot from a disk with
no partition marked 'bootable' in the MBR. If 'gpt_hybrid_mbr' is
not set, xorriso will write a strictly UEFI-spec compliant label,
with just the 'protective MBR' required by the UEFI spec (no
bootable partition) and the correct GPT partition table. Note
this is somewhat different from what gpt_hybrid_mbr does for
disk images.

Also, we now pass -compliance no_emul_toc when building ISOs, as
recommended by upstream in
https://lists.gnu.org/archive/html/bug-xorriso/2024-11/msg00012.html
This tool is generally always going to be building ISOs intended
for write-once use, not multi-session use (and which are rarely,
these days, written to physical discs at all anyway).

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2024-12-13 11:13:27 -08:00
Marcus Schäfer
b1da972438
Update system files setup for containers
The attribute provide_system_files creates a meta file in the
root tree named 'systemfiles'. The contents of this file were
produced by just a dump of the package database so far. For
a more generic use of this data some adaptions were needed.
First we allow to skip packages matching a pattern from being
part of the system files. Next we do not put ghost and doc
files into account. And last we handle library files in a different
file named 'systemfiles.libs' where we do not add symlink targets
if the target path is also part of the package. The consumer
of this information is flake-pilot which syncs that library system
files from the host via --copy-links. This allows a more generic
use with regards to versioned libraries e.g. libc
2024-12-13 10:44:39 +01:00