Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overlay files deployed to root directory in completed image #2690

Open
c4t3l opened this issue Dec 2, 2024 · 3 comments
Open

Overlay files deployed to root directory in completed image #2690

c4t3l opened this issue Dec 2, 2024 · 3 comments

Comments

@c4t3l
Copy link

c4t3l commented Dec 2, 2024

Problem description

Named profile overlay directory is appearing within / of completed image artifact. My image description contains two profiles, Kitchen and Kitchen-Nightly. None of the files or directories appear in the expected locations. My image description directory layout looks like the following:

.
├── components
│   ├── boot.xml
│   └── users.xml
├── config.sh
├── config.xml
├── ABC-CentOS-Stream.kiwi -> config.xml
├── grub.cfg.iso-template
├── Kitchen
│   └── etc
│       ├── fstab.script
│       ├── sysconfig
│       │   └── kernel
│       └── yum.repos.d
│           └── abc-centos-stream-9.repo
├── Kitchen-Nightly
│   └── etc
│       ├── fstab.script
│       ├── sysconfig
│       │   └── kernel
│       └── yum.repos.d
│           └── abc-centos-stream-9-latest.repo
├── platforms
│   └── cloud.xml
└── repositories
    └── core.xml

The completed artifact image looks like this:

[root@default-c9 ~]# ls -l /
total 28
dr-xr-xr-x.   2 root root    6 Jun 25 09:23 afs
lrwxrwxrwx.   1 root root    7 Jun 25 09:23 bin -> usr/bin
drwxr-xr-x.   6 root root 4096 Nov 22 08:27 boot
-rw-rw-r--.   1 root root   58 Nov 22 08:27 config.bootoptions
-rw-rw-r--.   1 root root   89 Nov 22 08:26 config.partids
drwxr-xr-x   17 root root 3060 Nov 22 08:34 dev
drwxr-xr-x    2 root root    0 Nov 22 08:34 efi
drwxr-xr-x.  82 root root 8192 Nov 22 08:34 etc
drwxrwxr-x.   3 root root   19 Nov 22 08:27 grub2
drwxr-xr-x.   3 root root   21 Nov 22 08:25 home
drwxr-xr-x.   3 root root   17 Nov 22 08:24 Kitchen <-----
drwxr-xr-x.   3 root root   17 Nov 22 08:24 Kitchen-Nightly <-----
lrwxrwxrwx.   1 root root    7 Jun 25 09:23 lib -> usr/lib
lrwxrwxrwx.   1 root root    9 Jun 25 09:23 lib64 -> usr/lib64
drwxr-xr-x.   2 root root    6 Jun 25 09:23 media
drwxr-xr-x.   2 root root    6 Jun 25 09:23 mnt
drwxr-xr-x.   3 root root   17 Nov 22 08:25 opt
dr-xr-xr-x  158 root root    0 Nov 22 08:34 proc
dr-xr-x---.   3 root root  103 Nov 22 08:25 root
drwxr-xr-x   28 root root  820 Nov 22 08:34 run
lrwxrwxrwx.   1 root root    8 Jun 25 09:23 sbin -> usr/sbin
drwxr-xr-x.   2 root root    6 Jun 25 09:23 srv
dr-xr-xr-x   13 root root    0 Nov 22 08:34 sys
drwxrwxrwt.   9 root root 4096 Nov 22 08:35 tmp
drwxr-xr-x.  12 root root  144 Nov 22 08:24 usr
drwxr-xr-x.  19 root root  264 Nov 22 08:34 var

Expected behaviour

Overlay files should be deployed to appropriate directory structure as defined in https://osinside.github.io/kiwi/overview.html#terminology.

Steps to reproduce the behaviour

Submit kiwi build to local koji cluster:

 koji kiwi-build --scratch --release=20241124 --kiwi-profile=Kitchen-Nightly image9s git+https://git@git.example.com/efg/img-instance-cloud.git#remotes/origin/c9s kiwi/ABC-CentOS-Stream.kiwi

OS and Software information

  • KIWI version: 10.2.0-1.el9
  • Operating system host version: CentOS Stream 9
  • Operating system target version: CentOS Stream 9
  • Open Build Service version (N/A if not using OBS): N/A
  • Koji version (N/A if not using Koji): 1.34.0-3.el9
@schaefi
Copy link
Collaborator

schaefi commented Dec 3, 2024

@c4t3l Hi, thanks for reporting. I was looking at your description layout and was wondering why kiwi at all picks up Kitchen or Kitchen-Nightly into the build process. The general overlay files are recognized by kiwi only if they are placed inside of a directory named root.

In any other case an explicit setup for data as an archive needs to be specified inside of the XML description like in the following example

<archive name="foo.tar.gz"/>

As I don't know how your XML data looks like I can only guess that koji packages Kitchen and Kitchen-Nightly into archives referenced as such in your description ? Another possibility would be that koji kiwi-build injects the data into the tree itself somehow ?

But I can assure you that kiwi handles overlay files in the way you would expect it. The data in the Kitchen and Kitchen-Nightly sub directories are by default not subject to the kiwi build and needs a preprocessing step to make them effectively used by kiwi. I assume the solution to your issue lives in this area.

@Conan-Kudo Do you have more insight how koji build consumes this Kitchen and Kitchen-Nightly data ?

Thanks

@Conan-Kudo
Copy link
Member

All the Koji plugin does is rewrite the config.xml file to use the koji repositories and then passes it to kiwi to run it. Beyond that, there's nothing else Koji does.

@c4t3l
Copy link
Author

c4t3l commented Dec 9, 2024

Here is the generated config.xml file that koji provides:

<?xml version="1.0" ?>
<image schemaversion="7.4" name="ABC-CentOS-Stream-Kitchen-Nightly">
        <description type="system">
                <author>ABC Devops Team</author>
                <contact>engineering@example.com</contact>
                <specification>CentOS Stream 9 Images</specification>
        </description>
        <preferences>
                <version>9</version>
                <packagemanager>dnf</packagemanager>
                <locale>en_US</locale>
                <keytable>us</keytable>
                <timezone>America/Chicago</timezone>
                <release-version>9</release-version>
        </preferences>
        <packages type="image" patternType="plusRecommended">
                <namedCollection name="core"/>
                <package name="chrony"/>
                <package name="vim-enhanced"/>
                <package name="vim-minimal"/>
                <package name="yum-utils"/>
        </packages>
        <packages type="bootstrap">
                <package name="basesystem"/>
                <package name="filesystem"/>
        </packages>
        <profiles>
                <profile name="BootCore" description="Boot core packages"/>
        </profiles>
        <packages type="image" patternType="plusRecommended" profiles="BootCore">
                <package name="grub2-efi-aa64" arch="aarch64"/>
                <package name="grub2-efi-aa64-modules" arch="aarch64"/>
                <package name="grub2-efi-x64" arch="x86_64"/>
                <package name="grub2-efi-x64-modules" arch="x86_64"/>
                <package name="grub2-pc" arch="x86_64"/>
                <package name="grub2-pc-modules" arch="x86_64"/>
                <package name="shim-signed-aa64" arch="aarch64"/>
                <package name="shim-signed-x64" arch="x86_64"/>
                <package name="kernel-core"/>
                <package name="systemd-oomd-defaults"/>
                <package name="systemd-resolved"/>
        </packages>
        <packages type="iso" patternType="plusRecommended" profiles="BootCore">
                <package name="grub2-efi-aa64-cdboot" arch="aarch64"/>
                <package name="grub2-efi-x64-cdboot" arch="x86_64"/>
        </packages>
        <users profiles="Kitchen">
                <user password="kitchen" home="/home/kitchen" name="kitchen" groups="kitchen,wheel" pwdformat="plain"/>
        </users>
        <users profiles="Kitchen-Nightly">
                <user password="kitchen" home="/home/kitchen" name="kitchen" groups="kitchen,wheel" pwdformat="plain"/>
        </users>
        <profiles>
                <profile name="CloudCore" description="Cloud image core packages">
                        <requires profile="BootCore"/>
                </profile>
                <profile name="Kitchen" description="Kitchen-CI image">
                        <requires profile="CloudCore"/>
                </profile>
                <profile name="Kitchen-Nightly" description="Nightly Kitchen-CI image">
                        <requires profile="CloudCore"/>
                </profile>
        </profiles>
        <preferences profiles="Kitchen">
                <type image="oem" filesystem="xfs" kernelcmdline="console=ttyS0 net.ifnames=0 dis_ucode_ldr" devicepersistency="by-label" bootpartition="true" bootpartsize="1000" bootfilesystem="ext2" efipartsize="100" firmware="uefi" format="qcow2">
                        <bootloader name="grub2" console="console" timeout="1"/>
                        <size unit="G">10</size>
                        <oemconfig>
                                <oem-swap>true</oem-swap>
                                <oem-swapsize>1024</oem-swapsize>
                                <oem-resize>false</oem-resize>
                        </oemconfig>
                </type>
        </preferences>
        <preferences profiles="Kitchen-Nightly">
                <type image="oem" filesystem="xfs" kernelcmdline="console=ttyS0 net.ifnames=0 dis_ucode_ldr" devicepersistency="by-label" bootpartition="true" bootpartsize="1000" bootfilesystem="ext2" efipartsize="100" firmware="uefi" format="qcow2">
                        <bootloader name="grub2" console="console" timeout="1"/>
                        <size unit="G">10</size>
                        <oemconfig>
                                <oem-swap>true</oem-swap>
                                <oem-swapsize>1024</oem-swapsize>
                                <oem-resize>false</oem-resize>
                        </oemconfig>
                </type>
        </preferences>
        <packages type="image" patternType="plusRecommended" profiles="CloudCore">
                <ignore name="dracut-config-rescue"/>
                <ignore name="firewalld"/>
                <ignore name="kernel"/>
                <ignore name="*-firmware"/>
                <ignore name="geolite2-city"/>
                <ignore name="geolite2-country"/>
                <package name="dracut-kiwi-oem-repart"/>
                <package name="abc-filesystem"/>
                <package name="glibc-langpack-en"/>
        </packages>
        <packages type="image" patternType="plusRecommended" profiles="Kitchen">
                <package name="salt-minion"/>
        </packages>
        <packages type="image" patternType="plusRecommended" profiles="Kitchen-Nightly">
                <package name="salt3006-minion"/>
        </packages>
        <repository type="rpm-md">
                <source path="https://imgdevhub.example.com/kojifiles/repos/image9s-build/17/x86_64"/>
        </repository>
</image>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants