Skip to content

mkosi ignoring argument --distribution when building main image #3940

@Masber

Description

@Masber

mkosi commit the issue has been seen with

c37a55f

Used host distribution

Arch Linux

Used target distribution

fedora

Linux kernel version used

6.16.10-arch1-1

CPU architectures issue was seen on

x86_64

Unexpected behaviour you saw

mkosi is building main image with wrong distribution

This is the command I use to build images:

sudo mkosi -d fedora --format directory -o foobar -f --debug cat-config

Image builds successfully but the distro is Arch Linux instead of fedora

cat /home/masber/mkosi_conf/mkosi.output/foobar/etc/os-release
NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues"
PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/"
LOGO=archlinux-logo

I don't understand why the main image is Arch when I specified fedora in the mkosi command line

Used mkosi config

### IMAGE: main
# mkosi.conf

mkosi output

sudo mkosi -d fedora --format directory -o foobar -f --debug build
‣ Loading configuration file /home/masber/mkosi_conf/mkosi.conf
‣ Loading configuration file /tmp/tmpqqz4r3yx/resources/mkosi-initrd/mkosi.conf
‣ Loading configuration file /tmp/tmpqqz4r3yx/resources/mkosi-initrd/mkosi.conf.d/arch.conf
‣ Loading configuration file /tmp/tmpqqz4r3yx/resources/mkosi-initrd/mkosi.conf
‣ Loading configuration file /tmp/tmpqqz4r3yx/resources/mkosi-initrd/mkosi.conf.d/azure-centos-fedora.conf
‣ Loading configuration file /tmp/tmpqqz4r3yx/resources/mkosi-initrd/mkosi.conf.d/fedora.conf
‣ Validating certificates and keys
‣ + bash -c 'shopt -s nullglob && printf '"'"'%s\n'"'"' /usr/share/distribution-gpg-keys/*/RPM-GPG-KEY-fedora-rawhide-primary* /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-rawhide-primary* | xargs -r readlink -f'
‣ + bash -c 'shopt -s nullglob && printf '"'"'%s\n'"'"' /usr/share/distribution-gpg-keys/*/RPM-GPG-KEY-fedora-44-primary* /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-44-primary* | xargs -r readlink -f'
‣ + bash -c 'shopt -s nullglob && printf '"'"'%s\n'"'"' /usr/share/distribution-gpg-keys/*/RPM-GPG-KEY-fedora-45-primary* /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-45-primary* | xargs -r readlink -f'
‣ + bash -c 'shopt -s nullglob && printf '"'"'%s\n'"'"' /usr/share/distribution-gpg-keys/*/RPM-GPG-KEY-fedora-46-primary* /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-46-primary* | xargs -r readlink -f'
‣ Syncing package manager metadata
‣ + dnf5 --assumeyes --best --releasever=rawhide --installroot=/buildroot --setopt=keepcache=1 --setopt=logdir=/var/log --setopt=cachedir=/var/cache/libdnf5 --setopt=install_weak_deps=0 --setopt=check_config_file_age=0 --setopt=persistdir=/buildroot/var/lib/dnf --setopt=debuglevel=10 --use-host-config --setopt=proxy_sslcacert=/proxy.cacert makecache
Updating and loading repositories:
Repositories loaded.
Metadata cache created.
‣ + rm -rf -- /work/var/tmp/mkosi-workspace-1jl7vlrx /work/var/tmp/mkosi-workspace-1jl7vlrx/root
‣ Building main image
‣ + bash -c 'shopt -s nullglob && printf '"'"'%s\n'"'"' /usr/share/distribution-gpg-keys/*/RPM-GPG-KEY-fedora-rawhide-primary* /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-rawhide-primary* | xargs -r readlink -f'
‣ + bash -c 'shopt -s nullglob && printf '"'"'%s\n'"'"' /usr/share/distribution-gpg-keys/*/RPM-GPG-KEY-fedora-44-primary* /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-44-primary* | xargs -r readlink -f'
‣ + bash -c 'shopt -s nullglob && printf '"'"'%s\n'"'"' /usr/share/distribution-gpg-keys/*/RPM-GPG-KEY-fedora-45-primary* /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-45-primary* | xargs -r readlink -f'
‣ + bash -c 'shopt -s nullglob && printf '"'"'%s\n'"'"' /usr/share/distribution-gpg-keys/*/RPM-GPG-KEY-fedora-46-primary* /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-46-primary* | xargs -r readlink -f'
‣  Installing Fedora Linux
‣ + dnf5 --assumeyes --best --releasever=rawhide --installroot=/buildroot --setopt=keepcache=1 --setopt=logdir=/var/log --setopt=cachedir=/var/cache/libdnf5 --setopt=install_weak_deps=0 --setopt=check_config_file_age=0 --setopt=persistdir=/buildroot/var/lib/dnf --setopt=debuglevel=10 --setopt=metadata_expire=never --setopt=cacheonly=metadata --use-host-config --setopt=proxy_sslcacert=/proxy.cacert install basesystem
Updating and loading repositories:
Repositories loaded.
Package                                              Arch          Version                                               Repository                        Size
Installing:
 filesystem                                          x86_64        3.18-50.fc43                                          fedora                       112.0   B
Installing dependencies:
 fedora-gpg-keys                                     noarch        44-0.1                                                fedora                       131.2 KiB
 fedora-release                                      noarch        44-0.3                                                fedora                         0.0   B
 fedora-release-common                               noarch        44-0.3                                                fedora                        20.6 KiB
 fedora-release-identity-basic                       noarch        44-0.3                                                fedora                       664.0   B
 fedora-repos                                        noarch        44-0.1                                                fedora                         4.9 KiB
 fedora-repos-rawhide                                noarch        44-0.1                                                fedora                         2.2 KiB
 setup                                               noarch        2.15.0-26.fc43                                        fedora                       725.0 KiB

Transaction Summary:
 Installing:         8 packages

Total size of inbound packages is 2 MiB. Need to download 0 B.
After this operation, 885 KiB extra will be used (install 885 KiB, remove 0 B).
[1/8] filesystem-0:3.18-50.fc43.x86_64                                                                                 100% |   0.0   B/s |   0.0   B |  00m00s
>>> Already downloaded
[2/8] setup-0:2.15.0-26.fc43.noarch                                                                                    100% |   0.0   B/s |   0.0   B |  00m00s
>>> Already downloaded
[3/8] fedora-release-0:44-0.3.noarch                                                                                   100% |   0.0   B/s |   0.0   B |  00m00s
>>> Already downloaded
[4/8] fedora-release-common-0:44-0.3.noarch                                                                            100% |   0.0   B/s |   0.0   B |  00m00s
>>> Already downloaded
[5/8] fedora-repos-0:44-0.1.noarch                                                                                     100% |   0.0   B/s |   0.0   B |  00m00s
>>> Already downloaded
[6/8] fedora-gpg-keys-0:44-0.1.noarch                                                                                  100% |   0.0   B/s |   0.0   B |  00m00s
>>> Already downloaded
[7/8] fedora-repos-rawhide-0:44-0.1.noarch                                                                             100% |   0.0   B/s |   0.0   B |  00m00s
>>> Already downloaded
[8/8] fedora-release-identity-basic-0:44-0.3.noarch                                                                    100% |   0.0   B/s |   0.0   B |  00m00s
>>> Already downloaded
---------------------------------------------------------------------------------------------------------------------------------------------------------------
[8/8] Total                                                                                                            100% |   0.0   B/s |   0.0   B |  00m00s
Running transaction
Importing OpenPGP key 0x31645531:
 UserID     : "Fedora (43) <[email protected]>"
 Fingerprint: C6E7F081CF80E13146676E88829B606631645531
 From       : file:///usr/share/distribution-gpg-keys/fedora/RPM-GPG-KEY-fedora-43-primary
The key was successfully imported.
Importing OpenPGP key 0x6D9F90A6:
 UserID     : "Fedora (44) <[email protected]>"
 Fingerprint: 36F612DCF27F7D1A48A835E4DBFCF71C6D9F90A6
 From       : file:///usr/share/distribution-gpg-keys/fedora/RPM-GPG-KEY-fedora-44-primary
The key was successfully imported.
Importing OpenPGP key 0xF577861E:
 UserID     : "Fedora (45) <[email protected]>"
 Fingerprint: 4F50A6114CD5C6976A7F1179655A4B02F577861E
 From       : file:///usr/share/distribution-gpg-keys/fedora/RPM-GPG-KEY-fedora-45-primary
The key was successfully imported.
[ 1/10] Verify package files                                                                                           100% | 250.0   B/s |   8.0   B |  00m00s
>>> Running %pretrans scriptlet: filesystem-0:3.18-50.fc43.x86_64
>>> Finished %pretrans scriptlet: filesystem-0:3.18-50.fc43.x86_64
>>> [RPM] private mounts in chroot not implemented
[ 2/10] Prepare transaction                                                                                            100% | 380.0   B/s |   8.0   B |  00m00s
[ 3/10] Installing fedora-release-identity-basic-0:44-0.3.noarch                                                       100% |   0.0   B/s | 920.0   B |  00m00s
[ 4/10] Installing fedora-repos-rawhide-0:44-0.1.noarch                                                                100% |   2.4 MiB/s |   2.4 KiB |  00m00s
[ 5/10] Installing fedora-gpg-keys-0:44-0.1.noarch                                                                     100% |  17.5 MiB/s | 179.0 KiB |  00m00s
[ 6/10] Installing fedora-repos-0:44-0.1.noarch                                                                        100% |   0.0   B/s |   5.7 KiB |  00m00s
[ 7/10] Installing fedora-release-common-0:44-0.3.noarch                                                               100% |  12.1 MiB/s |  24.9 KiB |  00m00s
[ 8/10] Installing fedora-release-0:44-0.3.noarch                                                                      100% |  98.0   B/s | 124.0   B |  00m01s
>>> Running sysusers scriptlet: setup-0:2.15.0-26.fc43.noarch
>>> Finished sysusers scriptlet: setup-0:2.15.0-26.fc43.noarch
>>> Scriptlet output:
>>> useradd: Warning: missing or non-executable shell '/sbin/halt'
>>> useradd warning: nobody's uid 65534 is greater than SYS_UID_MAX 999
>>> useradd: Warning: missing or non-executable shell '/bin/bash'
>>> useradd: Warning: missing or non-executable shell '/sbin/shutdown'
>>> useradd: Warning: missing or non-executable shell '/bin/sync'
>>>
[ 9/10] Installing setup-0:2.15.0-26.fc43.noarch                                                                       100% |  19.8 MiB/s | 730.6 KiB |  00m00s
[10/10] Installing filesystem-0:3.18-50.fc43.x86_64                                                                    100% |   1.4 MiB/s | 212.8 KiB |  00m00s
Complete!
‣  Copying in extra file trees…
‣ + cp --version
‣ + cp --recursive --no-dereference --preserve=mode,links --reflink=auto --copy-contents /work/home/masber/mkosi_conf/mkosi.extra /work/var/tmp/mkosi-workspace-4n3e_11d/root --keep-directory-symlink --no-target-directory
‣  Generating system users
‣ + systemd-sysusers --root=/buildroot
‣  Generating volatile files
‣ + systemd-tmpfiles --root=/buildroot --boot --create --remove --exclude-prefix=/tmp --exclude-prefix=/var/tmp --exclude-prefix=/run --exclude-prefix=/proc --exclude-prefix=/sys --exclude-prefix=/dev
‣  Applying presets…
‣ + systemctl --root=/buildroot preset-all
‣ + systemctl --root=/buildroot --global preset-all
‣  Generating hardware database
‣ + systemd-hwdb --root=/buildroot --usr --strict update
No hwdb files found, skipping.
‣ + kernel-install --help
‣ + kernel-install --version
‣ Version reported by kernel-install is 258-4-arch
‣ + kernel-install --root=/buildroot --json=pretty inspect
‣ {
    "MachineID": "62fa3edcddb24310aa771fd6a6843726",
    "KernelImageType": "unknown",
    "Layout": "bls",
    "BootRoot": "boot",
    "EntryTokenType": "os-id",
    "EntryToken": "arch",
    "EntryDirectory": "boot/arch/KERNEL_VERSION",
    "KernelVersion": null,
    "Kernel": null,
    "Initrds": null,
    "InitrdGenerator": null,
    "UKIGenerator": null,
    "Plugins": null,
    "PluginEnvironment": [
        "LC_COLLATE=C.UTF-8",
        "KERNEL_INSTALL_VERBOSE=0",
        "KERNEL_INSTALL_IMAGE_TYPE=unknown",
        "KERNEL_INSTALL_MACHINE_ID=62fa3edcddb24310aa771fd6a6843726",
        "KERNEL_INSTALL_ENTRY_TOKEN=arch",
        "KERNEL_INSTALL_BOOT_ROOT=boot",
        "KERNEL_INSTALL_LAYOUT=bls",
        "KERNEL_INSTALL_INITRD_GENERATOR=",
        "KERNEL_INSTALL_UKI_GENERATOR=",
        "KERNEL_INSTALL_STAGING_AREA=/tmp/kernel-install.staging.XXXXXX"
    ]
}
‣  /home/masber/mkosi_conf/mkosi.output/foobar size is 4.1M.
‣ + rm -rf -- /work/var/tmp/mkosi-workspace-4n3e_11d
‣ + tput cnorm
‣ + tput smam

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions