Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-4654

Tar compose type created by os-build does not include some of the important packages.

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • None
    • Important
    • rhel-sst-image-builder
    • ssg_front_door
    • None
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • If docs needed, set a value
    • None
    • 57,005

      Description of problem:

      Tar compose type created by os-build does not include some of the mandatory packages which can cause system installed with tar file (using liveimg command) to be unbootable.

      If we create an empty blueprint as per below to create `tar` compose and then use the tar file created to install a system using Boot ISO and Kickstart file which points to tar file using the liveimg command.
      ~~~

      1. cat blueprint-test-1.toml
        name = "blueprint-test-1"
        description = "LONG FORM DESCRIPTION TEXT"
        version = "0.0.1"
        modules = []
        groups = []

      [[packages]]
      name = "tmux"
      version = "*"
      ~~~

      Depsolve show that this does not add the grub or shim or efibootmgr or lvm or xfs related rpms.
      ~~~

      1. composer-cli blueprints depsolve blueprint-test-1 | grep -e tmux -e grub -e efibootmgr -e lvm -e shim -e xfs -e authselect -e subscription-manager
        tmux-3.2a-4.el9.x86_64
        ~~~

      There are not booting related file created.
      ~~~

      1. compose-cli compose image 9fea8c6c-1c17-43f6-b07e-f7c4e91d4506
        9fea8c6c-1c17-43f6-b07e-f7c4e91d4506-root.tar.xz
      1. tar -tvf 9fea8c6c-1c17-43f6-b07e-f7c4e91d4506-root.tar.xz | grep /boot
        drwx------ root/root 0 2023-04-12 18:36 ./var/lib/selinux/targeted/active/modules/100/bootloader/
        rw------ root/root 4238 2023-02-16 18:23 ./var/lib/selinux/targeted/active/modules/100/bootloader/cil
        rw------ root/root 12610 2023-02-16 18:23 ./var/lib/selinux/targeted/active/modules/100/bootloader/hll
        rw------ root/root 2 2023-02-16 18:23 ./var/lib/selinux/targeted/active/modules/100/bootloader/lang_ext
        rw-rr- root/root 463 2022-01-18 17:05 ./usr/lib/systemd/system/boot-complete.target
        rw-rr- root/root 256 2022-07-15 14:00 ./usr/lib/firmware/RTL8192E/boot.img.xz
        rw-rr- root/root 232 2022-07-15 14:00 ./usr/lib/firmware/av7110/bootcode.bin.xz
        rw-rr- root/root 192 2022-07-15 14:00 ./usr/lib/firmware/dsp56k/bootstrap.bin.xz
        rw-rr- root/root 3808 2022-07-15 14:00 ./usr/lib/firmware/edgeport/boot.fw.xz
        rw-rr- root/root 3592 2022-07-15 14:00 ./usr/lib/firmware/edgeport/boot2.fw.xz
        rw-rr- root/root 4636 2023-02-13 21:21 ./usr/share/man/man7/bootup.7.gz
        dr-xr-xr-x root/root 0 2023-04-12 18:36 ./boot/
        rw------ root/root 16860183 2023-04-12 18:36 ./boot/initramfs-5.14.0-162.23.1.el9_1.x86_64.img
        ~~~

      I used the following Kickstart to do the installation where the URL with liveimg points to this tar along with RHEL 9.1 Boot ISO the installation fails during the post installation stage where the grub command are run by anaconda.
      ~~~
      text
      firstboot --enable
      keyboard --vckeymap=us --xlayouts='us'
      lang en_US.UTF-8
      timezone America/New_York --utc

      liveimg --url http://192.168.122.25/liveimg-tests/9fea8c6c-1c17-43f6-b07e-f7c4e91d4506-root.tar.xz

      authselect --enableshadow --passalgo=sha512
      rootpw --iscrypted XXXXXXXXX
      user --groups=wheel --name=ameya --password=XXXXXXX --iscrypted --gecos="ameya"

      network --hostname=rhel9-default.test.local --bootproto=dhcp --onboot=yes --ipv6=auto --activate

      bootloader --append=" crashkernel=auto console=tty0 console=ttyS0,115200n8" --location=mbr
      ignoredisk --only-use=vda
      clearpart --all --initlabel

      autopart --type=lvm
      ~~~

      After experimenting with the packages needed for the installation to complete and the system to reboot sucessfully after installation with BIOS as well as UEFI and for lvm as well as standard partitioning.
      I have listed the error which I used to receive when I skip the package in the comment in the blueprints below.
      ~~~

      1. cat blueprint-test-2.toml
        name = "blueprint-test-2"
        description = "LONG FORM DESCRIPTION TEXT"
        version = "0.0.1"
        modules = []
        groups = []
        1. For EFI support
      1. Pulls necessary deps for both BIOS as well as UEFI grub packages such as grub2-tools which provide grub2-mkconfig and other utilities.
      2. For UEFI - dasbus.error.DBusError: [Errno 2] No such file or directory: '/mnt/sysroot/boot/efi/EFI/redhat/grub.cfg'
      3. FOR BIOS - dasbus.error.DBusError: [Errno 2] No such file or directory: 'grub2-editenv'
        [[packages]]
        name = "grub2-efi-x64"
        version = "*"
      1. Needed for secure boot.
      2. Secure boot does not work without this.
        [[packages]]
        name = "shim-x64"
        version = "*"
      1. Required for UEFI system after grub is installed.
        #dasbus.error.DBusError: [Errno 2] No such file or directory: 'efibootmgr'
        [[packages]]
        name = "efibootmgr"
        version = "*"
        1. For BIOS Support
      1. Need grub2-pc-modules for grub2-install command to work.
      2. grub2-install fails with missing /usr/lib/grub/i386-pc/modinfo.sh
        [[packages]]
        name = "grub2-pc-modules"
        version = "*"
      1. xfsprogs required otherwise the xfs_freeze command ran just before grub2-install fails.
        #INFO:program:Running... xfs_freeze -u /boot
        #ERROR:program:Error running xfs_freeze: No such file or directory
        #ERROR:blivet:failed to sync filesytem: [Errno 2] No such file or directory: 'xfs_freeze'
      2. Note I have not install "e2fsprogs" because the automatic partitioning used by Anaconda is XFS , however using Kickstart with ext4 partitioning, I think will require it.
        [[packages]]
        name = "xfsprogs"
        version = "*"
        1. For LVM support in both UEFI and BIOS
      1. Error - Cant install on an LVM device , it fails during the filesystem check during the first boot.
        [[packages]]
        name = "lvm2"
        version = "*"
        1. For authselect to be able to run post installation
      1. pyanaconda.modules.common.errors.installation.SecurityInstallationError: /usr/bin/authselect is missing. Cannot setup authentication.
        [[packages]]
        name = "authselect"
        version = "*"
        1. Subscription-manager is not installed by default so the system cant be subscribed.
          [[packages]]
          name = "subscription-manager"
          version = "*"
          ~~~

      Version-Release number of selected component (if applicable):

      • The installation of system using Kickstart was also done using RHEL 9.1 ISO
      • The tar was created with Latest RHEL 9.1 packages
        ~~~
      1. rpm -qa | grep osbuild
        osbuild-composer-dnf-json-62.1-3.el9_1.x86_64
        osbuild-composer-core-62.1-3.el9_1.x86_64
        python3-osbuild-65-1.el9.noarch
        osbuild-65-1.el9.noarch
        osbuild-selinux-65-1.el9.noarch
        osbuild-ostree-65-1.el9.noarch
        osbuild-luks2-65-1.el9.noarch
        osbuild-lvm2-65-1.el9.noarch
        osbuild-composer-worker-62.1-3.el9_1.x86_64
        osbuild-composer-62.1-3.el9_1.x86_64
        ~~~

      How reproducible:
      Everytime

      Steps to Reproduce:

      1. Create a tar compose with a short test blueprint.
      ~~~

      1. cat blueprint-test-1.toml
        name = "blueprint-test-1"
        description = "LONG FORM DESCRIPTION TEXT"
        version = "0.0.1"
        modules = []
        groups = []

      [[packages]]
      name = "tmux"
      version = "*"

      1. composer-cli blueprints push blueprint-test-1.toml
      2. composer-cli blueprints show blueprint-test-1
      3. composer-cli compose start blueprint-test-1 tar
        ~~~

      2. Download the tar image and use it for installation with a test kickstart.
      ~~~

      1. composer-cli compose image <UUID>
      2. mkdir -v /var/www/html/liveimg-tests/
      3. cp -v <UUID>-root.tar.xz /var/www/html/liveimg-tests/
      4. yum install httpd -y ; systemctl enable --now httpd ; firewall-cmd --add-service=http
      1. cat /var/www/html/liveimg-tests/rhel9.ks
        text
        firstboot --enable
        keyboard --vckeymap=us --xlayouts='us'
        lang en_US.UTF-8
        timezone America/New_York --utc

      liveimg --url http://192.168.122.25/liveimg-tests/9fea8c6c-1c17-43f6-b07e-f7c4e91d4506-root.tar.xz

      authselect --enableshadow --passalgo=sha512
      rootpw --iscrypted XXXXXXXXX
      user --groups=wheel --name=ameya --password=XXXXXXX --iscrypted --gecos="ameya"

      network --hostname=rhel9-default.test.local --bootproto=dhcp --onboot=yes --ipv6=auto --activate

      bootloader --append=" crashkernel=auto console=tty0 console=ttyS0,115200n8" --location=mbr
      ignoredisk --only-use=vda
      clearpart --all --initlabel

      autopart --type=lvm
      ~~~

      3. Install using the Kickstart to try to boot on UEFI or BIOS.

      Boot with RHEL 9.1 ISO and add the boot parameter for Kickstart inst.ks=http://192.168.122.25/rhel9.ks

      Actual results:

      System does not install if there is no package mentioned.
      It also fails for first boot if you have few pacakges like grub/shim pacakges and not LVM but the installation was done with LVM enabled.

      Expected results:
      The tar image help install sucessfully and also boot sucessfully first boot.

      Additional info:
      Other compose like qcow2/ami/etc. contain these packages on the installed system by default even with the same blueprint which does not listed them specifically.

              osbuilders Osbuilders Bot Account
              rhn-support-amepatil Ameya Patil
              Osbuilders Bot Account Osbuilders Bot Account
              RH Bugzilla Integration RH Bugzilla Integration
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: