Kickstart failure with repo from USB

Latest response

Hello,

I got the problem by launching an kickstart installation with the following boot parameters appended after the vmlinuz:

initrd=initrd.img inst.stage2=hd:LABEL=PROMPTUSBIN inst.ks=hd:LABEL=PROMPTUSBIN:/tsmmirror-rhel8-sda.cfg inst.dd=hd:LABEL=PROMPTUSBIN:/dd-megaraid_sas.rpm inst.repo=hd:LABEL=PROMPTUSBIN:/RHEL/8/BaseOS/x86_64/os inst.gpt net.ifnames=0 biosdevname=0

The only parameter/option failing by Anaconda is always "inst.repo=hd:LABEL=PROMPTUSBIN:/RHEL/8/BaseOS/x86_64/os".
The others worked fine before.
But its done like in the Red Hat documentation (https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/performing_an_advanced_rhel_installation/kickstart-and-advanced-boot-options_installing-rhel-as-an-experienced-user#editing-boot-options_kickstart-and-advanced-boot-options) and Anaconda always says that there aren't any packages.

Does anyone know why or could this be an Anaconda bug?

Responses

Hi Daniel,

Since RHEL 8.0 you need two repos to install the Operating System BaseOS and AppStream. could this be the issue?

Regards,

Jan Gerrit Kootstra

Hello Jan,

well at my USB stick i have both repos (BaseOS and AppStream) but for installation i only need the BaseOS. I've tested it before with an network installation kickstart and that worked fine. My problem is that Anaconda can't find any software information on that path or the parameter "inst.repo" has an bug when using "hd:LABEL=xxx:/path".

I believe the inst.repo directive can be omitted entirely if the root directory of the USB drive contains the file images/install.img along with the Packages/ and repodata/ directories (these may be symbolic links).

Additional repositories may be specified in the kickstart file using the repo directive:

repo --name=local-appstream --baseurl=file:///mnt/install/repo/RHEL/8/AppStream/x86_64

Hello Robert,

Thanks for the detailed answer. But the problem is still active equal if i have the whole dvd1 with all packages on my USB drive in the root directory. In my kickstart i use "harddrive --partition=LABEL=PROMPTUSBIN --dir=/" and i also tested to protect the USB drive from formatting with "ignoredisk --drives=/dev/disk/by-path/usb". I found also some information in the Anaconda documentation: https://anaconda-installer.readthedocs.io/en/latest/boot-options.html

That is indeed baffling. I suggest running the installer, then switching to a console to verify that /mnt/install/repo is mounted and contains the correct repository. Also, try removing the cdrom directive from the kickstart file, if it's present.

Is there any false option in the kickstart or should something be changed or added?

#platform x86, AMD64, or Intel EM64T
# Firewall configuration
firewall --enabled --ssh --port=1500:tcp,1581:tcp
# Use local repositories
harddrive --partition=LABEL=PROMPTUSBIN --dir=/
ignoredisk --drives=/dev/disk/by-path/*usb*
# Root password
rootpw --iscrypted xxxxxxxxxxxxxxxxxxxxxx
# System authorization information
auth --passalgo=sha512 --useshadow
# Use text mode install
text
# Disable system configuration
firstboot --disable
# System keyboard
keyboard de
# System language
lang de_DE
# SELinux configuration
selinux --enforcing
# Do not configure the X Window System
skipx
# Installation logging level
logging --level=info
# Reboot after installation
reboot
# System timezone
timezone Europe/Berlin --isUtc --ntpservers=timeserver
# Network information
network --activate --bootproto=dhcp --ipv6=auto --hostname=xxx --onboot=on
# System bootloader configuration
bootloader --location=mbr --append="crashkernel=auto net.ifnames=0 biosdevname=0"
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
part /boot --fstype=ext4 --size=500
part /boot/efi --fstype="efi" --size=200
part / --fstype=ext4 --size=30000
part /var/tivoli/tsm/db --fstype=ext4 --size=30000
part /var/tivoli/tsm/log --fstype=ext4 --size=30000
part /var/tivoli/tsm/data0 --fstype=ext4 --size=1 --grow
# Create repositories
repo --name=BaseOS --baseurl=file:///dev/disk/by-label/PROMPTUSBIN/CentOS/\$releasever/BaseOS/\$basearch/os --install
repo --name=EPEL --baseurl=file:///dev/disk/by-label/PROMPTUSBIN/EPEL/\$releasever/\$basearch --install

Those repo statements are not consistent with anything I've ever used, so I'm inclined to believe they may be the source of the issue.

First, in my experience, the "BaseOS" repository should not be specified using repo. It should be url, or it should be in a predefined location on the device specified in the inst.stage2 boot option. The predefined locations are either absolute, or defined in metadata:

  • Absolute: the file /images/install.img and directories /Packages and /repodata
  • Metadata: the file /.treeinfo, whose contents specify the location of the repository

Also, note that the repo name can be an issue by itself. I recall a version of Fedora that would fail with repo --name=updates because updates was a reserved name. So, avoid using RHEL terms such as "BaseOS" and "AppStream" when naming local repositories.

Anyway, here are the url and repo directives I would use:

# Create repositories
url --url file:///mnt/install/repo/CentOS/8/BaseOS/x86_64/os
#repo --name=local-BaseOS --baseurl=file:///mnt/install/repo/CentOS/8/BaseOS/x86_64/os
repo --name=local-EPEL --baseurl=file:///mnt/install/repo/EPEL/8/x86_64

Hello Robert,

Your solution was the right and worked. The problem where the repo options in the kickstart file. Now the kickstart installation workes fine and Ananconda finds the correct pathes to the USB drive.

Greetings Daniel