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

Add support for lorax-composer on other arches #616

Merged
merged 13 commits into from Mar 21, 2019

Conversation

bcl
Copy link
Contributor

@bcl bcl commented Feb 20, 2019

This is a port of PR #603, including a few extra patches to support easier cherry-picking and tests.

--- Merge policy ---

  • Travis CI PASS
  • *-aws-runtest PASS
  • *-azure-runtest PASS
  • *-images-runtest PASS
  • *-openstack-runtest PASS
  • *-vmware-runtest PASS
  • For rhel8-* and rhel7-* branches commit log references an approved
    bug in Bugzilla. Do not merge if the bug doesn't have the 3 ACKs set to +!

--- Jenkins commands ---

  • ok to test to accept this pull request for testing
  • test this please for a one time test run
  • retest this please to start a new build

@atodorov
Copy link
Member

I have uninstalled xorriso from the test system. I have genisoimage which provides mkisofs:

2019-02-21 07:54:22,984:   runcmd mkisofs -v -U -J -R -T -o /var/tmp/lmc-work-0hadlbu7/images/boot.iso -part -hfs -r -l -sysid PPC -A Red Hat Enterprise Linux 8.0 -V Red_Hat_Enterprise_Linux_8_0_ppc -volset 8.0 -volset-size 1 -volset-seqno 1 -hfs-volid 8.0 -chrp-boot -map /var/tmp/lorax.imgutils.av55jptp/tmp/config_files/ppc/mapping -no-desktop -allow-multidot -graft-points .discinfo=/var/tmp/lmc-work-0hadlbu7/.discinfo ppc=/var/tmp/lmc-work-0hadlbu7/ppc boot/grub=/var/tmp/lmc-work-0hadlbu7/boot/grub LiveOS=/var/tmp/lmc-work-0hadlbu7/LiveOS
2019-02-21 07:54:22,985:   subprocess.CalledProcessError: Command '['mkisofs', '-v', '-U', '-J', '-R', '-T', '-o', '/var/tmp/lmc-work-0hadlbu7/images/boot.iso', '-part', '-hfs', '-r', '-l', '-sysid', 'PPC', '-A', 'Red Hat Enterprise Linux 8.0', '-V', 'Red_Hat_Enterprise_Linux_8_0_ppc', '-volset', '8.0', '-volset-size', '1', '-volset-seqno', '1', '-hfs-volid', '8.0', '-chrp-boot', '-map', '/var/tmp/lorax.imgutils.av55jptp/tmp/config_files/ppc/mapping', '-no-desktop', '-allow-multidot', '-graft-points', '.discinfo=/var/tmp/lmc-work-0hadlbu7/.discinfo', 'ppc=/var/tmp/lmc-work-0hadlbu7/ppc', 'boot/grub=/var/tmp/lmc-work-0hadlbu7/boot/grub', 'LiveOS=/var/tmp/lmc-work-0hadlbu7/LiveOS']' returned non-zero exit status 2.
2019-02-21 07:54:23,488: traceback: Traceback (most recent call last):
  File "/root/lorax/src/pylorax/api/queue.py", line 143, in monitor
    make_compose(cfg, os.path.realpath(dst))
  File "/root/lorax/src/pylorax/api/queue.py", line 248, in make_compose
    run_creator(install_cfg, cancel_func=cancel_build)
  File "/root/lorax/src/pylorax/creator.py", line 701, in run_creator
    result_dir = make_livecd(opts, mount_dir, work_dir)
  File "/root/lorax/src/pylorax/creator.py", line 369, in make_livecd
    tb.build()
  File "/root/lorax/src/pylorax/treebuilder.py", line 312, in build
    self._runner.run(templatefile, kernels=self.kernels)
  File "/root/lorax/src/pylorax/ltmpl.py", line 141, in run
    self._run(commands)
  File "/root/lorax/src/pylorax/ltmpl.py", line 160, in _run
    f(*args)
  File "/root/lorax/src/pylorax/ltmpl.py", line 520, in runcmd
    stdout = runcmd_output(cmd)
  File "/root/lorax/src/pylorax/executils.py", line 347, in runcmd_output
    return execWithCapture(cmd[0], cmd[1:], **kwargs)
  File "/root/lorax/src/pylorax/executils.py", line 249, in execWithCapture
    reset_handlers=reset_handlers, reset_lang=reset_lang)[1]
  File "/root/lorax/src/pylorax/executils.py", line 201, in _run_program
    raise subprocess.CalledProcessError(proc.returncode, argv, output)
subprocess.CalledProcessError: Command '['mkisofs', '-v', '-U', '-J', '-R', '-T', '-o', '/var/tmp/lmc-work-0hadlbu7/images/boot.iso', '-part', '-hfs', '-r', '-l', '-sysid', 'PPC', '-A', 'Red Hat Enterprise Linux 8.0', '-V', 'Red_Hat_Enterprise_Linux_8_0_ppc', '-volset', '8.0', '-volset-size', '1', '-volset-seqno', '1', '-hfs-volid', '8.0', '-chrp-boot', '-map', '/var/tmp/lorax.imgutils.av55jptp/tmp/config_files/ppc/mapping', '-no-desktop', '-allow-multidot', '-graft-points', '.discinfo=/var/tmp/lmc-work-0hadlbu7/.discinfo', 'ppc=/var/tmp/lmc-work-0hadlbu7/ppc', 'boot/grub=/var/tmp/lmc-work-0hadlbu7/boot/grub', 'LiveOS=/var/tmp/lmc-work-0hadlbu7/LiveOS']' returned non-zero exit status 2.

@bcl
Copy link
Contributor Author

bcl commented Feb 21, 2019

There's some missing output there, probably captured in program.log I can't tell why it failed from just the error code. Also, I copied that over from the rhel8 template, so it really should work...

@atodorov
Copy link
Member

with the latest changes I was able to build live-iso on ppc and boot the results with kvm.

bcl added 13 commits March 21, 2019 14:48
Some platforms do not have grub2, and some require other partitions.

Anaconda will add platform specific partitions if the 'reqpart' command
is included, and it will add bootloader specific packages to the list if
they are needed.

Related: rhbz#1673744
This is complicated by the fact that much of this module requires mount.
So for now just test the things that don't need mount.

Related: rhbz#1673744
Add a /.in-container file to the container root so that tests requiring root
and loop device support will be skipped when running in a container.

Related: rhbz#1673744
This also moves the run_creator kickstart checks into check_kickstart
so that tests may be added.

Related: rhbz#1673744
Related: rhbz#1673744
Apparently nobody has used these since the switch to py3, xrange is now
range and it needs to read the file in binary mode when generating the
sha256.

Related: rhbz#1673744
reqpart can be used to make kickstarts more platform agnostic, creating
needed partitions without lmc having to keep track of the arch-specific
needs. eg. ppc64 needs prepboot and /boot

This increases the size of the disk based on whether reqpart or
reqpart --add-boot is in the kickstart.

Note that this is only valid for partitioned disk output types, not
for filesystem images or live iso output.

Related: rhbz#1673744
Some platforms, like ppc64, require that the /boot partition be present.
It doesn't hurt to have it there on other platforms so instead of trying
to add per-arch kickstart templates just use reqpart --add-boot
everywhere.

Related: rhbz#1673744
This will make it easier to add a new subclass that only handles
installpkg for use with livemedia-creator and lorax-composer iso
creation.

Related: rhbz#1673744
This template runner only uses the installpkg command to gather a list
of package NEVRA to be installed to support live iso creation.

Related: rhbz#1673744
If a package is excluded in the template and later added by a blueprint
or dependency, anaconda will fail to finish the installation. So remove
the -dracut-config-rescue exclusion and instead remove the rescue
artifacts in %post

Related: rhbz#1673744
In order to support iso creation on multiple arches with the templates
we need to be able to select different packages based on arch.
lorax-composer uses the arch-specific Lorax templates in order to
generate the output iso so this patch:

1. Creates a new template and type to parse it, live-install.tmpl
   which contains only installpkg commands and #if clauses for arch
2. Removes bootloader related packages from the live-iso.ks
3. Remove dracut-config-rescue exclusion because it can cause problems
   with some blueprints.
4. Switch logo requirement to system-logos which is satisfied by
   generic-logos or fedora-logos. This prevents conflicts when a blueprint
   installs fedora-release-workstation.

So in the future, if x86.tmpl, etc. need a new package to support
creating the iso it should be added to the correct section in
./share/live/live-install.tmpl

Resolves: rhbz#1673744
@bcl bcl merged commit 09d7e9e into weldr:rhel8-branch Mar 21, 2019
@coveralls
Copy link

Pull Request Test Coverage Report for Build 1375

  • 92 of 127 (72.44%) changed or added relevant lines in 3 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+4.7%) to 49.219%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/pylorax/creator.py 24 25 96.0%
src/pylorax/ltmpl.py 50 84 59.52%
Files with Coverage Reduction New Missed Lines %
src/pylorax/ltmpl.py 1 22.83%
Totals Coverage Status
Change from base Build 1374: 4.7%
Covered Lines: 2476
Relevant Lines: 4762

💛 - Coveralls

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

Successfully merging this pull request may close these issues.

None yet

3 participants