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

LVM partitioning using kickstart format in config.toml is not respected #695

Closed
oglok opened this issue Oct 28, 2024 · 9 comments
Closed

Comments

@oglok
Copy link

oglok commented Oct 28, 2024

podman version
Client:       Podman Engine
Version:      4.9.4-rhel
API Version:  4.9.4-rhel
Go Version:   go1.21.11 (Red Hat 1.21.11-1.el9_4)
Built:        Thu Aug  8 10:51:41 2024
OS/Arch:      linux/amd64

Building an anaconda-iso type:

sudo podman run --rm -it  --privileged  --pull=newer   --security-opt label=type:unconfined_t   -v /home/oglok/bootc-xxxx/output:/output  -v /home/oglok/bootc-xxxxx/config.toml:/config.toml:ro               -v /var/lib/containers/storage:/var/lib/containers/storage     registry.redhat.io/rhel9/bootc-image-builder:latest  --type  anaconda-iso     --local quay.io/oglok/bootc-xxxx-flightctl:latest

This is the example from the official documentation:

cat config.toml
[customizations.installer.kickstart]
contents = """
text --non-interactive
zerombr
clearpart --all --initlabel --disklabel=gpt
autopart --noswap --type=lvm
network --bootproto=dhcp --device=link --activate --onboot=on
"""

Installation ends without error, but the anaconda-ks and orig-ks show this:

[root@localhost ~]# cat anaconda-ks.cfg
# Generated by Anaconda 34.25.4.9
# Generated by pykickstart v3.32
#version=RHEL9
# Use graphical install
graphical
# Reboot after installation
reboot --eject

%post
bootc switch --mutate-in-place --transport registry quay.io/oglok/bootc-xxxx-flightctl:latest
%end

%addon com_redhat_kdump --enable --reserve-mb='auto'

%end

# Network information
network  --bootproto=dhcp --device=link --activate

# OSTree container setup
ostreecontainer --no-signature-verification --transport="oci" --url="/run/install/repo/container"

# Generated using Blivet version 3.6.0
ignoredisk --only-use=vda
# Partition clearing information
clearpart --all
# Disk partitioning information
part / --fstype="ext4" --size=18431
part /boot --fstype="xfs" --ondisk=vda --size=1024
part swap --fstype="swap" --size=1024

[root@localhost ~]# cat original-ks.cfg
%include /run/install/repo/osbuild-base.ks

reqpart --add-boot

part swap --fstype=swap --size=1024
part / --fstype=ext4 --grow

reboot --eject
%post
bootc switch --mutate-in-place --transport registry quay.io/oglok/bootc-xxxx-flightctl:latest
%end
@achilleas-k
Copy link
Member

Installation ends without error, but the anaconda-ks and orig-ks show this:

Where do these come from? Is are you looking at them on the ISO itself or as part of the live OS after installation?

@oglok
Copy link
Author

oglok commented Oct 28, 2024

In the final device where I installed the ISO.
Anyway, the device has no lvm at all:

[redhat@localhost ~]$ lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
loop0    7:0    0  7.9M  1 loop
sr0     11:0    1 1024M  0 rom
zram0  251:0    0  1.7G  0 disk [SWAP]
vda    252:0    0   20G  0 disk
├─vda1 252:1    0    1G  0 part /boot
├─vda2 252:2    0    1G  0 part [SWAP]
└─vda3 252:3    0   18G  0 part /var/lib/containers/storage/overlay
                                /var
                                /sysroot/ostree/deploy/default/var
                                /etc
                                /sysroot
[redhat@localhost ~]$ sudo vgs
[redhat@localhost ~]$ sudo lvs
[redhat@localhost ~]$ cat /etc/fstab

#
# /etc/fstab
# Created by anaconda on Mon Oct 28 17:17:56 2024
#
# Accessible filesystems, by reference, are maintained under '/dev/disk/'.
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info.
#
# After editing this file, run 'systemctl daemon-reload' to update systemd
# units generated from this file.
#
# Updated by bootc-fstab-edit.service
UUID=99bea36e-72b9-4aea-a399-e1a06657623e / ext4 defaults,ro 1 1
UUID=4f2be855-fc35-4283-b5fd-cdb47e2b9505 /boot                   xfs     defaults        0 0
UUID=11459aaf-2e86-4bb3-a1d9-5cd8cd714df1 none                    swap    defaults        0 0

@achilleas-k
Copy link
Member

Well that matches what the original-ks.cfg says at least. But where did that come from? Did you modify the ISO in any way after building it and before installing? Maybe the kernel args?

@oglok
Copy link
Author

oglok commented Oct 29, 2024

yeah, the original-ks matches what's executed in the system (no surprise I guess). But nothing similar to what BIB is supposed to inject, right?
I didn't modified the ISO in any way, just fresh out of the build process.

@mvo5
Copy link
Collaborator

mvo5 commented Oct 29, 2024

Hey @oglok - could you please run:

$ sudo podman run -it --rm registry.redhat.io/rhel9/bootc-image-builder:latest version

so that we can double check what version is currently in the rhel container - I wonder if maybe the downstream container is slightly behind what we have in quay.io

@oglok
Copy link
Author

oglok commented Oct 29, 2024

I don't see a BIB version command:

[oglok@maxwell ~]$ sudo podman run -it --rm registry.redhat.io/rhel9/bootc-image-builder:latest version
Error: cannot validate the setup: this command requires a privileged container
2024/10/29 15:06:24 error: cannot validate the setup: this command requires a privileged container
[oglok@maxwell ~]$ sudo podman run --privileged -it --rm registry.redhat.io/rhel9/bootc-image-builder:latest version
Generating manifest manifest-qcow2.json
Error: cannot build manifest: failed to pull container image: exit status 125
Error: short-name resolution enforced but cannot prompt without a TTY

2024/10/29 15:06:35 error: cannot build manifest: failed to pull container image: exit status 125
Error: short-name resolution enforced but cannot prompt without a TTY
[oglok@maxwell ~]$ sudo podman run --privileged -it --rm registry.redhat.io/rhel9/bootc-image-builder:latest --entrypoint bash
Error: unknown flag: --entrypoint
2024/10/29 15:06:50 error: unknown flag: --entrypoint
[oglok@maxwell ~]$ sudo podman run --privileged -it --rm --entrypoint bash registry.redhat.io/rhel9/bootc-image-builder:latest
[root@686731ae87d8 output]# bootc-image-builder version
Error: unknown command "version" for "bootc-image-builder"
Run 'bootc-image-builder --help' for usage.
2024/10/29 15:07:09 error: unknown command "version" for "bootc-image-builder"
[root@686731ae87d8 output]# bootc-image-builder --help
create a bootable image from an ostree native container

Usage:
  bootc-image-builder [command]

Available Commands:
  build
  completion  Generate the autocompletion script for the specified shell
  help        Help about any command
  manifest

Flags:
  -h, --help               help for bootc-image-builder
      --log-level string   logging level (debug, info, error); default error

Use "bootc-image-builder [command] --help" for more information about a command.

@achilleas-k
Copy link
Member

achilleas-k commented Oct 29, 2024

Based on https://gitlab.com/redhat/rhel/bifrost/bootc-image-builder/-/tree/rhel-9.4, it's built from ec40771, which is a few months before the kickstart customization and even the version command.

@oglok
Copy link
Author

oglok commented Nov 4, 2024

Closing the issue as with new upstream versions of BIB it works.

@oglok oglok closed this as completed Nov 4, 2024
@benblasco
Copy link

benblasco commented Dec 21, 2024

@oglok Which version of BIB are you using? I am using quay.io/centos-bootc/bootc-image-builder:latest and have the same issue as you. Specifically, I am using this image:

https://quay.io/repository/centos-bootc/bootc-image-builder/manifest/sha256:fccbdb349dce1aa0cccb5c90c42ab0ba0e19acdb7ed4e8e2ea48cf379077adff

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

No branches or pull requests

4 participants