Compare commits

...

836 Commits

Author SHA1 Message Date
Matej Marusak
e04523f3ba
test: Don't upgrade pip packages (#1057)
See https://github.com/cockpit-project/bots/pull/1115

Related: rhbz#1785159
2020-08-04 13:51:10 +03:00
Chris Roberts
278b5523e8 Switch VMware testing env to improve stability
Related: rhbz#1785159
2020-08-03 09:05:57 -07:00
Brian C. Lane
9984fe605f Automatic commit of package [lorax-composer] release [19.7.43-1].
Created by command:

/usr/bin/tito tag
2020-06-18 15:07:36 -07:00
Brian C. Lane
ce4b4cef4f composer-cli: Change timeout to 5 minutes
In some cases osbuild-composer with an empty cache can take longer than
a minute to depsolve and start a compose.

Related: rhbz#1847490
2020-06-17 09:26:16 -07:00
Brian C. Lane
eece1686c5 composer-cli: Disable retry counter on connection timeout
urllib3 has a retry system that send the request again when the
connection fails, times out, is redircted, etc. This turns off retries,
which aren't very useful anyway.

Resolves: rhbz#1847490
2020-06-17 09:23:58 -07:00
Martin Pitt
9ce764521b test: Put VM image overlay into /var/tmp
At least in our CI, the default place to store VM runtime overlays
(testvm.get_temp_dir()) points to a tmpfs file, so that tests can put VM
overlays into RAM and are not affected by slow I/O. But that doesn't
work for composer, as it tends to produce huge overlays due to real-life
OS composed trees.

Use /var/tmp/ instead, which is meant for large files.

Also simplify the VirtMachine invocation -- if `identity_file` is None,
that's fine -- it's the default value of that argument anyway.

Cherry-picked from master commit 9b8e0e2335
2020-06-02 21:32:16 +02:00
Brian C. Lane
ba9d3249ca Automatic commit of package [lorax-composer] release [19.7.42-1].
Created by command:

/usr/bin/tito tag
2020-05-18 16:05:24 -07:00
Jiri Kortus
5400d3e9b6 [tests] Remove vm-local-repos Makefile target
Related: rhbz#1810711
2020-05-18 11:30:08 -07:00
Jiri Kortus
d72a2b0c7b [tests] Enable handling of rel-eng images
In order to enable testing on rel-eng images, it's necessary to properly
change the way lorax-composer packages are installed (in Makefile and
vm.install script).

Related: rhbz#1810711
2020-05-18 11:30:08 -07:00
Alexander Todorov
d4b40da130 tests: Unskip AWS test scenario
Related: rhbz#1785159
2020-05-15 14:56:09 +03:00
Brian C. Lane
f1e5c9fb05 Automatic commit of package [lorax-composer] release [19.7.41-1].
Created by command:

/usr/bin/tito tag
2020-05-11 15:27:39 -07:00
Jiri Kortus
3ac5810d35 [tests] Fix repos files handling in test_repos_sanity.sh
Related: rhbz#1828808
2020-05-11 14:45:55 +03:00
Jiri Kortus
486374eee8 [tests] update glusterfs version to 6
Related: rhbz#1828808
2020-05-04 16:45:17 +03:00
Jiri Kortus
dc18200b6f [tests] Use rel-eng/nightly repo in test_repos_sanity.sh and vm.install
The same change has been made in the live ISO test, so keep this change uniform
also in the test_repos_sanity.sh test and vm.install script.

Related: rhbz#1828808
2020-05-04 16:45:17 +03:00
Jiri Kortus
7a3916d09e [tests] Update download server URLs in tests
It's not possible anymore to use latest-RHEL-$major in the URLs, it's necessary
to also supply the minor version for rel-eng composes. Also the URL structure
had to be updated due to changes on the download servers.

Related: rhbz#1828808
2020-05-04 16:45:17 +03:00
Jiri Kortus
3e985d60ca Add test for running composer with --no-system-repos option
- add test coverage for rhbz#1650363
- cherry-picked from 5322664432

Related: rhbz#1785159
2020-04-27 11:19:38 -07:00
Jiri Kortus
828a516cb3 [tests] don't add only rel-eng optional repo for live-iso
Adding only rel-eng optional repo for live-iso can cause
broken dependencies if the base repo (nightly) contains
packages in newer versions than what is required by packages
in optional repo.

A better way in the live-iso test is to add a rel-eng or
nightly optional repo based on the already existing repos.

Fixes: rhbz#1826029
2020-04-27 13:24:11 +03:00
Brian C. Lane
14a8e81dda Automatic commit of package [lorax-composer] release [19.7.40-1].
Created by command:

/usr/bin/tito tag
2020-04-20 10:26:35 -07:00
Brian C. Lane
13608077ae Add --no-system-repos to lorax-composer
Running lorax-composer --no-system-repos will prevent it from copying
the yum repositories from /etc/yum.repos.d/ into the lorax-composer repo
directory. It will *only* use repositories setup using the sources api
or written to /var/lib/lorax/composer/repos.d/

If lorax-composer has previously been run without this switch the system
repos will need to be removed from the composer/repos.d/ directory. It
would also be a good idea to remove the cached metadata in
/var/tmp/composer/

Resolves: rhbz#1785388
2020-04-20 09:31:33 -07:00
Alexander Todorov
f467a3aba7 tests: update skip message for TestApi
Related: rhbz#1785159
2020-04-20 09:28:11 -07:00
Jakub Rusz
4d28da3818 tests: remove --test=2 from compose_sanity
This ensures that after canceling a compose, the next one can be finished.

(cherry picked from commit 6924571d95)

Related: rhbz#1789451
2020-04-20 13:18:38 +03:00
Jakub Rusz
06f09b2335 Add test for canceling a running compose
This is a modification of an existing test for compose sanity.
Cherry picked from 8c9f528cd4

Related: rhbz#1789451
2020-04-20 13:18:38 +03:00
Chris Roberts
772e841a7f Update datastore for VMware testing
This change is needed for VMWare testing due to changes in the storage,
and the datastore we used before is not available for the time being.
Related: rhbz#1785159
2020-04-17 09:29:51 -07:00
Alexander Todorov
c56d57ef7e tests: pip install future
Resolves:
https://github.com/ansible/ansible/issues/68616
https://github.com/cockpit-project/bots/pull/636

Another posibility would be to `yum install python2-future` from
EPEL in vm.install instead.

Related: rhbz#1785159
2020-04-17 09:27:54 -07:00
Brian C. Lane
9291f3f3ea lorax-composer: Estimate metadata size required by Anaconda
Anaconda doesn't download the filelists or 'other' metadata, which can
add a significant amount of space to the metadata cache on the build
host. So to estimate the amount of space needed by Anaconda exclude the
space used by *filelists* and *other* files.

With these changes the lorax-composer estimate should actually be fairly
accurate. But since Anaconda only uses the installedsize * 1.35 we have
to make sure that the size we use is at least as big as what anaconda
will estimate, otherwise the installation will fail.

Resolves: rhbz#1761337
2020-04-17 09:08:53 -07:00
Brian C. Lane
e0da9b987b composer: Add the yum cache archive size to the size estimate
anaconda moves the yum cache to the disk once it is partitioned, so the
downloaded rpms also consume space until the installation is finished.
Take this into account when estimating the size.

Thanks to Christophe Besson for spotting this.

Related: rhbz#1761337
2020-04-17 09:08:53 -07:00
Brian C. Lane
9c44f5213b Automatic commit of package [lorax-composer] release [19.7.39-1].
Created by command:

/usr/bin/tito tag
2019-12-13 16:50:44 -08:00
Brian C. Lane
7fcd0aa979 test: Turn TestLiveIso back on
Related: rhbz#1770193
2019-12-11 15:23:40 -08:00
Brian C. Lane
626dfbd4ea Makefile: archive should not run git tag
This causes 'make vm' to tag the current commit as 'HEAD' which causes
no end of confusion.

Related: rhbz#1770193
2019-12-11 15:23:40 -08:00
Brian C. Lane
a432c71c95 lorax-composer: Add liveuser on live-iso to wheel group
They can already su - to root, adding them to wheel lets sudo also work.

Related: rhbz#1770193
2019-12-11 15:23:40 -08:00
Brian C. Lane
a25fcf4369 tests: Boot the test images with graphics=True
This adds vnc to the libvirt config, which makes booting the
live-iso work.

Related: rhbz#1770193
2019-12-11 15:23:19 -08:00
Brian C. Lane
64998d853d tests: Add serial console to images we boot in CI
In some cases it will not boot without a console, and the CI framework
defaults to using serial console. So set it on live-iso, qcow2, and the
final iso installed with liveimg.

Related: rhbz#1770193
2019-12-11 15:16:50 -08:00
Brian C. Lane
60806ab596 Automatic commit of package [lorax-composer] release [19.7.38-1].
Created by command:

/bin/tito tag
2019-12-09 16:02:22 -08:00
Brian C. Lane
e51b00edca lorax-composer: Change cockpit.socket examples to cockpit
The RHEL7 version of Anaconda only allows .service units to be used with
the kickstart services command. Update the documentation, examples, and
tests to reflect this.

Related: rhbz#1718473
2019-12-06 11:01:55 -08:00
Brian C. Lane
915fc24fee Automatic commit of package [lorax-composer] release [19.7.37-1].
Created by command:

/bin/tito tag
2019-12-02 15:30:50 -08:00
Alexander Todorov
bc0dd4c92c tests: If TEST_OS isn't specified then match the host OS
this will help with downstream snapshots testing making
it easier to match the host OS snapshot

Cherry-picked from 6839390be2

Related: rhbz#1770193
2019-11-28 10:30:08 +02:00
Alexander Todorov
b81e260c4d Remove all repo files & install composer-cli from host repos
when testing downstream snapshots this makes sure that
lorax-composer and composer-cli are coming from the host OS.

We also make 100% sure that there are no other repositories inside
the VM other than what has been configured on the host!

Make it possible to override where repo files are copied from by
defining the REPOS_DIR variable. By default the value is
/etc/yum.repos.d

Cherry-picked from bd2f4925de

Related: rhbz#1770193
2019-11-28 10:30:08 +02:00
Alexander Todorov
50aa59cec1 Always remove lorax-composer & composer-cli RPMs before installing them
this will ensure locally built packages are always installed

Cherry-picked from 29492b62f6

Related: rhbz#1770193
2019-11-28 10:30:08 +02:00
Alexander Todorov
553498d543 Always remove existing VM image before building new one
Cherry-picked from 92bf03ea51

Related: rhbz#1770193
2019-11-28 10:30:08 +02:00
Alexander Todorov
c020cec968 tests: enable compose_ext4 test to use CDN repos
Cherry-picked from b903bf0abcf6fb12e308992b875d79d420c5ca74

Related: rhbz#1698366
2019-11-27 19:44:22 +02:00
Brian C. Lane
bb82857ab3 Automatic commit of package [lorax-composer] release [19.7.36-1].
Created by command:

/bin/tito tag
2019-11-19 10:12:14 -08:00
Alexander Todorov
0d344e6cae tests: restart composer after adding optional reporsitory
b/c live-iso needs grub2-efi-*-cdboot from Optional

Related: rhbz#1770193
2019-11-19 09:59:58 -08:00
Alexander Todorov
64a593a376 tests: Keep beakerlib repo on the VM for tests which need it
Related: rhbz#1770193
2019-11-19 09:59:58 -08:00
Alexander Todorov
b0dc59534c tests: unskip Qcow2 scenario
previously relying on nested virt

Related: rhbz#1770193

NOTE: live-iso still fails on RHEL 7 and we've been unsuccessfull
figuring out why so skip it for now
2019-11-19 09:59:58 -08:00
Alexander Todorov
d11f5079f4 tests: Ensure failure if beakerlib results file not found
In example here
https://209.132.184.41:8493/logs/pull-887-20191025-100505-509b9eae-weldr-lorax--fedora-31-tar/log.html

we're seeing stuff like:
/tests/test_cli.sh: line 109: /tmp/composer-test.wIAITH/TestResults: No such file or directory

but the result is PASS

Cherry-picked from 2b578dcee8

Related: rhbz#1770193
2019-11-19 09:59:58 -08:00
Alexander Todorov
dee3f4ed2b tests: Documentation updates
Cherry-picked from c43ba9e78f

Related: rhbz#1770193
2019-11-19 09:59:58 -08:00
Alexander Todorov
a0cee0b543 tests: Use host repositories for make vm
to help with running the tests by hand on downstream snapshots.
In that scenario we want TEST_OS/VM_IMAGE to look as closely as
possibly like the snapshot that we'd like to test.

Cherry-picked from 1351c4dc63

Related: rhbz#1770193
2019-11-19 09:59:58 -08:00
Alexander Todorov
60ef7231fe Remove unused make targets
these were only used by Jenkins but we don't have Jenkins anymore

Cherry-picked from e7e70313ef

Related: rhbz#1770193
2019-11-19 09:59:58 -08:00
Alexander Todorov
92535addc8 DRY when setting up, running & parsing results for beakerlib tests
Cherry-picked from b197e448ff

Related: rhbz#1770193
2019-11-19 09:59:58 -08:00
Brian C. Lane
3d3c32819c tests: Fix check_root_account when used with tar liveimg test
passwd and openssh-clients need to be installed, and there is no need to
use sudo when you are connecting to the system as root.

Cherry-picked from 454af0c5d5

Related: rhbz#1770193
2019-11-19 09:59:58 -08:00
Alexander Todorov
ac1bcd9d1d tests: Use the same asserts as before
after the changes around live-iso and qcow2 test cases the asserts
used have also changed. This commit utilizes the existing test lib.

Cherry-picked from d67745d755

Related: rhbz#1770193
2019-11-19 09:59:58 -08:00
Alexander Todorov
33b9b46fb6 tests: switch to using podman instead of docker
Note: use podman-docker to avoid changing tests too much. This
is also what we have on the RHEL branches.

There's no service to be started/restarted so remove everything
related to docker service.

Cherry-picked from e1b45958f4

Related: rhbz#1770193
2019-11-19 09:59:58 -08:00
Brian C. Lane
bb57558603 tests: Remove nested vm from tar liveimg kickstart test
Use anaconda to install the root.tar.xz into a disk image.  Copy the
disk image to the host, and use the cockpit vm support to boot it and
test it.

Cherry-picked from 4705ff3b1e

Related: rhbz#1770193
2019-11-19 09:59:58 -08:00
Brian C. Lane
ad472685c9 tests: Use --http0.9 for curl ssh test
Cherry-picked from a0ae10c2d7

Related: rhbz#1770193
2019-11-19 09:59:58 -08:00
Brian C. Lane
742a245719 test: Boot the live-iso faster, and login using ssh key
On Fedora 31 passworless root login is no longer working. We already
install a ssh key, may as well use it.

This also reduces the live boot timeout to 2s from 60s, which should
help with timeout problems when booting.

Cherry-picked from e3654e8297

Related: rhbz#1770193
2019-11-19 09:59:58 -08:00
Brian C. Lane
5cdd01be36 tests: Split testing the image into a separate script
Nested virt is not reliable enough, especially on other arches, to rely
on for testing the created images. This moves the test code into
test_boot_* scripts to be run from inside the booted images.

It also adds copying the results of the build into
/var/tmp/test-results/, and includes the generated ssh key so that
whatever boots the image can also log in.

The tests/test_image.sh script has been added to handle running the
test_boot_* scripts without any of the extra lorax-composer specific
setup.

Cherry-picked from b8bf258a3c

Related: rhbz#1770193
2019-11-19 09:59:58 -08:00
Brian C. Lane
c1609d7ffe test: Split up the test class to allow booting other images
This splits out the lorax-composer specific execution so that the built
image can be downloaded from the build vm and booted by the host instead
of using nested virt to try and boot it inside the build vm.

Also adds copying the ssh key from the build vm so that it can log into
the image and run the test_boot_* scripts.

Cherry-picked from df7a018ee2

Related: rhbz#1770193
2019-11-19 09:59:58 -08:00
Alexander Todorov
8b8f5355bf [tests] Collect compose logs after each build
- save compose logs under /var/log/$TEST
- save qemu logs under /var/log/$TEST/qemu.log
- download everything to $TEST_ATTACHMENTS so it can be saved
  in CI results

Cherry-picked from 8af9723c

Related: rhbz#1770193
2019-11-19 09:59:58 -08:00
Jiri Kortus
a8d7841bc1 [tests] Use a function to wait for compose to finish
The function is meant to replace the duplicate pieces of code used in various
tests, the polling interval is unified to 20 seconds.

Cherry-picked from 836f0ddf

Related: rhbz#1770193
2019-11-19 09:59:58 -08:00
Alexander Todorov
78fbb7c49e [tests] Use functions for starting and stopping lorax-composer
Cherry-picked from f978d4b01c

Related: rhbz#1770193
2019-11-19 09:59:58 -08:00
Brian C. Lane
8e650d1d07 Update for differences from py3 in the backported code
In py3 dicts are not predictable, make sure the keys are sorted so that
the tests are useful.

Use StringIO.StringIO instead of io.StringIO which requires unicode
text.

kickstart timezone.ntpservers is a set() so adjust the test for it.

Related: rhbz#1718473
2019-11-18 12:36:18 +02:00
Brian C. Lane
406dddafef Remove repos.git related tests
Support is not included in this patchset.

(cherry picked from commit a643522769)

Related: rhbz#1718473
2019-11-18 12:36:18 +02:00
Brian C. Lane
39f464d46b composer-cli: Update diff support for customizations and repos.git
composer-cli will now output information about changes to customizations
entries and the repos.git entries.

(cherry picked from commit 156ef0acfd)

Related: rhbz#1718473
2019-11-18 12:36:18 +02:00
Brian C. Lane
f0efcd9b0f Add support for customizations and repos.git to /blueprints/diff/
This also includes extensive tests for each of the currently supported
customizations. It should be generic enough to continue working as long
as the list of dicts includes a 'name' or 'user' field in the dict.
Otherwise support for a new dict key will need to be added to the
customizations_diff function.

(cherry picked from commit 850c490b6e)

Related: rhbz#1718473
2019-11-18 12:36:18 +02:00
Brian C. Lane
e2262e57e3 tests: Update custom-base with customizations
(cherry picked from commit 9724731b8d)

Related: rhbz#1718473
2019-11-18 12:36:18 +02:00
Brian C. Lane
b4a95b8d2b Change customizations.firewall to append items instead of replace
To maintain consistency with the other options this changes firewall to
combine the existing settings from the image template with the settings
from the blueprint.

Also updated the docs, added a new test for it, and sorted the output
for consistency.

(cherry picked from commit 3e08389a0f)

Related: rhbz#1718473
2019-11-18 12:36:18 +02:00
Brian C. Lane
4d7e3bb4bc Update customizations.services documentation
Make it clear that the services are added to services already listed in
the image templates, and that you can specify any systemd unit filename.

Older releases are more restrictive, and this documentation will need to
be updated when these changes are backported.

(cherry picked from commit 4f701e7e92)

Related: rhbz#1718473
2019-11-18 12:36:18 +02:00
Brian C. Lane
f2209932a6 lorax-composer: Add services support to blueprints
Add support for enabling and disabling systemd services in the
blueprint. It works like this:

    [customizations.services]
    enabled = ["sshd", "cockpit.socket", "httpd"]
    disabled = ["postfix", "telnetd"]

They are *added* to any existing settings in the kickstart templates.

(cherry picked from commit 1111aee92d)

Related: rhbz#1718473
2019-11-18 12:36:18 +02:00
Brian C. Lane
780f00d81a lorax-composer: Add firewall support to blueprints
You can now open ports in the firewall, using port numbers or service
names:

    [customizations.firewall]
    ports = ["22:tcp", "80:tcp", "imap:tcp", "53:tcp", "53:udp"]

Or enable/disable services registered with firewalld:

     [customizations.firewall.services]
     enabled = ["ftp", "ntp", "dhcp"]
     disabled = ["telnet"]

If the template contains firewall --disabled it cannot be overridden,
under the assumption that it is required for the image to boot in the
selected environment.

(cherry picked from commit 4d35668ab5)

Related: rhbz#1718473
2019-11-18 12:36:18 +02:00
Brian C. Lane
a9c5581aa9 lorax-composer: Add locale support to blueprints
You can now set the keyboard layout and language. Eg.

[customizations.locale]
languages = ["en_CA.utf8", "en_HK.utf8"]
keyboard = "de (dvorak)"

Existing entries in the kickstart templates are replaced with the new
ones. If there are no entries then it will default to 'keyboard us' and
'lang en_US.UTF-8'

Includes tests, and leaves the existing keyboard and lang entries in the
templates with a note that they can be replaced by the blueprint.

(cherry picked from commit e5a8700bdf)

Related: rhbz#1718473
2019-11-18 12:36:18 +02:00
Brian C. Lane
5d307a475d Update docs for new timezone section
(cherry picked from commit 2929deaf01)

Related: rhbz#1718473
2019-11-18 12:36:18 +02:00
Brian C. Lane
956ebfc77c lorax-composer: Add timezone support to blueprint
For example:

[customizations.timezone]
timezone = "US/Samoa"
ntpservers = ["0.pool.ntp.org"]

Also includes tests.

This removes the timezone kickstart command from all of the templates
except for google.ks which needs to set it's own ntp servers and timezone.

If timezone isn't included in the blueprint, and it is not already in a
template, it will be set to 'timezone UTC' by default.

If timezone is set in a template it is left as-is, under the assumption
that the image type requires it to boot correctly.

(cherry picked from commit 9bdbb29662)

Related: rhbz#1718473
2019-11-18 12:36:18 +02:00
Brian C. Lane
e72debe1d1 Proposal for adding to the blueprint customizations
The goal here is to do the minimum needed to get the images setup for
use so they can have more complex customizations applied later.
I think this list is a pretty good minimal set of features without going
full kickstart.

(cherry picked from commit 95c288d829)

Related: rhbz#1718473
2019-11-18 12:36:18 +02:00
Alexander Todorov
e34201c0bd tests: Document Azure setup 2019-10-21 20:51:20 +03:00
Alexander Todorov
96091d3295 tests: unskip Azure scenario 2019-10-21 19:46:40 +02:00
Martin Pitt
b899a67bee Support CI testing against a bots project PR
* If `$COCKPIT_BOTS_REF` is set, check out that bots version instead of
   master.

 * Use git cache in $XDG_CACHE_HOME if available. Our CI uses that to
   save downloads, and it does not get in the way for local developers.

Adapted from https://github.com/cockpit-project/starter-kit/pull/233

Cherry-picked from master commit a2c67385e4.
2019-10-15 07:30:51 +02:00
Sanne Raymaekers
ecd2d8c463 Makefile: Update bots target for moved GitHub project
Cockpit bots are in their own project now.

Cherry-picked from master commits 4643afa58 and 29c308ae73.
2019-10-15 07:30:51 +02:00
Jiri Kortus
22acf067cd tests: Add kickstart tar installation test
Related: rhbz#1733504
2019-10-04 12:09:12 +03:00
Jiri Kortus
2795969126 tests: Increase test VM memory to 3 GB
The reason for this change is that the tar image kickstart installation
test doesn't work with 2 GB.

Related: rhbz#1733504
2019-10-04 12:09:12 +03:00
Jiri Kortus
64f00d94b8 tests: add option to disable kernel command line parameters check
Related: rhbz#1733504
2019-10-04 12:09:12 +03:00
Brian C. Lane
c2c6bfa458 tests: Use a loop to wait for VM and sshd to start
Related: rhbz#1733504
2019-10-04 12:09:12 +03:00
Brian C. Lane
9d7fcc8642 tests: Drop sort from compose types test
The output from the API is already sorted, and 'sort' changes this
ordering in some situations.

Related: rhbz#1749802
2019-09-13 14:05:42 +03:00
Alexander Todorov
80c69f0621 New test: assert toml files in git workspace
export BLUEPRINTS_DIR for use in tests

Depending on the way the tests are run the directory may be a temporary
dir, or it may be the standard /var/lib/lorax/... path.

Related: rhbz#1749802
2019-09-13 14:05:42 +03:00
Alexander Todorov
258d01647a Change paths for '/api/status' calls and skip this test
Skipping because:

larsu: I get `open failed: administratively prohibited: open failed`
larsu: ssh somehow disallows making a side channel for the forward
larsu: there's an option that controls it, but it's set to "yes"
larsu: I've straced the sshd, with no luck coming closer

We'll deal with this later, possibly together with the rest of
the skipped test cases.

Related: rhbz#1698366
2019-09-13 11:27:12 +03:00
Alexander Todorov
22de8ed603 Ignore Cockpit CI files when linting
- these files are executed under Python 3 while the linter
  is Python 2 for RHEL 7 so we just ingore them
- also reverts the changes introduced to make these files Py2
  compatible, making them the same as on master branch

Related: rhbz#1698366
2019-09-13 11:27:12 +03:00
Alexander Todorov
b38a358ea3 Use optional repository in Live ISO test
live-iso image type needs grub2-efi-*-cdboot from optional.

Related: rhbz#1698366
2019-09-13 11:27:12 +03:00
Alexander Todorov
77649cbf76 Install test dependencies inside virtualenv
Related: rhbz#1698366
2019-09-13 11:27:12 +03:00
Alexander Todorov
89e56aa3b4 Install python2-pip in the test VM and disable EPEL repo
so we don't use EPEL when actually building the images

Related: rhbz#1698366
2019-09-13 11:27:12 +03:00
Alexander Todorov
2136d88cd6 Use qemu-kvm in tests instead of qemu-system
Related: rhbz#1698366
2019-09-13 11:27:12 +03:00
Alexander Todorov
a728011196 Skip AWS, Azure, qcow2 and live-iso tests
due to infrastructure issues. These will be investigated and enabled
later.

Related: rhbz#1698366
2019-09-13 11:27:12 +03:00
Alexander Todorov
3d27053605 Don't hard-code the path to toml-compare
Related: rhbz#1698366
2019-09-13 11:27:12 +03:00
Alexander Todorov
29531d373e Install or remove packages in the test environment
which are needed for running the tests or prevent some test tools
from installing

Related: rhbz#1698366
2019-09-13 11:27:12 +03:00
Alexander Todorov
e7035b8f78 Install additional repositories for testing
Related: rhbz#1698366
2019-09-13 11:27:12 +03:00
Alexander Todorov
d97ff118d9 Prevent ssh asking for password when testing on interactive terminal
Related: rhbz#1704209
2019-09-13 11:27:12 +03:00
Alexander Todorov
0777e91d52 Fail if number of excuted tests != number of dicovered tests
this will report failing status in CI in case we have the
'Ran 0 tests in 46.486s' scenario.

Note: the check is placed after runner.run() to present the
message shown above which should make it more clear what went on.

Related: rhbz#1698366

0 run
2019-09-13 11:27:12 +03:00
Alexander Todorov
9bce583fc2 Fix typo from test backport
Related: rhbz#1698366
2019-09-13 11:27:12 +03:00
Jiri Kortus
b0b603dc2e Use passwd --status for locked root account check
Related: rhbz#1687595
2019-07-10 09:17:58 +02:00
Alexander Todorov
8734f662e9 Backport changes for Cockpit CI
Related: rhbz#1698366
2019-06-25 11:57:33 +03:00
Brian C. Lane
3951363660 Automatic commit of package [lorax-composer] release [19.7.35-1].
Created by command:

/bin/tito tag
2019-06-24 16:45:10 -07:00
Lars Karlitski
fd2e1738ab test_compose_tar: Fix docker test
The docker phase always failed because `-ti` was passed even though the
the output was not a terminal. Moreover docker service isn't running by
default on RHEL-7, so it's necessary to start it first explicitly.

Related: rhbz#1720224
2019-06-24 10:33:37 +03:00
Brian C. Lane
cdfdb651f7 tests: kill the qemu process name used to start it
Related: rhbz#1710877
2019-06-24 10:33:37 +03:00
Brian C. Lane
7c8e6e75ca Update local copy of lorax to current rhel7-branch
These are used when running tests, so catch-up with changes in lorax.
Includes adding rootfs-size, extra kernel args, and using locking to
prevent temporary files from being deleted by systemd tmpfiles handling.

Related: rhbz#1668520
Related: rhbz#1715116
Related: rhbz#1689314
2019-06-24 10:33:37 +03:00
Brian C. Lane
9e52529025 Update the lorax templates to match what lorax provides
lorax-creator doesn't ship these, but it uses them for running tests, so
make sure they are current.

Related: rhbz#1689314
2019-06-24 10:33:37 +03:00
Brian C. Lane
16a00db1f0 Enable networking in lorax-composer templates
Because anaconda --dirinstall is used the kickstart's network like isn't
processed at all. So we need to remove the NetworkManager-server-config
package which disables networking.

Resolves: rhbz#1710877
2019-06-17 16:12:34 -07:00
Brian C. Lane
47cce303d5 Automatic commit of package [lorax-composer] release [19.7.34-1].
Created by command:

/bin/tito tag
2019-06-13 08:38:21 -07:00
Alexander Todorov
63c50c08eb [tests] Handle blueprints in setup_tests/teardown_tests correctly
It's necessary to make sure the blueprints directory doesn't contain
the git/ directory before the tests are run, so that we can just simply
modify the blueprint files without using blueprints push.

Related: rhbz#1698366
2019-06-12 21:50:08 +03:00
Lars Karlitski
7c0d2577a8 tests: Set BLUEPRINTS_DIR in all cases
`setup_tests()` expected BLUEPRINTS_DIR to be set, but it wasn't when
running in automated mode (with $CLI set).

Fix this and move share and blueprint dirs to function arguments.

Related: rhbz#1698366
2019-06-12 21:50:08 +03:00
Alexander Todorov
9b5554aa1e tests: Change the way how we remove pyOpenSSL
the version coming from RPM is older and prevents installing
ansible[azure] via pip. OTOH removing with yum also removes
lorax-composer and breaks tests when running against the RPM
instead of git checkout (which will be the default with Cockpit CI).

Related: rhbz#1715003
2019-06-12 11:21:56 +03:00
Jiri Kortus
94892e56dd Use a less strict regex for disabled root account check
Related: rhbz#1687595
2019-05-13 15:31:27 +03:00
Jiri Kortus
481f33b898 Add test for passing custom option on kernel command line
Related: rhbz#1688335
2019-05-13 15:31:27 +03:00
Jiri Kortus
0980ddfc54 Use verify_image function as a helper for generic tests
Related: rhbz#1704209
2019-05-13 15:31:27 +03:00
Brian C. Lane
59793f9889 Automatic commit of package [lorax-composer] release [19.7.33-1].
Created by command:

/bin/tito tag
2019-05-07 10:56:29 -07:00
Lars Karlitski
e7c910d4fa Pass ssl certificate options to anaconda
If a repository has `sslcacert`, `sslclientcert`, or `ssclientkey` set,
pass them to anaconda through the kickstart file. This is mostly the
case when using RHEL repositories that are accessed through a
subscription.

Resolves: rhbz#1701033
2019-05-07 10:42:09 -07:00
Alexander Todorov
1bf7708830 Change [[modules]] to [[packages]] in tests
> bcl: this should really be [[packages]] since [[modules]] is
> going to change to actual modules at some point

Related: rhbz#1698366
2019-05-07 19:19:27 +03:00
Alexander Todorov
83707bfa06 Add new test to verify compose paths exist
because they are mentioned in the official documentation

Related: rhbz#1698366
2019-05-07 19:19:27 +03:00
Alexander Todorov
ff7d7c2d49 Add new sanity tests for blueprints
- verify SemVer .patch number will be automatically updated when
  we push the blueprint a second time without changing version
- verify show displays the content in TOML format and it matches
  what is on disk. Because of that also start with empty packages
  and groups fields in the initial toml. If they are missing they
  will be added automatically by lorax-composer and this simplifies
  the test
- verify delete works

Related: rhbz#1698366
2019-05-07 19:19:27 +03:00
Brian C. Lane
b7b17391de Automatic commit of package [lorax-composer] release [19.7.32-1].
Created by command:

/bin/tito tag
2019-04-29 16:29:13 -07:00
Brian C. Lane
41d822f754 tests: Add a test for using [[customizations]] with [customizations.kernel]
Make sure this is really fixed by running the template tests with both
variations. NOTE: [customizations] is the correct form. An early
documentation bug led to both being accepted.

Related: rhbz#1688335
2019-04-29 16:01:30 -07:00
Brian C. Lane
5b2d894269 lorax-composer: Fix customizations when creating a recipe
This fixes the customizations list problem earlier than in
add_customizations.

In the recipe it should be [customizations] not [[customizations]]
which creates a list. If it was used that way grab the first element and
replace the list with it.

Related: rhbz#1688335
2019-04-29 16:01:17 -07:00
Brian C. Lane
8ca8702fbc Automatic commit of package [lorax-composer] release [19.7.31-1].
Created by command:

/bin/tito tag
2019-04-29 11:20:26 -07:00
Brian C. Lane
e988b8e7d6 Fixup print function usage with StringIO
Related: rhbz#1688335
2019-04-29 10:41:57 -07:00
Brian C. Lane
0b8a5ac87c lorax-composer: pass customization.kernel append to extra_boot_args
This allows iso builds to include the extra kernel boot parameters by
passing them to the arch-specific live/*tmpl template.

Also adds tests to make sure it is written to config.toml in the build
metadata.

Resolves: rhbz#1688335
2019-04-29 10:41:57 -07:00
Brian C. Lane
9cebd1ddaf lorax-composer: Add the ability to append to the kernel command-line
Sometimes it is necessary to modify the kernel command-line of the
image, this adds support for a [customizations.kernel] section to the
blueprint:

[customizations.kernel]
append = "nosmt=force"

This will be appended to the kickstart's bootloader --append argument.

Includes tests for modifying the bootloader line, the kickstart
template, and examining the final-kickstart.ks created for a compose.

Related: rhbz#1688335
2019-04-29 10:41:57 -07:00
Brian C. Lane
72d1094fb6 Automatic commit of package [lorax-composer] release [19.7.30-1].
Created by command:

/bin/tito tag
2019-04-24 09:36:28 -07:00
Jiri Kortus
5b45593f3c Add test for starting compose with deleted blueprint
Related: rhbz#1683442
2019-04-24 14:14:40 +03:00
Brian C. Lane
a81964a603 lorax-composer: Return UnknownBlueprint errors when using deleted blueprints
Reading a blueprint wasn't checking to see if it had been deleted so it
was returning the most recent commit before it had been deleted. This
allowed things like starting a compose with a blueprint that technically
doesn't exist.

One exception to this is the /changes/ route, it must be available so
that you can use the commit hash to undo a delete.

This also adds tests for the various operations.

(cherry picked from commit d32f477e0b)

Resolves: rhbz#1683442
2019-04-22 10:17:25 -07:00
Brian C. Lane
2eb4437159 lorax-composer: Delete workspace copy when deleting blueprint
Also extends the blueprint delete test to also check the workspace.

(cherry picked from commit 26bd2c1378)

Related: rhbz#1683442
2019-04-22 10:16:40 -07:00
Jan Stodola
73de195334 Use existing storage account
To avoid creating a new storage account for every new VM.

Related: rhbz#1673012
2019-04-22 15:57:07 +03:00
Jan Stodola
fabf428f00 Record date/time of VM creation
Related: rhbz#1673012
2019-04-22 15:57:07 +03:00
Chris Roberts
2ebf60f28d Update datastore for VMware testing
Cluster and Network changed due to new hardware in RDU2 DC

Related: rhbz#1656105
2019-04-18 10:35:53 +03:00
Jiri Kortus
6fb94326e7 Fixes for locked root account test
Fixes related to a few issues in the locked root account test I somehow
managed to overlook in the initial commit.

Related: rhbz#1687595
2019-04-09 18:54:03 +03:00
Jiri Kortus
277d391f01 Add checks for disabled root account
The root account checks are applied to generated and deployed images
to make sure that root account is locked, except for live ISO.

Related: rhbz#1687595
2019-03-29 15:22:57 +02:00
Jiri Kortus
5d6446a7bd 'compose info' is 'compose details' on RHEL-7
Add the correct composer-cli command 'compose details' in places
where 'compose info' was still used on RHEL-7
(see commit 808454b561)

Related: rhbz#1687595
2019-03-29 14:44:53 +02:00
Chris Roberts
c6e8befe21 Update some grammer issues in the test Bash scripts
Related: rhbz#1656105
2019-03-22 12:15:38 +02:00
Chris Roberts
48a28e0950 Update datastore for VMware testing
Datastore switched from NFS to iSCSI

Related: rhbz#1656105
2019-03-22 12:11:56 +02:00
Brian C. Lane
86718c517d Automatic commit of package [lorax-composer] release [19.7.29-1].
Created by command:

/bin/tito tag
2019-03-19 09:27:03 -07:00
Alexander Todorov
64baf7c147 Allow overriding $CLI outside test scripts
this will allow you to test against installed RPM like so:

    # export CLI="/usr/bin/composer-cli"
    # make test_images

If you already have lorax-composer running then you can directly
execute test scripts:

    # ./tests/cli/test_build_and_deploy_aws.sh

Related: rhbz#1687595
2019-03-15 11:02:00 +02:00
Alexander Todorov
e96a5917bb Use make ci inside test-in-copy target
this minimizes the possibility of these two to diverge over time.
make ci is the default for Jenkins and will also be used for
internal gating tests.

Related: rhbz#1687595
2019-03-15 11:02:00 +02:00
Alexander Todorov
4fb3e42a70 New test: Build live-iso and boot with KVM
explicitly enables sshd for live-iso during testing

Related: rhbz#1656105
2019-03-04 22:08:43 +02:00
Alexander Todorov
561302a30a New test: Build qcow2 compose and test it with QEMU-KVM
Related: rhbz#1656105
2019-02-27 21:46:44 +02:00
Alexander Todorov
c24ad2fed7 New test: Verify tar images with Docker and systemd-nspawn
- on some arches (also Fedora x86_64) systemd-nspawn may not be
  available
- delete composes from other tests in rlPhaseStartCleanup because
  we're seeing the tar compose kind of hanging in Jenkins and that
  test script is executed last so the slave may be running out of
  disk space. Be a good citizen and clean up after the previous
  tests.

Related: rhbz#1656105
2019-02-27 21:46:44 +02:00
Alexander Todorov
41e3f8fecb Update OpenStack flavor and network settings in tests
b/c we've migrated to Upshift we must use different instance type,
specify the desired network to connect to and update how we get
the ip address of the launched VM.

Related: rhbz#1656105
2019-02-27 21:46:44 +02:00
Alexander Todorov
44a79a8a6b Install ansible and openstacksdk inside virtualenv
otherwise we get a conflict with python-ipaddress which is a
dependency of python2-pip and can't really be removed!

Installing from RPM is also a no-go b/c openstacksdk is
not available in EPEL 7. OTOH the RDO repositories which
OpenStack recommends have older version (0.11) and ansible wants
0.12 or later!

Related: rhbz#1656105
2019-02-27 21:46:44 +02:00
Alexander Todorov
2f51fcfb8b Remove python-requests, python-dateutil and pyOpenSSL
b/c they conflict with the modules coming from pip and
prevent azure/ansible installation

Related: rhbz#1656105
2019-02-27 21:46:44 +02:00
Alexander Todorov
5adde2671e Add /usr/local/bin to PATH for tests
pip will install commands there and later scripts will not be able
to find them.

Related rhbz#1656105
2019-02-27 21:46:44 +02:00
Alexander Todorov
9c0f34c0ab Do not generate journal.xml from beakerlib
bacause this requires additional Python modules and we don't
really use it!

Related: rhbz#1656105
2019-02-27 21:46:44 +02:00
Jan Stodola
cd1f26d4e7 Expand parameters as separate words
Related rhbz#1656105
2019-02-27 21:46:44 +02:00
Brian C. Lane
619daa1307 Automatic commit of package [lorax-composer] release [19.7.28-1].
Created by command:

/bin/tito tag
2019-02-25 12:03:19 -08:00
Brian C. Lane
f9c1dad0ba lorax-composer: Check for STATUS before deleting
When there is no run or new symlink do one last check to make sure no
STATUS file was written. If it is missing, go ahead and remove the
results directory.

(cherry picked from commit a8f616c6da)

Related: rhbz#1659129
2019-02-21 16:47:07 -08:00
Brian C. Lane
0baa524d8d Check for existing CANCEL request, and exit on FINISHED
If another CANCEL request has already been made just exit from
uuid_cancel. If the build is FINISHED before it times out just exit,
don't remove the finished results.

(cherry picked from commit 962d10b3b7)

Related: rhbz#1659129
2019-02-21 09:37:24 -08:00
Brian C. Lane
48c8ae6819 Add cancel_func to virt and novirt_install functions
In addition to monitoring the logs for errors, call a function (or
functions) that tell it to cancel the anaconda process and cleanup.

Also check for a cancel after creating the squashfs image for live-iso
since that's a long running process.

This required adding a new argument to a number of existing functions,
passing it down to VirtualInstall and novirt_install where the function
is called.

(cherry picked from commit 4b84475612)

Resolves: rhbz#1659129
2019-02-21 09:37:24 -08:00
Brian C. Lane
ade25f34b3 Remove duplicate repositories from the sources list
In some cases when the host has, for whatever reason, multiple copies of
the same repo listed the build may fail with an error about running out
of space.

So this commit removes duplicate entries after the host's repos have been
loaded. It also adjusts some of the test repos to use different
temporary repo names for the tests.

Resolves: rhbz#1664128
2019-02-21 09:19:30 -08:00
Brian C. Lane
3e5e8b9f1d Remove unneeded else from for/else loop. It confuses pylint
(cherry picked from commit 2950f2641b)

Related: rhbz#1666517
2019-02-19 14:13:32 -08:00
David Shea
252c9f6226 Allow customizations to be specified as a toml list
Support both

  [customizations]
  hostname = "whatever"

and

  [[customizations]]
  hostname = "whatever"

in the blueprint data. The [[ syntax matches the other customization
directives (user, group, sshkey), and as such it's easy to accidentally
use it for the hostname without even realizing it's specifying something
different.

Add some tests for converting customizations to kickstarts.

(cherry picked from commit 35ab6a1336)

Resolves: rhbz#1666517
2019-02-19 14:04:43 -08:00
Jiri Kortus
56d0e704c0 Make sure compose build tests run with SELinux in enforcing mode
Related: rhbz#1654795
2019-02-06 13:59:17 +01:00
Brian C. Lane
47fd6e85b2 Add tests for metapackages and package name globs
This makes sure that depsolving shim installs the shim-* package, and
that depsolving grub2-efi-*-cdboot installs a specific -cdboot package.

Related: rhbz#1641601
2019-01-24 09:57:08 -08:00
Alexander Todorov
2ac027c78b Upgrade pip & setuptools b/c they are rather old
and sometimes Python dependencies fail to install with:

SetuptoolsOutdatedWarning: your setuptools is too old (<12)
2019-01-09 10:55:58 +02:00
Alexander Todorov
177e62a896 Workaround openstacksdk dependency issue
See:
fd61b54679 (diff-b4ef698db8ca845e5845c4618278f29a)

Note: may also affect master/rhel8-branch but haven't seen it
so far. For master we can do:

	dnf install ansible python3-openstacksdk

Not so easy on RHEL 7
2018-12-20 10:55:04 +02:00
Alexander Todorov
7143456043 On Python 2 Azure needs the futures module
this will prevent
ImportError: No module named concurrent.futures

see
https://github.com/Azure/azure-sdk-for-python/issues/2166
2018-12-20 10:55:04 +02:00
Alexander Todorov
d63de76cb3 On RHEL 7 we have Python 2, not Python 3 2018-12-20 10:55:04 +02:00
Alexander Todorov
5dc19500ad On RHEL 7 we have yum instead of dnf 2018-12-20 10:55:04 +02:00
Alexander Todorov
808454b561 On RHEL 7 compose info is compose details 2018-12-20 10:55:04 +02:00
Brian C. Lane
74792f6b6e Report an error if the blueprint doesn't exist
composer-cli uses TOML for 'blueprints save' which was returning an
empty 200 response if the blueprint didn't exist. Change this to return
a standard 400 error response if the blueprint doesn't exist.

composer-cli is already setup to handle receiving json when an error is
returned so just the toml API response for `blueprints/save` needed to
be changed.
2018-12-20 10:55:04 +02:00
Alexander Todorov
aebc3bf280 Build the HTML docs before running tests
on master docs/html/ is part of the git repository, here it is not
2018-12-20 10:55:04 +02:00
Brian C. Lane
dccd283dd2 Disable pylint errors with Flask and gevent
pylint has trouble with Flask response objects, thinking they are tuples
and returning no-member errors. It also doesn't recognize gevent.socket
members like AF_UNIX.
2018-12-20 10:55:04 +02:00
Alexander Todorov
f8137b94db Backport cloud image tests from master 2018-12-20 10:55:04 +02:00
Brian C. Lane
63306c1f64 Fix compose_args for openstack image
RHEL7 arguments are slightly different from the RHEL8 version this was
ported from.

Related: rhbz#1656105
2018-12-14 15:23:43 -08:00
Brian C. Lane
7291c8f8c3 Fix compose_args for vmdk image
RHEL7 arguments are slightly different from the RHEL8 version this was
ported from.

Related: rhbz#1656105
2018-12-14 15:23:43 -08:00
Brian C. Lane
f426a357b1 Fix compose_args for vhd image
RHEL7 arguments are slightly different from the RHEL8 version this was
ported from.

Related: rhbz#1656105
2018-12-14 15:23:43 -08:00
Brian C. Lane
ab17674f75 Fix compose_args for ami image
RHEL7 arguments are slightly different from the RHEL8 version this was
ported from.

Related: rhbz#1656105
2018-12-14 14:19:54 -08:00
Brian C. Lane
5797099552 Update projects list to return only the unique projects
The projects_list function uses a different yum request, and doesn't
return a full project dict. Updated it to also return only the unique
project names.

Related: rhbz#1657055
2018-12-07 15:07:36 -08:00
Brian C. Lane
b449d1cd81 Change yaps_to_module to proj_to_module
It now gets a project dict instead of a yum object, so change it to use
the dict's "name" and update the tests.

Related: rhbz#1657055
2018-12-07 14:41:23 -08:00
Brian C. Lane
0e54983be8 lorax-composer: Handle packages with multiple builds
When the repository has multiple arches, eg. i686 and x86_64, it should
add a new entry to the project's builds list, not create a new project
in the list.

This handles that by adding a modified insort_left function and
examining the packages returned from dnf to make sure they aren't
already listed in the results. It also handles adding them in sorted
order so that no further sorting needs to be done on the results.

Resolves: rhbz#1657055
(cherry picked from commit 663a0dcd73)
2018-12-07 14:10:54 -08:00
Brian C. Lane
72bd52e061 lorax-composer: Check the queue and results at startup
If the system ran out of space, or was rebooted unexpectedly, the state
of the queue symlinks, or the results STATUS files may be inconsistent.
This checks them and:
 * Removes broken symlinks from queue/new and queue/run
 * Removes symlinks from run and sets the build to FAILED
 * Sets builds w/o a STATUS to FAILED
 * Sets builds with STATUS of RUNNING to FAILED
 * Creates missing queue/new symlinks to results with STATUS of WAITING

So, any builds that were running during the reboot will be FAILED, and
any that were waiting to be started will be started upon rebooting.

Resolves: rhbz#1657054
(cherry picked from commit f0bac40d7f)
2018-12-07 13:48:10 -08:00
Brian C. Lane
e1d2e168ed Add an openstack image type
This is a qcow2 image with cloud-init in the template.

(cherry picked from commit 98f8b23129)

Resolves: rhbz#1656105
2018-12-07 13:59:45 -05:00
David Shea
5e64051665 Replace /etc/machine-id with an empty file
Since these images can be used to create multiple machines, they should
not have a unique machine-id attached to them. Replace /etc/machine-id
with an empty file so that it will be regenerated at boot time.

(cherry picked from commit 6fab72d894)

Related: rhbz#1656105
2018-12-07 13:59:45 -05:00
David Shea
4f28d87a6d Add virt guest agents to the qcow2 compose
(cherry picked from commit d5a1993640)

Resolves: rhbz#1656105
2018-12-07 13:59:45 -05:00
David Shea
4862eccd88 Add a vmdk compose type.
This is similar to the AMI type, but also adds open-vm-tools and does not do
anything special to the partitioning

(cherry picked from commit 1056bfc25b)

Resolves: rhbz#1656105
2018-12-07 13:59:45 -05:00
David Shea
202814ae9d Add a vhd compose type for Azure images
This is similar to the AMI compose type, with a handful of additional
changes specific to Azure:

* Add waagent (but leave NetworkManager enabled, despite some of the
  docs)
* Disable cloud-init
* Add Hyper-V modules into initrams.

Fixes specific for RHEL:

* Create ifcfg-eth0 required by waagent.
* Install python3 and net-tools required by waagent.

Recommended changes:

* Use recommended kernel boot args.
* Disable kdump.

(cherry picked from commit e0c236ff36)
(cherry picked from commit da0435bc90)
(cherry picked from commit b594fa99bc)

Resolves: rhbz#1656105
2018-12-07 13:59:45 -05:00
David Shea
61d4353bc7 Add an ami compose type for AWS images
This differs from lmc's --make-ami in that creates a full disk image instead of
an fsimage. Create a raw disk image with a / and /boot partitions, and enable
sshd, chronyd, and cockpit by default.

(cherry picked from commit 18188bf6cf)
(cherry picked from commit 81d38b6445)

Resolves: rhbz#1656105
2018-12-07 13:59:45 -05:00
David Shea
1ca0393771 Remove --fstype from the generated part line
Instead of specifying the fstype, just let anaconda use the default.

(cherry picked from commit 847fff4e11)

Related: rhbz#1656105
2018-12-07 13:59:45 -05:00
Brian C. Lane
60c7ab3e91 lorax-composer: Install selinux-policy-targeted in images
This is required to ensure that SELinux is configured properly while
building. It fixes the problem with building tar, and should be
installed in the other image types for consistency.

Resolves: rhbz#1654795
2018-12-06 16:36:36 -08:00
Brian C. Lane
6b17850739 Remove setfiles from mkrootfsimage
SELinux applies the correct labels, setfiles is no longer needed.
This allows lorax to run with SELinux in Enforcing mode.

Resolves: rhbz#1654795
2018-12-06 16:36:24 -08:00
Brian C. Lane
482d6277e0 Remove SELinux Permissive checks
Anaconda, Lorax, lorax-composer, and livemedia-creator can all now run
with SELinux in Enforcing mode. It does not need to be disabled and if
there are denials they should be reported as a bug.

Log the current state of SELinux when starting, update the
documentation.

Resolves: rhbz#1654795
2018-12-06 16:36:03 -08:00
Brian C. Lane
a40fc22047 Automatic commit of package [lorax-composer] release [19.7.27-1].
Created by command:

/usr/bin/tito tag
2018-10-22 12:03:23 -07:00
Brian C. Lane
bc79b636bb Use matchPackageNames instead of searchNames
Some kickstart templates use globbing to match packages, searchNames
doesn't support this.

Add fallback code to find packages that are just a dep, matching the
behavior of yum.install()

This fixes things so that it can depsolve package names with globs in
them like grub2-efi-*-cdboot, and deps like shim and grub2-efi.

Results are still filtered by the version glob, with the highest NEVRA
selected for installation.

Resolves: rhbz#1641601
2018-10-22 11:03:40 -07:00
Brian C. Lane
e167e5d09f Automatic commit of package [lorax-composer] release [19.7.26-1].
Created by command:

/usr/bin/tito tag
2018-10-08 17:04:23 -07:00
Brian C. Lane
250e68840b Revert "Rename composer-cli to composer"
This reverts commit b8da0a8c8e.

It conflicts with the PHP dependency manager project named 'composer'

Related: rhbz#1635760
2018-10-08 16:55:57 -07:00
Brian C. Lane
b2f94675ce Automatic commit of package [lorax-composer] release [19.7.25-1].
Created by command:

/usr/bin/tito tag
2018-10-05 09:02:50 -07:00
Lars Karlitski
b8da0a8c8e Rename composer-cli to composer
Resolves: rhbz#1635760
2018-10-03 10:43:01 -07:00
Brian C. Lane
a7ab87832b Automatic commit of package [lorax-composer] release [19.7.24-1].
Created by command:

/usr/bin/tito tag
2018-10-01 13:50:24 -07:00
Brian C. Lane
0f130dd91c Add a test for repo metadata expiration
This tests to make sure that the metadata timer is working (by setting
it to 10s and adding a new package to the repo), and that
YumLock.lock_check immediately picks up a new package.

This depends on rpmfluff which is available from Fedora or EPEL repos.

Related: rhbz#1632962
2018-10-01 13:37:44 -07:00
Brian C. Lane
c9582a0468 Create a new YumBase object when repodata changes
The problem this solves is that yum really isn't designed to be part of\
a long running daemon. So when repodata changes upstream, even when
you force it to download the new metadata, it doesn't change in memory
so you end up with lorax-composer depsolving against old versions, and
anaconda depsolving against new versions (because it sets up its own
YumBase and cache) and then the kickstart is no longer valid.

To solve this I have
 - Added a 6h timeout to the metadata check (because yum's doesn't work
   in this situation).
 - Added a metadata check to the YumLock .lock property, but only when
   the timeout expires.
 - Added a new .lock_check property to YumLock that always checks the
   metadata and resets the timeout.

If it has changed it does its best to tear down the existing YumBase,
deleting as much as it can in hopes it doesn't leak memory. And then it
sets up a totally new YumBase with the new repodata.

Resolves: rhbz#1632962
2018-10-01 13:37:44 -07:00
Brian C. Lane
6fd0e71530 Fix projects_depsolve_with_size version globbing
Use a common _depsolve function for projects_depsolve and
projects_depsolve_with_size so that it always uses the correct version
glob support when depsolving blueprints and templates.

Resolves: rhbz#1628114
2018-10-01 11:09:20 -07:00
Brian C. Lane
f8f49159ad Add a version glob test forprojects_depsolve_with_size
Resolves: rhbz#1628114
2018-10-01 11:09:20 -07:00
Brian C. Lane
956b29eb64 Add tests for setting root password and ssh key with blueprints
Related: rhbz#1626120
2018-09-28 15:21:11 -07:00
Brian C. Lane
6e92d52c14 Use rootpw for setting the root password instead of user
Ends up you cannot use the kickstart user command on root, since it
already exists, so we have to translate that into a rootpw command.

So [[customizations.user]] with name = "root" only support key, which
will set the ssh key, and password which will use rootpw to set the
password. plain text or encrypted are supported.

Related: rhbz#1626120
2018-09-28 14:30:58 -07:00
Brian C. Lane
f113766f22 Lock the root account, except on live-iso
If we leave the root account w/o a password people will use it that way,
leading to insecure images. Also if we use a default password. So lock
the root account in the templates.

Users will need to do one of these things:
 1. Use [[customizations.user]] in their blueprint to configure root or
    another user.
 2. Use [[customizations.sshkey]] to set a key for root
 2. Install a package that configures a user at install time
 3. Install a package that sets up a user at boot time (eg. cloud-init)

This also drops the auth line from the kickstart templates, allowing it
to use the default password algoritm instead of md5.

Resolves: rhbz#1626120
2018-09-28 14:30:58 -07:00
Brian C. Lane
2876211b14 Automatic commit of package [lorax-composer] release [19.7.23-1].
Created by command:

/usr/bin/tito tag
2018-09-19 08:30:34 -07:00
Brian C. Lane
2a85694c9b Fix depsolve version globbing
The blueprint version glob was being applied to the whole package NEVRA
by yum (it lacks a separate API for just globbing versions), so this
implements that in filterVersionGlob using fnmatchcase on the package
names, and the yum package verGT comparison on the versions for the
selected package.

Also includes tests.

Resolves: rhbz#1628114
2018-09-19 08:19:59 -07:00
Brian C. Lane
9685fdd7aa Fix /compose/cancel API documentation
It said /blueprints/cancel which is incorrect.
2018-08-29 10:06:25 -07:00
Brian C. Lane
b9afb2eb6b Automatic commit of package [lorax-composer] release [19.7.22-1].
Created by command:

/usr/bin/tito tag
2018-08-27 15:06:25 -07:00
Brian C. Lane
fd54205a5f Fix composer-cli blueprints changes to get correct total
blueprints/changes is different, each blueprint has it's own total,
limited by the call's limit. So it needs to find the max total of all
the requested blueprints.
2018-08-23 16:21:54 -07:00
Brian C. Lane
d17cb66195 Fix blueprints/list and blueprints/changes to return the correct total 2018-08-23 16:21:00 -07:00
Brian C. Lane
2e6f5fdf71 Add tests for limit=0 routes
Passing ?limit=0 to the blueprints/list, blueprints/changes,
projects/list, modules/list should always return the total possible
results, not 0.

Also move the composer-cli test_diff to the end so that it will work
consistently. Do this by naming it test_z_diff.
2018-08-23 16:17:33 -07:00
Brian C. Lane
e2c6ae906d Add a function to get_url_json_unlimited to retrieve the total
The blueprints/changes API is a bit different from the others, the total
that it includes is for each blueprint, not one total for all of them,
since there will be a different number of commits for each.

The function is passed the dict, and it can be used to select the total
to use for retrieving all of the results. If it isn't included it will
use data["total"] which works fine in most cases.
2018-08-23 15:29:26 -07:00
Brian C. Lane
8dd6096f5e Fix tests related to blueprint name changes 2018-08-21 15:08:58 -07:00
Brian C. Lane
3a3f358f9b Add 'example' to the example blueprint names 2018-08-21 14:02:30 -07:00
Brian C. Lane
c51000ce60 Don't include glusterfs.toml as an example blueprint 2018-08-21 12:25:57 -07:00
Brian C. Lane
a00b009f77 Add a pylorax.api.version number
lorax-composer is in a different package than lorax, so we need to use
its version number not lorax's when reporting the API /status/
2018-08-21 12:10:01 -07:00
Brian C. Lane
d0c4524253 composer-cli should not log to a file by default
The user can pass --log /path/to/logfile.log if they want logging
enabled.
2018-08-21 11:30:22 -07:00
Brian C. Lane
773613bc80 Add documentation for using a DVD as the package source 2018-08-21 11:27:55 -07:00
Lars Karlitski
a980309744 Set TCP listen backlog for API socket to SOMAXCONN
A value of 1 is too low for heavy users of the API, such as the weldr-web
interface.

This is also systemd's default for sockets it opens. Using lorax-composer with
socket activation already results in a backlog of SOMAXCONN connections.

(cherry picked from commit be5d50e6f3)
2018-08-20 15:23:53 -07:00
Brian C. Lane
3ea2946e08 Add a note about using lorax-composer.service
Update the docs to make it clear that .socket will be slow to respond to
the first request, and to use .service to speed it up.

(cherry picked from commit 83e5f3f885)
(cherry picked from commit c2f96b3d3b)
2018-08-13 16:58:15 -07:00
David Shea
c0c135426e In composer-cli, request all results
Add a limit argument to all potentially paginated results, equal to
whatever the composer backend is the total number of results. This still
has the potential to provide truncated data if the number of results
increases between the two HTTP requests.

Resolves: #404
2018-08-13 10:36:32 -04:00
Brian C. Lane
a81000529d Fix bash_completion.d typo 2018-08-10 14:35:38 -07:00
Chris Lumens
5dddef6f49 Fix a little bug in running "modules list". 2018-08-10 11:59:42 -04:00
David Shea
587f05e551 Add tests for /compose/status filter arguments 2018-08-10 10:18:27 -04:00
David Shea
c71c196157 Allow '*' as a uuid in /compose/status/<uuid>
This will display all UUIDs that match the filter arguments
2018-08-10 10:18:27 -04:00
David Shea
1b6e6254fe Add filter arguments to /compose/status
This adds the following optional arguments to the /compose/status route:

  - type, matches the compose_type field
  - status, matches the queue_status field
  - blueprint, matches the blueprint field
2018-08-10 10:18:27 -04:00
Brian C. Lane
fb85c841be Automatic commit of package [lorax-composer] release [19.7.21-1].
Created by command:

/usr/bin/tito tag
2018-08-09 15:46:45 -07:00
Brian C. Lane
acc7b811b6 Move disklabel and UEFI support to compose.py
Currently we are making MBR disk images for qcow2 and partitioned disk,
so the UEFI packages aren't required at this point.

Move the clearpart command into compose.py so that in the futute it can
use clearpart --disklabel to create a GPT image, and add the required
packages to the package set.
2018-08-09 15:13:58 -07:00
Chris Lumens
4cb15e0a0f Fix more tests.
These were broken due to me rebasing before sending a PR off.  They
should work now.
2018-08-09 16:11:32 -04:00
Chris Lumens
bf0318eab6 Change INVALID_NAME to INVALID_CHARS.
It's getting used in a whole lot more places now, so make it a bit more
generic sounding.
2018-08-09 16:11:32 -04:00
Chris Lumens
bc96f75992 Update composer-cli for the new error return types. 2018-08-09 16:11:32 -04:00
Chris Lumens
fd901c5e3f Add default error IDs everywhere else.
The idea here is to make sure all return points have the same type for
the error cases.  There's not really all that many, so they just go in
one patch.  Some of these could potentially turn into more specialized
errors later.
2018-08-09 16:11:32 -04:00
Chris Lumens
b3bb438254 Add error IDs to things that can go wrong when running a compose.
Note the exception string checking around compose_type.  I didn't really
want to introduce a new exception type just for this, but also didn't
want to duplicate strings.  I'd be open to other suggestions for how to
do this.
2018-08-09 16:11:32 -04:00
Chris Lumens
e43adfc7af Add error IDs for common source-related errors. 2018-08-09 16:11:32 -04:00
Chris Lumens
2adcfc9563 Add error IDs for unknown modules and unknown projects. 2018-08-09 16:11:32 -04:00
Chris Lumens
07528a431e Add error IDs for when an unknown commit is requested. 2018-08-09 16:11:32 -04:00
Chris Lumens
a925cc7ddb Add error IDs for when an unknown blueprint is requested.
This adds some fairly redundant code to the beginning of all the
blueprint routes to attempt reading a commit from git for the
blueprint's recipe.  If it succeeds, the blueprint exists and the route
can continue.  Otherwise, return an error.  Hopefully this doesn't slow
things down too much.
2018-08-09 16:11:32 -04:00
Chris Lumens
6497b4fb65 Add error IDs for when an unknown build UUID is requested.
Note that this also changes the return type of uuid_info to return None
when an unknown ID is given.  The other uuid_* functions are fine
because they are checked ahead of time.
2018-08-09 16:11:32 -04:00
Chris Lumens
d76e24053a Add error IDs for bad state conditions. 2018-08-09 16:11:32 -04:00
Chris Lumens
9677b012da Change the error return type for bad limit= and offset=.
Each element in the errors value is now a dict, with a msg field and an
id field.  The id field contains a value out of errors.py that can be
used by the front end to key on.  The msg field is the same as what's
been there.

The idea is to keep the number of IDs somewhat limited so there's not a
huge number of things for the front end to know.
2018-08-09 16:11:32 -04:00
Chris Lumens
4c3f93e329 Don't sort error messages.
This should make it easier to return more complex error structures.  It
also doesn't appear to matter - tests still pass without changes.
2018-08-09 16:11:32 -04:00
Brian C. Lane
d0e2c2308a Fix bash completion of compose info 2018-08-07 16:46:56 -07:00
Brian C. Lane
5d9aa457f4 Add + to the allowed API string character set 2018-08-07 15:16:20 -07:00
Brian C. Lane
97ca285cf2 Add job_* timestamp support to compose status 2018-08-07 14:05:53 -07:00
Brian C. Lane
eda5c9bde1 Add a test for the pylorax.api.timestamp functions 2018-08-07 10:51:06 -07:00
Will Woods
df7409f83d Add etc/bash_completion.d/composer-cli
Here's a bash_completion file for composer-cli! It completes known
commands, subcommands, and flags, plus arguments to flags that take
arguments, and if you've got write access to the socket it'll also
autocomplete:

* source names for commands that need source names
* blueprint names for commands that take blueprint names
* compose uuids for commands that take compose uuids
  * intelligently only suggests appropriate uuids - e.g. only
    suggests uuids of running composes for "compose cancel"

NOTE: bash completion scripts are horrible and this is no exception.
Please forgive me.
2018-08-07 12:57:34 -04:00
Will Woods
80b5a37036 composer-cli: clean up "list" commands
This patch does two things:

1) Add "compose list", which lists compose UUIDs and other basic info,
2) Fix up "blueprints list", "modules list", "sources list", and
   "compose types" so their output is just a plain list of identifiers
2018-08-07 12:57:34 -04:00
Brian C. Lane
86d79cd8a6 Add input string checks to the branch and format arguments
Make sure no UTF8 characters are allowed and return an error if they
are.

Also includes tests to make sure the correct error is returned.
2018-08-06 14:21:24 -07:00
Brian C. Lane
74f5def3d4 Add a test for invalid characters in the API route
Currently the code is not UTF8 safe, so we need to return a clear error
when invalid characters are passed in.

This also adds tests for the routes to confirm that an error is
correctly returned.
2018-08-06 13:24:24 -07:00
Chris Lumens
5daf2d416a Return a JSON error instead of a 404 on certain malformed URLs.
This handles the case where a route is requested, but without a required
parameter.  So, /blueprints/info is requested instead of
/blueprints/info/http-server.  It accomplishes this via a decorator, so
a lot of these route-related functions now have quite a few decorators
attached to them.

Typo'd URLs (/blueprints/nfo for instance) will still return a 404.  I
think this is a reasonable thing to do.
2018-08-06 13:38:14 -04:00
Chris Lumens
8e948e4a4d Return an error if /modules/info doesn't return anything.
Unfortunately, this isn't very useful if /modules/info is provided with
multiple modules.  yum doesn't traceback when doPackageLists is given
something that doesn't exist.  It just returns an empty list.  If
/modules/info is given just one module and yum gives us an empty list,
it's easy to say what happened.  If /modules/info is given several
modules and just one does not exist, we will not be able to detect that.

Fixing this would require doing more yum operations, which is likely to
slow things down and isn't the direction I want to be going.
2018-08-06 12:37:58 -04:00
Chris Lumens
6193a7c9d8 Update documentation (#409). 2018-08-06 12:04:00 -04:00
Chris Lumens
fdf4d63f3b Use constants instead of strings (#409). 2018-08-06 12:04:00 -04:00
Chris Lumens
3ba9d53b8b Write timestamps when important events happen during the compose (#409).
Right now, this is when the compose is queued up, when it is started by
anaconda, and when it is finished (whether that's success or not).
2018-08-06 12:04:00 -04:00
Chris Lumens
17c40ef271 Return multiple timestamps in API results (#409).
If one of the timestamps isn't present (for instance, the finished
timestamp for a job that is still running), null is returned.
2018-08-06 12:04:00 -04:00
Chris Lumens
b59d59b124 Add a new timestamp.py file to the API directory (#409).
This is responsible for writing out a new times.toml file, containing
important timestamps in the life of a compose.  This seems a little more
reliable than attempting to infer things from the filesystem, especially
in light of the fact that we can't ever really know when a file was
created.
2018-08-06 12:04:00 -04:00
Chris Lumens
01a3d365ef Run as root/weldr by default.
We need to be root to read the certificates that give access to the
package repos.  Right now, the alternative seems to be changing
permissions on the certs themselves, which seems less good.  We're
running anaconda as root anyway.
2018-08-02 08:55:17 -04:00
Brian C. Lane
3fd5e50c80 Use the first enabled system repo for the test 2018-07-27 17:25:06 -07:00
Brian C. Lane
26df083bd4 Show more details when the system repo delete test fails
Works fine for me locally, but not in Travis for some reason so let's
get more info.
2018-07-27 15:47:22 -07:00
Brian C. Lane
7700ae3135 Add composer-cli function tests
These depend on there being a freshly installed lorax-composer API
server running, if there is no /run/weldr/api.socket they will be
skipped.
2018-07-26 18:12:02 -07:00
Brian C. Lane
eeae331ba0 Add a test library
This adds empty __init__.py to tests so that a lib.py library of helper
functions can be imported from the tests.

Add captured_output to use with composer-cli tests to capture stdout/err
output from the functions.
2018-07-26 18:12:02 -07:00
Brian C. Lane
2edd7a995b composer-cli: Add support for Group to blueprints diff 2018-07-26 18:12:02 -07:00
Brian C. Lane
638fdb49cb Adjust the tests so they will pass on CentOS7 and RHEL7
Also pulls the name of a system repo from /etc/yum.repos.d/ instead of
hard-coding 'base' in there.
2018-07-26 15:06:05 -07:00
Brian C. Lane
642f117d54 Update status.py to use new handle_api_result
Use the new function to properly handle error responses for all the
commands.
2018-07-26 11:22:22 -07:00
Brian C. Lane
3205e47a13 Update sources.py to use new handle_api_result
Use the new function to properly handle error responses for all the
commands.
2018-07-26 10:44:36 -07:00
Brian C. Lane
77767cd93a Update projects.py to use new handle_api_result
Use the new function to properly handle error responses for all the
commands.
2018-07-26 10:33:32 -07:00
Brian C. Lane
b55b86d0b3 Update modules.py to use new handle_api_result
Use the new function to properly handle error responses for all the
commands.
2018-07-26 10:28:54 -07:00
Brian C. Lane
760aeb61a7 Update compose.py to use new handle_api_result
Use the new function to properly handle error responses for all the
commands.
2018-07-26 10:23:39 -07:00
Brian C. Lane
c1c5536ec8 Update blueprints.py to use new handle_api_result
Use the new function to properly handle error responses for all the
commands.
2018-07-25 17:32:48 -07:00
Brian C. Lane
35fa067219 Modify handle_api_result so it can be used in more places
Some results have errors and no status, others have status and errors.
Update the function to return the final rc to exit with, and a bool
indicating whether or not to continue processing the other fields.

Add a bunch of tests for the new function to make sure I have the logic
correct.
2018-07-25 17:30:50 -07:00
Brian C. Lane
e974ec2477 composer-cli: Fix non-zero epoch in projets info
The json value is an int, so convert it to a str.

(cherry picked from commit 18521cec1a)
2018-07-25 11:40:16 -07:00
Chris Lumens
a3572c9fdd Fix help output on the compose subcommand. 2018-07-25 14:29:39 -04:00
Chris Lumens
7bcb61849d Add timestamps to "compose-cli compose status" output. 2018-07-25 12:47:17 -04:00
Chris Lumens
eb0939d967 And then add real output to the status command. 2018-07-23 17:08:08 -04:00
Chris Lumens
9eafc60fa0 Add the beginnings of a new status subcommand. 2018-07-23 17:08:08 -04:00
Brian C. Lane
38675dbe0f Automatic commit of package [lorax-composer] release [19.7.20-1].
Created by command:

/usr/bin/tito tag
2018-07-20 16:48:38 -07:00
Chris Lumens
b7e4524ac0
Merge pull request #396 from clumens/locking
A couple patches about running lorax-composer twice.
2018-07-20 09:26:19 -04:00
Chris Lumens
052828047c Document that you shouldn't run lorax-composer twice. 2018-07-19 14:53:32 -04:00
Chris Lumens
e37eae55b8 Add PIDFile to the .service file.
This will cause systemd to delete the lock file when the service
terminates.  This does not do anything if lorax-composer is started on
the command line, however.
2018-07-19 13:57:03 -04:00
Brian C. Lane
8080abda67 Log and exit on metadata update errors at startup
A bad system repo can cause lorax-composer to fail to start. Instead of
a traceback log the error and exit.

(note that the exit still results in an OSError traceback due to part of
it running as root, this needs to be addressed in another commit).
2018-07-17 13:47:26 -07:00
Brian C. Lane
f916e41d00 Check /projects responses for null values.
Some values can be null/None so check for that instead of crashing.
2018-07-17 11:51:04 -07:00
Brian C. Lane
b20aa4609c Clarify error message from /source/new 2018-07-17 10:17:06 -07:00
Brian C. Lane
7e8245abcc Download metadata when updating or adding new repos
cacheonly=1 was skipping downloading new metadata when a new source was
added. Set it to 0 so that the update is immediate.
2018-07-17 09:59:26 -07:00
Brian C. Lane
6444e16df9 Automatic commit of package [lorax-composer] release [19.7.19-1].
Created by command:

/usr/bin/tito tag
2018-07-13 17:03:41 -07:00
Chris Lumens
c8d2045f89 Support loading groups from the kickstart template files. 2018-07-12 17:31:56 -04:00
Chris Lumens
ab0655d5a9 Add group-based tests. 2018-07-12 17:31:56 -04:00
Chris Lumens
5fe4b47072 Include groups in depsolving.
This adds a new argument to projects_depsolve and
projects_depsolve_with_size that contains the group list, unfortunately.
I would have prefered adding a function that just returns a list of all
the contents of a group and then add that to what was being passed into
projects_depsolve.  However, there does not appear to be any good way to
do that in yum aside from a lot of grubbing around in the comps object,
which I am unwilling to do.
2018-07-12 17:31:44 -04:00
Chris Lumens
0f69d2084c Add support for groups to blueprints.
Nothing is currently being done with this information, but it will be
soon.
2018-07-12 17:31:44 -04:00
Brian C. Lane
d692a7dddd Check the compose templates at startup
Depsolve the packages included in the templates and report any errors
using the /api/status 'msgs' field. This should help narrow down
problems with package sources not being setup correctly.
2018-07-12 09:25:22 -07:00
Brian C. Lane
f1814ce35f List individual package install failures
Previously it was impossible to know which package in a blueprint caused
a failure, if it was just one of them, or all of them, etc. This catches
the error when calling yb.install and lists all the failures in the
error message that is raised.
2018-07-11 15:35:04 -07:00
Brian C. Lane
2c81a4c1db lorax-composer: Update documentation
This updates the documentation to include composer-cli instead of curl,
warnings about SELinux and needing the RHEL 7 Optional package repo, as
well as other documentation improvements from the master branch.
2018-06-29 13:35:19 -07:00
Chris Lumens
954f330ace Add help output to each subcommand.
This is the same as the output at the top level, just trimmed down to
only the options for a single subcommand.  It's trigged by providing
"help" or "--help" as a subcommand option.
2018-06-28 14:38:05 -04:00
Chris Lumens
70e4211ad1 Split the help output into its own module.
This means I can reuse it for help output for individual subcommands.
2018-06-28 14:38:05 -04:00
Chris Lumens
3743d6d208 If the help subcommand is given, print the help output.
This isn't a real subcommand like the others.  The option processing
just intercepts it and prints the output.  Given that we're subcommand
based, it makes sense to support this in addition to --help.
2018-06-28 14:38:05 -04:00
Brian C. Lane
db2ce9b073 Automatic commit of package [lorax-composer] release [19.7.18-1].
Created by command:

/usr/bin/tito tag
2018-06-27 09:22:30 -07:00
Brian C. Lane
5a7b30699b Only include some of the test blueprints 2018-06-27 09:11:26 -07:00
Brian C. Lane
c01e1e0486 Include example blueprints in the rpm
This also sets ownership of /var/lib/lorax/composer/ to root:weldr to
allow missing directories to be created at runtime.
2018-06-26 14:53:11 -07:00
Brian C. Lane
4c466d4620 Make sure /run/weldr has correct ownership and permissions
Normally tmpfiles.d will handle this at boot time, but if you install
lorax-composer without rebooting it was ending up with root:root
ownership instead of root:weldr
2018-06-25 14:01:36 -07:00
Brian C. Lane
adc91a4ce0 Automatic commit of package [lorax-composer] release [19.7.17-1].
Created by command:

/usr/bin/tito tag
2018-06-20 12:33:58 -07:00
Brian C. Lane
80a2267283 version.py doesn't depend on the .spec 2018-06-19 14:35:43 -07:00
Brian C. Lane
e56e55bb3b Fix Sphinx read_version code
It needs to look for ../lorax.spec OR ../lorax-composer.spec
2018-06-19 14:35:43 -07:00
Brian C. Lane
cc4ae5d19b Build lorax-composer and composer-cli without lorax files
lorax is built from rhel7-branch

This also changes the lorax Requires to 19.7.16

The lorax package will change at a slower rate than lorax-composer, so
making it require the exact same version doesn't make sense.
2018-06-19 14:35:43 -07:00
Brian C. Lane
9fff793dff Automatic commit of package [lorax] release [19.7.17-1].
Created by command:

/usr/bin/tito tag
2018-06-19 14:09:05 -07:00
Brian C. Lane
c4417470da Exclude lorax-composer and composer-cli code from the lorax build
These will be built in Extras from the rhel7-extras branch using the
lorax-composer package name.

Resolves: rhbz#1547759
2018-06-19 11:56:40 -07:00
Brian C. Lane
bb8c7851d2 Fix composer-cli command help text
sources shouldn't be indented
details for a compose are 'details' not 'info'
2018-06-18 10:45:36 -07:00
Brian C. Lane
2ddad4dd82 Automatic commit of package [lorax] release [19.7.16-2].
Created by command:

/usr/bin/tito tag --keep-version
2018-06-15 10:46:25 -07:00
Brian C. Lane
9eb7c0d206 Fixup the lorax.spec after rebasing on 19.6.105-1
Also correct some long running rpmlint complaints.

Resolves: rhbz#1547759
2018-06-15 10:44:31 -07:00
Brian C. Lane
ba76efba14 Automatic commit of package [lorax] release [19.7.16-1].
Created by command:

/usr/bin/tito tag
2018-06-11 16:54:59 -07:00
Brian C. Lane
4bfcd8fcd2 Remove SortMode from list_commits
The current version of libgit2 available (0.26.3) has different behavior
with SortMode.TIME. It works correctly when left at the default (which
is also how the rawhide version works).
2018-06-11 16:54:59 -07:00
Brian C. Lane
3cfb895054 Use yum.add_enable_repo() for new repos
Yum needs to have some other attrs setup on the YumRepository object, so
use the function provided to ensure that everything is correct. Also
switch the related functions to use a dict instead of a YumRepository
object.
2018-06-11 16:54:59 -07:00
Brian C. Lane
957def1264 Add support for sources to composer-cli
This adds the sources command which can be used to list, add, change,
and delete sources using the TOML formatted source file.
2018-06-11 16:54:59 -07:00
Brian C. Lane
a5eaebeefc yum repos has a delete() function. But it doesn't clear the cache.
yum also has a cache it uses for listEnabled(), but the cache isn't
invalidated when a repo is deleted it any following metadata update
will fail because it is still using the deleted repo.

We are forced to use the heavy hammer on a yum private variable yet
again to force the cache to be cleared so that it won't crash.
2018-06-11 16:54:59 -07:00
Brian C. Lane
2e95b56508 Fix DNF related issues with source selection
yum TumRepository.dump() function cannot be used as a .repo file Add a
new function to write this in the correct format, and limited to the
fields we use.

Add a test for the new function.

Fix /projects/source/info to return an error 400 if a nonexistant TOML
source is requested. If JSON is used the error is part of the standard
response.

Update test_server.py to check for the correct error code.
2018-06-11 16:54:59 -07:00
Brian C. Lane
3f7997d7ae Fix handling bad source repos and add a test
When adding a source failed it wasn't being removed from the dnf object.
This fixes that, and returns an error when setting up the source fails.
Also adds a test for it.
2018-06-11 16:54:59 -07:00
Brian C. Lane
f1000b448d Make sure new sources show up in the source/list output
Also remove an unneeded makedirs from test_server.py
2018-06-11 16:54:59 -07:00
Brian C. Lane
25bae61520 Fix make_dnf_dirs
It was chopping off an extra directory level due to realpath removing
the trailing / from the paths when they are setup.
2018-06-11 16:54:59 -07:00
Brian C. Lane
33c84331fe Add support for user defined package sources API
This lives under /api/v0/projects/source/*

See the documentation for details
2018-06-11 16:54:59 -07:00
Brian C. Lane
82c8c3a491 gevent has deprecated .wsgi, should use .pywsgi instead
https://github.com/gevent/gevent/blob/master/doc/api/gevent.wsgi.rst
(cherry picked from commit c9ca451568)
2018-06-11 16:54:59 -07:00
Brian C. Lane
b99d8d7f6b Add support for version globs to blueprints
You can use '*' wildcards and '?' for single character matching.
2018-06-11 16:54:59 -07:00
Brian C. Lane
9e06f6e113 Automatic commit of package [lorax] release [19.7.15-1].
Created by command:

/usr/bin/tito tag
2018-06-11 16:54:59 -07:00
Brian C. Lane
ce715ad15f Check to make sure blueprints directory exists 2018-06-11 16:54:59 -07:00
Brian C. Lane
7745a019c0 lorax-composer also requires tar 2018-06-11 16:54:59 -07:00
Brian C. Lane
3c60f07d98 Remove temporary files after run_compose
A crash can also leave temporary lmc-* files, remove them as well.
2018-06-11 16:54:59 -07:00
Brian C. Lane
f26a6212d6 Add --proxy to lorax-composer cmdline
Overrides the [yum] proxy setting in the config file.
2018-06-11 16:54:59 -07:00
Brian C. Lane
9978503a69 Pass the --tmp value into run_creator and cleanup after a crash
Crashing can sometimes leave directories in /var/tmp/lmc-* so clean
those up after run_creator is finished.
2018-06-11 16:54:59 -07:00
Brian C. Lane
3a38a57ae1 Add --tmp to lorax-composer and set default tempdir
It was using /tmp/ which can fill up quickly when building images.
Default to /var/tmp unless the user passes --tmp /tmp/
2018-06-11 16:54:59 -07:00
Brian C. Lane
050f87168a Skip creating groups with the same name as a user
Otherwise the user creation fails when anaconda sees there is already a
group with that name. Log a warning and continue on.

(cherry picked from commit a363aee971)
2018-06-11 16:54:59 -07:00
Brian C. Lane
5b7b37860a Add user and group creation to blueprint
[[customizations.user]] and [[customizations.group]]
2018-06-11 16:54:59 -07:00
Brian C. Lane
ccafa76019 Add blueprint customization support for hostname and ssh key
This adds support for the optional blueprint section [customizations].

Use it like this:

[customizations]
hostname = yourhostnamehere

[[customizations.sshkey]]
user = root
key = root user key
2018-06-11 16:54:59 -07:00
Brian C. Lane
ffc3195d77 Add support for systemd socket activation
Instead of enabling lorax-composer.service enable lorax-composer.socket
and it will start lorax-composer on first access to
/run/weldr/api.socket
2018-06-11 16:54:59 -07:00
Brian C. Lane
8eccb5d6bd Automatic commit of package [lorax] release [19.7.14-1].
Created by command:

/usr/bin/tito tag
2018-06-11 16:54:59 -07:00
Brian C. Lane
85f365bd73 Sort the list of supported output types 2018-06-11 16:54:59 -07:00
Brian C. Lane
1fc7cff52b Add some tests for error conditions. 2018-06-11 16:54:59 -07:00
Brian C. Lane
f40f7cc0fd Update the error responses to just return lists of strings.
This makes error handling consistent and easier than a couple layers of
fields to fetch.
2018-06-11 16:54:59 -07:00
Brian C. Lane
d44957aa95 Automatic commit of package [lorax] release [19.7.13-1].
Created by command:

/usr/bin/tito tag
2018-06-11 16:54:59 -07:00
Brian C. Lane
520439a7c4 Move status to /api/status
Also drops /api/v0/test, and redirects / to /api/docs/

db and schema are fixed at 0 since lorax-composer uses yum, not the bdcs
metadata.db
2018-06-11 16:54:59 -07:00
Brian C. Lane
0d7e1dacfd Update the path for the test blueprints 2018-06-11 16:54:59 -07:00
Brian C. Lane
d030209d40 Drop part command from tar kickstart template. 2018-06-11 16:54:59 -07:00
Brian C. Lane
0887bd3d95 Update the queue to use blueprint.toml
Also update the output JSON to use 'blueprint' instead of 'recipe'
2018-06-11 16:54:59 -07:00
Brian C. Lane
5efeb05aa7 Update composer-cli to use blueprint instead of recipe 2018-06-11 16:54:59 -07:00
Brian C. Lane
f0d29be521 Update lorax-composer docs for recipe -> blueprint change. 2018-06-11 16:54:59 -07:00
Brian C. Lane
651e111d1f Change the API code to use blueprint
This includes in the JSON output. The only exception is when using
functions from the recipes module. There are no plans to change that.
2018-06-11 16:54:59 -07:00
Brian C. Lane
8c65257a5a Update the tests for the recipe -> blueprint change 2018-06-11 16:54:59 -07:00
Brian C. Lane
c22d05032e Change the tests for /recipes/ routes to /blueprints/ 2018-06-11 16:54:59 -07:00
Brian C. Lane
540f36eee4 Change the /recipes/ routes to /blueprints/
And change recipe_names API variable to blueprint_names.  This *only*
changes the API variable, it does not change any subsequent usage of
'recipe'. The goal here is to change the public API, not all of the
code.
2018-06-11 16:54:59 -07:00
Brian C. Lane
2939feadec Change recipe in API documentation to blueprint 2018-06-11 16:54:59 -07:00
Brian C. Lane
fcf47904aa Automatic commit of package [lorax] release [19.7.12-1].
Created by command:

/usr/bin/tito tag
2018-06-11 16:54:59 -07:00
Brian C. Lane
2697bb2bc7 Add support for building ext4 filesystem images. 2018-06-11 16:54:59 -07:00
Brian C. Lane
020d9de4b3 Add the image size to the composer-cli status output 2018-06-11 16:54:59 -07:00
Brian C. Lane
211f1bf764 Add image_size to the compose/info JSON
The size will be 0 until the compose is finished. It will then be set
to the size of the image in bytes.
2018-06-11 16:54:59 -07:00
Brian C. Lane
78c02dd7e7 Add image size to the compose details
If the image is finished include the size of the image file as
"image_size" in the ouput JSON from /compose/finished
2018-06-11 16:54:59 -07:00
Brian C. Lane
b2f5fe2f60 Removed the fixed partition size from composer ks templates
The default size is always going to be wrong, so try to estimate a more
reasonable amount of space. This is more complicated than you would
expect, yum's installedsize doesn't take into account the block size of
the filesystem, nor any extra artifacts generated by pre/post scripts.

So in the end we end up with a minimum image size of 1GiB, a partition
that is 40% larger than the estimated space needed, and a disk image
that increases size in 1GiB increments. This is still better than having
a fixed 4GiB / partition that was either too large or too small.
2018-06-11 16:54:59 -07:00
Brian C. Lane
47a3980b12 Fix some pylint warnings 2018-06-11 16:54:59 -07:00
Brian C. Lane
c15f3c89fa Add the compose type to the output from compose status 2018-06-11 16:54:59 -07:00
Brian C. Lane
423e8cba88 Fix composer-cli handling of log and detail errors. 2018-06-11 16:54:59 -07:00
Brian C. Lane
2481c486a5 Fix a couple of error responses
Errors should always be "error:{"msg":"message"}
2018-06-11 16:54:59 -07:00
Brian C. Lane
c58e1994e9 Add missing checks on return value from uuid_status 2018-06-11 16:54:59 -07:00
Brian C. Lane
97eb262d1e Fix handling of missing STATUS file
If lorax-composer is interrupted by ^C it can leave a result directory
without a STATUS file. Don't crash when that happens, just skip the
directory.
2018-06-11 16:54:59 -07:00
Brian C. Lane
258cecf75d Fix compose types command
Missed a function when adding the testmode arguments. Also add
documentation for testmode.
2018-06-11 16:54:59 -07:00
Brian C. Lane
af68a98abe Add qcow2 image type
Very similar to partitioned-disk, image is named disk.qcow2 instead of
disk.img
2018-06-11 16:54:58 -07:00
Brian C. Lane
c5a07ff80f Update the URL in lorax.spec to point to new Lorax location
Moved to https://github.com/weldr/lorax
2018-06-11 16:54:58 -07:00
Brian C. Lane
5d4c550df4 Automatic commit of package [lorax] release [19.7.11-1].
Created by command:

/usr/bin/tito tag
2018-06-11 16:54:58 -07:00
Brian C. Lane
5446cad1b0 Fix prettyDiffEntry output
It was returning old -> old for Description and Version, not old -> new
2018-06-11 16:54:58 -07:00
Brian C. Lane
6560cc6f27 Fix the prettyDiffEntry test so that it fails correctly 2018-06-11 16:54:58 -07:00
Brian C. Lane
9e16e1c0c5 Default composer-cli log should be in ./composer-cli.log
Multiple users may use the tool, each one gets their own logfile.
2018-06-11 16:54:58 -07:00
Brian C. Lane
73011c6bb0 Update Sphinx documentation for composer.cli 2018-06-11 16:54:58 -07:00
Brian C. Lane
114f7f348e Update docs/ with lorax, livemedia-creator, and product-images
Copied from master and edited for the RHEL7 branch.
2018-06-11 16:54:58 -07:00
Brian C. Lane
579e6840f8 Install the composer-cli library and include it in the rpm 2018-06-11 16:54:58 -07:00
Brian C. Lane
5c878a695f Add --test option to composer-cli
The API server will run a mock compose when a test mode is passed to it.
Passing a 1 will queue a build, pretend to run the build for 10 seconds,
and then fail. Passing a 2 will do the same thing, but it will finish as
if it was successful. All results are available but the output file is
only the string "TEST IMAGE"

This should allow running tests inside docker without calling anaconda
(becuase it will not run in docker, it needs a VM).
2018-06-11 16:54:58 -07:00
Brian C. Lane
1a4a4defcc Make sure lorax-composer tests only use temporary directories
It was using /var/tmp/composer/, now it places everything under a
temporary directory that is removed when it is finished.
2018-06-11 16:54:58 -07:00
Brian C. Lane
597c19466e Add some tests for composer-cli
These tests a fairly minimal, testing things that can be tested without
setting up a full API server.
2018-06-11 16:54:58 -07:00
Brian C. Lane
d4b99b5ee9 Refactor get_filename so it can be tested
Just pass in the headers instead of the whole response object so that it
can be tested without needing an actual server.
2018-06-11 16:54:58 -07:00
Brian C. Lane
d0676dbf7c Fix bug in prettyDiffEntry output
It was not handling adding or removing modules correctly.
2018-06-11 16:54:58 -07:00
Brian C. Lane
aa076ee53b composer-cli: Handle download errors
The API will return an error 400 with a json error object if the
download fails, catch this and report the error to the user without a
traceback.
2018-06-11 16:54:58 -07:00
Brian C. Lane
de604b37a6 Add a pid file for lorax-composer
This will prevent accidentally running more than 1 instance.
Uses /run/lorax-composer.pid and checks to make sure that the PID
written to it isn't stale.
2018-06-11 16:54:58 -07:00
Brian C. Lane
7ad9939fac Cleanup more /tmp/ files when running with --no-virt
Make extra sure anaconda starts with a clean slate.
2018-06-11 16:54:58 -07:00
Brian C. Lane
e425b7ccca lorax-composer: Update the yum metadata at startup
Otherwise it can become out of date and depsolving will fail.
2018-06-11 16:54:58 -07:00
Brian C. Lane
2e61bc8bf9 Fix the error responses from lorax-composer
They are now all consistent, returning status 400, including a json
object with status=flase, and an error message inside the error object.
2018-06-11 16:54:58 -07:00
Brian C. Lane
60874d0197 Check to make sure image file exists for /compose/image/
Return an error 400 with an error message if it is missing.
2018-06-11 16:54:58 -07:00
Brian C. Lane
37c982b66e Install anaconda-tui in the test Docker image 2018-06-11 16:54:58 -07:00
Brian C. Lane
dbe9c15ee1 Add UUID prefix to /compose/image/ download filename.
This will make sure it is received as a unique filename, not just
'disk.img' when downloading it.
2018-06-11 16:54:58 -07:00
Brian C. Lane
56766e794f Add support for composer-cli compose commands.
This adds all the commands needed to start, monitor, delete, and
download a compose.
2018-06-11 16:54:58 -07:00
Brian C. Lane
9ba24f305d Add support for modules list, projects list, and projects info 2018-06-11 16:54:58 -07:00
Brian C. Lane
d2f784e5da Add composer-cli utility and implement the recipes commands
composer-cli --help shows the commands.
Output defaults to human readable, but raw json can be displayed by
passing --json
2018-06-11 16:54:58 -07:00
Brian C. Lane
79fa1c957e Add ?format=toml support to /recipes/freeze 2018-06-11 16:54:58 -07:00
Brian C. Lane
0ea4eb5206 Fix epoch to ouput an int instead of a str
Also updates the tests.
2018-06-11 16:54:58 -07:00
Brian C. Lane
413964b92f Add ?format=toml support to /recipes/info/
This will return the recipe in TOML format. Note that this does not
include any extra information about errors. Just the recipes, any
unrecognized recipe names will be skipped.
2018-06-11 16:54:58 -07:00
Brian C. Lane
b0d91204a4 Automatic commit of package [lorax] release [19.7.10-1].
Created by command:

/usr/bin/tito tag
2018-06-11 16:54:58 -07:00
Brian C. Lane
6796861773 Add the partitioned-disk.ks file for the new output type 2018-06-11 16:54:58 -07:00
Brian C. Lane
41fd9ab19c lorax-composer: Add partitioned-disk output support
Also add more documentation on lorax-composer, including how to add
support for new output types.
2018-06-11 16:54:58 -07:00
Brian C. Lane
4ae5944567 Add live-iso output support to lorax-composer
This ended up requiring more intrusive changes, but it should be the
most complex of the output types. After moving the core of
livemedia-creator into a function I added more settings to compose_args,
and more defaults to start_build. It now pulls the release information
from /etc/os-release, and produces a bootable .iso
2018-06-11 16:54:58 -07:00
Brian C. Lane
59fd3934f3 Move core of livemedia-creator to run_creator()
We need to be able to share the output types from livemedia-creator with
lorax-composer, so move the core of the main() function into
run_creatoe(). Pass in the cmdline args or a DataHolder with them set.
2018-06-11 16:54:58 -07:00
Brian C. Lane
85ee784efc Only chown recipe directory if it already exists
Since creation of the directory has been moved after switching users
this now needs to check to make sure it exists first.
2018-06-11 16:54:58 -07:00
Brian C. Lane
0e3b87a1da Automatic commit of package [lorax] release [19.7.9-1].
Created by command:

/usr/bin/tito tag
2018-06-11 16:54:58 -07:00
Brian C. Lane
74326ba7a3 Fix a problem with diff/NEWEST/WORKSPACE
If there is no WORKSPACE yet it was not falling back to using NEWEST.
Also add a test for this.
2018-06-11 16:54:58 -07:00
Alexander Todorov
06648d415a Don't be overly strict when validating /api/docs/ response in tests
this avoids comparing against files on disk (and the huge diff the
test runner produces in case of failure). Instead we look for a
200 HTTP response with large enough size and some well known
strings inside the response data.
2018-06-11 16:54:58 -07:00
Brian C. Lane
4144c3937c Check for a source tree doc install first, not second.
This way a source install and test run will always take precedence over
a system installed version.
2018-06-11 16:54:58 -07:00
Alexander Todorov
91cebe7b67 Measure coverage for parallel processes 2018-06-11 16:54:58 -07:00
Alexander Todorov
af8c193b52 Remove calls to print() 2018-06-11 16:54:58 -07:00
Alexander Todorov
5500ec8c06 Use sudo to run the tests
in 9ed1964 the tests start using makq_queue_dirs() which does
chown with guid/id 0!
2018-06-11 16:54:58 -07:00
Alexander Todorov
98f3b7e7eb Add tests for api.crossdomain.py 2018-06-11 16:54:58 -07:00
Alexander Todorov
1f90455ee6 Add required_methods for decorator
otherwise we can't issue OPTIONS requests to the server, see
first comment at http://flask.pocoo.org/snippets/56/
2018-06-11 16:54:58 -07:00
Alexander Todorov
7f7295e3b0 Convert max_age to int b/c timedelta.total_seconds() is a float 2018-06-11 16:54:58 -07:00
Alexander Todorov
3dd5612732 Fix syntax error caused by conflict resolution 2018-06-11 16:54:58 -07:00
Brian C. Lane
64ce465285 Automatic commit of package [lorax] release [19.7.8-1].
Created by command:

/usr/bin/tito tag
2018-06-11 16:54:58 -07:00
Brian C. Lane
c399447b81 Fix a problem with using a mirror as the primary url
Because of how Anaconda is run it needs to be passed a baseurl (using
--repo on the anaconda cmdline), not a mirrorlist url. This fixes it so
that the first mirror is used if the main repository is using a
mirrorlist.
2018-06-11 16:54:58 -07:00
Brian C. Lane
a1427b1a31 Set the HOME variable to a directory the uid can access
libgit2 will look for $HOME/.gitconfig after dropping root privileges so
this needs to be accessible to the user.
2018-06-11 16:54:58 -07:00
Brian C. Lane
442dc43206 Open the git repo after dropping root privileges
Also make sure the recipe directory and its contents have correct
ownership, and change the default recipe path when using the systemd
service to /var/lib/lorax/composer/recipes/
2018-06-11 16:54:58 -07:00
Brian C. Lane
43fe00c1c2 Create the weldr user in lorax.spec
Only created when lorax-composer is installed, not lorax by itself.
2018-06-11 16:54:58 -07:00
Brian C. Lane
4ae2e1450d Exit on uid/gid errors before checking directory permissions
If the uid/gid check fails there is no sense in trying to examine the
ownership or permissions.
2018-06-11 16:54:58 -07:00
Brian C. Lane
5e075f6102 lorax-composer now requires anaconda-tui 2018-06-11 16:54:58 -07:00
Brian C. Lane
fdecf13299 Add tests for /compose API
Because you cannot share data between test methods these have to all be
in one big function. This adds one series to test the failed compose
results, and a 2nd function to test for the successful compose.
2018-06-11 16:54:58 -07:00
Brian C. Lane
daa5ed2aaf Add documentation for /compose and /compose/types 2018-06-11 16:54:58 -07:00
Brian C. Lane
eb2a7208c8 Move queue monitor startup into a function
This allows it to be used by the test framework.
2018-06-11 16:54:58 -07:00
Brian C. Lane
63a7897457 Move queue directory creation into a function
So that it can also be used during tests
2018-06-11 16:54:58 -07:00
Brian C. Lane
8da6214e10 Add a test mode to /compose
This will allow testing without having a full system setup with
anaconda, if ?test=1 is passed to the POST /compose command it will wait
10 seconds instead of running Anaconda, and then raise an error to
generate a failed build.

Passing ?test=2 will also wait 10 seconds instead of running Anaconda,
but will finish successfully.
2018-06-11 16:54:58 -07:00
Brian C. Lane
2e1e8c20c7 Cleanup docstrings for queue.py 2018-06-11 16:54:58 -07:00
Brian C. Lane
9603c866af Drop cancel_q from the monitor() function
Not needed, builds are canceled by writing a 'CANCEL' file in the results
directory.
2018-06-11 16:54:58 -07:00
Brian C. Lane
166350fcb6 Fix the jsonify calls to use kwargs
No need to pass it a dict, just set the args.
2018-06-11 16:54:58 -07:00
Brian C. Lane
ff7d36bcbc Add /compose/log/ API to retrieve the end of the build log
This allows the client to request the end of the anaconda.log during and
after a build. The amount of data returned can be set by adding
?size=<kbytes>

Output is raw bytes, starting on the next available line boundry.
2018-06-11 16:54:58 -07:00
Brian C. Lane
caee8e7cdf Return a status of false if the uuid isn't valid 2018-06-11 16:54:58 -07:00
Brian C. Lane
072aa720ff Add /compose/cancel API to cancel a running build
If the build hasn't started yet (state is WAITING) try removing the
symlink to it. If this succeeds, delete the partial results directory.

If the build makes it to RUNNING then it writes a CANCEL file in the
results directory. The callback that is passed to execWithRedirect
catches this, causing a SIGTERM to be sent to anaconda. It then exits
and cleanup happens normally. The partial results directory is then
removed.
2018-06-11 16:54:58 -07:00
Brian C. Lane
8f0bca00c0 Pass the callback_func through novirt_install to execWithRedirect
The default is no callback.
2018-06-11 16:54:58 -07:00
Brian C. Lane
f1d8b10867 Add a callback to execWithRedirect
If the callback returns true send the process a SIGTERM to terminate it.
2018-06-11 16:54:58 -07:00
Alexander Todorov
dfe8774616 Update how we pass the source to docker so it includes docs/ dir
since the last commit the tests require to have the docs built
before hand but the docs/ dir was missing from the docker image.
2018-06-11 16:54:58 -07:00
Alexander Todorov
d3d92d13b1 Add tests for functions in api/projects 2018-06-11 16:54:58 -07:00
Alexander Todorov
1c977b79ef Add tests for api/server.py
some of the new tests require that we first build the documentation
2018-06-11 16:54:58 -07:00
Alexander Todorov
32db249538 Add tests for yumbase and update how we inspect boolean options
.get_default() returns string so make sure we're actually parsing
the value as boolean and not evaluating a non-empty string in a
boolean context (which will always return True)
2018-06-11 16:54:58 -07:00
Alexander Todorov
a954cde36a Add new tests for workspace_read() and workspace_delete() 2018-06-11 16:54:58 -07:00
Alexander Todorov
e830d9766b Add new tests for configure() 2018-06-11 16:54:58 -07:00
Alexander Todorov
395c4a4b7f Add more tests for api.recipes
- test against already existing git repository
- test commit_recipe_file() handling of IOError
- update tests for commit_recipe_directory()
  - add asserts on the existing test. Not raising an exception
    isn't enough!
  - add test which exercises the method under test while it handles
    exceptions raised by other methods
- test for list_commits() when the underlying calls fail to convert
  timestamp
- test for find_name() when `name' is not on the list
- tests for get_revision_from_tag()
2018-06-11 16:54:58 -07:00
Brian C. Lane
6a95a314e9 Add API routes for downloading build results
Also fix a bug with the name of the queue status in the status results
(it is now 'queue_status' not 'status' which is used for error
responses).

This adds the following routes:
 - /compose/metadata/<uuid> to retrieve a .tar of the build metadata
 - /compose/results/<uuid> to retrieve .tar of all of the build results
 - /compose/logs/<uuid> to retrieve a .tar of just the logs from the build
 - /compose/image/<uuid> to retrieve the output image from the build
2018-06-11 16:54:58 -07:00
Brian C. Lane
ed03ac7524 Add /compose/info route to retrieve details about a compose
The results is a JSON string with the following information:

* id - The uuid of the comoposition
* config - containing the configuration settings used to run Anaconda
* recipe - The depsolved recipe used to generate the kickstart
* commit - The (local) git commit hash for the recipe used
* deps - The NEVRA of all of the dependencies used in the composition
* compose_type - The type of output generated (tar, iso, etc.)
* queue_status - The final status of the composition (FINISHED or FAILED)
2018-06-11 16:54:58 -07:00
Brian C. Lane
d3a9ec3002 Return the commit id for the recipe being read
This adds returning the commit id from read_commit, and a new function
read_recipe_and_id() that returns the commit id and the recipe in a
tuple.

If the commit is passed in, it is used as is. If no commit is passed in
it finds the most recent commit for the file on the selected branch and
returns that.

Missing recipes now raise a RecipeError with an informative message.
eg. "No commits for missing-recipe.toml on the master branch."
2018-06-11 16:54:58 -07:00
Brian C. Lane
22c03ceba7 Fix yum config directory creation for projects and server tests 2018-06-11 16:54:58 -07:00
Brian C. Lane
b99a7756de Add DELETE /compose/delete/<uuids> API route
This will delete all of the build's results and cannot be undone.
2018-06-11 16:54:58 -07:00
Brian C. Lane
3fdf3a9819 Turn on o+x permission for the queue and results directories
Otherwise it won't allow a group member to delete things.
2018-06-11 16:54:58 -07:00
Brian C. Lane
fdcf839753 Add /compose/status/<uuids> to retrieve details of a specific build 2018-06-11 16:54:58 -07:00
Brian C. Lane
91c6d1525d Add compose status routes /compose/finished and /compose/failed
These will return a list of details about the finished or failed builds.
2018-06-11 16:54:58 -07:00
Brian C. Lane
fd2aa7c79b Automatic commit of package [lorax] release [19.7.7-1].
Created by command:

/usr/bin/tito tag
2018-06-11 16:54:58 -07:00
Brian C. Lane
520177afca Add /compose/queue to get the status of the build queue
This will return a JSON result that includes the waiting builds,
and the running builds.
2018-06-11 16:54:58 -07:00
Brian C. Lane
47f21af7fb Add reading a recipe directly from a file
Adds helper function recipe_from_file to recipes.py
2018-06-11 16:54:58 -07:00
Brian C. Lane
0065cadf2d Include the recipe in the results of a build
Write original as recipe.toml and the depsolved version as frozen.toml

Also write 'WAITING' to the STATUS file as its first state.
The STATUS states are now WAITING -> RUNNING -> FINISHED|FAILED
2018-06-11 16:54:58 -07:00
Brian C. Lane
9fc973366f Move creating a frozen recipe into recipes.py
Also adds .package_names and .module_names properties. Call
recipe.freeze with a list of NEVRA dependencies and it will return a new
Recipe object with all of the packages and modules set to the depsolved
version.
2018-06-11 16:54:58 -07:00
Brian C. Lane
67da4d6971 Add building an image, and the /compose route to start it
This adds the ability to build a tar output image. The /compose and
/compose/types API routes are now available.

To start a build POST a JSON body to /compose, like this:

{"recipe_name":"glusterfs", "compose_type":"tar", "branch":"master"}

This will return a unique build id:

{
  "build_id": "4d13abb6-aa4e-4c80-a671-0b867e6e77f6",
  "status": true
}

which will be used to keep track of the build status (routes for this
do not exist yet).
2018-06-11 16:54:58 -07:00
Brian C. Lane
de9f5b0456 Remove test configuration and read it from the build directory 2018-06-11 16:54:58 -07:00
Brian C. Lane
7372faa969 Add function to return full NEVRA of a dependency 2018-06-11 16:54:58 -07:00
Brian C. Lane
c92373ecd6 Change config and paths
With the API running as weldr the permissions on the yum directories
needs to be accessable to it, as well as the results and queue/new
directories.
2018-06-11 16:54:58 -07:00
Brian C. Lane
e2f4674fb3 Add basic composer queue handling
The queue is in /var/lib/weldr/queue/new by default. It watches the
directory for new symlinks (to /var/lib/weldr/results/<dirname>) and
handles running anaconda on the kickstart found in final-kickstart.ks
inside the symlinked directory.
2018-06-11 16:54:58 -07:00
Brian C. Lane
0ce4197a1e Change compress to use communicate instead of wait
Also move default_image_name into imgutils so it can be used in other
places.

When running from lorax-composer the wait() call wasn't waiting until
the tar was finished. I think this is due to gevent monkey-patching
something. Using communicate() solves this problem.
2018-06-11 16:54:58 -07:00
Brian C. Lane
ea4f9ed615 Automatic commit of package [lorax] release [19.7.6-1].
Created by command:

/usr/bin/tito tag
2018-06-11 16:54:58 -07:00
Brian C. Lane
57d9d40c29 Add documentation for the API routes.
Use Sphinx on a CentOS7/RHEL7 system to generate the docs with 'make docs'
2018-06-11 16:54:58 -07:00
Brian C. Lane
377f5e4124 Switch the API to use a Unix Domain Socket
This drops support for the TCP port and switches to using a socket at
/var/run/weldr/api.socket

Also add the start of some docs for lorax-composer.

--host and --port argument have been removed.

--group sets the group name to use for access to the socket and its
parent directory. Defaults to 'weldr'

--socket sets the full path to the socket to create. Defaults to
'/var/run/weldr/api.socket'
2018-06-11 16:54:58 -07:00
Brian C. Lane
916a001d73 Add support for other branches to the routes
Passing ?branch=<branch-name> will use the specified branch instead of
master.

The new branch will not exist until a /recipes/new?branch=new-branch
POST is made. At that time the branch will be created based on the
current master branch and the new commit will be added to it.
2018-06-11 16:54:58 -07:00
Alexander Todorov
0af072c77e Silence pocketlint bad-preconf-access warnings 2018-06-11 16:54:58 -07:00
Alexander Todorov
7809da61e6 Properly report coverage
- use same version of coverage.py as is inside the container b/c
  data format has changed between versions
- use `coverage combine' with a .coveragerc mapping to adjust for
  differences in file paths between the container and Travis
2018-06-11 16:54:58 -07:00
Alexander Todorov
c90ea64e59 Enable testing in Travis CI using Docker container 2018-06-11 16:54:58 -07:00
Martin Pitt
176b12dd8c Fix depsolving empty recipes
- Fix `projects_depsolve()` to not consider a successful empty response
   (rc == 0) as an error.
 - Fix recipe_from_dict() to default modules and packages to empty lists
   instead of `None`, to avoid a Python-ism in the API for consumers and
   stay compatible to the bdcs API.

Fixes #290
2018-06-11 16:54:58 -07:00
Martin Pitt
da3616db72 Fix wrong function name in api/v0/recipes/freeze error messages 2018-06-11 16:54:58 -07:00
Martin Pitt
53cd264ece Fix project tests for non-Central time zones
When running tests somewhere else than Central Time, `test_api_time()`
fails like

    AssertionError: '1985-10-27T02:00:00' != '1985-10-26T21:00:00'

`test_yaps_to_project_info()` fails in a similar way.

Pin the time zone to UTC for this test and adjust timestamps to UTC.
2018-06-11 16:54:58 -07:00
Brian C. Lane
e1af0c67bd Automatic commit of package [lorax] release [19.7.5-1].
Created by command:

/usr/bin/tito tag
2018-06-11 16:54:58 -07:00
Brian C. Lane
3e5c0707bb Redirect yum's logging to yum.log 2018-06-11 16:54:58 -07:00
Brian C. Lane
a44e499eee Close the rpmdb after every API operation.
rpm blocks all of the signals until closeRpmDB() is called.
We need to call it after all of the API calls.
2018-06-11 16:54:58 -07:00
Brian C. Lane
cf42e1a480 Fix error string when there is a problem listing projects 2018-06-11 16:54:58 -07:00
Brian C. Lane
efd15aaad7 Add --releasever option to lorax-composer
If it isn't set the releasever value will use yum and the system / to
find the releasever.
2018-06-11 16:54:58 -07:00
Brian C. Lane
d6f41fbfa1 Automatic commit of package [lorax] release [19.7.4-1].
Created by command:

/usr/bin/tito tag
2018-06-11 16:54:58 -07:00
Brian C. Lane
c1bd07635a Fix wrong name for /etc/composer.conf 2018-06-11 16:54:58 -07:00
Brian C. Lane
27a3f4e38c Automatic commit of package [lorax] release [19.7.3-1].
Created by command:

/usr/bin/tito tag
2018-06-11 16:54:58 -07:00
Brian C. Lane
bae551b7ab Add filtering and glob support to /modules/list route 2018-06-11 16:54:58 -07:00
Brian C. Lane
6b4bf92e7f Add /recipes/freeze route and tests. 2018-06-11 16:54:58 -07:00
Brian C. Lane
b8212358bc Add /recipes/depsolve route and test 2018-06-11 16:54:58 -07:00
Brian C. Lane
a85d0ced8b Add /projects and /modules API tests 2018-06-11 16:54:58 -07:00
Brian C. Lane
164232ba4d Modify pylorax.api.config.configure so it can also be used for tests. 2018-06-11 16:54:58 -07:00
Brian C. Lane
f26af06739 Add tests for projects module functions 2018-06-11 16:54:58 -07:00
Brian C. Lane
ad5ab71551 Move ComposerConfig into pylorax.api.config module 2018-06-11 16:54:58 -07:00
Brian C. Lane
8fee86a5db Catch ProjectsError and return an error 400 with a message. 2018-06-11 16:54:58 -07:00
Brian C. Lane
a1e7e4831d Catch Yum errors in the projects functions 2018-06-11 16:54:58 -07:00
Brian C. Lane
23d90ec066 Add /modules/list and /modules/info routes 2018-06-11 16:54:58 -07:00
Brian C. Lane
8635a59ac7 Add modules functions and update function documentation 2018-06-11 16:54:58 -07:00
Brian C. Lane
c3d495fe53 Add /projects/depsolve route 2018-06-11 16:54:58 -07:00
Brian C. Lane
99140b98b9 Add /projects/info route
Elements that have no match in yum (metadata) are set to empty dicts.
2018-06-11 16:54:58 -07:00
Brian C. Lane
0819e97646 Add /projects/list route 2018-06-11 16:54:58 -07:00
Brian C. Lane
105679d79d Add /api/v0/test route
Returns a simple string to indicate that the API server is running.

/api/v0/status should be used instead, it provides more detailed info in
JSON format.
2018-06-11 16:54:58 -07:00
Brian C. Lane
569ce1d3dc Add support for yum to lorax-composer
This includes a new configuration file at /etc/lorax/composer.conf with
built-in defaults. It also adds a YUMLOCK server config object so that
request handlers can access the yum base object without interfering
with each other.
2018-06-11 16:54:58 -07:00
Brian C. Lane
4f99c208aa Add lorax requires to lorax-composer package. 2018-06-11 16:54:58 -07:00
Brian C. Lane
5d6c236af6 Add /api/docs to serve up the documentation
This requires that the docs be at /usr/share/doc/lorax-*/html/ or if
running from the source tree, at ./docs/html/

They can be re-created by running 'make docs'
2018-06-11 16:54:58 -07:00
Brian C. Lane
8db5cdd512 Add basic documentation generation with Sphinx
Docs are included with the rpm, so the .spec needs a number of packages
as BuildRequires in order for Sphinx to run.
2018-06-11 16:54:58 -07:00
Brian C. Lane
9ec571ab23 Automatic commit of package [lorax] release [19.7.2-1].
Created by command:

/usr/bin/tito tag
2018-06-11 16:54:58 -07:00
Brian C. Lane
1d53d00532 Add limit/offset to recipes/list 2018-06-11 16:54:58 -07:00
Brian C. Lane
2cd4fcfd88 Add error message for offset/limit type errors 2018-06-11 16:54:58 -07:00
Brian C. Lane
9ca9bfe46f Add error logging to api/v0.py
These will end up in the /var/log/lorax-composer/composer.log
2018-06-11 16:54:58 -07:00
Brian C. Lane
950d9df217 Fix server request logging.
And switch the other logs to append instead of overwrite on each run.
2018-06-11 16:54:57 -07:00
Brian C. Lane
9f9d227600 Update lorax.spec for lorax-composer
Create a lorax-composer subpackage, with the pylorax/api code, systemd
service and runtime requirements in it.
2018-06-11 16:54:57 -07:00
Brian C. Lane
3bbbeb347a setup.py: Add pylorax.api module to install, and systemd service
lorax-composer.service will be installed by default, but not enabled.
It stores recipes at /var/lib/lorax-composer/recipes/
2018-06-11 16:54:57 -07:00
Brian C. Lane
453082ab9f lorax-composer: Drop unneeded parameters and create missing directories
The log directory (and parents) will be created if they are missing.
An empty recipe directory will be created if it doesn't exist.
2018-06-11 16:54:57 -07:00
Brian C. Lane
d701120d90 Add /recipes/diff route and tests 2018-06-11 16:54:57 -07:00
Brian C. Lane
052a8ba991 Add recipe_diff function and helpers.
This takes a pair of Recipe objects and returns a list of diff dicts
that include what was changed between the two recipes.
2018-06-11 16:54:57 -07:00
Brian C. Lane
a76e95dcb5 Add POST /recipes/tag/ route and tests 2018-06-11 16:54:57 -07:00
Brian C. Lane
7f1adf120c Add tag_recipe_commit helper function
And change tests to use it so that both it and tag_file_commit are used.
2018-06-11 16:54:57 -07:00
Brian C. Lane
3f4140d5d3 Add POST /recipes/undo route and tests 2018-06-11 16:54:57 -07:00
Brian C. Lane
639d325a0c Change read_recipe_commit to use the recipe name
Callers really shouldn't need to know the details of the filenames, so
change it to convert it internally.
2018-06-11 16:54:57 -07:00
Brian C. Lane
ab6decec0b Add revert_recipe function
And adjust the tests to use it so that it covers both revert_recipe and
revert_file.
2018-06-11 16:54:57 -07:00
Brian C. Lane
c294b7747d Add DELETE /recipes/delete/<recipe_name> route and tests
Also add numbering to the tests so that they are executed in the
expected order.
2018-06-11 16:54:57 -07:00
Brian C. Lane
c937e69d3b Add delete_recipe helper function and test
Use delete_recipe in the test so that both it and delete_file are
covered.
2018-06-11 16:54:57 -07:00
Brian C. Lane
6e453e70dc Add DELETE /recipes/workspace/<recipe_name> route and tests
This will delete the workspace copy of the recipe.
2018-06-11 16:54:57 -07:00
Brian C. Lane
83e13c4ca8 Add tests for POST /recipes/workspace for JSON and TOML
As a side-effect also tests reading workspace only changes from
/recipes/info
2018-06-11 16:54:57 -07:00
Brian C. Lane
72b4c4fe28 Add POST /recipes/workspace route
Also fix use of workspace in /recipes/info (was using filename instead
of recipe name and logic for changed was backwards).
2018-06-11 16:54:57 -07:00
Brian C. Lane
711cdf53b3 Add /recipes/new route and tests
This handles json data when the mime type is "application/json" and toml
recipes when it is "text/x-toml"
2018-06-11 16:54:57 -07:00
Brian C. Lane
7b5115d19c Split recipe_from_toml into recipe_from_dict helper.
This will be useful for creating Recipe objects from json created dicts.
2018-06-11 16:54:57 -07:00
Brian C. Lane
3c75711b30 Fix the recipe version bumping
Recipe should have its version bumped based on the version from the
previous commit, and not be bumped on the first commit. Fix the code and
the tests.
2018-06-11 16:54:57 -07:00
Brian C. Lane
02db2afb2b Add /recipes/changes route with tests. 2018-06-11 16:54:57 -07:00
Brian C. Lane
1e7335a506 Add /recipes/info route and tests 2018-06-11 16:54:57 -07:00
Brian C. Lane
b7f651a631 Add workspace module and tests
This handles the recipe workspace, which is a temporary location to
store recipes before committing them to git. It will be used by the
/recipes/ API.
2018-06-11 16:54:57 -07:00
Brian C. Lane
b6fb22133c Add /recipes/list route and tests
Includes adding a lock for access to the git repo from the API.
2018-06-11 16:54:57 -07:00
Brian C. Lane
90a8798f4c Move the git repo into a subdirectory
And fix the import of recipes (needs to have full path passed in).
2018-06-11 16:54:57 -07:00
Brian C. Lane
5b0d662007 Add basic API Server testing framework 2018-06-11 16:54:57 -07:00
Brian C. Lane
596f06d5c0 Fix list_commits sort order.
It appears that with libgit2 v0.24.6 reverse causes it to list them
newest first. In 0.25.1 it lists them oldest first. On both versions
just using SortMode.TIME gives the desired result of oldest first.
2018-06-11 16:54:57 -07:00
Brian C. Lane
afdb320266 Add tests for the pylorax.api.recipes module 2018-06-11 16:54:57 -07:00
Brian C. Lane
bfc9c6913f Add pylorax.api.recipes code for handling the Recipe's Git repository 2018-06-11 16:54:57 -07:00
Alexander Todorov
d71290153e Fix mocking the built-in open function for Python2
- fix import of mock module
- account for io.StringIO differences in Python 2
2018-06-11 16:54:57 -07:00
Alexander Todorov
2cd4f73177 Don't do wildcard imports 2018-06-11 16:54:57 -07:00
Alexander Todorov
e9e6e5701e Misc pylint fixes that are reported usually once 2018-06-11 16:54:57 -07:00
Alexander Todorov
bf9ed50d51 Fix dangerous-default value warnings
when default value is list or dict the default arguments are
instantiated as objects at the time of definition. This is significant
(exposing visible semantics) when the object is mutable. There’s no way
of re-binding that default argument name in the function’s closure. When
function is executed multiple times with its default value the value
will change between executions, possibly leading to strange side effects.

For more information see:
http://satran.in/2012/01/12/python-dangerous-default-value-as-argument.html
2018-06-11 16:54:57 -07:00
Alexander Todorov
a0766b1d70 Don't redefine variables from outer scope 2018-06-11 16:54:57 -07:00
Alexander Todorov
4d8e2b5356 Define all class attributes inside __init__ 2018-06-11 16:54:57 -07:00
Alexander Todorov
663b0f8378 Fix logging formatting 2018-06-11 16:54:57 -07:00
Alexander Todorov
18528b4f47 Don't redefine builtins 2018-06-11 16:54:57 -07:00
Alexander Todorov
b15df5a0af Silence relative import warnings 2018-06-11 16:54:57 -07:00
Alexander Todorov
7f5b492198 pylint fix: unused variable warning 2018-06-11 16:54:57 -07:00
Alexander Todorov
15de3e1687 pylint fix: remove unused imports 2018-06-11 16:54:57 -07:00
Alexander Todorov
54cdb5dbf5 Add make test target and update .gitignore
also submit coverage report to Coveralls.io if environment is
configured
2018-06-11 16:54:57 -07:00
Alexander Todorov
f405aedf6e Add first unit test so we can start collecting coverage 2018-06-11 16:54:57 -07:00
Brian C. Lane
2008a413b6 lorax-composer initial commit
The lorax-composer program will launch a BDCS compatible API server
using Flask and Gevent. Currently this is a skeleton application with
only one active route (/api/v0/status).

The API code lives in ./src/pylorax/api/v0.py with related code in other
pylorax/api/* modules.
2018-06-11 16:54:57 -07:00
Brian C. Lane
798023b199 Add pylint support to Makefile
This requires pylint and python-pocketlint from EPEL7 to work.
runpylint.py copied from upstream lorax.
2018-06-11 16:54:57 -07:00
Brian C. Lane
bf8be43c90 livemedia-creator: Move core functions into pylorax modules
This reduces the amount of code in livemedia-creator to the cmdline
parsing and calling of the installer functions. Moving them into other
modules will allow them to be used by other projects, like the
lorax-composer API server.
2018-06-11 16:54:57 -07:00
Brian C. Lane
47aa2fb215 Automatic commit of package [lorax] release [19.7.1-1].
Created by command:

/usr/bin/tito tag --keep-version
2018-06-11 16:27:56 -07:00
Brian C. Lane
c5dfe8e940 Automatic commit of package [lorax] release [19.6.105-1].
Created by command:

/usr/bin/tito tag
2018-06-11 14:52:23 -07:00
Brian C. Lane
c746e8b0c3 Retry losetup if loop_attach fails
It appears that sometimes the loop device doesn't get setup properly,
this may be a race with other users of loop devices on the system, or
some other mechanism that isn't understood.

To try and prevent total failure when this happens this patch retries
the loop setup 3 times before giving up. Previously it would wait for
the loop device to appear (checking 5 times), that operation is now
executed 3 times with a new losetup attempt each time.

Resolves: rhbz#1589084
2018-06-11 13:56:53 -07:00
Brian C. Lane
f116ee8f05 Add reqpart to example kickstart files
This will make sure that platform specific partitions are created when
making partitioned disk images.

Resolves: rhbz#1545289
2018-06-11 13:52:21 -07:00
Brian C. Lane
4788d4eb4d Increase default ram used with lmc and virt to 2048
1024 is a bit small in some situations, double it.

Resolves: rhbz#1538747
2018-06-11 13:49:28 -07:00
Brian C. Lane
c8cee96b1c Add --virt-uefi to boot the VM using OVMF
This requires OVMF to be setup on the system, and for the kickstart to
create a /boot/efi/ partition. You can then use it to create UEFI
bootable partitioned disk images.

The UEFI firmware needs to be installed manually on the system, either
in the default location of /usr/share/OVMF/ or use --ovmf-path to point
to the location.

Resolves: rhbz#1546715
Resolves: rhbz#1544805
2018-06-11 13:45:32 -07:00
Brian C. Lane
22392b64fc Add --dracut-arg support to lorax
Use it to override the default dracut arguments (displayed as part of
the --help output). If you want to extend the default arguments they
all need to be passed in on the cmdline as well. eg.

--dracut-arg='--xz' --dracut-arg='--install /.buildstamp' ...

Resolves: rhbz#1452220
2018-06-06 17:38:55 -07:00
Brian C. Lane
6f2494f9d5 livemedia-creator: Search for kernel/initrd under /images/pxeboot (#1522629)
On aarch64 the kernel and initrd are under /images/pxeboot, add these
paths to the search list.

Resolves: rhbz#1522629
2018-05-17 10:30:34 -07:00
Brian C. Lane
88664f03a1 Automatic commit of package [lorax] release [19.6.104-1].
Created by command:

/usr/bin/tito tag
2018-01-24 08:47:26 -08:00
Brian C. Lane
99254492e3 Replace fedora-gnome-theme with gnome-themes-standard (#1537573)
gnome-themes-standard used to provide fedora-gnome-theme, but dropped it
in version 3.22.2-1

Resolves: rhbz#1537573
2018-01-23 08:34:27 -08:00
Brian C. Lane
5479fab3e4 Automatic commit of package [lorax] release [19.6.103-1].
Created by command:

/usr/bin/tito tag
2018-01-11 09:22:50 -08:00
Samantha N. Bueno
730badfebc Keep hid-multitouch and i2c-hid modules. (rhbz#1526323)
Several laptops require these modules for the touchpad to work.

Resolves: rhbz#1526323
2018-01-11 08:55:17 -08:00
Brian C. Lane
8361d021a5 Automatic commit of package [lorax] release [19.6.102-1].
Created by command:

/usr/bin/tito tag
2018-01-02 11:55:06 -08:00
Brian C. Lane
2c5ba00dc0 Add grub2-tools to aarch64 (#1489707)
These can be useful during installation or rescue.

Resolves: rhbz#1489707
2017-12-05 08:33:22 -08:00
Brian C. Lane
ea72c3e035 Automatic commit of package [lorax] release [19.6.101-1].
Created by command:

/usr/bin/tito tag
2017-10-17 10:20:41 -07:00
Brian C. Lane
9429d392d6 Restore all of the grub2-tools on x86_64 and i386 (#1489707)
These can be useful during installation or rescue.
(They are already present on ppc64)

Resolves: rhbz#1489707
2017-10-13 09:00:31 -07:00
Brian C. Lane
db8892bef3 Automatic commit of package [lorax] release [19.6.100-1].
Created by command:

/usr/bin/tito tag
2017-10-09 11:49:44 -07:00
Vendula Poncova
9c6575689a Add dependencies for SE/HMC (#1498834)
Resolves: rhbz#1498834
2017-10-09 08:52:44 -07:00
Brian C. Lane
1745c4f15b Automatic commit of package [lorax] release [19.6.99-1].
Created by command:

/usr/bin/tito tag
2017-09-29 09:37:04 -07:00
Brian C. Lane
7a0b4f2070 s390 doesn't need to graft product.img and updates.img into /images (#1478448)
The /images directory is already grafted into the iso, so it
doesn't need a specific line for the .img files.

Related: rhbz#1478448
2017-09-29 09:31:34 -07:00
Brian C. Lane
58309c2018 Automatic commit of package [lorax] release [19.6.98-1].
Created by command:

/usr/bin/tito tag
2017-09-27 09:08:26 -07:00
Brian C. Lane
54d973e059 Write a list of installed packages to /root/lorax-packages.log (#1416155)
This can't be done the same way as on master because there is no rpm
database inside the installroot to run rpm -qa against. Do it at the end
of the yum transaction.

Resolves: rhbz#1416155
2017-09-27 08:30:04 -07:00
Brian C. Lane
1639df6862 Set the releasever and install gpg keys when using --repo
This uses the --release value as the yum releasever so that $releasever
in a --repo will work.

It also turns on assumeyes so that any gpgkey entries in the .repo file
will be installed and used automatically if gpgcheck is enabled for the
repo.

Related: rhbz#1430479
2017-09-26 15:48:37 -07:00
Brian C. Lane
b1aa852b58 Automatic commit of package [lorax] release [19.6.97-1].
Created by command:

/usr/bin/tito tag
2017-08-18 10:21:20 -07:00
Brian C. Lane
df35857c9b Remove -boot-info-table from s390 boot.iso creation (#1478448)
It corrupts the kernel+initrd and isn't needed when booting on s390.

Related: rhbz#1478448
2017-08-18 10:19:28 -07:00
Brian C. Lane
4f55facece Automatic commit of package [lorax] release [19.6.96-1].
Created by command:

/usr/bin/tito tag
2017-08-15 15:05:13 -07:00
Brian C. Lane
641bbc21af Install mk-s390-cdboot to /usr/bin/ (#1478448)
Related: rhbz#1478448
2017-08-15 14:55:46 -07:00
Brian C. Lane
a909182aad Automatic commit of package [lorax] release [19.6.95-1].
Created by command:

/usr/bin/tito tag
2017-08-11 18:00:15 -07:00
Brian C. Lane
3cfd532382 IsoMountpoint: Add ppc64le kernel to search (#1373358)
Resolves: rhbz#1373358
2017-08-11 17:38:58 -07:00
Brian C. Lane
d30143d146 livemedia-creator: Report correct results dir (#1374609)
Resolves: rhbz#1374609
2017-08-11 17:38:58 -07:00
Brian C. Lane
e5c6f9e8bc Add creation of a bootable s390 iso (#1478448)
Use mk-s390-cdboot to create a combined kernel+initrd and then build a
boot.iso using it.

Resolves: rhbz#1478448
2017-08-11 16:02:52 -07:00
Brian C. Lane
6007b35096 Add mk-s360-cdboot utility (#1478448)
Add a utility to concatenate the kernel and initrd, and edit the kernel.

This is based on:
https://github.com/rhinstaller/anaconda/blob/rhel6-branch/utils/mk-s390-cdboot.c

It takes into account byteorder and it wipes the cmdline area before
writing the parmfile into the kernel.

Related: rhbz#1478448
2017-08-11 16:02:52 -07:00
Brian C. Lane
5238b9cd18 Fix systemctl command (#1478247)
When multiple units are passed to systemctl and one fails it doesn't
finish the others. Change the template command to call systemctl for
each unit individually.

This also removes the lvm2-activation-generator in runtime-cleanup.tmpl

Resolves: rhbz#1478247
2017-08-11 15:49:10 -07:00
Brian C. Lane
1b29041089 Add the version to the log (#1335456)
Log the version number as INFO and add -V version display to
livemedia-creator.

Resolves: rhbz#1335456
2017-08-11 15:42:16 -07:00
Brian C. Lane
7aa71188b9 Include the dracut fips module in the initrd (#1341280)
This will allow anaconda to fetch kickstarts using https when installing
with fips=1

Leave vmlinuz and .vmlinuz.hmac in /boot

dracut-fips module needs the vmlinuz.hmac file in order to boot.

Resolves: rhbz#1341280
2017-08-11 15:22:50 -07:00
Brian C. Lane
a883412ccc Fix loop_wait (#1462150)
The previous code used losetup --list -O to return the backing store
associated with the loop device. This can fail due to losetup truncating
the output filename if sysfs isn't setup. Instead of printing the full
path it will truncate it to 64 characters with a * at the end.

See util-linux lib/loopdev.c for the code that does this.

This commit changes it to use the existing get_loop_name function, which
uses losetup -j to lookup the loop device associated with the backing
store which avoids the truncation problem.

Resolves: rhbz#1462150
2017-08-11 15:18:00 -07:00
Brian C. Lane
79917e7e88 Document kickstart restrictions on %include (#1418500)
%include cannot be used with livemedia-creator

Resolves: rhbz#1418500
2017-08-11 15:11:30 -07:00
Brian C. Lane
487618314c Add support for --repo to read yum .repo files directly (#1430479)
This makes it easier to specify existing repos with extra args, eg.
/etc/yum.repos.d/redhat.repo generated by subscription-manager.

Resolves: rhbz#1430479
2017-08-11 15:11:30 -07:00
Marek Hruscak
81d534670b Package grub2-efi-ia32 need to be added explicitly to example kickstarts. (#1458937)
Boot on 32bit UEFI requires this package. Legacy grub2-efi package
is satisfied only with grub2-efi-x64 package and grub2-efi-ia32 is missing.

Resolves: rhbz#1458937
2017-08-11 15:08:37 -07:00
Brian C. Lane
694a630a89 Automatic commit of package [lorax] release [19.6.94-1].
Created by command:

/usr/bin/tito tag
2017-06-23 08:29:15 -07:00
Brian C. Lane
aaf1cc3894 Fix waiting for loop devices (#1462150)
Missing change for the previous commit.

Resolves: rhbz#1462150
2017-06-23 08:28:32 -07:00
Brian C. Lane
bbfc50b185 Automatic commit of package [lorax] release [19.6.93-1].
Created by command:

/usr/bin/tito tag
2017-06-22 08:29:32 -07:00
Brian C. Lane
e0d9e309ae Make sure loop device is setup (#1462150)
It seems that on rare occasions losetup can return before the /dev/loopX
is ready for use, causing problems with mkfs. This tries to make sure
that the loop device really is associated with the backing file before
continuing.

Resolves: rhbz#1462150
2017-06-21 14:31:35 -07:00
Brian C. Lane
db32eb7295 Automatic commit of package [lorax] release [19.6.92-1].
Created by command:

/usr/bin/tito tag
2017-06-20 08:59:02 -07:00
Brian C. Lane
1d2639cd92 Remove the iso-graft check from the aarch64.tmpl
RHEL7 doesn't support the workdir+/iso-graft feature.

Resolves: rhbz#1369014
2017-06-19 14:58:40 -07:00
Brian C. Lane
fd7199d3b4 Automatic commit of package [lorax] release [19.6.91-1].
Created by command:

/usr/bin/tito tag
2017-06-15 11:37:08 -07:00
Brian C. Lane
31fec67150 Update livemedia-creator examples
Make sure grub2-efi-*-cdboot is included in the live media kickstart,
add some documentation about creating UEFI disk images, and add ia32 to
the minimal example (it will need to be commented out for other arches).

Resolves: rhbz#1458937
2017-06-15 10:58:52 -07:00
Brian C. Lane
16594715cc Automatic commit of package [lorax] release [19.6.90-1].
Created by command:

/usr/bin/tito tag
2017-06-05 17:05:43 -07:00
Brian C. Lane
5970d38a1a Fix aarch64 efi.tmpl invocation for live images
We didn't add "efiarch32" on aarch64 because it made no sense, but we
need to because it's not an optional argument in the other template.
Just make it efiarch32=None.

Also fixes a typo in share/live/uefi.tmpl

Related: rhbz#1310775
2017-06-05 14:27:47 -07:00
Brian C. Lane
8d1e55a765 Automatic commit of package [lorax] release [19.6.89-1].
Created by command:

/usr/bin/tito tag
2017-05-31 09:48:22 -07:00
Brian C. Lane
351b4a0ce4 Remove incorrect variables from rhel7-livemedia.ks example
The only environmental variable set during %post is $ANA_INSTALL_PATH
which points to the installroot (usually /mnt/sysimage). It can be used
in a %post --nochroot to copy things from the installer root to the
target's root filesystem.

This removes the %post --nochroot section because the image is not
accessable at this point in the process. Items that need to go into the
/ of the iso need to be added in the final iso creation templates, like
x86_64.tmpl

Resolves: rhbz#1430547
2017-05-31 09:43:06 -07:00
Brian C. Lane
c049f01c46 Automatic commit of package [lorax] release [19.6.88-1].
Created by command:

/usr/bin/tito tag
2017-05-30 09:56:14 -07:00
Brian C. Lane
6d5dc9cfa3 Add support for aarch64 live images
This adds the aarch64 template, and the grub2-efi config file to the
live template directory.

Resolves: rhbz#1369014
(cherry picked from commit 89c7a93508b7328fc9c180164b23fae29bcd022b)
2017-05-22 10:14:34 -07:00
Brian C. Lane
985a2f1c3d Automatic commit of package [lorax] release [19.6.87-1].
Created by command:

/usr/bin/tito tag
2017-05-18 08:55:21 -07:00
Brian C. Lane
cac3e38bcb Increase rootfs size for rhel7-livemedia.ks example
A 4G / is no longer large enough, increase it to 5G

Also update the example release urls to 7.4
2017-05-17 13:36:19 -07:00
Brian C. Lane
77618d27b9 Automatic commit of package [lorax] release [19.6.86-1].
Created by command:

/usr/bin/tito tag
2017-04-11 14:21:06 -07:00
Brian C. Lane
c271124e84 lorax: Remove cairo-sphinx from the image
It doesn't run because we remove the libcairo-script* libraries, and
isn't needed by anything in the installation environment. Its presence
causes automated tests checking for missing libs to raise an error.

Resolves: rhbz#1355681
2017-04-11 13:55:53 -07:00
Brian C. Lane
8dbdd4abd4 Automatic commit of package [lorax] release [19.6.85-1].
Created by command:

/usr/bin/tito tag
2017-04-07 17:32:14 -07:00
Peter Jones
460bcd8f68 Fix aarch64 efi.tmpl invocation
We didn't add "efiarch32" on aarch64 because it made no sense, but we
need to because it's not an optional argument in the other template.
Just make it efiarch32=None.

Related: rhbz#1310775

Signed-off-by: Peter Jones <pjones@redhat.com>
2017-04-07 17:31:18 -07:00
Brian C. Lane
8c19af511e Automatic commit of package [lorax] release [19.6.84-1].
Created by command:

/usr/bin/tito tag
2017-03-28 13:37:06 -07:00
Jonathan Lebon
d7ae7a9e1f runtime-cleanup.tmpl: don't delete localedef
This is required in the future for anaconda to be able to inspect the
supported locales in Atomic Host installations.

Related: rhbz#1429576
2017-03-28 10:46:51 -07:00
Brian C. Lane
49321eef6f Automatic commit of package [lorax] release [19.6.83-1].
Created by command:

/usr/bin/tito tag
2017-03-22 10:33:09 -07:00
Peter Jones
5d204bd21e Make 64-bit kernel on 32-bit firmware work for x86 efi machines
This enables Baytrail and similar atom CPUs that typically ship with a
32-bit firmware, but have a 64-bit capable CPU.

Resolves: rhbz#1310775

Signed-off-by: Peter Jones <pjones@redhat.com>
2017-03-21 16:54:07 -04:00
Brian C. Lane
e9e30a2516 Automatic commit of package [lorax] release [19.6.82-1].
Created by command:

/usr/bin/tito tag
2017-03-17 09:49:41 -07:00
Brian C. Lane
d4437ce5ee Add --noverifyssl to lorax (#1430483)
Previously lorax had no way to use repos with self-signed certificates.
This adds the --noverifyssl cmdline option which will ignore certificate
errors.

Resolves: rhbz#1430483
2017-03-17 09:07:58 -07:00
Brian C. Lane
8ef5f48a3e Automatic commit of package [lorax] release [19.6.81-1].
Created by command:

/usr/bin/tito tag
2017-03-02 14:51:01 -08:00
Robert Marshall
2ee0b0a2ae Keep fsfreeze in install environment (#1315468)
The latest POWER platform allows a host machine to configure guests
running in a different endian mode. Guests configured in this way may
have their bootloader configuration file corrupted after installation if
the file was not fully written to disk. The host machine would read the
journal and try to finish writing the file in the wrong endian mode.

Issuing an fsfreeze and unfreeze gives more assurance that the
configuration file is properly written before a reboot; this patch adds
fsfreeze to the installer runtime environment.

Related: rhbz#1315468
(cherry picked from commit 9543a46dac)
2017-03-02 14:49:01 -08:00
Radek Vykydal
975c46b35f Fix duplicate kernel messages in /tmp/syslog (#1382611)
Resolves: rhbz#1382611

The kernel messages will be read from journal so don't use additional imlkog
module to read them duplicitly.

Fixup of
commit b5d0b1fd79
2017-03-02 13:08:44 +01:00
Brian C. Lane
371286180a Automatic commit of package [lorax] release [19.6.80-1].
Created by command:

/usr/bin/tito tag
2017-02-22 10:07:44 -08:00
Jiri Konecny
3fa988aa17 Add dependency for lvmdump -l command (#1255659)
This is required for pre installation log feature in Anaconda.

The libpcap library is dependency for nmap-ncat which is dependency for
lvmdump -l.

Related: rhbz#1255659
2017-02-22 10:06:43 -08:00
Brian C. Lane
2543a1ee19 Automatic commit of package [lorax] release [19.6.79-1].
Created by command:

/usr/bin/tito tag
2017-02-17 14:01:30 -08:00
Colin Walters
766cad3ad3 templates: Enusre basic.target.wants dir exists for rngd
There's something racy here; in my Atomic Workstation CI/CD I'm seeing:

```
01:12:43   symlink /lib/systemd/system/rngd.service etc/systemd/system/basic.target.wants/rngd.service
01:12:43   FileNotFoundError: [Errno 2] No such file or directory: '/lib/systemd/system/rngd.service' -> '/var/tmp/lorax.7cgdtz1_/installtree/etc/systemd/system/basic.target.wants/rngd.service'
```

Rather than debug this right now, let's just make sure it exists,
like we do right above for `tmp.mount`.

(cherry picked from commit 4f1f118cee)
Signed-off-by: Brian C. Lane <bcl@redhat.com>

Resolves: rhbz#1377430
2017-02-17 13:57:32 -08:00
Brian C. Lane
02dda2c00b Automatic commit of package [lorax] release [19.6.78-1]. 2016-09-08 12:17:54 -07:00
Radek Vykydal
05d271d0d9 Don't log dracut initrd regeneration messages into /tmp/syslog (#1369439)
Related: rhbz#1369439

Keep it same as in RHEL 7.2. They increase the size of the /tmp/syslog file
from ~280K to ~1M, and can be obtained from journal if needed.
2016-08-23 14:55:04 +02:00
Radek Vykydal
b5d0b1fd79 Use imjournal for rsyslogd instead of sharing /dev/log with journal (#1369439)
Resolves: rhbz#1369439

Rsyslogd used to read messages from /dev/log together with systemd-journald
which resulted in NetworkManager messages not being passed to syslog due to a
race condition during starting NetworkManager and rsyslogd service. So use
imjournal rsyslog plugin that picks messages from journald instead of using the
/dev/log socket. Same as regular RHEL 7 system.
2016-08-23 14:50:16 +02:00
Brian C. Lane
5dbb282289 Automatic commit of package [lorax] release [19.6.77-1]. 2016-08-01 15:59:37 -07:00
Brian C. Lane
6268aaff6e livemedia-creator: Install genericdvd.prm (#1269213)
share/live/s390.tmpl needs to install the file.

Related: rhbz#1269213
2016-08-01 14:24:44 -07:00
Brian C. Lane
c2be4bdfc8 livemedia-creator: Use imgutils.copytree for results (#1362157)
commit 5da9f5c179 cleaned up the resultdir
handling, but didn't take into account that on master shutil.copytree
was switched to imgutil.copytree which doesn't care if the empty
directory exists or not.

Resolves: rhbz#1362157
2016-08-01 14:22:29 -07:00
Brian C. Lane
8110952abb Automatic commit of package [lorax] release [19.6.76-1]. 2016-07-28 14:17:03 -07:00
Brian C. Lane
492d39933d livemedia-creator: Fix logging (#1361031)
The cherry-pick for commit 0d28b9e09c
dropped the patch into the middle of setup_logging and added a (unused)
main() function so things would still run, but logging wasn't being
setup properly.

This removes the main() and moves the default_image_name() function
after all of the logging setup code.

Resolves: rhbz#1361031
2016-07-28 14:11:37 -07:00
Brian C. Lane
c63963c99f Automatic commit of package [lorax] release [19.6.75-1]. 2016-07-26 16:40:22 -07:00
Brian C. Lane
3093ff7bac livemedia-creator: Use hd:LABEL for stage2 iso (#1355882)
The correct way with the current dracut (and it should be backwards
compatible) is to reference it as stage2=hd:LABEL=...

(cherry picked from commit 4bc4b4c5a5)
Resolves: rhbz#1355882
2016-07-25 08:09:12 -07:00
Brian C. Lane
1f9af67806 Automatic commit of package [lorax] release [19.6.74-1]. 2016-07-18 14:58:13 -07:00
Brian C. Lane
6a8663c270 Keep fb_sys_fops module needed for ast support (#1272658)
Ends up the drm_kms_helper module depends on fb_sys_fops so keep that as well.

Resolves: rhbz#1272658
2016-07-18 14:57:40 -07:00
Brian C. Lane
a1ef3b009b Automatic commit of package [lorax] release [19.6.73-1]. 2016-06-24 17:44:45 -07:00
David Shea
b7f74cdb01 Add back libraries needed by spice-vdagent
spice-vdagent, half of the thing that lets copy/paste work across a
spice connection, added sound support, I guess, so now we need
alsa-libs.

(cherry picked from commit 89441cd675)

Resolves: rhbz#1347737
2016-06-23 09:45:04 -04:00
Brian C. Lane
9455d47c10 Automatic commit of package [lorax] release [19.6.72-1]. 2016-06-22 16:45:56 -07:00
Brian C. Lane
9a64d851f1 Make sure cmdline config file exists (#1348302)
If the --config file doesn't exist lorax will fall back to its defaults,
which are probably not what you want. Now it will exit if it doesn't
exist.

Resolves: rhbz#1348302
(cherry picked from commit 748259619b)
2016-06-22 16:44:12 -07:00
Brian C. Lane
abfbd76af2 Keep all of the kernel drivers/target/ modules (#1348381)
The ib_srpt, and ib_isert modules depend on these.

Resolves: rhbz#1348381
(cherry picked from commit 8bf144843a)
2016-06-22 15:33:12 -07:00
Brian C. Lane
4bdfa33958 Keep the pci utilities for use in kickstarts (#1344926)
Resolves: rhbz#1344926
(cherry picked from commit 1a60afc4ff)
2016-06-21 16:25:58 -07:00
Brian C. Lane
ba52b0f952 Automatic commit of package [lorax] release [19.6.71-1]. 2016-05-05 08:48:07 -07:00
Brian C. Lane
73b368de28 Create an empty selinux config file (#1332147)
In order for selinux to properly label the system it needs to see that
the config file exists.

Also remove the old code trying to copy in a selinux config file, it
never worked -- the removepkg would remove it.

(cherry picked from commit d6584e1d77)

Resolves: rhbz#1332147
2016-05-03 10:57:10 -07:00
Brian C. Lane
4ec05dd1c9 Automatic commit of package [lorax] release [19.6.70-1]. 2016-04-21 16:52:23 -07:00
Brian C. Lane
e2285683c4 Use eurlatgr as the console font (#1265354)
Resolves: rhbz#1265354
2016-04-19 16:52:07 -07:00
Brian C. Lane
1f078e5e03 Automatic commit of package [lorax] release [19.6.69-1]. 2016-04-15 18:15:04 -07:00
Brian C. Lane
51eac47775 Remove Metacity override and theme (#1324890)
This will now be handled by Anaconda because it is also needed on the
installed system for Initial Setup.

Resolves: rhbz#1324890
2016-04-13 13:38:36 -07:00
Brian C. Lane
391f1a7b57 Copying same file shouldn't crash (#1269213)
When using the template install command copying the same file to itself
shouldn't crash. Just log the error and continue.

Also copy the s390 configuration files for use with livemedia-creator

Resolves: rhbz#1269213
(cherry picked from commit 701ab02619)
2016-04-06 17:02:41 -07:00
Brian C. Lane
424fdd5cda Automatic commit of package [lorax] release [19.6.68-1]. 2016-03-30 14:44:24 -07:00
Brian C. Lane
0d28b9e09c livemedia-creator: Use correct suffix on default image names (#1318958)
When an image name hasn't been passed, and the compression type is
something other than xz, the default image name should use the user
specified compression suffix.

Resolves: rhbz#1318958
(cherry picked from commit f753a064b8)
2016-03-30 14:29:44 -07:00
Brian C. Lane
69daa095bf Fix livemedia-creator manpage (#1318952)
Resolves: rhbz#1318952
2016-03-28 16:23:20 -07:00
Brian C. Lane
5be2a9c57a Automatic commit of package [lorax] release [19.6.67-1]. 2016-03-01 17:49:04 -08:00
Colin Walters
cc374548e8 templates: Reinstate gpgme-pthread.so for ostree (#1311793)
See https://github.com/GNOME/ostree/pull/190

Without this the installer ISO generation fails.

Resolves: rhbz#1311793
(cherry picked from commit 6fcdac5c88)
2016-02-25 09:37:41 -08:00
Brian C. Lane
fec7b8d7b8 Add rng-tools and start rngd.service by default (#1258516)
This will help improve the entropy situation with non-x86 hardware. rngd
will add entropy from hardware rng sources.

Resolves: rhbz#1258516
(cherry picked from commit 690feba381)
2016-02-25 09:09:13 -08:00
Brian C. Lane
de835d687a Add @anaconda-tools to example live kickstart (#1269891)
This includes packages that anaconda runs from the installed system
during installation. It includes grub2, grub2-efi, shim, efibootmgr
among others.

Resolves: rhbz#1269891
2016-02-24 11:20:21 -08:00
Brian C. Lane
0252c5a7f1 Include grub2-efi-modules on the boot.iso (#1277227)
Some users need to be able to run grub2-install from %pre

Resolves: rhbz#1277227
2016-02-24 07:48:06 -08:00
Brian C. Lane
a17cecdee2 Keep modules needed for ast video driver support (#1272658)
The ast module depends on:
drm,drm_kms_helper,ttm,syscopyarea,i2c-core,sysfillrect,sysimgblt,i2c-algo-bit

This retains the syscopyarea, sysfillrect, and sysimgblt modules.

Resolves: rhbz#1272658
2016-02-24 07:45:45 -08:00
Radek Vykydal
420d006ab6 configure NetworkManager to loglevel=DEBUG (#1274647)
Resolves: rhbz#1274647
2016-02-19 16:47:39 -08:00
Brian C. Lane
2795b08b1c Update docs for product.img (#1272361)
Make it clear that the contents of product.img and updates.img comes
from the install root, not from the build host's filesystem.

Resolves: rhbz#1272361
2016-02-19 16:41:58 -08:00
Brian C. Lane
cc715caaf9 paste is needed by os-prober (#1275105)
Resolves: rhbz#1275105
(cherry picked from commit 4312ddf1a6)
2016-02-19 16:31:06 -08:00
Brian C. Lane
b8bcb063cc Keep libthread so that gdb will work correctly (#1269055)
Resolves: rhbz#1269055
(cherry picked from commit 0b8b74edda)
2016-02-19 16:14:48 -08:00
Colin Walters
7c4d7b0c42 Add --installpkgs argument (#1272222)
Recently, Fedora has been trying to do a 3 product split.  As part of
that, lorax was changed to do "installpkg lorax-product-*" via
provides.

I think that approach is awkward; a much simpler approach is to simply
specify the product package as input to lorax on the command line, via
external rel-eng scripts.

This patch therefore adds --installpkgs (and we should probably add an
option to remove the implicit lorax-product-* glob).

(cherry picked from commit 52d962d613)

Resolves: rhbz#1272222
2016-02-19 15:58:50 -08:00
Brian C. Lane
5da9f5c179 livemedia-creator: Clean up resultdir handling (#1290552)
(cherry picked from commit 3148a2b215)

Resolves: rhbz#1290552
2016-02-19 14:15:41 -08:00
Colin Walters
f9dfc02fbf https is a sane package source URL scheme (#1292680)
Add https as a URL source and use list comprehension to check the
supported protocols.

(cherry picked from commit 611cef1823)

Resolves: rhbz#1292680
2016-02-19 14:04:57 -08:00
Dan Horák
7949b7dc52 Add product.img support for s390 templates (#1272359)
(cherry picked from commit a2c2a4be28)

Resolves: rhbz#1272359
2016-02-19 13:53:18 -08:00
Brian C. Lane
8a9fe5f8e2 Automatic commit of package [lorax] release [19.6.66-1]. 2015-09-02 17:07:37 -07:00
Brian C. Lane
3f5047dd4f livemedia-creator: Remove random-seed from images (#1258986)
systemd uses /var/lib/systemd/random-seed to add entropy to /dev/urandom
at boot time. During image creation this file is created, and if not
removed everything using the image will be adding the same seed.

This is only additional entropy, NOT a seed in the sense of a starting
point for a PRNG, so it will be mixed with other entropy as the system
runs. It isn't a good idea to use the same value everywhere so make sure
it is removed in %post

Resolves: rhbz#1258986
2015-09-02 10:26:42 -07:00
Brian C. Lane
243a29b495 Automatic commit of package [lorax] release [19.6.65-1]. 2015-09-01 16:26:32 -07:00
Brian C. Lane
62cfefd718 Don't include early microcode in initramfs (#1258498)
The system the image boots on will likely not match the host where lorax
was run, and in some cases this can cause systems to hang.

Resolves: rhbz#1258498
2015-09-01 09:50:05 -07:00
Brian C. Lane
c5e842b58a Automatic commit of package [lorax] release [19.6.64-1]. 2015-08-31 16:59:47 -07:00
Brian C. Lane
94d4bc7c4a Fix metacity theme path (#1231856)
${configdir} already includes the /common/ path component.

Related: rhbz#1231856
2015-08-31 10:42:17 -07:00
David Shea
41715eb194 Run spice-vdagentd without systemd-logind integration
The system-wide spice guest agent, spice-vdagentd, normally uses
systemd-logind to determine which of the per-session spice-vdagent
instances it should be communicating with. On the non-live media, the X
session isn't registered with systemd-logind, so instead start
spice-vdagentd with -X to disable the systemd-logind integration and
serve instead to a single spice-vdagent.

(cherry picked from commit 96ecdd4e6e)

Related: rhbz#1169991
2015-08-28 09:46:18 -04:00
Brian C. Lane
411fb2407c Automatic commit of package [lorax] release [19.6.63-1]. 2015-08-27 15:36:13 -07:00
David Shea
d93ace517e Replace the metacity theme file.
This replaces the Adwaita metacity-theme-2.xml file with a version that
sets has_title=False and removes the title borders for maximized
windows. This allows anaconda to run as a maximized window instead of a
fullscreen window while still running without a titlebar.

Related: rhbz#1231856
2015-08-26 14:53:47 -04:00
Brian C. Lane
aab6998a49 Automatic commit of package [lorax] release [19.6.62-1]. 2015-08-16 12:07:56 -07:00
Brian C. Lane
f9b36c0f5f Change default releasever to 7 (#1253242)
7 is more generic than 7.0 and doesn't need to be changed for each
release.

Resolves: rhbz#1253242
2015-08-13 09:01:40 -07:00
Brian C. Lane
7db0c5834b Automatic commit of package [lorax] release [19.6.61-1]. 2015-08-12 17:13:04 -07:00
Radek Vykydal
c124d8277d Add lldptool (#1085325)
Related: rhbz#1085325
2015-08-11 13:40:58 +02:00
Brian C. Lane
4cd75072c2 Automatic commit of package [lorax] release [19.6.60-1]. 2015-08-05 17:17:49 -07:00
Brian C. Lane
6e86552714 Fix tito tagger to bump version, not release (#1085013)
Related: rhbz#1085013
2015-08-05 17:16:57 -07:00
Brian C. Lane
ee9f35dc74 Automatic commit of package [lorax] minor release [19.6.59-2]. 2015-08-05 16:37:02 -07:00
Jiri Konecny
b2f6a9f129 Fix chronyd not working in the installation (#1085013)
Service chronyd not working on rhel7 now because it's missing command
flock.

Related: rhbz#1085013
2015-08-05 15:35:27 +02:00
Brian C. Lane
84514e18ce Add a custom RHEL tagger for tito
The default tagger doesn't add Related/Resolves lines to the changelog,
resulting in builds that have to be fixed up manually.

The output from this code still needs to be edited to remove the '-'
prefix from the Related/Resolves lines because tito appends them to
every line of output from the Tagger. But this is better than having to
add them manually.
2015-07-15 11:17:41 -07:00
Brian C. Lane
4fcabd4f00 Fix the lorax.spec again. Add missing Related. 2015-07-14 13:57:40 -07:00
Brian C. Lane
9c09f2a75a Automatic commit of package [lorax] release [19.6.59-1]. 2015-07-14 13:53:46 -07:00
Brian C. Lane
d48d0edd9c Add installimg command for use in the templates
installimg SRCDIR DESTFILE
  Create a compressed cpio archive of the contents of SRCDIR and place
  it in DESTFILE.

  If SRCDIR doesn't exist or is empty nothing is created.

Examples:
  installimg ${LORAXDIR}/product/ images/product.img

(cherry picked from commit b064ae6166)

Related: rhbz#1202278
2015-07-14 12:19:49 -07:00
Brian C. Lane
b3a4b56733 Automatic commit of package [lorax] release [19.6.58-1]. 2015-06-30 17:17:09 -07:00
Brian C. Lane
b51ff60875 Keep hyperv_fb driver in the image (#834791)
Hyper-V needs this.

Resolves: rhbz#834791
2015-06-29 11:01:45 -07:00
Brian C. Lane
f15503d2cc Automatic commit of package [lorax] release [19.6.57-1]. 2015-06-26 18:03:20 -07:00
Brian C. Lane
6b7407599b livemedia-creator: fix base repo log monitor (#1196721)
The anaconda rebase changed the repo download failure to ERR, fix this
in the log watching code so that it will shut down the VM when it hits
it.

Related: rhbz#1196721
2015-06-26 15:05:39 -07:00
Radek Vykydal
96371548d3 network: turn slaves autoconnection on
So we can activate master connection instead of searching for and activating
slave connections.

Makes turning bond/team device on in network spoke work.

Resolves: rhbz#1172751

It also causes a device configured in dracut to be properly reactivated as a slave
if it is configured so by kickstart.

Resolves: rhbz#1134090
2015-06-26 15:00:27 +02:00
Brian C. Lane
5688d58dcc Automatic commit of package [lorax] release [19.6.56-1]. 2015-06-25 16:13:05 -07:00
Colin Walters
50f9f48cc1 Add ability for external templates to graft content into boot.iso (#1202278)
I originally added --add-template to support doing something similar
to pungi, which injects content into the system to be used by default.
However, this causes the content to be part of the squashfs, which
means PXE installations have to download significantly more data that
they may not need (if they actually want to pull the tree data from
the network, which is not an unusual case).

What I actually need is to be able to modify *both* the runtime image
and the arch-specific content.  For the runtime, I need to change
/usr/share/anaconda/interactive-defaults.ks to point to the new
content.  (Although, potentially we could patch Anaconda itself to
auto-detect an ostree repository configured in disk image, similar to
what it does for yum repositories)

For the arch-specfic image, I want to drop my content into the ISO
root.

So this patch adds --add-arch-template and --add-arch-template-var
in order to do the latter, while preserving the --add-template
to affect the runtime image.

Further, the templates will automatically graft in a directory named
"iso-graft/" from the working directory (if it exists).

(I suggest that external templates create a subdirectory named
 "content" to avoid clashes with any future lorax work)

Thus, this will be used by the Atomic Host lorax templates to inject
content/repo, but could be used by e.g. pungi to add content/rpms as
well.

I tried to avoid code deduplication by creating a new template for the
product.img bits and this, but that broke because the parent boot.iso
code needs access to the `${imggraft}` variable.  I think a real fix
here would involve turning the product.img, content/, *and* boot.iso
into a new template.

Resolves: rhbz#1202278
2015-06-25 09:18:25 +02:00
Brian C. Lane
b3dabdd2e0 Update templates to use installimg for product and updates
With these templates if a package has installed files in
/usr/share/lorax/product or /usr/share/lorax/updates/ they will be used
to create product.img and/or updates.img which will be included in the
images/ directory of the iso and of the final output tree.

These can be used to customize the installation environment or provide
updates. See README.product for current documentation.

Related: rhbz#1202278
2015-06-25 09:18:24 +02:00
Brian C. Lane
5e1a7e4e3c Automatic commit of package [lorax] release [19.6.55-1]. 2015-06-22 17:19:06 -07:00
Jiri Konecny
b7ce8b4b0f Merge pull request #26 from jkonecny12/rhel7-ntp-add
Add ntp configuration file to installation for the main patch part in anaconda.
2015-06-22 15:02:11 +02:00
Jiri Konecny
13ea2c5253 Add ntp configuration file to installation
Add package ntp and remove it except ntp.conf file.
This is required for the main patch part in the anaconda.

Related: rhbz#1085013
2015-06-22 13:33:57 +02:00
Brian C. Lane
ba017a8d71 livemedia-creator: Add option to create qcow2 disk images (#1210413)
This adds the --qcow2 option to create qcow2 disk images in virt and
no-virt modes. You can pass extra options to qemu-img with --qcow2-arg

(cherry picked from commit b73aeb92a9)
Resolves: rhbz#1210413
2015-06-19 16:14:36 -07:00
Brian C. Lane
58929b550b Add support for creating qcow2 images (#1210413)
(cherry picked from commit 07d5cb176d)

Related: rhbz#1210413
2015-06-19 15:32:38 -07:00
Vratislav Podzimek
80fcdb4f91 Install the oscap-anaconda-addon (#1190685)
And keep in the rpm2cpio utility it requires.

Signed-off-by: Vratislav Podzimek <vpodzime@redhat.com>
2015-06-17 09:00:29 -07:00
Brian C. Lane
cbcfb27335 Automatic commit of package [lorax] release [19.6.54-1]. 2015-06-15 17:51:11 -07:00
Brian C. Lane
a37a59b3eb Add removekmod template command (#1230356)
removekmod GLOB [GLOB...] --allbut KEEPGLOB [KEEPGLOB...]

This can be used to remove kernel modules from under
/lib/modules/*/kernel/ while keeping specific items. This should be
easier than constructing find arguments to select the right things to
save.

(cherry picked from commit 11c9e0e8ee)

Resolves: rhbz#1230356
2015-06-15 15:04:06 -07:00
Brian C. Lane
b79ad68a50 Disable systemd-tmpfiles-clean (#1202545)
When the time changes dramatically it cleans up the files in /tmp/
causing problems with the installation.

Resolves: rhbz#1202545
2015-06-12 16:01:07 -07:00
Brian C. Lane
115d6d4c7d Add bridge-utils (#1188812)
This allows dracut's bridge commands to be used.

Resolves: rhbz#1188812
(cherry picked from commit 918c2c0cd1)
2015-06-12 15:07:32 -07:00
Brian C. Lane
29ae3b0293 Automatic commit of package [lorax] release [19.6.53-1]. 2015-06-05 16:26:33 -07:00
Brian C. Lane
9b57050fc6 Keep the zram kernel module
Needed by the zram.service

Related: rhbz#1196721
2015-06-05 08:34:44 -07:00
Vratislav Podzimek
bf8d25fc91 Keep seq and getconf utilities in the image
They are needed by the zram.service.

(cherry picked from commit 668fe3aa4b)

Related: rhbz#1996721
2015-06-05 08:34:35 -07:00
Brian C. Lane
680037372e Don't remove usr/lib/rpm/platform/ (#1116450)
This appears to cause the rpm-plugin-selinux to fail and some of the
selinux lebels aren't applied correctly.

(cherry picked from commit e1741763a9)

Related: rhbz#1196721
2015-06-05 08:34:18 -07:00
David Lehman
155750a4c8 Include /sbin/ldconfig from glibc.
python-pyudev needs it.

(cherry picked from commit f035057ef0)

Related: rhbz#1202877
2015-06-05 08:33:09 -07:00
Brian C. Lane
aff2a05f1c Fix changelog 2015-04-17 17:36:54 -07:00
Brian C. Lane
931a3bc87d Automatic commit of package [lorax] release [19.6.52-1]. 2015-04-17 17:34:08 -07:00
Radek Vykydal
ed3bec702e Add --live-rootfs-keep-size option
Resolves: rhbz#1184021
2015-04-13 10:05:17 +02:00
Radek Vykydal
9d8aabded6 Add --live-rootfs-size option.
Resolves: rhbz#1184021
2015-04-13 10:05:17 +02:00
Radek Vykydal
219ede2ae5 --make-pxe-target: change permissions of regenerated initramrfs to 0644
Resolves: rhbz#1184021
2015-04-13 10:05:17 +02:00
Radek Vykydal
52cd17be3f Override services kickstart setting from interactive-defaults.ks
Resolves: rhbz#1184021
2015-04-13 10:05:17 +02:00
Radek Vykydal
28801d8d42 Add --make-pxe-live and --make-ostree-live (for Atomic) targets.
Resolves: rhbz#1184021

--make-pxe-live target generate live squashfs and initrd for pxe boot.
Also generates pxe config template.

--make-ostree-live is used for installations of Atomic Host. Additionally to
--make-pxe-live it ensures using deployment root instead of physical root of
installed disk image where needed. Atomic installation needs to be virt
installation with /boot on separate partition (the only way supported by
Anaconda currently). Content of boot partition is added to live root fs so that
ostree can find deployment by boot configuration.
2015-04-13 10:05:17 +02:00
Brian C. Lane
e087f5a33c Make sure dracut uses no-hostonly mode
Related: rhbz#1184021
2015-04-13 10:05:03 +02:00
Chris Lumens
14c3324cac Allow doing non-URL installs if using virt.
In this case, we don't need to pass a repo parameter to anaconda.  It's running
in a VM and knows how to deal with a kickstart file.

Related: rhbz#1184021
2015-04-13 10:05:00 +02:00
Brian C. Lane
e95d34d13c Automatic commit of package [lorax] release [19.6.51-1]. 2015-01-16 20:08:49 -08:00
Brian C. Lane
a0f4a50291 Remove imggraft from aarch64.tmpl (#1174475)
rhel7 branch doesn't use imggraft.

Related: rhbz#1174475
2015-01-16 10:46:58 -08:00
Brian C. Lane
e9848670e5 Automatic commit of package [lorax] release [19.6.50-1]. 2015-01-14 17:20:48 -08:00
Peter Jones
db5e36b2b6 Use gcdaa64.efi and make boot.iso on aarch64 (#1174475)
Add iso creation and switch to using gcdaa64.efi instead of grubaa64.efi

Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Brian C. Lane <bcl@redhat.com>

(cherry picked from commit 8f582846af)

Resolves: rhbz#1174475
2015-01-13 08:54:00 -08:00
Brian C. Lane
6688b96b38 Automatic commit of package [lorax] release [19.6.49-1]. 2015-01-07 16:59:30 -08:00
Laszlo Ersek
fa2655f7d4 runtime-cleanup.tmpl: keep virtio-rng (#1179000)
Virtual machines easily get starved for randomness, and Anaconda insists
on sufficient amounts of entropy when the user requests LUKS disk
encryption. As a result, such installations can hang until Anaconda gives
up (after 10 minutes) and makes do with whatever entropy is available.

The virtualization host can feed randomness to the guest, unblocking the
installation. However, the guest can only consume that randomness through
the virtio-rng module. Let's not remove that module.

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Brian C. Lane <bcl@redhat.com>

Resolves: rhbz#1179000
(cherry picked from commit bd501cccef)
2015-01-07 10:31:46 -08:00
Brian C. Lane
30d7c14e29 Automatic commit of package [lorax] release [19.6.48-1]. 2014-12-19 10:26:36 -08:00
Brian C. Lane
e1655d7c3a aarch64 no longer needs explicit console setting (#1170413)
As of kernel-3.18.0-0.54 aarch64 can sort out what to use for the
console on its own, so drop the console= from the aarch64 grub2-efi.cfg
template.

Resolves: rhbz#1170413

(cherry picked from commit 519771a1df)
2014-12-19 10:16:23 -08:00
Brian C. Lane
16b052e99b Automatic commit of package [lorax] release [19.6.47-1]. 2014-12-02 12:27:44 -08:00
Brian C. Lane
6db00b977e Drop 32 bit for loop from ppc64 grub2 config (#1169878)
Older versions of petitboot don't understand the for loop and won't
boot.  We also don't shipt 32 bit media anymore so there is no reason
for this to remain.

(cherry picked from commit 5909574a44)
2014-12-02 12:23:38 -08:00
Brian C. Lane
5a283bb5f7 Fix changelog 2014-11-20 14:45:30 -08:00
Brian C. Lane
8fa43fc607 Automatic commit of package [lorax] release [19.6.46-1]. 2014-11-20 14:43:37 -08:00
Colin Walters
1ef49fca1e Add --add-template{,-var}
What I need is to make something like the traditional DVD which also
includes packages.  At present this is apparently handled by the
entirely separate pungi tool.

At the moment for me, it's the least bad option to modify lorax to
inject data from an external source than to create a new tool, or
attempt to also modify pungi to do this.

This would also allow pungi's DVD creation to eventually be a set of
external templates for Lorax.

(cherry picked from commit 66359415be)

Resolves: rhbz#1157777
2014-11-20 14:41:21 -08:00
Brian C. Lane
923ec7f682 Automatic commit of package [lorax] release [19.6.45-1]. 2014-10-31 17:56:17 -07:00
David Lehman
c79b291923 Don't include the stock lvm.conf.
We started including it as an unintended side-effect of commit 9ca487f8.

lvm doesn't like it when there are multiple 'global' sections in lvm.conf,
and we add one right at the end of that block. We expect ours to be the
file's only content.

(cherry picked from commit 4a7552d4be)

Related: rhbz#1149992
2014-10-31 13:22:42 -05:00
Brian C. Lane
e425ee14c6 Automatic commit of package [lorax] release [19.6.44-1]. 2014-10-22 16:28:02 -07:00
Brian C. Lane
e543fecde0 move image-minimizer to lorax (#1082642)
This is used as a kickstart %post interpreter to streamline
modifications to images.

Also adds an example kickstart.

This Obsoletes the old appliance-tools-minimizer and includes a Provide
so that the transition will be seamless.

(cherry picked from commit 99f2ab9137)
(cherry picked from commit b090a09dca)

Resolves: rhbz#1082642
2014-10-22 10:32:14 -07:00
Brian C. Lane
253e953962 Automatic commit of package [lorax] release [19.6.43-1]. 2014-10-16 17:54:57 -07:00
Brian C. Lane
f259ff0e29 Use all upper case for shim in live/efi.tmpl
mkefiboot now expects all upper case for BOOT*.EFI

Related: rhbz#1100048

Conflicts:
	share/live/efi.tmpl
2014-10-15 11:44:09 -04:00
Brian C. Lane
b0638ca2cd Automatic commit of package [lorax] release [19.6.42-1]. 2014-10-07 18:28:04 -07:00
Martin Kolman
d646ddb5d6 Revert "Don't remove /usr/share/doc/anaconda." (#1072033)
The help content path has been changed to /usr/share/anaconda/help,
so this Lorax change is no longer needed.

This reverts commit 8bd3d8d232.

Related: rhbz#1072033
2014-10-07 18:44:36 +02:00
Peter Jones
073d5de464 Look for "BOOT${efiarch}.EFI" in mkefiboot as well.
The aarch64 change to use shim (6907567) also stopped using mixed-case
names for BOOT${efiarch}.efi (so it's always .EFI and ${efiarch} is X64
IA32 AA64 etc. now), and mkefiboot needs to match that.

Related: rhbz#1100048

Incidentally, this should fix are aych bee zee one zero four three two
seven four.
2014-10-07 10:52:54 -04:00
Martin Kolman
1f56b27082 Libgailutil is required yelp, don't remove it (#1072033)
Related: rhbz#1072033
2014-10-06 18:13:08 +02:00
Brian C. Lane
880a56d1c0 Automatic commit of package [lorax] release [19.6.41-1]. 2014-10-03 17:11:48 -07:00
Peter Jones
26cfe3ebc8 Make sure shim is actually in the package list on aarch64 as well.
Otherwise all the other stuff gets to be just extra error messages and
failures.

Signed-off-by: Peter Jones <pjones@redhat.com>
2014-10-03 16:45:45 -04:00
Brian C. Lane
16d06ac7c9 Automatic commit of package [lorax] release [19.6.40-1]. 2014-10-02 17:58:59 -07:00
Peter Jones
771ff40c4e Use shim on aarch64.
We have shim and grub working together on aarch64 now, so we may as well
use them.

(this also makes the case of boot${arch}.efi not mixed-case, which
should guarantee it's in FAT rather than VFAT...)

Related: rhbz#1100048

Signed-off-by: Peter Jones <pjones@redhat.com>
2014-10-02 15:58:04 -07:00
Vratislav Podzimek
b343637745 Keep the /etc/lvm/profiles directory in the image
Profile definitions are needed e.g. for creation of thin pools with specific
profile.

Related: rhbz#869456
2014-10-02 15:44:59 +02:00
Brian C. Lane
036d7d1a79 Automatic commit of package [lorax] release [19.6.39-1]. 2014-09-30 08:37:36 -07:00
Chris Lumens
8bd3d8d232 Don't remove /usr/share/doc/anaconda.
That's where the help is stored.

Resolves: rhbz#1147518
2014-09-30 09:59:36 -04:00
Chris Lumens
bc0976b8d6 Stop removing libXt from the installation media.
It's needed by yelp, which is how anaconda displays help.

Related: rhbz#1147518
2014-09-30 09:59:25 -04:00
Radek Vykydal
5b841e69a4 network: add support for bridge (#1075195)
Related: rhbz#1075195
2014-09-26 13:50:17 +02:00
Brian C. Lane
790adbe143 Automatic commit of package [lorax] release [19.6.38-1]. 2014-09-23 12:17:17 -07:00
Brian C. Lane
da68471b33 livemedia-creator: Make sure ROOT_PATH exists (#1144140)
If ROOT_PATH doesn't exist when making a tar file, create it first.

Related: rhbz#1144140
2014-09-22 17:03:53 -07:00
Brian C. Lane
55299e3944 livemedia-creator: Use RHEL7 version of kickstart (#1144140)
Need to use the right kickstart version, eg. support for
bootloader --disabled

Related: rhbz#1144140
2014-09-22 17:03:43 -07:00
Brian C. Lane
0e6ea6be85 RHEL7 doesn't include pigz or pbzip2 (#1144140)
Don't try to speed up gzip or bzip2 compression with them.

Related: rhbz#1144140
2014-09-22 17:03:43 -07:00
Brian C. Lane
a8681aca4e livemedia-creator: Add --no-recursion to mktar (#1144140)
tar recurses into directories by default, but find is feeding it all the
files and directories so the tar it produces is considerably larger than
it needs to be due to duplicate files. Add --no-recursion flag so that
tar will only add the specific files and directories piped to it by find.

Related: rhbz#1144140
2014-09-22 17:03:30 -07:00
Brian C. Lane
526988651d livemedia-creator: Add support for making tarfiles (#1144140)
This adds the --make-tar option which will produce a xz compressed tar
of the root filesystem. This works with either virt-install or no-virt
modes. Use --image-name to set the output filename.

--compression is used to set the compression type to use, which defaults
to xz. Supported types are xz, lzma, gzip and bzip2.

--compress-arg is used to pass arguments to the compression utility.

(cherry picked from commit d04a99e8f4)

Resolves: rhbz#1144140
2014-09-22 15:25:22 -07:00
Brian C. Lane
8f2283cf1c livemedia-creator: Check fsimage kickstart for single partition (#1144140)
(cherry picked from commit 30591349ca)

Related: rhbz#1144140
2014-09-22 15:18:15 -07:00
Brian C. Lane
0a9992267c livemedia-creator: Copy fsimage if hardlink fails (#1144140)
If the user supplies a fsimage to use for the iso it may not be on the
same filesystem as the working directory. Try to hardlink first, but if
that fails copy the image.

(cherry picked from commit b3e80b7564)

Related: rhbz#1144140
2014-09-22 15:17:14 -07:00
Brian C. Lane
4a05a02fe6 livemedia-creator: Make --make-fsimage work with virt-install (#1144140)
--make-fsimage was only working with --no-virt, this re-structures
things so that virt-install partitioned disk images can be converted to
a fsimage. --make-ami was actually already doing this, so change it to
use --make-fsimage and set the default image name to "ami-root.img" with
a label of "AMI".

This also adds the ability to set the fs label on iso fsimage and
fsimages created with --make-fsimage and --make-ami by passing
--fs-label, but note that bootable iso's expect the Anaconda label.

(cherry picked from commit 19d8304070)

Related: rhbz#1144140
2014-09-22 15:15:38 -07:00
Brian C. Lane
6a40fe1bfa Automatic commit of package [lorax] release [19.6.37-1]. 2014-09-15 17:16:47 -07:00
David Shea
74b1877f1b Let the plymouth dracut module back into the ppc64 upgrade.img
The 32MiB size limit does not apply to upgrade.img since it's installed
to /boot by redhat-upgrade-tool instead of downloaded through TFTP. The
warning in rebuild_initrds will still be triggered by an upgrade.img
over the limit, but this doesn't halt the compose and it's probably not
a bad thing to know about.

Resolves: rhbz#1069671
2014-09-11 17:07:24 -04:00
Brian C. Lane
46d67de350 Automatic commit of package [lorax] release [19.6.36-1]. 2014-09-09 11:56:13 -07:00
Brian C. Lane
44b6948d1e Add more tools for rescue mode (#1109785)
This adds od, hexdump, hexedit, gdisk, and binaries from sg3_utils

Resolves: rhbz#1109785
(cherry picked from commit 8a804d10e5)
2014-09-09 11:27:04 -07:00
Brian C. Lane
02177d916f Add kexec anaconda addon (#1116335)
Add the kexec addon to the boot.iso

Resolves: rhbz#1116335

(cherry picked from commit 41a289fc0e)
2014-09-08 11:21:37 -07:00
Brian C. Lane
f6cc7ed16a Automatic commit of package [lorax] release [19.6.35-1]. 2014-09-03 17:44:22 -07:00
Brian C. Lane
84af4b08f5 Add ppc64le arch (#1136490)
basearch is ppc64le so we needs to check for that in addition to ppc64.

Resolves:rhbz#1136490
(cherry picked from commit 72357bf96b6b016c3a39b2af51eaf5cf724a0928)
2014-09-03 10:43:00 -07:00
Brian C. Lane
0828f63bc9 Automatic commit of package [lorax] release [19.6.34-1]. 2014-08-29 15:32:16 -07:00
Dan Horák
d1ec67c8d2 allow setting additional dracut parameters for DVD s390x installs (#1132050)
The installation from DVD on s390x needs setting the target disks and
network information that are usually set by editing the generic.prm file.
By including the "rd.cmdline=ask" parameter dracut will open a simple
dialog so the user can enter the required information.

Resolves: rhbz#1132050
(cherry picked from commit e92ea26206)
2014-08-29 15:30:48 -07:00
Brian C. Lane
ca4b3d35dd spec changelog cleanup 2014-08-28 19:45:50 -07:00
Brian C. Lane
4589a155e4 Automatic commit of package [lorax] release [19.6.33-1]. 2014-08-28 19:39:35 -07:00
Brian C. Lane
da8326fd58 livemedia-creator: Update ppc64 live to use grub2
Update the templates and configuration files to support grub2 live
image creation.

Related: rhbz#1102318
Related: rhbz#1131199
2014-08-27 16:27:52 -07:00
Brian C. Lane
b6c4d51c65 Automatic commit of package [lorax] release [19.6.32-1]. 2014-08-19 12:57:21 -07:00
David W. Aquilina
7d6e8c65f3 Yaboot to grub2 conversion cleanup.
Drop yaboot from runtime-install and don't install efika.forth

Related: rhbz#1131199

Signed-off-by: Brian C. Lane <bcl@redhat.com>
2014-08-19 09:19:15 -07:00
Paulo Flabiano Smorigo
af4cf82071 GRUB2 as the ISO boot loader for POWER arch (#1131199)
Currently, yaboot is the ISO boot loader in fedora and the Fedora on
POWER team is making an effort in order to replace it by GRUB2 in the
F20 release cycle. I'm sending a lorax patch so you guys can comment
on it. I'm planning to create a feature page for that too.

This patch only change the lorax template for ppc and should not
affect other archs, like x86.

--
Paulo Flabiano Smorigo
Software Engineer
Linux Technology Center - IBM Systems & Technology Group

Resolves: rhbz#1131199
Signed-off-by: Brian C. Lane <bcl@redhat.com>
2014-08-19 09:19:15 -07:00
Brian C. Lane
fbfc6e34f6 Revert "Require 32bit glibc on ppc64"
This reverts commit cd8e565f78.

This is not needed since we are switching to grub2.

Related: rhbz#1131199
2014-08-19 09:19:15 -07:00
Brian C. Lane
1e4af4e304 Automatic commit of package [lorax] release [19.6.31-1]. 2014-08-15 17:01:46 -07:00
d.marlin
6f27e0bd09 Add efibootmgr to installpkg list for aarch64. (#1130366)
Resolves: rhbz#1130366
2014-08-15 16:59:24 -07:00
Brian C. Lane
1c9a7b3621 Automatic commit of package [lorax] release [19.6.30-1]. 2014-08-12 16:30:42 -07:00
Brian C. Lane
cb1c6f1c6f Update tito.props configuration
Tito has renamed some of the options, change them so it will stop
complaining.
2014-08-12 16:26:59 -07:00
Brian C. Lane
55cd4d207f livemedia-creator: Cleanup temp yum files (#1073502)
When running lmc with --no-virt yum will use /tmp/ to cache some things.
If the kickstart or repos change between runs this cache can become
stale so remove it when lmc is finished.

Resolves: 1073502
2014-08-12 12:06:50 -07:00
Brian C. Lane
cd8e565f78 Require 32bit glibc on ppc64
ppc.tmpl uses the 32bit addnote from usr/lib/yaboot/ and it needs to
have 32bit glibc available on the host to work.
2014-08-12 12:02:02 -07:00
Brian C. Lane
1c936ee984 Add xfsdump and remove extra files from xfsprogs (#1118654)
Resolves: rhbz#1118654
2014-08-12 11:49:39 -07:00
Brian C. Lane
1686a1a159 Add ipmitool and drivers (#1126009)
Add the ipmi tools and keep the impi drivers in the image.

Resolves: rhbz#1126009
2014-08-12 11:28:33 -07:00
d.marlin
bbec9e21bd Update grub2-efi.cfg for aarch64 to more closely match x86 (#1089418).
Resolves: rhbz#1089418.

Signed-off-by: David A. Marlin <dmarlin@redhat.com>
2014-08-12 11:20:29 -07:00
Brian C. Lane
ac6f0b04c5 Automatic commit of package [lorax] release [19.6.29-1]. 2014-08-08 17:27:16 -07:00
Brian C. Lane
39e4da7ce8 utf-8 encode yum actions before displaying them (#1072362)
Otherwise running lorax in other locales will crash.

Resolves: rhbz#1072362
2014-07-30 17:05:59 -07:00
Brian C. Lane
ee71bc9b11 Use BOOTAA64.efi for AARCH64 bootloader filename (#1080113)
Need to stay withing the FAT filename 8.3 limits

Resolves: rhbz#1080113
2014-07-30 17:04:46 -07:00
Brian C. Lane
ccb43c2a62 Drop devicetree from aarch64 grub2-efi.cfg (#1089418)
This is non longer needed, Acadia/Biscayne now contains an embedded DTB.

Resolves: rhbz#1089418
2014-07-30 17:01:01 -07:00
Brian C. Lane
59f256e989 livemedia-creator: Add ppc64 live creation support (#1102318)
The ppc config files were missing from the live config_files directory
and ppc needs the correct lib directory so lmc has been switched to use
ArchData driven from the installed kernel arch.

Resolves: rhbz#1102318
2014-07-30 16:58:40 -07:00
Colin Walters
033dfac48d runtime-install: Add rpm-ostree
rpm-ostree is a new payload type available in Anaconda, will be used
by RHEL Atomic Host.

Related: rhbz#1113535
Port of rpmostreepayload patches from master
commit 3345a97f35
2014-07-28 09:35:48 +02:00
Brian C. Lane
e6c12f63f4 Automatic commit of package [lorax] release [19.6.28-1]. 2014-04-23 06:45:47 -07:00
Brian C. Lane
ce23e3e097 Install rdma so that dracut will use it along with libmlx4 (#1089564)
libmlx4 needs rdma, otherwise it is skipped when dracut builds the
initrd.

Resolves: rhbz#1089564
2014-04-23 06:44:37 -07:00
Brian C. Lane
5c468bdb7f Automatic commit of package [lorax] release [19.6.27-1]. 2014-04-03 14:17:47 -07:00
Brian C. Lane
c4ea32367d Stop removing curl after adding it (#1083205)
curl is useful for things like kickstart %pre and %post

Resolves: rhbz#1083205
2014-04-03 14:15:24 -07:00
Brian C. Lane
436a5aed0d Automatic commit of package [lorax] release [19.6.26-1]. 2014-02-28 16:53:19 -08:00
Brian C. Lane
cee25952d4 Use string for releasever not int (#1067746)
environmental variables need to be strings and there is no compelling
reason to force this to an int.

Related: rhbz#1067746
2014-02-28 13:35:08 -08:00
Peter Jones
d2de389cba Make lorax's installation of lockdown.efi conditional on its existence.
lockdown.efi only exists in the beta, but it'll probably also exist in
the 7.1 beta.  So don't toss this stuff out completely, but don't use it
if shim doesn't provide lockdown.efi either.

Resolves: rhbz#1071380

Signed-off-by: Peter Jones <pjones@redhat.com>
2014-02-28 11:36:20 -05:00
Brian C. Lane
84528efad6 Automatic commit of package [lorax] release [19.6.25-1]. 2014-02-26 10:12:04 -08:00
Brian C. Lane
e6015f93c5 createrepo is needed by driver disks (#1016004)
deltarpm is needed by createrepo.

Related: rhbz#1016004
2014-02-26 10:06:55 -08:00
Brian C. Lane
6700d862c4 Automatic commit of package [lorax] release [19.6.24-1]. 2014-02-25 16:50:34 -08:00
d.marlin
f2c4d4a43c Improve aarch64 UEFI support (#1067671)
Update the templates and config file to better support EFI on aarch64
on 64-bit ARM.

Resolves: rhbz#1067671

Signed-off-by: David A. Marlin <dmarlin@redhat.com>
Signed-off-by: Brian C. Lane <bcl@redhat.com>
2014-02-24 12:44:14 -08:00
Brian C. Lane
6510f5819b Automatic commit of package [lorax] release [19.6.23-1]. 2014-02-21 16:03:42 -08:00
Brian C. Lane
fceb957ad2 livemedia-creator: Set the product and release version env variables (#1067746)
When doing an image install there is no .buildstamp file to pull the
information from so use the cmdline variables (or their defaults) and
pass them to anaconda in the environment.

Resolves: rhbz#1067746
2014-02-21 13:42:15 -08:00
Brian C. Lane
d30390aa9e Remove unneeded images from the product -logos (#1068721)
The background images are not used during install, as well as a number
of other items from redhat-logos. There was also a bug -- product.name
did not expand to 'redhat' so it wasn't removing anything from the -logos
package.

Resolves: rhbz#1068721
2014-02-21 10:41:03 -08:00
Brian C. Lane
b18e0f88c3 Automatic commit of package [lorax] release [19.6.22-1]. 2014-02-18 16:13:38 -08:00
Brian C. Lane
28bf37089b fedora- services are named rhel- (#1066118)
These services were renamed for RHEL but never updated. They could
potentially cause problems with the installer.

Resolves: rhbz#1066118
2014-02-17 10:28:01 -08:00
Brian C. Lane
5b9c8c7ab5 Remove unneeded packages from runtime-install (#1065557)
These aren't shipped or needed by rhel7 so remove them, cleaning up the
output from lorax a bit.

Resolves: rhbz#1065557
2014-02-17 10:27:48 -08:00
Brian C. Lane
9b73faef1b Automatic commit of package [lorax] release [19.6.21-1]. 2014-02-13 10:51:04 -08:00
Brian C. Lane
9da051cd78 Check initrd size on ppc64 and warn (#1060691)
ppc64 initrd cannot be larger than 32MiB, so log a warning if it is too
large.

Related: rhbz#1060691
2014-02-13 09:41:53 -08:00
Brian C. Lane
e108883247 Remove drivers and modules on ppc64 (#1060691)
Remove more drivers and remove plymouth and drm dracut modules. Only on
PPC64 initrd, all other arches have the full set of drivers and modules.

Resolves: rhbz#1060691
2014-02-13 09:29:38 -08:00
Brian C. Lane
32cf10b3b8 Automatic commit of package [lorax] release [19.6.20-1]. 2014-02-12 15:38:29 -08:00
Brian C. Lane
d08d8081b6 Include mesa-dri-drivers (#1053940)
Radeon cards need these.

Resolves: rhbz#1053940
2014-02-12 15:34:38 -08:00
Brian C. Lane
ad4d53515a Automatic commit of package [lorax] release [19.6.19-1]. 2014-02-11 16:39:57 -08:00
Brian C. Lane
1cf54d3611 livemedia-creator: virt-image needs ram in MiB not KiB (#1061773)
Resolves: rhbz#1061773
(cherry picked from commit 04ba927777)
2014-02-11 09:11:19 -08:00
Brian C. Lane
9ceff1c965 Include all the example kickstarts (#1019728)
Just include all the *ks files in the doc directory instead of naming
them individually.

Resolves: rhbz#1019728
2014-02-05 14:24:34 -08:00
Brian C. Lane
b506a0cf48 Automatic commit of package [lorax] release [19.6.18-1]. 2014-02-05 12:34:52 -08:00
Brian C. Lane
88863a63d7 Remove floppy and scsi_debug from initrd (#1060691)
ppc64 can't PXE boot a initrd that is > 32M. This removes 2 drivers from
initrd creation to reduce the size.

Resolves: rhbz#1060691
2014-02-05 12:33:16 -08:00
Brian C. Lane
16fe80f6b1 Automatic commit of package [lorax] release [19.6.17-1]. 2014-01-31 17:52:30 -08:00
Radek Vykydal
61401e2640 Don't activate default auto connections after switchroot (#1012511)
Related: rhbz#1012511

Add NetworkManager config file turning default auto connections off.
2014-01-31 17:05:25 +01:00
Brian C. Lane
aaef9fc2e4 Automatic commit of package [lorax] release [19.6.16-1]. 2014-01-24 16:43:04 -08:00
Will Woods
b01abcaf64 Activate anaconda-shell@.service on switch to empty VT (#980062)
Right now, logind reserves tty6 for a login shell, which is not what we
want - normally anaconda puts Xorg there, and there's no need for a
login prompt anyway.

This configures logind to activate "anaconda-shell@.service" when a user
switches to an unused tty, and reserves tty2 for that purpose (which is
where users expect a shell anyway).

This will avoid us having login prompts that users don't know what to do
with. It also probably saves us a little bit of RAM.
2014-01-24 13:05:35 -05:00
Brian C. Lane
d65ca8d789 flush data to disk after mkfsimage (#1052175)
Make sure the data is written before we do anything else with the disk
image. This shouldn't be needed, umount should take care of it, but it
also can't hurt.

Resolves: rhbz#1052175
2014-01-24 09:44:37 -08:00
Brian C. Lane
1562dbe6ef Automatic commit of package [lorax] release [19.6.15-1]. 2013-12-17 17:05:45 -08:00
d.marlin
3a5e515d4f Add initial 64-bit ARM (aarch64) support (#1034432)
Signed-off-by: Brian C. Lane <bcl@redhat.com>

Resolves: rhbz#1034432
2013-12-17 10:48:59 -08:00
Brian C. Lane
0d74373fd0 Automatic commit of package [lorax] release [19.6.14-1]. 2013-12-16 09:56:11 -08:00
Brian C. Lane
7f090e3311 s390 switch to generic condev (#1042765)
Resolves: rhbz#1042765
2013-12-16 09:53:31 -08:00
Brian C. Lane
ee6802a0fa Automatic commit of package [lorax] release [19.6.13-1]. 2013-11-15 14:28:10 -08:00
Brian C. Lane
ca3d374a64 Add SB lockdown to EFI grub menu (#1030495)
Resolves: rhbz#1030495
2013-11-15 14:03:17 -08:00
Brian C. Lane
7871eb592a Automatic commit of package [lorax] release [19.6.12-1]. 2013-11-14 13:48:45 -08:00
Brian C. Lane
0a9bdb2157 Include partx (#1022899)
Used by lvm on multipath.

Resolves: rhbz#1022899
2013-11-14 13:47:20 -08:00
Brian C. Lane
760b56dd9d Automatic commit of package [lorax] release [19.6.11-1]. 2013-11-14 11:06:20 -08:00
David Shea
26d8c14796 Create upgrade.img using redhat-upgrade-dracut
Use redhat-upgrade-dracut for the RHEL version of the system-upgrade
dracut module. upgrade.img also needs the convertfs module for upgrades
from RHEL6.

Resolves: rhbz#1029999
2013-11-13 13:07:20 -05:00
Vratislav Podzimek
14a191009d Automatic commit of package [lorax] release [19.6.10-1]. 2013-11-11 13:10:51 +01:00
Vratislav Podzimek
123728393d Do not remove libdaemon from the runtime environment (#1028938)
It is needed by the new NetworkManager.
2013-11-11 12:46:37 +01:00
Brian C. Lane
8daa0d36d4 Automatic commit of package [lorax] release [19.6.9-1]. 2013-11-07 08:16:05 -08:00
Brian C. Lane
09490877a0 Install subscription-manager (#1026304)
Only use the product-id plugin.

Resolves: rhbz#1026304
2013-11-04 11:29:52 -08:00
Brian C. Lane
71002d3753 Automatic commit of package [lorax] release [19.6.8-1]. 2013-11-01 16:10:14 -07:00
Brian C. Lane
12e03abfa9 Set UEFI defaults to match BIOS (#1021451,#1021446)
60 second timeout and default to testing media.

Resolves: rhbz#1021451
Resolves: rhbz#1021446
2013-10-31 16:17:12 -07:00
Brian C. Lane
4d8f6d904d livemedia-creator: Set default name to Red Hat Enterprise Linux 7 (#1002027)
Resolves: rhbz#1002027
2013-10-31 16:17:12 -07:00
Brian C. Lane
5dd01b4aef livemedia-creator: Add minimal disk example kickstart (#1019728)
Also adds a check for a bad url repo, and fix ram calculation for
appliance mode. Updates the README.livemedia-creator documentation.

Resolves: rhbz#1019728
2013-10-31 16:17:12 -07:00
Brian C. Lane
fa0fb57e4b Automatic commit of package [lorax] release [19.6.7-1]. 2013-10-17 13:11:17 -07:00
Brian C. Lane
dccaa0eeb0 Keep virtio_console module (#750231)
virtio_console is a module in RHEL7, so we need to leave it in place
when cleaning the image. It will be loaded automatically when needed.
2013-10-11 13:34:49 -07:00
Brian C. Lane
ad19c8a2d9 Automatic commit of package [lorax] release [19.6.6-1]. 2013-10-07 11:19:04 -07:00
Brian C. Lane
eae915f34f livemedia-creator: Update minimal packages in README (#1003078)
Related: rhbz#1003078
2013-10-07 10:43:30 -07:00
Brian C. Lane
ed5803bae8 macboot defaults to no on rhel7 (#1012529)
The tools needed are not shipped with RHEL7 so default to no macboot.

Resolves: rhbz#1012529
2013-09-26 16:59:13 -07:00
Brian C. Lane
ac202ee4ed Add macboot option (#1012529)
Add a macboot option to lorax and both macboot and nomacboot to lmc.

Related: rhbz#1012529
2013-09-26 16:54:03 -07:00
Brian C. Lane
6eb04c63cb Automatic commit of package [lorax] release [19.6.5-1]. 2013-09-25 10:19:12 -07:00
Brian C. Lane
e8f114b4cb drop dracut args from config files (#1008054)
It no longer autoassembles things so we don't need to pass rd.md=0, etc.
2013-09-24 17:01:12 -07:00
Brian C. Lane
f44d2f874d Automatic commit of package [lorax] release [19.6.4-1]. 2013-09-20 17:49:31 -07:00
Brian C. Lane
7d83abb8d0 livemedia-creator: Fix gcdx64.efi path to work for other distros than Fedora (#1003078) 2013-09-18 16:59:32 -07:00
Brian C. Lane
2025a6a1df livemedia-creator: Update example kickstart for rhel7 (#922064)
Based on fedora live kickstart. Removes the ec2 example because RHEL7
doesn't include cloud-init and I have no way to test the results.
2013-09-16 15:20:51 -07:00
Brian C. Lane
5228b31661 Automatic commit of package [lorax] release [19.6.3-1]. 2013-08-23 17:01:08 -07:00
David Shea
186999b5da Keep liblzo2.* (#997976)
/usr/lib*/realmd/realmd needs liblzo2.

(cherry picked from commit d001ff409a)
2013-08-16 12:24:57 -04:00
Brian C. Lane
0bf78e7acf Automatic commit of package [lorax] release [19.6.2-1]. 2013-08-01 10:06:24 -07:00
Harald Hoyer
22a36d3a81 dracut-nohostonly and dracut-norescue got renamed for dracut >= 030 (#990305) 2013-08-01 10:05:08 -07:00
David Shea
2ea99b1810 Don't remove xkeyboard-config message files (#989757)
The xkeybard-config .mo files are needed to translate the layout
switching options. The xklavier calls in anaconda will automatically
translate the option strings as long as the translations are present.
2013-07-29 17:14:19 -04:00
Brian C. Lane
70b6b8d675 Automatic commit of package [lorax] release [19.6.1-1]. 2013-07-26 16:52:40 -07:00
Brian C. Lane
96991655b4 remove yum-plugin-fastestmirror (#876135) 2013-07-26 16:35:23 -07:00
221 changed files with 24727 additions and 2077 deletions

12
.coveragerc Normal file
View File

@ -0,0 +1,12 @@
# http://nedbatchelder.com/code/coverage/config.html
[run]
concurrency = multiprocessing
parallel = True
branch = True
[report]
include = src/*
[paths]
source = .
/lorax/

2
.dockerignore Normal file
View File

@ -0,0 +1,2 @@
.git/
.coverage

9
.gitignore vendored
View File

@ -1,2 +1,11 @@
*.pyc *.pyc
src/pylorax/version.py* src/pylorax/version.py*
src/pylorax/api/version.py*
src/composer/version.py*
*.swp
.pylint.d/
_build/
tests/pylint/.pylint.d/
__pycache__/
.coverage
pylint-log

23
.travis.yml Normal file
View File

@ -0,0 +1,23 @@
sudo: required
language: python
services:
- docker
script:
- make test-in-docker
after_success:
- |
sudo docker create --name results-cont welder/lorax-composer
sudo docker cp results-cont:/lorax/.coverage .coverage.docker
sudo docker rm results-cont
pip install coverage==3.6 coveralls
coverage combine
coveralls
notifications:
email:
on_failure: change
on_success: never

42
Dockerfile.test Normal file
View File

@ -0,0 +1,42 @@
FROM centos:7
COPY epel.repo /etc/yum.repos.d/
RUN yum -y install --nogpgcheck epel-release && \
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-* && \
yum -y install \
anaconda-tui \
libgit2-glib \
libselinux-python \
make \
pykickstart \
python-coverage \
python-coveralls \
python-flask \
python-gevent \
python-magic \
python-mako \
python2-mock \
python-nose \
python-pocketlint \
python-pylint \
pyparted \
python2-pytoml \
python-semantic_version \
python-sphinx \
python-rpmfluff \
python-librepo \
beakerlib \
sudo \
tito \
rsync \
e2fsprogs \
xz-lzma-compat \
pbzip2 \
squashfs-tools \
qemu-img \
which && \
touch /.in-container
RUN useradd weldr
VOLUME /lorax-ro
VOLUME /test-results
WORKDIR /lorax-ro

134
Makefile
View File

@ -1,37 +1,92 @@
PYTHON ?= /usr/bin/python PYTHON ?= /usr/bin/python
DESTDIR ?= / DESTDIR ?= /
DOCKER ?= docker
PKGNAME = lorax PKGNAME = lorax-composer
VERSION = $(shell awk '/Version:/ { print $$2 }' $(PKGNAME).spec) VERSION = $(shell awk '/Version:/ { print $$2 }' $(PKGNAME).spec)
RELEASE = $(shell awk '/Release:/ { print $$2 }' $(PKGNAME).spec | sed -e 's|%.*$$||g') RELEASE = $(shell awk '/Release:/ { print $$2 }' $(PKGNAME).spec | sed -e 's|%.*$$||g')
TAG = lorax-$(VERSION)-$(RELEASE) TAG = lorax-$(VERSION)-$(RELEASE)
IMAGE_RELEASE = $(shell awk -F: '/FROM/ { print $$2}' Dockerfile.test)
ifeq ($(TEST_OS),)
OS_ID = $(shell awk -F= '/^ID=/ {print $$2}' /etc/os-release)
OS_VERSION = $(shell awk -F= '/^VERSION_ID/ {print $$2}' /etc/os-release | tr '.' '-')
TEST_OS = $(OS_ID)-$(OS_VERSION)
endif
export TEST_OS
VM_IMAGE=$(CURDIR)/test/images/$(TEST_OS)
default: all default: all
src/pylorax/version.py: lorax.spec src/composer/version.py:
echo "num = '$(VERSION)-$(RELEASE)'" > src/composer/version.py
src/pylorax/version.py:
echo "num = '$(VERSION)-$(RELEASE)'" > src/pylorax/version.py echo "num = '$(VERSION)-$(RELEASE)'" > src/pylorax/version.py
all: src/pylorax/version.py src/pylorax/api/version.py:
echo "num = '$(VERSION)-$(RELEASE)'" > src/pylorax/api/version.py
all: src/pylorax/version.py src/pylorax/api/version.py src/composer/version.py
$(PYTHON) setup.py build $(PYTHON) setup.py build
install: all install: all
$(PYTHON) setup.py install --root=$(DESTDIR) $(PYTHON) setup.py install --root=$(DESTDIR)
mkdir -p $(DESTDIR)/$(mandir)/man1 mkdir -p $(DESTDIR)/$(mandir)/man1
install -m 644 docs/lorax.1 $(DESTDIR)/$(mandir)/man1 install -m 644 docs/man/lorax.1 $(DESTDIR)/$(mandir)/man1
install -m 644 docs/livemedia-creator.1 $(DESTDIR)/$(mandir)/man1 install -m 644 docs/man/livemedia-creator.1 $(DESTDIR)/$(mandir)/man1
mkdir -p $(DESTDIR)/etc/bash_completion.d
install -m 644 etc/bash_completion.d/composer-cli $(DESTDIR)/etc/bash_completion.d
check:
@echo "*** Running pylint ***"
PYTHONPATH=$(PYTHONPATH):./src/ ./tests/pylint/runpylint.py
test: docs
@echo "*** Running tests ***"
PYTHONPATH=$(PYTHONPATH):./src/ $(PYTHON) -m nose -v --with-coverage --cover-erase --cover-branches \
--cover-package=pylorax --cover-inclusive \
./tests/pylorax/ ./tests/composer/
coverage report -m
[ -f "/usr/bin/coveralls" ] && [ -n "$(COVERALLS_REPO_TOKEN)" ] && coveralls || echo
# need `losetup`, which needs Docker to be in privileged mode (--privileged)
# but even so fails in Travis CI
test_images:
sudo -E ./tests/test_cli.sh tests/cli/test_compose_ext4-filesystem.sh \
tests/cli/test_compose_partitioned-disk.sh \
tests/cli/test_compose_tar.sh \
tests/cli/test_compose_tar_kickstart.sh \
tests/cli/test_compose_qcow2.sh \
tests/cli/test_compose_live-iso.sh
test_cli:
sudo -E ./tests/test_cli.sh
clean: clean:
-rm -rf build src/pylorax/version.py -rm -rf build src/pylorax/version.py
-rm -rf build src/pylorax/api/version.py
-rm -rf build src/composer/version.py
tag: tag:
git tag -f $(TAG) git tag -f $(TAG)
archive: tag docs:
$(MAKE) -C docs apidoc html
archive:
@git archive --format=tar --prefix=$(PKGNAME)-$(VERSION)/ $(TAG) > $(PKGNAME)-$(VERSION).tar @git archive --format=tar --prefix=$(PKGNAME)-$(VERSION)/ $(TAG) > $(PKGNAME)-$(VERSION).tar
@gzip $(PKGNAME)-$(VERSION).tar @gzip -f $(PKGNAME)-$(VERSION).tar
@echo "The archive is in $(PKGNAME)-$(VERSION).tar.gz" @echo "The archive is in $(PKGNAME)-$(VERSION).tar.gz"
srpm: archive $(PKGNAME).spec
rpmbuild -bs \
--define "_sourcedir $(CURDIR)" \
--define "_srcrpmdir $(CURDIR)" \
lorax-composer.spec
local: local:
@rm -rf $(PKGNAME)-$(VERSION).tar.gz @rm -rf $(PKGNAME)-$(VERSION).tar.gz
@rm -rf /var/tmp/$(PKGNAME)-$(VERSION) @rm -rf /var/tmp/$(PKGNAME)-$(VERSION)
@ -40,3 +95,68 @@ local:
@dir=$$PWD; cd /var/tmp; tar --gzip -cSpf $$dir/$(PKGNAME)-$(VERSION).tar.gz $(PKGNAME)-$(VERSION) @dir=$$PWD; cd /var/tmp; tar --gzip -cSpf $$dir/$(PKGNAME)-$(VERSION).tar.gz $(PKGNAME)-$(VERSION)
@rm -rf /var/tmp/$(PKGNAME)-$(VERSION) @rm -rf /var/tmp/$(PKGNAME)-$(VERSION)
@echo "The archive is in $(PKGNAME)-$(VERSION).tar.gz" @echo "The archive is in $(PKGNAME)-$(VERSION).tar.gz"
test-in-copy:
rsync -aP --exclude=.git /lorax-ro/ /lorax/
make -C /lorax/ ci
cp /lorax/.coverage /test-results/
test-in-docker:
sudo $(DOCKER) build -t welder/lorax-tests:$(IMAGE_RELEASE) -f Dockerfile.test .
sudo $(DOCKER) run --rm -it -v `pwd`/.test-results/:/test-results -v `pwd`:/lorax-ro:ro --security-opt label=disable welder/lorax-tests:$(IMAGE_RELEASE) make test-in-copy
docs-in-docker:
sudo $(DOCKER) run -it --rm -v `pwd`/docs/html/:/lorax/docs/html/ --security-opt label=disable welder/lorax-tests:$(IMAGE_RELEASE) make docs
ci: check test
$(VM_IMAGE): TAG=HEAD
$(VM_IMAGE): srpm bots
rm -f $(VM_IMAGE) $(VM_IMAGE).qcow2
srpm=$(shell rpm --qf '%{Name}-%{Version}-%{Release}.src.rpm\n' -q --specfile lorax-composer.spec | head -n1) ; \
bots/image-customize -v \
--resize 20G \
--upload $$srpm:/var/tmp \
--upload $(CURDIR)/test/vm.install:/var/tmp/vm.install \
--upload $(realpath tests):/ \
--run-command "chmod +x /var/tmp/vm.install" \
--run-command "cd /var/tmp; /var/tmp/vm.install $$srpm" \
$(TEST_OS)
[ -f ~/.config/lorax-test-env ] && bots/image-customize \
--upload ~/.config/lorax-test-env:/var/tmp/lorax-test-env \
$(TEST_OS) || echo
# convenience target for the above
vm: $(VM_IMAGE)
echo $(VM_IMAGE)
vm-releng:
rm -f $(VM_IMAGE) $(VM_IMAGE).qcow2
bots/image-customize -v \
--resize 20G \
--upload $(CURDIR)/test/vm.install:/var/tmp/vm.install \
--upload $(realpath tests):/ \
--run-command "chmod +x /var/tmp/vm.install" \
--run-command "cd /var/tmp; BUILD_SRPM=0 /var/tmp/vm.install" \
$(TEST_OS)
[ -f ~/.config/lorax-test-env ] && bots/image-customize \
--upload ~/.config/lorax-test-env:/var/tmp/lorax-test-env \
$(TEST_OS) || echo
vm-reset:
rm -f $(VM_IMAGE) $(VM_IMAGE).qcow2
# checkout Cockpit's bots for standard test VM images and API to launch them
# must be from master, as only that has current and existing images; but testvm.py API is stable
# support CI testing against a bots change
bots:
git clone --quiet --reference-if-able $${XDG_CACHE_HOME:-$$HOME/.cache}/cockpit-project/bots https://github.com/cockpit-project/bots.git
if [ -n "$$COCKPIT_BOTS_REF" ]; then git -C bots fetch --quiet --depth=1 origin "$$COCKPIT_BOTS_REF"; git -C bots checkout --quiet FETCH_HEAD; fi
@echo "checked out bots/ ref $$(git -C bots rev-parse HEAD)"
.PHONY: all install check test clean tag docs archive local
.PHONY: ci_after_success
ci_after_success:
# nothing to do here, but Jenkins expects this to be present, otherwise fails

View File

@ -16,6 +16,14 @@ minimum you need:
--iso to specify the Anaconda install media to use with virt-install --iso to specify the Anaconda install media to use with virt-install
--ks is the kickstart to use to install the system --ks is the kickstart to use to install the system
To use livemedia-creator with virt-install you will need to install the
following packages, as well as have libvirtd setup correctly.
virt-install
libvirt-python
If you are going to be using Anaconda directly, with --no-virt mode, make sure
you have the anaconda package installed.
QUICKSTART QUICKSTART
---------- ----------
@ -74,13 +82,27 @@ written using the Mako template system which is very flexible.
KICKSTARTS KICKSTARTS
---------- ----------
Existing spin kickstarts can be used to create live media with a few changes. The docs/ directory includes two example kickstarts, one to create a live desktop
Here are the steps I used to convert the XFCE spin. iso using GNOME, and the other to create a minimal disk image. When creating your
own kickstarts you should start with the minimal example, it includes several
needed packages that are not always included by dependencies.
livemedia-creator parses the 'part /' entry to determine how big a disk image
needs to be created. This means that the common kickstart technique of using
%pre to generate a partition scheme for use with %include will not work. There
needs to be a 'part /' entry in the main part of the kickstart.
Only one kickstart file is supported, so if your kickstart is built from a
number of %include commands it needs to be flattened into a single file with
ksflatten first.
Or you can use existing spin kickstarts to create live media with a few
changes. Here are the steps I used to convert the Fedora XFCE spin.
1. Flatten the xfce kickstart using ksflatten 1. Flatten the xfce kickstart using ksflatten
2. Add zerombr so you don't get the disk init dialog 2. Add zerombr so you don't get the disk init dialog
3. Add clearpart --all 3. Add clearpart --all
4. Add swap and biosboot partitions 4. Add swap partition
5. bootloader target 5. bootloader target
6. Add shutdown to the kickstart 6. Add shutdown to the kickstart
7. Add network --bootproto=dhcp --activate to activate the network 7. Add network --bootproto=dhcp --activate to activate the network
@ -96,7 +118,6 @@ network --bootproto=dhcp --activate
zerombr zerombr
clearpart --all clearpart --all
bootloader --location=mbr bootloader --location=mbr
part biosboot --size=1
part swap --size=512 part swap --size=512
shutdown shutdown
@ -110,8 +131,12 @@ passwd -d root > /dev/null
cat /dev/null > /dev/fstab cat /dev/null > /dev/fstab
Do this only for live iso's, the filesystem will be mounted read only if
there is no /etc/fstab
11. Don't delete initramfs files from /boot in %post 11. Don't delete initramfs files from /boot in %post
12. Have dracut-norescue, grub-efi, memtest86+ and syslinux in the package list 12. Have dracut-config-generic, grub2-efi, shim, memtest86+, isomd5sum and syslinux in the package list
13. Omit dracut-config-rescue from the package list "-dracut-config-rescue"
One drawback to using virt-install is that it pulls the packages from One drawback to using virt-install is that it pulls the packages from
the repo each time you run it. To speed things up you either need a local the repo each time you run it. To speed things up you either need a local
@ -129,6 +154,16 @@ You can also add an update repo, but don't name it updates. Add --proxy to
it as well. it as well.
UEFI Disk Image Creation
------------------------
When making a live iso the bootloader is added after Anaconda has run. As long as
anaconda-tools and grub2-efi-*-cdboot are included in the kickstart the iso will
be bootable on UEFI systems.
To create a disk image, eg. using rhel7-minimal.ks, livemedia-creator needs to be
run from a UEFI system or virt running UEFI firmware.
ANACONDA IMAGE INSTALL ANACONDA IMAGE INSTALL
---------------------- ----------------------
You can create images without using virt-install by passing --no-virt on the You can create images without using virt-install by passing --no-virt on the
@ -178,7 +213,7 @@ switch. This will create the partitioned disk image and an XML file that can be
used with virt-image to setup a virtual system. used with virt-image to setup a virtual system.
The XML is generated using the Mako template from The XML is generated using the Mako template from
/usr/share/lorax/appliance/virt-image.xml You can use a different template by /usr/share/lorax/appliance/libvirt.xml You can use a different template by
passing --app-template <template path> passing --app-template <template path>
Documentation on the Mako template system can be found here: Documentation on the Mako template system can be found here:
@ -203,6 +238,41 @@ title from --title
project from --project project from --project
releasever from --releasever releasever from --releasever
The created image can be imported into libvirt using:
virt-image appliance.xml
TAR FILE CREATION
-----------------
The --make-tar command can be used to create a tar of the root filesystem. By
default it is compressed using xz, but this can be changed using the
--compression and --compress-arg options. This option works with both virt and
--no-virt install methods.
As with --make-fsimage the kickstart should be limited to a single / partition.
eg.
livemedia-creator --make-tar --iso=/path/to/boot.iso --ks=./docs/fedora-minimal.ks \
--image-name=fedora-root.tar.xz
LIVE IMAGE FOR PXE BOOT
-----------------------
The --make-pxe-live command will produce squashfs image containing live root
filesystem that can be used for pxe boot. Directory with results will contain
the live image, kernel image, initrd image and template of pxe configuration
for the images.
ATOMIC LIVE IMAGE FOR PXE BOOT
------------------------------
The --make-ostree-live command will produce the same result as --make-pxe-live
for installations of Atomic Host. Example kickstart for such an installation
using Atomic installer iso with local repo included in the image can be found
in docs/rhel-atomic-pxe-live.ks.
DEBUGGING PROBLEMS DEBUGGING PROBLEMS
------------------ ------------------

21
README.product Normal file
View File

@ -0,0 +1,21 @@
Lorax now supports creation of product.img and updates.img as part of the build
process. This is implemented using the installimg template command which will
take the contents of a directory and create a compressed archive from it. The
directory must be created by one of the packages installed by
runtime-install.tmpl or by passing ``--installpkgs <pkgname>`` to lorax at
runtime. The x86, ppc, ppc64le and aarch64 templates all look for
/usr/share/lorax/product/ and /usr/share/lorax/updates/ directories in the
install chroot while creating the final install tree. If there are files in
those directories lorax will create images/product.img and/or
images/updates.img
These archives are just like an anaconda updates image -- they are copied over
the top of the filesystem at boot time so that you can drop in files to add to
or replace anything on the filesystem.
Anaconda has several places that it looks for updates, the one for product.img
is in /run/install/product. For example, to add an installclass to Anaconda
you would put your custom class here:
/usr/share/lorax/product/run/install/product/pyanaconda/installclasses/custom.py

183
docs/Makefile Normal file
View File

@ -0,0 +1,183 @@
# Makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXAPIDOC = sphinx-apidoc
PAPER =
BUILDDIR = .
SOURCEDIR = ../src
MODULE_NAMES = pylorax.rst pylorax.api.rst modules.rst composer.rst composer.cli.rst
# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
endif
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " xml to make Docutils-native XML files"
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
apidoc:
if [ -f /usr/bin/$(SPHINXAPIDOC) ]; then \
rm $(addprefix ./, $(MODULE_NAMES)) ; \
$(SPHINXAPIDOC) -o . $(SOURCEDIR) ; \
fi
html: apidoc
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
dirhtml: apidoc
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
singlehtml: apidoc
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
pickle: apidoc
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."
json: apidoc
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."
htmlhelp: apidoc
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."
qthelp: apidoc
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/src.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/src.qhc"
devhelp: apidoc
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/src"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/src"
@echo "# devhelp"
epub: apidoc
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
latex: apidoc
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."
latexpdf: apidoc
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
latexpdfja: apidoc
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through platex and dvipdfmx..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
text: apidoc
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."
man: apidoc
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
texinfo: apidoc
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."
info: apidoc
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(BUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
gettext: apidoc
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
changes: apidoc
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."
linkcheck: apidoc
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."
doctest: apidoc
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."
xml: apidoc
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
@echo
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
pseudoxml: apidoc
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
@echo
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."

62
docs/composer-cli.rst Normal file
View File

@ -0,0 +1,62 @@
composer-cli
============
:Authors:
Brian C. Lane <bcl@redhat.com>
``composer-cli`` is used to interact with the ``lorax-composer`` API server, managing blueprints, exploring available packages, and building new images.
It requires `lorax-composer <lorax-composer.html>`_ to be installed on the
local system, and the user running it needs to be a member of the ``weldr``
group. They do not need to be root, but all of the `security precautions
<lorax-composer.html#security>`_ apply.
composer-cli cmdline arguments
------------------------------
.. argparse::
:ref: composer.cli.cmdline.composer_cli_parser
:prog: composer-cli
Edit a Blueprint
----------------
Start out by listing the available blueprints using ``composer-cli blueprints
list``, pick one and save it to the local directory by running ``composer-cli
blueprints save http-server``. If there are no blueprints available you can
copy one of the examples `from the test suite
<https://github.com/weldr/lorax/tree/master/tests/pylorax/blueprints/>`_.
Edit the file (it will be saved with a .toml extension) and change the
description, add a package or module to it. Send it back to the server by
running ``composer-cli blueprints push http-server.toml``. You can verify that it was
saved by viewing the changelog - ``composer-cli blueprints changes http-server``.
Build an image
----------------
Build a ``qcow2`` disk image from this blueprint by running ``composer-cli
compose start http-server qcow2``. It will print a UUID that you can use to
keep track of the build. You can also cancel the build if needed.
The available types of images is displayed by ``composer-cli compose types``.
Currently this consists of: ami, ext4-filesystem, live-iso, openstack,
partitioned-disk, qcow2, tar, vhd, vmdk
Monitor the build status
------------------------
Monitor it using ``composer-cli compose status``, which will show the status of
all the builds on the system. You can view the end of the anaconda build logs
once it is in the ``RUNNING`` state using ``composer-cli compose log UUID``
where UUID is the UUID returned by the start command.
Once the build is in the ``FINISHED`` state you can download the image.
Download the image
------------------
Downloading the final image is done with ``composer-cli compose image UUID`` and it will
save the qcow2 image as ``UUID-disk.qcow2`` which you can then use to boot a VM like this::
qemu-kvm --name test-image -m 1024 -hda ./UUID-disk.qcow2

398
docs/conf.py Normal file
View File

@ -0,0 +1,398 @@
# -*- coding: utf-8 -*-
#
# src documentation build configuration file, created by
# sphinx-quickstart on Wed Apr 8 13:46:00 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys
import os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('../src/'))
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.viewcode',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.coverage',
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix of source filenames.
source_suffix = '.rst'
# The encoding of source files.
#source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = u'Lorax'
copyright = u'2018, Red Hat, Inc.' # pylint: disable=redefined-builtin
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
def read_version():
""" Read version from ../lorax.spec or lorax-composer.spec"""
import re
version_re = re.compile(r"Version:\s+(.*)")
if os.path.exists("../lorax.spec"):
f = open("../lorax.spec", "rt")
elif os.path.exists("../lorax-composer.spec"):
f = open("../lorax-composer.spec", "rt")
else:
raise RuntimeError("Sphinx read_version() Cannot find lorax.spec or lorax-composer.spec")
for line in f:
m = version_re.match(line)
if m:
return m.group(1)
#
# The short X.Y version.
version = read_version()
# The full version, including alpha/beta/rc tags.
release = version
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_build', 'html']
# The reST default role (used for this markup: `text`) to use for all
# documents.
#default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
# If true, keep warnings as "system message" paragraphs in the built documents.
#keep_warnings = False
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'default'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = []
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
#html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#html_logo = None
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#html_favicon = None
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
# directly to the root of the documentation.
#html_extra_path = []
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
#html_last_updated_fmt = '%b %d, %Y'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}
# If false, no module index is generated.
#html_domain_indices = True
# If false, no index is generated.
#html_use_index = True
# If true, the index is split into individual pages for each letter.
#html_split_index = False
# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = None
# Output file base name for HTML help builder.
htmlhelp_basename = 'Loraxdoc'
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#'preamble': '',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
('index', 'Lorax.tex', u'Lorax Documentation',
u'Anaconda Team', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False
# If true, show page references after internal links.
#latex_show_pagerefs = False
# If true, show URL addresses after external links.
#latex_show_urls = False
# Documents to append as an appendix to all manuals.
#latex_appendices = []
# If false, no module index is generated.
#latex_domain_indices = True
# -- Options for manual page output ---------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('lorax', 'lorax', u'Lorax Documentation', [u'Anaconda Team'], 1),
('livemedia-creator', 'livemedia-creator', u'Live Media Creator Documentation', [u'Anaconda Team'], 1)
]
# If true, show URL addresses after external links.
#man_show_urls = False
# -- Options for Texinfo output -------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'Lorax', u'Lorax Documentation',
u'Anaconda Team', 'Lorax', 'One line description of project.',
'Miscellaneous'),
]
# Documents to append as an appendix to all manuals.
#texinfo_appendices = []
# If false, no module index is generated.
#texinfo_domain_indices = True
# How to display URL addresses: 'footnote', 'no', or 'inline'.
#texinfo_show_urls = 'footnote'
# If true, do not generate a @detailmenu in the "Top" node's menu.
#texinfo_no_detailmenu = False
# -- Options for Epub output ----------------------------------------------
# Bibliographic Dublin Core info.
epub_title = u'Lorax'
epub_author = u'Anaconda Team'
epub_publisher = u'Anaconda Team'
epub_copyright = u'2018, Red Hat, Inc.'
# The basename for the epub file. It defaults to the project name.
#epub_basename = u'src'
# The HTML theme for the epub output. Since the default themes are not optimized
# for small screen space, using the same theme for HTML and epub output is
# usually not wise. This defaults to 'epub', a theme designed to save visual
# space.
#epub_theme = 'epub'
# The language of the text. It defaults to the language option
# or en if the language is not set.
#epub_language = ''
# The scheme of the identifier. Typical schemes are ISBN or URL.
#epub_scheme = ''
# The unique identifier of the text. This can be a ISBN number
# or the project homepage.
#epub_identifier = ''
# A unique identification for the text.
#epub_uid = ''
# A tuple containing the cover image and cover page html template filenames.
#epub_cover = ()
# A sequence of (type, uri, title) tuples for the guide element of content.opf.
#epub_guide = ()
# HTML files that should be inserted before the pages created by sphinx.
# The format is a list of tuples containing the path and title.
#epub_pre_files = []
# HTML files shat should be inserted after the pages created by sphinx.
# The format is a list of tuples containing the path and title.
#epub_post_files = []
# A list of files that should not be packed into the epub file.
epub_exclude_files = ['search.html']
# The depth of the table of contents in toc.ncx.
#epub_tocdepth = 3
# Allow duplicate toc entries.
#epub_tocdup = True
# Choose between 'default' and 'includehidden'.
#epub_tocscope = 'default'
# Fix unsupported image types using the PIL.
#epub_fix_images = False
# Scale large images.
#epub_max_image_width = 0
# How to display URL addresses: 'footnote', 'no', or 'inline'.
#epub_show_urls = 'inline'
# If false, no index is generated.
#epub_use_index = True
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/2': None}
# on_rtd is whether we are on readthedocs.org
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
#if not on_rtd: # only import and set the theme if we're building docs locally
# import sphinx_rtd_theme
# html_theme = 'sphinx_rtd_theme'
# html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# otherwise, readthedocs.org uses their theme by default, so no need to specify it
# This was taken directly from here:
# http://read-the-docs.readthedocs.org/en/latest/faq.html#i-get-import-errors-on-libraries-that-depend-on-c-modules
# I only added the __getitem__ method.
# NOTE: this can be removed whenever we move to sphinx-1.3, at which point we'll
# be able to use autodoc_mock_imports (value is a list of modules to be
# mocked).
class Mock(object):
__all__ = []
def __init__(self, *args, **kwargs):
pass
def __call__(self, *args, **kwargs):
return Mock()
@classmethod
def __getattr__(cls, name):
if name in ('__file__', '__path__'):
return '/dev/null'
elif name[0] == name[0].upper():
mockType = type(name, (), {})
mockType.__module__ = __name__
return mockType
else:
return Mock()
@classmethod
def __getitem__(cls, key):
return cls.__getattr__(key)
MOCK_MODULES = ["selinux", "dnf", "rpmUtils", "rpmUtils.arch", "rpmUtils.transaction", "rpmUtils.miscutils", "rpmUtils.updates"]
for mod_name in MOCK_MODULES:
sys.modules[mod_name] = Mock()

View File

@ -1,120 +0,0 @@
# Build a basic Fedora AMI using livemedia-creator
lang en_US.UTF-8
keyboard us
timezone --utc America/New_York
auth --useshadow --enablemd5
selinux --enforcing
firewall --service=ssh
bootloader --location=none
network --bootproto=dhcp --device=eth0 --onboot=on --activate
services --enabled=network,sshd,rsyslog
shutdown
# By default the root password is emptied
rootpw --plaintext removethispw
#
# Define how large you want your rootfs to be
# NOTE: S3-backed AMIs have a limit of 10G
#
zerombr
clearpart --all
part / --size 10000 --fstype ext4 --ondisk sda
part biosboot --size=1
part swap --size=512
#
# Repositories
url --url="http://dl.fedoraproject.org/pub/fedora/linux/development/19/x86_64/os/"
#
#
# Add all the packages after the base packages
#
%packages --nobase
@core
system-config-securitylevel-tui
audit
pciutils
bash
coreutils
kernel
e2fsprogs
passwd
policycoreutils
chkconfig
rootfiles
yum
vim-minimal
acpid
openssh-clients
openssh-server
curl
sudo
#Allow for dhcp access
dhclient
iputils
-firstboot
-biosdevname
# package to setup cloudy bits for us
cloud-init
grub
dracut-norescue
%end
# more ec2-ify
%post --erroronfail
# create ec2-user
/usr/sbin/useradd ec2-user
/bin/echo -e 'ec2-user\tALL=(ALL)\tNOPASSWD: ALL' >> /etc/sudoers
# fstab mounting is different for x86_64 and i386
cat <<EOL > /etc/fstab
/dev/xvda1 / ext4 defaults 1 1
/dev/xvda2 /mnt ext3 defaults 0 0
/dev/xvda3 swap swap defaults 0 0
EOL
if [ ! -d /lib64 ] ; then
# workaround xen performance issue (bz 651861)
echo "hwcap 1 nosegneg" > /etc/ld.so.conf.d/libc6-xen.conf
fi
# Install grub.conf
# idle=nomwait is to allow xen images to boot and not try use cpu features that are not supported
INITRD=`ls /boot/initramfs-* | head -n1`
KERNEL=`ls /boot/vmlinuz-* | head -n1`
mkdir /boot/grub
pushd /boot/grub
cat <<EOL > grub.conf
default 0
timeout 0
title Fedora Linux
root (hd0)
kernel $KERNEL root=/dev/xvda1 idle=halt
initrd $INITRD
EOL
# symlink grub.conf to menu.lst for use by EC2 pv-grub
ln -s grub.conf menu.lst
popd
# the firewall rules get saved as .old without this we end up not being able
# ssh in as iptables blocks access
rename -v .old "" /etc/sysconfig/*old
# setup systemd to boot to the right runlevel
rm /etc/systemd/system/default.target
ln -s /lib/systemd/system/multi-user.target /etc/systemd/system/default.target
# remove the root password
passwd -d root > /dev/null
%end

107
docs/fedora-minimized.ks Normal file
View File

@ -0,0 +1,107 @@
# Minimal Disk Image -- Example of image-minimizer usage in %post
#
sshpw --username=root --plaintext randOmStrinGhERE
# Firewall configuration
firewall --enabled
# Use network installation
url --url="http://dl.fedoraproject.org/pub/fedora/linux/development/20/x86_64/os/"
# Root password
rootpw --plaintext removethispw
# Network information
network --bootproto=dhcp --onboot=on --activate
# System authorization information
auth --useshadow --enablemd5
# System keyboard
keyboard --xlayouts=us --vckeymap=us
# System language
lang en_US.UTF-8
# SELinux configuration
selinux --enforcing
# Installation logging level
logging --level=info
# Shutdown after installation
shutdown
# System timezone
timezone US/Eastern
# System bootloader configuration
bootloader --location=mbr
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all
# Disk partitioning information
part / --fstype="ext4" --size=4000
part swap --size=1000
%post
# Remove root password
passwd -d root > /dev/null
# Remove random-seed
rm /var/lib/systemd/random-seed
%end
%packages
@core
kernel
memtest86+
grub2-efi
grub2
shim
syslinux
-dracut-config-rescue
%end
#
# Use the image-minimizer to remove some packages and dirs
#
%post --interpreter=image-minimizer --nochroot
# Kernel modules minimization
# Drop many filesystems
drop /lib/modules/*/kernel/fs
keep /lib/modules/*/kernel/fs/ext*
keep /lib/modules/*/kernel/fs/mbcache*
keep /lib/modules/*/kernel/fs/squashfs
keep /lib/modules/*/kernel/fs/jbd*
keep /lib/modules/*/kernel/fs/btrfs
keep /lib/modules/*/kernel/fs/cifs*
keep /lib/modules/*/kernel/fs/fat
keep /lib/modules/*/kernel/fs/nfs
keep /lib/modules/*/kernel/fs/nfs_common
keep /lib/modules/*/kernel/fs/fscache
keep /lib/modules/*/kernel/fs/lockd
keep /lib/modules/*/kernel/fs/nls/nls_utf8.ko
keep /lib/modules/*/kernel/fs/configfs/configfs.ko
keep /lib/modules/*/kernel/fs/fuse
keep /lib/modules/*/kernel/fs/isofs
# No sound
drop /lib/modules/*/kernel/sound
# Drop some unused rpms, without dropping dependencies
droprpm checkpolicy
droprpm dmraid-events
droprpm gamin
droprpm gnupg2
droprpm linux-atm-libs
droprpm make
droprpm mtools
droprpm mysql-libs
droprpm perl
droprpm perl-Module-Pluggable
droprpm perl-Net-Telnet
droprpm perl-PathTools
droprpm perl-Pod-Escapes
droprpm perl-Pod-Simple
droprpm perl-Scalar-List-Utils
droprpm perl-hivex
droprpm perl-macros
droprpm sgpio
droprpm syslinux
droprpm system-config-firewall-base
droprpm usermode
%end

29
docs/index.rst Normal file
View File

@ -0,0 +1,29 @@
.. Lorax documentation master file, created by
sphinx-quickstart on Wed Apr 8 13:46:00 2015.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to Lorax's documentation!
=================================
Contents:
.. toctree::
:maxdepth: 1
intro
lorax
livemedia-creator
lorax-composer
composer-cli
product-images
modules
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

67
docs/intro.rst Normal file
View File

@ -0,0 +1,67 @@
Introduction to Lorax
=====================
I am the Lorax. I speak for the trees [and images].
Lorax is used to build the Anaconda Installer boot.iso, it consists of a
library, pylorax, a set of templates, and the lorax script. Its operation
is driven by a customized set of Mako templates that lists the packages
to be installed, steps to execute to remove unneeded files, and creation
of the iso for all of the supported architectures.
Before Lorax
============
Tree building tools such as pungi and revisor rely on 'buildinstall' in
anaconda/scripts/ to produce the boot images and other such control files
in the final tree. The existing buildinstall scripts written in a mix of
bash and Python are unmaintainable. Lorax is an attempt to replace them
with something more flexible.
EXISTING WORKFLOW:
pungi and other tools call scripts/buildinstall, which in turn call other
scripts to do the image building and data generation. Here's how it
currently looks:
-> buildinstall
* process command line options
* write temporary yum.conf to point to correct repo
* find anaconda release RPM
* unpack RPM, pull in those versions of upd-instroot, mk-images,
maketreeinfo.py, makestamp.py, and buildinstall
-> call upd-instroot
-> call maketreeinfo.py
-> call mk-images (which figures out which mk-images.ARCH to call)
-> call makestamp.py
* clean up
PROBLEMS:
The existing workflow presents some problems with maintaining the scripts.
First, almost all knowledge of what goes in to the stage 1 and stage 2
images lives in upd-instroot. The mk-images* scripts copy things from the
root created by upd-instroot in order to build the stage 1 image, though
it's not completely clear from reading the scripts.
NEW IDEAS:
Create a new central driver with all information living in Python modules.
Configuration files will provide the knowledge previously contained in the
upd-instroot and mk-images* scripts.

391
docs/livemedia-creator.rst Normal file
View File

@ -0,0 +1,391 @@
livemedia-creator
=================
:Authors:
Brian C. Lane <bcl@redhat.com>
livemedia-creator uses `Anaconda <https://github.com/rhinstaller/anaconda>`_,
`kickstart <https://github.com/rhinstaller/pykickstart>`_ and `Lorax
<https://github.com/rhinstaller/lorax>`_ to create bootable media that use the
same install path as a normal system installation. It can be used to make live
isos, bootable (partitioned) disk images, tarfiles, and filesystem images for
use with virtualization and container solutions like libvirt, docker, and
OpenStack.
The general idea is to use virt-install with kickstart and an Anaconda boot.iso to
install into a disk image and then use the disk image to create the bootable
media.
livemedia-creator --help will describe all of the options available. At the
minimum you need:
``--make-iso`` to create a final bootable .iso or one of the other ``--make-*`` options.
``--iso`` to specify the Anaconda install media to use with virt-install.
``--ks`` to select the kickstart file describing what to install.
To use livemedia-creator with virtualization you will need to have virt-install installed.
If you are going to be using Anaconda directly, with ``--no-virt`` mode, make sure
you have the anaconda-tui package installed.
Conventions used in this document:
``lmc`` is an abbreviation for livemedia-creator.
``builder`` is the system where livemedia-creator is being run
``image`` is the disk image being created by running livemedia-creator
livemedia-creator cmdline arguments
-----------------------------------
See the output from ``livemedia-creator --help`` for the commandline arguments.
Quickstart
----------
Run this to create a bootable live iso::
sudo livemedia-creator --make-iso \
--iso=/extra/iso/boot.iso --ks=./docs/rhel7-livemedia.ks
You can run it directly from the lorax git repo like this::
sudo PATH=./src/sbin/:$PATH PYTHONPATH=./src/ ./src/sbin/livemedia-creator \
--make-iso --iso=/extra/iso/boot.iso \
--ks=./docs/rhel7-livemedia.ks --lorax-templates=./share/
You can observe the installation using vnc. The logs will show what port was
chosen, or you can use a specific port by passing it. eg. ``--vnc vnc:127.0.0.1:5``
This is usually a good idea when testing changes to the kickstart. lmc tries
to monitor the logs for fatal errors, but may not catch everything.
How ISO creation works
----------------------
There are 2 stages, the install stage which produces a disk or filesystem image
as its output, and the boot media creation which uses the image as its input.
Normally you would run both stages, but it is possible to stop after the
install stage, by using ``--image-only``, or to skip the install stage and use
a previously created disk image by passing ``--disk-image`` or ``--fs-image``
When creating an iso virt-install boots using the passed Anaconda installer iso
and installs the system based on the kickstart. The ``%post`` section of the
kickstart is used to customize the installed system in the same way that
current spin-kickstarts do.
livemedia-creator monitors the install process for problems by watching the
install logs. They are written to the current directory or to the base
directory specified by the --logfile command. You can also monitor the install
by using a vnc client. This is recommended when first modifying a kickstart,
since there are still places where Anaconda may get stuck without the log
monitor catching it.
The output from this process is a partitioned disk image. kpartx can be used
to mount and examine it when there is a problem with the install. It can also
be booted using kvm.
When creating an iso the disk image's / partition is copied into a formatted
filesystem image which is then used as the input to lorax for creation of the
final media.
The final image is created by lorax, using the templates in /usr/share/lorax/live/
or the live directory below the directory specified by ``--lorax-templates``. The
templates are written using the Mako template system with some extra commands
added by lorax.
Kickstarts
----------
The docs/ directory includes several example kickstarts, one to create a live
desktop iso using GNOME, and another to create a minimal disk image. When
creating your own kickstarts you should start with the minimal example, it
includes several needed packages that are not always included by dependencies.
Or you can use existing spin kickstarts to create live media with a few
changes. Here are the steps I used to convert the Fedora XFCE spin.
1. Flatten the xfce kickstart using ksflatten
2. Add zerombr so you don't get the disk init dialog
3. Add clearpart --all
4. Add swap partition
5. bootloader target
6. Add shutdown to the kickstart
7. Add network --bootproto=dhcp --activate to activate the network
This works for F16 builds but for F15 and before you need to pass
something on the cmdline that activate the network, like sshd:
``livemedia-creator --kernel-args="sshd"``
8. Add a root password::
rootpw rootme
network --bootproto=dhcp --activate
zerombr
clearpart --all
bootloader --location=mbr
part swap --size=512
shutdown
9. In the livesys script section of the %post remove the root password. This
really depends on how the spin wants to work. You could add the live user
that you create to the %wheel group so that sudo works if you wanted to.
``passwd -d root > /dev/null``
10. Remove /etc/fstab in %post, dracut handles mounting the rootfs
``cat /dev/null > /dev/fstab``
Do this only for live iso's, the filesystem will be mounted read only if
there is no /etc/fstab
11. Don't delete initramfs files from /boot in %post
12. When creating live iso's you need to have, at least, these packages in the %package section::
dracut-config-generic
dracut-live
-dracut-config-rescue
grub-efi
memtest86+
syslinux
One drawback to using virt-install is that it pulls the packages from the repo
each time you run it. To speed things up you either need a local mirror of the
packages, or you can use a caching proxy. When using a proxy you pass it to
livemedia-creator like this:
``--proxy=http://proxy.yourdomain.com:3128``
You also need to use a specific mirror instead of mirrormanager so that the
packages will get cached, so your kickstart url would look like:
``url --url="http://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/x86_64/os/"``
You can also add an update repo, but don't name it updates. Add --proxy to it
as well.
Anaconda image install (no-virt)
--------------------------------
You can create images without using virt-install by passing ``--no-virt`` on
the cmdline. This will use Anaconda's directory install feature to handle the
install. There are a couple of things to keep in mind when doing this:
1. It will be most reliable when building images for the same release that the
host is running. Because Anaconda has expectations about the system it is
running under you may encounter strange bugs if you try to build newer or
older releases.
2. Make sure selinux is set to permissive or disabled. It won't install
correctly with selinux set to enforcing yet.
3. It may totally trash your host. So far I haven't had this happen, but the
possibility exists that a bug in Anaconda could result in it operating on
real devices. I recommend running it in a virt or on a system that you can
afford to lose all data from.
The logs from anaconda will be placed in an ./anaconda/ directory in either
the current directory or in the directory used for --logfile
Example cmdline:
``sudo livemedia-creator --make-iso --no-virt --ks=./rhel7-livemedia.ks``
.. note::
Using no-virt to create a partitioned disk image (eg. --make-disk or
--make-vagrant) will only create disks usable on the host platform (BIOS
or UEFI). You can create BIOS partitioned disk images on UEFI by using
virt.
AMI Images
----------
Amazon EC2 images can be created by using the --make-ami switch and an appropriate
kickstart file. All of the work to customize the image is handled by the kickstart.
The example currently included was modified from the cloud-kickstarts version so
that it would work with livemedia-creator.
Example cmdline:
``sudo livemedia-creator --make-ami --iso=/path/to/boot.iso --ks=./docs/rhel7-livemedia-ec2.ks``
This will produce an ami-root.img file in the working directory.
At this time I have not tested the image with EC2. Feedback would be welcome.
Appliance Creation
------------------
livemedia-creator can now replace appliance-tools by using the --make-appliance
switch. This will create the partitioned disk image and an XML file that can be
used with virt-image to setup a virtual system.
The XML is generated using the Mako template from
/usr/share/lorax/appliance/libvirt.xml You can use a different template by
passing ``--app-template <template path>``
Documentation on the Mako template system can be found at the `Mako site
<http://docs.makotemplates.org/en/latest/index.html>`_
The name of the final output XML is appliance.xml, this can be changed with
``--app-file <file path>``
The following variables are passed to the template:
``disks``
A list of disk_info about each disk.
Each entry has the following attributes:
``name``
base name of the disk image file
``format``
"raw"
``checksum_type``
"sha256"
``checksum``
sha256 checksum of the disk image
``name``
Name of appliance, from --app-name argument
``arch``
Architecture
``memory``
Memory in KB (from ``--ram``)
``vcpus``
from ``--vcpus``
``networks``
list of networks from the kickstart or []
``title``
from ``--title``
``project``
from ``--project``
``releasever``
from ``--releasever``
The created image can be imported into libvirt using:
``virt-image appliance.xml``
You can also create qcow2 appliance images using ``--image-type=qcow2``, for example::
sudo livemedia-creator --make-appliance --iso=/path/to/boot.iso --ks=./docs/rhel7-minimal.ks \
--image-type=qcow2 --app-file=minimal-test.xml --image-name=minimal-test.img
Filesystem Image Creation
-------------------------
livemedia-creator can be used to create un-partitined filesystem images using
the ``--make-fsimage`` option. As of version 21.8 this works with both virt and
no-virt modes of operation. Previously it was only available with no-virt.
Kickstarts should have a single / partition with no extra mountpoints.
``livemedia-creator --make-fsimage --iso=/path/to/boot.iso --ks=./docs/rhel7-minimal.ks``
You can name the output image with ``--image-name`` and set a label on the filesystem with ``--fs-label``
TAR File Creation
-----------------
The ``--make-tar`` command can be used to create a tar of the root filesystem. By
default it is compressed using xz, but this can be changed using the
``--compression`` and ``--compress-arg`` options. This option works with both virt and
no-virt install methods.
As with ``--make-fsimage`` the kickstart should be limited to a single / partition.
For example::
livemedia-creator --make-tar --iso=/path/to/boot.iso --ks=./docs/rhel7-minimal.ks \
--image-name=rhel7-root.tar.xz
Live Image for PXE Boot
-----------------------
The ``--make-pxe-live`` command will produce squashfs image containing live root
filesystem that can be used for pxe boot. Directory with results will contain
the live image, kernel image, initrd image and template of pxe configuration
for the images.
Atomic Live Image for PXE Boot
------------------------------
The ``--make-ostree-live`` command will produce the same result as ``--make-pxe-live``
for installations of Atomic Host. Example kickstart for such an installation
using Atomic installer iso with local repo included in the image can be found
in docs/rhel-atomic-pxe-live.ks.
The PXE images can also be created with ``--no-virt`` by using the example
kickstart in docs/rhel-atomic-pxe-live-novirt.ks. This also works inside the
mock environment.
Debugging problems
------------------
Sometimes an installation will get stuck. When using virt-install the logs will
be written to ./virt-install.log and most of the time any problems that happen
will be near the end of the file. lmc tries to detect common errors and will
cancel the installation when they happen. But not everything can be caught.
When creating a new kickstart it is helpful to use vnc so that you can monitor
the installation as it happens, and if it gets stuck without lmc detecting the
problem you can switch to tty1 and examine the system directly.
If it does get stuck the best way to cancel is to use kill -9 on the virt-install pid,
lmc will detect that the process died and cleanup.
If lmc didn't handle the cleanup for some reason you can do this:
1. ``sudo umount /tmp/lmc-XXXX`` to unmount the iso from its mountpoint.
2. ``sudo rm -rf /tmp/lmc-XXXX``
3. ``sudo rm /var/tmp/lmc-disk-XXXXX`` to remove the disk image.
Note that lmc uses the lmc- prefix for all of its temporary files and
directories to make it easier to find and clean up leftovers.
The logs from the virt-install run are stored in virt-install.log, logs from
livemedia-creator are in livemedia.log and program.log
You can add ``--image-only`` to skip the .iso creation and examine the resulting
disk image. Or you can pass ``--keep-image`` to keep it around after the iso has
been created.
Cleaning up aborted ``--no-virt`` installs can sometimes be accomplished by
running the ``anaconda-cleanup`` script. As of Fedora 18 anaconda is
multi-threaded and it can sometimes become stuck and refuse to exit. When this
happens you can usually clean up by first killing the anaconda process then
running ``anaconda-cleanup``.
Hacking
-------
Development on this will take place as part of the lorax project, and on the
anaconda-devel-list mailing list, and `on github <https://github.com/rhinstaller/lorax>`_
Feedback, enhancements and bugs are welcome. You can use `bugzilla
<https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=lorax>`_ to
report bugs against the lorax component.

457
docs/lorax-composer.rst Normal file
View File

@ -0,0 +1,457 @@
lorax-composer
==============
:Authors:
Brian C. Lane <bcl@redhat.com>
``lorax-composer`` is an API server that allows you to build disk images using
`Blueprints`_ to describe the package versions to be installed into the image.
It is compatible with the Weldr project's bdcs-api REST protocol. More
information on Weldr can be found `on the Weldr blog <http://www.weldr.io>`_.
Behind the scenes it uses `livemedia-creator <livemedia-creator.html>`_ and
`Anaconda <https://anaconda-installer.readthedocs.io/en/latest/>`_ to handle the
installation and configuration of the images.
Important Things To Note
------------------------
* SELinux must be in Permissive mode. Anaconda requires SELinux be in permissive mode
for image creation to work correctly. You can either edit the setting in the
``/etc/sysconfig/selinux`` file, or run ``setenforce 0`` before starting lorax-composer.
* Some output types require packages from the RHEL 7 Optional repository. See the
`Red Hat Enterprise Linux 7 documentation <https://access.redhat.com/solutions/392003>`_
for information on how to enable it. Otherwise you will see image creation fail to
depsolve even if the blueprint itself is correct.
* All image types lock the root account, except for live-iso. You will need to either
use one of the `Customizations`_ methods for setting a ssh key/password, install a
package that creates a user, or use something like `cloud-init` to setup access at
boot time.
Installation
------------
The best way to install ``lorax-composer`` is to use ``sudo dnf install
lorax-composer composer-cli``, this will setup the weldr user and install the
systemd socket activation service. You will then need to enable it with ``sudo
systemctl enable lorax-composer.socket && sudo systemctl start
lorax-composer.socket``. This will leave the server off until the first request
is made. Systemd will then launch the server and it will remain running until
the system is rebooted. This will cause some delay in responding to the first
request from the UI or `composer-cli`.
.. note::
If you want lorax-composer to respond immediately to the first request you can
start and enable `lorax-composer.service` instead of `lorax-composer.socket`
Quickstart
----------
1. Create a ``weldr`` user and group by running ``useradd weldr``
2. Remove any pre-existing socket directory with ``rm -rf /run/weldr/``
A new directory with correct permissions will be created the first time the server runs.
3. Enable the socket activation with ``systemctl enable lorax-composer.socket
&& sudo systemctl start lorax-composer.socket``.
NOTE: You can also run it directly with ``lorax-composer /path/to/blueprints``. However,
``lorax-composer`` does not react well to being started both on the command line and via
socket activation at the same time. It is therefore recommended that you run it directly
on the command line only for testing or development purposes. For real use or development
of other projects that simply use the API, you should stick to socket activation only.
The ``/path/to/blueprints/`` directory is where the blueprints' git repo will
be created, and all the blueprints created with the ``/api/v0/blueprints/new``
route will be stored. If there are blueprint ``.toml`` files in the top level
of the directory they will be imported into the blueprint git storage when
``lorax-composer`` starts.
Logs
----
Logs are stored under ``/var/log/lorax-composer/`` and include all console
messages as well as extra debugging info and API requests.
Security
--------
Some security related issues that you should be aware of before running ``lorax-composer``:
* One of the API server threads needs to retain root privileges in order to run Anaconda.
* SELinux must be set to Permissive or disabled to allow ``livemedia-creator`` to run Anaconda.
* Only allow authorized users access to the ``weldr`` group and socket.
Since Anaconda kickstarts are used there is the possibility that a user could
inject commands into a blueprint that would result in the kickstart executing
arbitrary code on the host. Only authorized users should be allowed to build
images using ``lorax-composer``.
How it Works
------------
The server runs as root, and as ``weldr``. Communication with it is via a unix
domain socket (``/run/weldr/api.socket`` by default). The directory and socket
are owned by ``root:weldr`` so that any user in the ``weldr`` group can use the API
to control ``lorax-composer``.
At startup the server will check for the correct permissions and
ownership of a pre-existing directory, or it will create a new one if it
doesn't exist. The socket path and group owner's name can be changed from the
cmdline by passing it the ``--socket`` and ``--group`` arguments.
It will then drop root privileges for the API thread and run as the ``weldr``
user. The queue and compose thread still runs as root because it needs to be
able to mount/umount files and run Anaconda.
Composing Images
----------------
The `welder-web <https://github.com/weldr/welder-web/>`_ GUI project can be used to construct
blueprints and create composes using a web browser.
Or use the command line with `composer-cli <composer-cli.html>`_.
Blueprints
----------
Blueprints are simple text files in `TOML <https://github.com/toml-lang/toml>`_ format that describe
which packages, and what versions, to install into the image. They can also define a limited set
of customizations to make to the final image.
Example blueprints can be found in the ``lorax-composer`` `test suite
<https://github.com/weldr/lorax/tree/master/tests/pylorax/blueprints/>`_, with a simple one
looking like this::
name = "base"
description = "A base system with bash"
version = "0.0.1"
[[packages]]
name = "bash"
version = "4.4.*"
The ``name`` field is the name of the blueprint. It can contain spaces, but they will be converted to ``-``
when it is written to disk. It should be short and descriptive.
``description`` can be a longer description of the blueprint, it is only used for display purposes.
``version`` is a `semver compatible <https://semver.org/>`_ version number. If
a new blueprint is uploaded with the same ``version`` the server will
automatically bump the PATCH level of the ``version``. If the ``version``
doesn't match it will be used as is. eg. Uploading a blueprint with ``version``
set to ``0.1.0`` when the existing blueprint ``version`` is ``0.0.1`` will
result in the new blueprint being stored as ``version 0.1.0``.
[[packages]] and [[modules]]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
These entries describe the package names and matching version glob to be installed into the image.
The names must match the names exactly, and the versions can be an exact match
or a filesystem-like glob of the version using ``*`` wildcards and ``?``
character matching.
NOTE: As of lorax-composer-29.2-1 the versions are not used for depsolving,
that is planned for a future release. And currently there are no differences
between ``packages`` and ``modules`` in ``lorax-composer``.
[[groups]]
~~~~~~~~~~
These entries describe a group of packages to be installed into the image. Package groups are
defined in the repository metadata. Each group has a descriptive name used primarily for display
in user interfaces and an ID more commonly used in kickstart files. Here, the ID is the expected
way of listing a group.
Groups have three different ways of categorizing their packages: mandatory, default, and optional.
For purposes of blueprints, mandatory and default packages will be installed. There is no mechanism
for selecting optional packages.
Customizations
~~~~~~~~~~~~~~
The ``[customizations]`` section can be used to configure the hostname of the final image. eg.::
[customizations]
hostname = "baseimage"
This is optional and may be left out to use the defaults.
[customizations.kernel]
***********************
This allows you to append arguments to the bootloader's kernel commandline. This will not have any
effect on ``tar`` or ``ext4-filesystem`` images since they do not include a bootloader.
For example::
[customizations.kernel]
append = "nosmt=force"
[[customizations.sshkey]]
*************************
Set an existing user's ssh key in the final image::
[[customizations.sshkey]]
user = "root"
key = "PUBLIC SSH KEY"
The key will be added to the user's authorized_keys file.
[[customizations.user]]
***********************
Add a user to the image, and/or set their ssh key.
All fields for this section are optional except for the ``name``, here is a complete example::
[[customizations.user]]
name = "admin"
description = "Administrator account"
password = "$6$CHO2$3rN8eviE2t50lmVyBYihTgVRHcaecmeCk31L..."
key = "PUBLIC SSH KEY"
home = "/srv/widget/"
shell = "/usr/bin/bash"
groups = ["widget", "users", "wheel"]
uid = 1200
gid = 1200
If the password starts with ``$6$``, ``$5$``, or ``$2b$`` it will be stored as
an encrypted password. Otherwise it will be treated as a plain text password.
[[customizations.group]]
************************
Add a group to the image. ``name`` is required and ``gid`` is optional::
[[customizations.group]]
name = "widget"
gid = 1130
[customizations.timezone]
*************************
Customizing the timezone and the NTP servers to use for the system::
[customizations.timezone]
timezone = "US/Eastern"
ntpservers = ["0.north-america.pool.ntp.org", "1.north-america.pool.ntp.org"]
The values supported by ``timezone`` can be listed by running ``timedatectl list-timezones``.
If no timezone is setup the system will default to using `UTC`. The ntp servers are also
optional and will default to using the distribution defaults which are fine for most uses.
In some image types there are already NTP servers setup, eg. Google cloud image, and they
cannot be overridden because they are required to boot in the selected environment. But the
timezone will be updated to the one selected in the blueprint.
[customizations.locale]
***********************
Customize the locale settings for the system::
[customizations.locale]
languages = ["en_US.UTF-8"]
keyboard = "us"
The values supported by ``languages`` can be listed by running ``localectl list-locales`` from
the command line.
The values supported by ``keyboard`` can be listed by running ``localectl list-keymaps`` from
the command line.
Multiple languages can be added. The first one becomes the
primary, and the others are added as secondary. One or the other of ``languages``
or ``keyboard`` must be included (or both) in the section.
[customizations.firewall]
*************************
By default the firewall blocks all access except for services that enable their ports explicitly,
like ``sshd``. This command can be used to open other ports or services. Ports are configured using
the port:protocol format::
[customizations.firewall]
ports = ["22:tcp", "80:tcp", "imap:tcp", "53:tcp", "53:udp"]
Numeric ports, or their names from ``/etc/services`` can be used in the ``ports`` enabled/disabled lists.
The blueprint settings extend any existing settings in the image templates, so if ``sshd`` is
already enabled it will extend the list of ports with the ones listed by the blueprint.
If the distribution uses ``firewalld`` you can specify services listed by ``firewall-cmd --get-services``
in a ``customizations.firewall.services`` section::
[customizations.firewall.services]
enabled = ["ftp", "ntp", "dhcp"]
disabled = ["telnet"]
Remember that the ``firewall.services`` are different from the names in ``/etc/services``.
Both are optional, if they are not used leave them out or set them to an empty list ``[]``. If you
only want the default firewall setup this section can be omitted from the blueprint.
NOTE: The ``Google`` and ``OpenStack`` templates explicitly disable the firewall for their environment.
This cannot be overridden by the blueprint.
[customizations.services]
*************************
This section can be used to control which services are enabled at boot time.
Some image types already have services enabled or disabled in order for the
image to work correctly, and cannot be overridden. eg. ``ami`` requires
``sshd``, ``chronyd``, and ``cloud-init``. Without them the image will not
boot. Blueprint services are added to, not replacing, the list already in the
templates, if any.
[customizations.services]
enabled = ["sshd", "cockpit", "httpd.service"]
disabled = ["postfix", "telnetd"]
.. note::
The service names are systemd service units. You can only specify the unit
name, eg. ``httpd``, or the full service name, eg. ``httpd.service`` -- but
not other systemd unit files. Note that this is different from newer
releases where you can specify any systemd unit file.
Adding Output Types
-------------------
``livemedia-creator`` supports a large number of output types, and only some of
these are currently available via ``lorax-composer``. To add a new output type to
lorax-composer a kickstart file needs to be added to ``./share/composer/``. The
name of the kickstart is what will be used by the ``/compose/types`` route, and the
``compose_type`` field of the POST to start a compose. It also needs to have
code added to the :py:func:`pylorax.api.compose.compose_args` function. The
``_MAP`` entry in this function defines what lorax-composer will pass to
:py:func:`pylorax.installer.novirt_install` when it runs the compose. When the
compose is finished the output files need to be copied out of the build
directory (``/var/lib/lorax/composer/results/<UUID>/compose/``),
:py:func:`pylorax.api.compose.move_compose_results` handles this for each type.
You should move them instead of copying to save space.
If the new output type does not have support in livemedia-creator it should be
added there first. This will make the output available to the widest number of
users.
Example: Add partitioned disk support
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Partitioned disk support is something that livemedia-creator already supports
via the ``--make-disk`` cmdline argument. To add this to lorax-composer it
needs 3 things:
* A ``partitioned-disk.ks`` file in ``./share/composer/``
* A new entry in the _MAP in :py:func:`pylorax.api.compose.compose_args`
* Add a bit of code to :py:func:`pylorax.api.compose.move_compose_results` to move the disk image from
the compose directory to the results directory.
The ``partitioned-disk.ks`` is pretty similar to the example minimal kickstart
in ``./docs/rhel7-minimal.ks``. You should remove the ``url`` and ``repo``
commands, they will be added by the compose process. Make sure the bootloader
packages are included in the ``%packages`` section at the end of the kickstart,
and you will want to leave off the ``%end`` so that the compose can append the
list of packages from the blueprint.
The new ``_MAP`` entry should be a copy of one of the existing entries, but with ``make_disk`` set
to ``True``. Make sure that none of the other ``make_*`` options are ``True``. The ``image_name`` is
what the name of the final image will be.
``move_compose_results()`` can be as simple as moving the output file into
the results directory, or it could do some post-processing on it. The end of
the function should always clean up the ``./compose/`` directory, removing any
unneeded extra files. This is especially true for the ``live-iso`` since it produces
the contents of the iso as well as the boot.iso itself.
Package Sources
---------------
By default lorax-composer uses the host's configured repositories. It copies
the ``*.repo`` files from ``/etc/yum.repos.d/`` into
``/var/lib/lorax/composer/repos.d/`` at startup, these are immutable system
repositories and cannot be deleted or changed. If you want to add additional
repos you can put them into ``/var/lib/lorax/composer/repos.d/`` or use the
``/api/v0/projects/source/*`` API routes to create them.
The new source can be added by doing a POST to the ``/api/v0/projects/source/new``
route using JSON (with `Content-Type` header set to `application/json`) or TOML
(with it set to `text/x-toml`). The format of the source looks like this (in
TOML)::
name = "custom-source-1"
url = "https://url/path/to/repository/"
type = "yum-baseurl"
proxy = "https://proxy-url/"
check_ssl = true
check_gpg = true
gpgkey_urls = ["https://url/path/to/gpg-key"]
The ``proxy`` and ``gpgkey_urls`` entries are optional. All of the others are required. The supported
types for the urls are:
* ``yum-baseurl`` is a URL to a yum repository.
* ``yum-mirrorlist`` is a URL for a mirrorlist.
* ``yum-metalink`` is a URL for a metalink.
If ``check_ssl`` is true the https certificates must be valid. If they are self-signed you can either set
this to false, or add your Certificate Authority to the host system.
If ``check_gpg`` is true the GPG key must either be installed on the host system, or ``gpgkey_urls``
should point to it.
You can edit an existing source (other than system sources), by doing a POST to the ``new`` route
with the new version of the source. It will overwrite the previous one.
A list of existing sources is available from ``/api/v0/projects/source/list``, and detailed info
on a source can be retrieved with the ``/api/v0/projects/source/info/<source-name>`` route. By default
it returns JSON but it can also return TOML if ``?format=toml`` is added to the request.
Non-system sources can be deleted by doing a ``DELETE`` request to the
``/api/v0/projects/source/delete/<source-name>`` route.
The documentation for the source API routes can be `found here <pylorax.api.html#api-v0-projects-source-list>`_
The configured sources are used for all blueprint depsolve operations, and for composing images.
When adding additional sources you must make sure that the packages in the source do not
conflict with any other package sources, otherwise depsolving will fail.
DVD ISO Package Source
~~~~~~~~~~~~~~~~~~~~~~
In some situations the system may want to *only* use a DVD iso as the package
source, not the repos from the network. ``lorax-composer`` and ``anaconda``
understand ``file://`` URLs so you can mount an iso on the host, and replace the
system repo files with a configuration file pointing to the DVD.
* Stop the ``lorax-composer.service`` if it is running
* Move the repo files in ``/etc/yum.repos.d/`` someplace safe
* Create a new ``iso.repo`` file in ``/etc/yum.repos.d/``::
[iso]
name=iso
baseurl=file:///mnt/iso/
enabled=1
gpgcheck=1
gpgkey=file:///mnt/iso/RPM-GPG-KEY-redhat-release
* Remove all the cached repo files from ``/var/lib/lorax/composer/repos/``
* Restart the ``lorax-composer.service``
* Check the output of ``composer-cli status show`` for any output specific depsolve errors.
For example, the DVD usually does not include ``grub2-efi-*-cdboot-*`` so the live-iso image
type will not be available.
If you want to *add* the DVD source to the existing sources you can do that by
mounting the iso and creating a source file to point to it as described in the
`Package Sources`_ documentation. In that case there is no need to remove the other
sources from ``/etc/yum.repos.d/`` or clear the cached repos.

148
docs/lorax.rst Normal file
View File

@ -0,0 +1,148 @@
Lorax
=====
:Authors:
Brian C. Lane <bcl@redhat.com>
"I am the Lorax. I speak for the trees [and images]."
The `lorax <https://github.com/rhinstaller/lorax>`_ tool is used to create the
`Anaconda <https://github.com/rhinstaller/anaconda>`_ installer boot.iso as
well as the basic release tree, and .treeinfo metadata file. Its dependencies
are fairly light-weight because it needs to be able to run in a mock chroot
environment. It is best to run lorax from the same release as is being targeted
because the templates may have release specific logic in them. eg. Use the
rawhide version to build the boot.iso for rawhide, along with the rawhide
repositories.
lorax cmdline arguments
-----------------------
See the output from ``lorax --help`` for the commandline arguments.
Quickstart
----------
Run this as root to create a boot.iso in ``./results/``::
yum install lorax
setenforce 0
lorax -p RHEL -v 7 -r 7 \
-s http://mirror.centos.org/centos-7/7/os/x86_64/ \
-s http://mirror.centos.org/centos-7/7/updates/x86_64/ \
./results/
setenforce 1
You can add your own repos with ``-s`` and packages with higher NVRs will
override the ones in the distribution repositories.
Under ``./results/`` will be the release tree files: .discinfo, .treeinfo, everything that
goes onto the boot.iso, the pxeboot directory, and the boot.iso under ``./images/``.
Running inside of mock
----------------------
If you are using lorax with mock v1.3.4 or later you will need to pass
``--old-chroot`` to mock. Mock now defaults to using systemd-nspawn which cannot
create the needed loop device nodes. Passing ``--old-chroot`` will use the old
system where ``/dev/loop*`` is setup for you.
How it works
------------
Lorax uses `yum <https://github.com/rpm-software-management/yum>`_ to install
packages into a temporary directory, sets up configuration files, it then
removes unneeded files to save space, and creates a squashfs filesystem of the
files. The iso is then built using a generic initramfs and the kernel from the
selected repositories.
To drive these processes Lorax uses a custom template system, based on `Mako
templates <http://www.makotemplates.org/>`_ with the addition of custom
commands (documented in :class:`pylorax.ltmpl.LoraxTemplateRunner`). Mako
supports ``%if/%endif`` blocks as well as free-form python code inside ``<%
%>`` tags and variable substitution with ``${}``. The default templates are
shipped with lorax in ``/usr/share/lorax/`` and use the
``.tmpl`` extension.
runtime-install.tmpl
~~~~~~~~~~~~~~~~~~~~
The ``runtime-install.tmpl`` template lists packages to be installed using the
``installpkg`` command. This template is fairly simple, installing common packages and
architecture specific packages. It must end with the ``run_pkg_transaction``
command which tells dnf to download and install the packages.
runtime-postinstall.tmpl
~~~~~~~~~~~~~~~~~~~~~~~~
The ``runtime-postinstall.tmpl`` template is where the system configuration
happens. The installer environment is similar to a normal running system, but
needs some special handling. Configuration files are setup, systemd is told to
start the anaconda.target instead of a default system target, and a number of
unneeded services are disabled, some of which can interfere with the
installation. A number of template commands are used here:
* :func:`append <pylorax.ltmpl.LoraxTemplateRunner.append>` to add text to a file.
* :func:`chmod <pylorax.ltmpl.LoraxTemplateRunner.chmod>` changes the file's mode.
* :func:`gconfset <pylorax.ltmpl.LoraxTemplateRunner.gconfset>` runs gconfset.
* :func:`install <pylorax.ltmpl.LoraxTemplateRunner.install>` to install a file into the installroot.
* :func:`mkdir <pylorax.ltmpl.LoraxTemplateRunner.mkdir>` makes a new directory.
* :func:`move <pylorax.ltmpl.LoraxTemplateRunner.move>` to move a file into the installroot
* :func:`replace <pylorax.ltmpl.LoraxTemplateRunner.replace>` does text substitution in a file
* :func:`remove <pylorax.ltmpl.LoraxTemplateRunner.remove>` deletes a file
* :func:`runcmd <pylorax.ltmpl.LoraxTemplateRunner.runcmd>` run arbitrary commands.
* :func:`symlink <pylorax.ltmpl.LoraxTemplateRunner.symlink>` creates a symlink
* :func:`systemctl <pylorax.ltmpl.LoraxTemplateRunner.systemctl>` runs systemctl in the installroot
runtime-cleanup.tmpl
~~~~~~~~~~~~~~~~~~~~
The ``runtime-cleanup.tmpl`` template is used to remove files that aren't strictly needed
by the installation environment. In addition to the ``remove`` template command it uses:
* :func:`removepkg <pylorax.ltmpl.LoraxTemplateRunner.removepkg>`
remove all of a specific package's contents. A package may be pulled in as a dependency, but
not really used. eg. sound support.
* :func:`removefrom <pylorax.ltmpl.LoraxTemplateRunner.removefrom>`
Removes some files from a package. A file glob can be used, or the --allbut option to
remove everything except a select few.
* :func:`removekmod <pylorax.ltmpl.LoraxTemplateRunner.removekmod>`
Removes kernel modules
The squashfs filesystem
~~~~~~~~~~~~~~~~~~~~~~~
After ``runtime-*.tmpl`` templates have finished their work lorax creates an
empty ext4 filesystem, copies the remaining files to it, and makes a squashfs
filesystem of it. This file is the / of the boot.iso's installer environment
and is what is in the LiveOS/squashfs.img file on the iso.
iso creation
~~~~~~~~~~~~
The iso creation is handled by another set of templates. The one used depends
on the architecture that the iso is being created for. They are also stored in
``/usr/share/lorax/`` and are named after the arch, like
``x86.tmpl`` and ``aarch64.tmpl``. They handle creation of the tree, copying
configuration template files, configuration variable substitution, treeinfo
metadata (via the :func:`treeinfo <pylorax.ltmpl.LoraxTemplateRunner.treeinfo>`
template command). Kernel and initrd are copied from the installroot to their
final locations and then mkisofs is run to create the boot.iso
Custom Templates
----------------
The default set of templates and configuration files are shipped in the
``/usr/share/lorax/`` directory. You can make a copy of them and place them
into another directory and then select the new template directory by passing
``--sharedir`` to lorax.

View File

@ -4,10 +4,14 @@ livemedia-creator \- Create live install media
.SH SYNOPSIS .SH SYNOPSIS
livemedia-creator [-h] livemedia-creator [-h]
(--make-iso | --make-disk | --make-fsimage | --make-appliance | --make-ami) (--make-iso | --make-disk | --make-fsimage | --make-appliance | --make-ami | --make-tar | --make-pxe-live | --make-ostree-live)
[--iso ISO] [--disk-image DISK_IMAGE] [--iso ISO] [--disk-image DISK_IMAGE]
[--fs-image FS_IMAGE] [--ks KS] [--fs-image FS_IMAGE] [--ks KS]
[--image-name IMAGE_NAME] [--image-only] [--image-name IMAGE_NAME] [--image-only]
[--fs-label FS_LABEL]
[--compression] [--compress-arg]
[--live-rootfs-size LIVE_ROOTFS_SIZE]
[--live-rootfs-keep-size LIVE_ROOTFS_KEEP_SIZE]
[--keep-image] [--no-virt] [--proxy PROXY] [--keep-image] [--no-virt] [--proxy PROXY]
[--anaconda-arg ANACONDA_ARGS] [--anaconda-arg ANACONDA_ARGS]
[--armplatform ARMPLATFORM] [--location LOCATION] [--armplatform ARMPLATFORM] [--location LOCATION]
@ -20,6 +24,7 @@ livemedia-creator [-h]
[--dracut-arg DRACUT_ARGS] [--title TITLE] [--dracut-arg DRACUT_ARGS] [--title TITLE]
[--project PROJECT] [--releasever RELEASEVER] [--project PROJECT] [--releasever RELEASEVER]
[--volid VOLID] [--squashfs_args SQUASHFS_ARGS] [--volid VOLID] [--squashfs_args SQUASHFS_ARGS]
[--virt-uefi] [--ovmf-path OVMF_PATH]
.SH DESCRIPTION .SH DESCRIPTION
livemedia-creator uses Anaconda, kickstart and Lorax to create bootable media livemedia-creator uses Anaconda, kickstart and Lorax to create bootable media
@ -63,6 +68,18 @@ Build an appliance image and XML description
\fB\-\-make\-ami\fR \fB\-\-make\-ami\fR
Build an ami image Build an ami image
.TP
\fB\-\-make\-tar\fR
Build a tar of the root filesystem. Defaults to root.tar.xz
.TP
\fB\-\-make\-pxe\-live\fR
Build a live pxe boot squashfs image
.TP
\fB\-\-make\-ostree\-live\fR
Build a live pxe boot squashfs image of Atomic Host
.TP .TP
\fB\-\-iso ISO\fR \fB\-\-iso ISO\fR
Anaconda installation .iso path to use for virt-install Anaconda installation .iso path to use for virt-install
@ -73,7 +90,24 @@ Path to disk image to use for creating final image
.TP .TP
\fB\-\-fs\-image FS_IMAGE\fR \fB\-\-fs\-image FS_IMAGE\fR
Path to filesystem image to use for creating final image Path to existing filesystem image to use for creating final image.
.TP
\fB\-\-qcow2\fR
Create qcow2 image instead of raw sparse image when making disk images.
.TP
\fB\-\-qcow2\-arg\fR
Arguments to pass to qemu-img. Pass once for each argument
>>>>>>> d04a99e... livemedia-creator: Add support for making tarfiles
.TP
\fB\-\-compression\fR
Compression binary for make-tar. xz, lzma, gzip, and bzip2 are supported. xz is the default.
.TP
\fB\-\-compress\-arg\fR
Arguments to pass to compression. Pass once for each argument
.TP .TP
\fB\-\-ks KS\fR \fB\-\-ks KS\fR
@ -160,6 +194,15 @@ Path to template to use for appliance data.
\fB\-\-app\-file APP_FILE\fR \fB\-\-app\-file APP_FILE\fR
Appliance template results file. Appliance template results file.
.SH PXE\-LIVE ARGUMENTS:
.TP
\fB\-\-live\-rootfs\-size\fR
Size of root filesystem of live image in GiB. By default approximate size of space used in root filesystem is used.
.TP
\fB\-\-live\-rootfs\-keep\-size\fR
Keep the size of original root filesystem (rounded down to GiB) in live image
.SH VIRT\-INSTALL ARGUMENTS: .SH VIRT\-INSTALL ARGUMENTS:
.TP .TP
\fB\-\-ram MEMORY\fR \fB\-\-ram MEMORY\fR
@ -181,6 +224,15 @@ Passed to --arch command
\fB\-\-kernel\-args KERNEL_ARGS\fR \fB\-\-kernel\-args KERNEL_ARGS\fR
Additional argument to pass to the installation kernel Additional argument to pass to the installation kernel
.TP
\fB\-\-virt\-uefi\fR
Boot the virtual machine in UEFI mode. Requires OVMF_CODE.fd and OVMF_VARS.fd
.TP
\fB\-\-ovmf\-path\fR
Path to OVMF_CODE.fd and OVMF_VARS.fd. Defaults to /usr/share/OVMF/, the UEFI
firmware files need to be installed manually, they are not shipped with RHEL.
.SH DRACUT ARGUMENTS: .SH DRACUT ARGUMENTS:
.TP .TP
\fB\-\-dracut\-arg DRACUT_ARGS\fR \fB\-\-dracut\-arg DRACUT_ARGS\fR

View File

@ -3,7 +3,7 @@
lorax \- Create installer boot iso lorax \- Create installer boot iso
.SH SYNOPSIS .SH SYNOPSIS
lorax -p PRODUCT -v VERSION -r RELEASE -s REPOSITORY OUTPUTDIR lorax -p PRODUCT -v VERSION -r RELEASE [-s REPOSITORY|--repo CONFIG] OUTPUTDIR
.SH DESCRIPTION .SH DESCRIPTION
@ -37,6 +37,10 @@ release information
\fB\-s REPOSITORY, \-\-source=REPOSITORY\fR \fB\-s REPOSITORY, \-\-source=REPOSITORY\fR
source repository (may be listed multiple times) source repository (may be listed multiple times)
.TP
\fB\--repo CONFIG\fR
repository configuration file (may be listed multiple times)
.SH .SH
OPTIONAL ARGUMENTS: OPTIONAL ARGUMENTS:
@ -89,6 +93,10 @@ Path to logfile
\fB\-\-tmp=TMP\fR \fB\-\-tmp=TMP\fR
Top level temporary directory Top level temporary directory
.TP
\fB\-\-noverifyssl\fR
This disables SSL certificate checking. eg. to allow using https: sources with self-signed certificates.
.SH AUTHORS .SH AUTHORS
.nf .nf
Martin Gracik Martin Gracik

27
docs/product-images.rst Normal file
View File

@ -0,0 +1,27 @@
Product and Updates Images
==========================
Lorax now supports creation of product.img and updates.img as part of the build
process. This is implemented using the installimg template command which will
take the contents of a directory and create a compressed archive from it. The
directory must be created by one of the packages installed by
runtime-install.tmpl or by passing ``--installpkgs <pkgname>`` to lorax at
runtime. The x86, ppc, ppc64le and aarch64 templates all look for
/usr/share/lorax/product/ and /usr/share/lorax/updates/ directories in the
install chroot while creating the final install tree. If there are files in
those directories lorax will create images/product.img and/or
images/updates.img
These archives are just like an anaconda updates image -- their contents are
copied over the top of the filesystem at boot time so that you can drop in
files to add to or replace anything on the filesystem.
Anaconda has several places that it looks for updates, the one for product.img
is in /run/install/product. So for example, to add an installclass to Anaconda
you would put your custom class here:
``/usr/share/lorax/product/run/install/product/pyanaconda/installclasses/custom.py``
If the packages containing the product/updates files are not included as part
of normal dependencies you can add specific packages with the ``--installpkgs``
command or the installpkgs paramater of :class:`pylorax.treebuilder.RuntimeBuilder`

View File

@ -0,0 +1,26 @@
# Settings for unattended installation:
lang en_US.UTF-8
keyboard us
timezone America/New_York
zerombr
clearpart --all --initlabel
rootpw --plaintext atomic
network --bootproto=dhcp --device=link --activate
# We are only able to install atomic with separate /boot partition currently
part / --fstype="ext4" --size=6000
part /boot --size=500 --fstype="ext4"
shutdown
# Using ostree repo included in installation iso. Respective ostreesetup command is included here.
# The included kickstart file with the command is created during installation iso compose.
%include /usr/share/anaconda/interactive-defaults.ks
services --disabled=cloud-init,cloud-init-local,cloud-final,cloud-config,docker-storage-setup
# We copy content of separate /boot partition to root part when building live squashfs image,
# and we don't want systemd to try to mount it when pxe booting
%post
cat /dev/null > /etc/fstab
%end

View File

@ -3,18 +3,19 @@ sshpw --username=root --plaintext randOmStrinGhERE
# Firewall configuration # Firewall configuration
firewall --enabled --service=mdns firewall --enabled --service=mdns
# Use network installation # Use network installation
url --url="http://dl.fedoraproject.org/pub/fedora/linux/development/19/x86_64/os/" url --url=http://repo/rhel7.4/Server/os
repo --name=optional --baseurl=http://repo/rhel7.4/Server/optional/os
# X Window System configuration information # X Window System configuration information
xconfig --startxonboot xconfig --startxonboot
# Root password # Root password
rootpw --plaintext removethispw rootpw --plaintext removethispw
# Network information # Network information
network --bootproto=dhcp --device=eth0 --onboot=on --activate network --bootproto=dhcp --onboot=on --activate
# System authorization information # System authorization information
auth --useshadow --enablemd5 auth --useshadow --enablemd5
# System keyboard # System keyboard
keyboard us keyboard --xlayouts=us --vckeymap=us
# System language # System language
lang en_US.UTF-8 lang en_US.UTF-8
# SELinux configuration # SELinux configuration
@ -34,8 +35,9 @@ zerombr
# Partition clearing information # Partition clearing information
clearpart --all clearpart --all
# Disk partitioning information # Disk partitioning information
reqpart
part biosboot --size=1 part biosboot --size=1
part / --fstype="ext4" --size=4000 part / --fstype="ext4" --size=5000
part swap --size=1000 part swap --size=1000
%post %post
@ -307,16 +309,8 @@ rm -f /core*
rm -f /.readahead_collect rm -f /.readahead_collect
touch /var/lib/readahead/early.sorted touch /var/lib/readahead/early.sorted
%end # Remove random-seed
rm /var/lib/systemd/random-seed
%post --nochroot
cp $INSTALL_ROOT/usr/share/doc/*-release-*/GPL $LIVE_ROOT/GPL
# only works on x86, x86_64
if [ "$(uname -i)" = "i386" -o "$(uname -i)" = "x86_64" ]; then
if [ ! -d $LIVE_ROOT/LiveOS ]; then mkdir -p $LIVE_ROOT/LiveOS ; fi
cp /usr/bin/livecd-iso-to-disk $LIVE_ROOT/LiveOS
fi
%end %end
%post %post
@ -346,9 +340,6 @@ gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults
# Turn off PackageKit-command-not-found while uninstalled # Turn off PackageKit-command-not-found while uninstalled
sed -i -e 's/^SoftwareSourceSearch=true/SoftwareSourceSearch=false/' /etc/PackageKit/CommandNotFound.conf sed -i -e 's/^SoftwareSourceSearch=true/SoftwareSourceSearch=false/' /etc/PackageKit/CommandNotFound.conf
# Use the animated laughlin background by default
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -t str -s /desktop/gnome/background/picture_filename /usr/share/backgrounds/laughlin/default-tod/laughlin.xml
EOF EOF
# Remove root password # Remove root password
@ -361,30 +352,23 @@ cat /dev/null > /etc/fstab
%end %end
%packages %packages
@admin-tools # Packages needed by anaconda, but not directly required.
@standard # Includes all of the grub2 and shim packages needed, except
@base-x # for the grub2-efi-*-cdboot package
@anaconda-tools --optional
@core @core
@dial-up
@fonts @fonts
@x11
@gnome-desktop @gnome-desktop
@graphical-internet
@hardware-support
@input-methods @input-methods
#@office
#@printing
#@sound-and-video
anaconda anaconda
isomd5sum isomd5sum
kernel kernel
laughlin-backgrounds-animated-gnome
memtest86+ memtest86+
nss-mdns
-ibus-pinyin-db-open-phrase
-smartmontools
grub2-efi
grub2
shim
syslinux syslinux
dracut-norescue -dracut-config-rescue
# This package is needed to boot the iso on UEFI
grub2-efi-*-cdboot
grub2-efi-ia32
%end %end

64
docs/rhel7-minimal.ks Normal file
View File

@ -0,0 +1,64 @@
# Minimal Disk Image
#
sshpw --username=root --plaintext randOmStrinGhERE
# Firewall configuration
firewall --enabled
# Use network installation
url --url=http://repo/rhel7.4/Server/os
repo --name=optional --baseurl=http://repo/rhel7.4/Server/optional/os
# Root password
rootpw --plaintext removethispw
# Network information
network --bootproto=dhcp --onboot=on --activate
# System authorization information
auth --useshadow --enablemd5
# System keyboard
keyboard --xlayouts=us --vckeymap=us
# System language
lang en_US.UTF-8
# SELinux configuration
selinux --enforcing
# Installation logging level
logging --level=info
# Shutdown after installation
shutdown
# System timezone
timezone US/Eastern
# System bootloader configuration
bootloader --location=mbr
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all
# Disk partitioning information
reqpart
part / --fstype="ext4" --size=4000
part swap --size=1000
%post
# Remove root password
passwd -d root > /dev/null
# Remove random-seed
rm /var/lib/systemd/random-seed
%end
%packages
@core
kernel
memtest86+
efibootmgr
grub2-efi
grub2
shim
syslinux
-dracut-config-rescue
# Boot on 32bit UEFI
shim-ia32
grub2-efi-ia32
# NOTE: To build a bootable UEFI disk image livemedia-creator needs to be
# run on a UEFI system or virt.
%end

8
epel.repo Normal file
View File

@ -0,0 +1,8 @@
[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

View File

@ -0,0 +1,143 @@
# bash completion for composer-cli
__composer_cli_flags="-h --help -j --json -s --socket --log -a --api --test -V"
declare -A __composer_cli_cmds=(
[compose]="list start types status log cancel delete info metadata logs results image"
[blueprints]="list show changes diff save delete depsolve push freeze tag undo workspace"
[modules]="list"
[projects]="list info"
[sources]="list info add change delete"
[help]=""
)
__composer_socket_ok() {
[ -w "${COMPOSER_SOCKET:-/run/weldr/api.socket}" ]
}
__composer_blueprints() {
__composer_socket_ok && composer-cli blueprints list
}
__composer_sources() {
__composer_socket_ok && composer-cli sources list
}
__composer_compose_types() {
__composer_socket_ok && composer-cli compose types
}
__composer_composes() {
__composer_socket_ok && composer-cli compose list $@ | while read id rest; do echo $id; done
}
__word_in_list() {
local w word=$1; shift
for w in "$@"; do
[ "$w" == "$word" ] && return 0
done
return 1
}
_composer_cli() {
local cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}"
local w="" wi=0 cmd="__NONE__" subcmd="__NONE__" cmd_cword=0
# find the command and its subcommand
for (( wi=0; wi < ${#COMP_WORDS[*]}; wi++ )); do
if __word_in_list "${COMP_WORDS[wi]}" "${!__composer_cli_cmds[@]}"; then
cmd="${COMP_WORDS[wi]}"
subcmd="${COMP_WORDS[wi+1]}"
cmd_cword=$((COMP_CWORD-wi))
break
fi
done
COMPREPLY=()
if [ "$cmd_cword" -le 0 ]; then
# No command yet, complete flags or commands
case "$prev" in
-s|--socket|--log)
# If it's a flag that takes a filename, suggest filenames
compopt -o filenames
COMPREPLY=($(compgen -f -- "${cur}"))
;;
-a|--api|--test)
# If it's a flag that takes an arg we can't guess, don't suggest anything
COMPREPLY=()
;;
*)
if [ "${cur:0:1}" == "-" ]; then
# Suggest flags if cur starts with '-'
COMPREPLY=($(compgen -W "${__composer_cli_flags}" -- "${cur}"))
else
# Suggest commands if there isn't one already
COMPREPLY=($(compgen -W "${!__composer_cli_cmds[*]}" -- "${cur}"))
fi
;;
esac
elif [ $cmd_cword == 1 ]; then
# Complete the word after the command
COMPREPLY=($(compgen -W "${__composer_cli_cmds[$cmd]} help" -- "${cur}"))
elif [ $cmd_cword == 2 ]; then
# Complete word(s) after subcommand
case "$cmd:$subcmd" in
compose:list)
COMPREPLY=($(compgen -W "waiting running finish failed" -- "${cur}"))
;;
*:list|*:help|compose:types)
COMPREPLY=()
;;
sources:info|sources:delete)
COMPREPLY=($(compgen -W "$(__composer_sources)" -- "${cur}"))
;;
sources:add|sources:change|blueprints:workspace|blueprints:push)
compopt -o filenames
COMPREPLY=($(compgen -f -- "${cur}"))
;;
blueprints:freeze)
COMPREPLY=($(compgen -W "$(__composer_blueprints) show save" -- "${cur}"))
;;
compose:start|blueprints:*)
COMPREPLY=($(compgen -W "$(__composer_blueprints)" -- "${cur}"))
;;
compose:cancel)
COMPREPLY=($(compgen -W "$(__composer_composes running waiting)" -- "${cur}"))
;;
compose:delete|compose:results|compose:metadata)
COMPREPLY=($(compgen -W "$(__composer_composes finished failed)" -- "${cur}"))
;;
compose:log*)
COMPREPLY=($(compgen -W "$(__composer_composes running finished failed)" -- "${cur}"))
;;
compose:image)
COMPREPLY=($(compgen -W "$(__composer_composes finished)" -- "${cur}"))
;;
compose:*)
COMPREPLY=($(compgen -W "$(__composer_composes)" -- "${cur}"))
;;
esac
else
# Complete words past the subcommand's argument (if appropriate)
case "$cmd:$subcmd" in
compose:delete)
COMPREPLY=($(compgen -W "$(__composer_composes finished failed)" -- "${cur}"))
;;
compose:start)
if [ "$cmd_cword" == 3 ]; then
COMPREPLY=($(compgen -W "$(__composer_compose_types)" -- "${cur}"))
fi
;;
# TODO: blueprints:diff and blueprints:undo want commits
blueprints:freeze|blueprints:save|blueprints:depsolve|blueprints:changes|blueprints:show)
COMPREPLY=($(compgen -W "$(__composer_blueprints)" -- "${cur}"))
;;
sources:info)
COMPREPLY=($(compgen -W "$(__composer_sources)" -- "${cur}"))
;;
esac
fi
}
complete -F _composer_cli composer-cli

1
etc/composer.conf Normal file
View File

@ -0,0 +1 @@
# lorax-composer configuration file

610
lorax-composer.spec Normal file
View File

@ -0,0 +1,610 @@
%define debug_package %{nil}
Name: lorax-composer
Version: 19.7.43
Release: 1%{?dist}
Summary: Lorax Image Composer API Server
Group: Applications/System
License: GPLv2+
URL: https://github.com/weldr/lorax
# To generate Source0 do:
# git clone https://github.com/weldr/lorax
# git checkout -b archive-branch lorax-%%{version}-%%{release}
# tito build --tgz
Source0: %{name}-%{version}.tar.gz
BuildRequires: python2-devel
# For Sphinx documentation build
BuildRequires: python-sphinx yum python-mako pykickstart
BuildRequires: python-flask python-gobject libgit2-glib python2-pytoml python-semantic_version
Requires: lorax >= 19.7.22
Requires(pre): /usr/bin/getent
Requires(pre): /usr/sbin/groupadd
Requires(pre): /usr/sbin/useradd
Requires: python2-pytoml
Requires: python-semantic_version
Requires: libgit2
Requires: libgit2-glib
Requires: python-flask
Requires: python-gevent
Requires: anaconda-tui
Requires: qemu-img
Requires: tar
Requires: pykickstart >= 1.99.66.20
%{?systemd_requires}
BuildRequires: systemd
%description
lorax-composer provides a REST API for building images using lorax.
%package -n composer-cli
Summary: A command line tool for use with the lorax-composer API server
Requires: python-urllib3
%description -n composer-cli
A command line tool for use with the lorax-composer API server. Examine recipes,
build images, etc. from the command line.
%prep
%setup -q
%build
make docs
%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT mandir=%{_mandir} install
# Install example blueprints from the test suite.
# This path MUST match the lorax-composer.service blueprint path.
mkdir -p $RPM_BUILD_ROOT/var/lib/lorax/composer/blueprints/
for bp in example-http-server.toml example-development.toml example-atlas.toml; do
cp ./tests/pylorax/blueprints/$bp $RPM_BUILD_ROOT/var/lib/lorax/composer/blueprints/
done
# Do Not Package the lorax files
rm -f $RPM_BUILD_ROOT/%{python_sitelib}/lorax-*.egg-info
rm -rf $RPM_BUILD_ROOT/%{python_sitelib}/pylorax/*py
rm -rf $RPM_BUILD_ROOT/%{python_sitelib}/pylorax/*py?
rm -rf $RPM_BUILD_ROOT/%{_datadir}/lorax/appliance
rm -rf $RPM_BUILD_ROOT/%{_datadir}/lorax/config_files
rm -rf $RPM_BUILD_ROOT/%{_datadir}/lorax/live
rm -rf $RPM_BUILD_ROOT/%{_datadir}/lorax/pxe-live
rm -rf $RPM_BUILD_ROOT/%{_mandir}/man1/*
rm -f $RPM_BUILD_ROOT/%{_datadir}/lorax/*tmpl
rm -f $RPM_BUILD_ROOT/%{_sbindir}/lorax
rm -f $RPM_BUILD_ROOT/%{_sbindir}/livemedia-creator
rm -f $RPM_BUILD_ROOT/%{_sbindir}/mkefiboot
rm -f $RPM_BUILD_ROOT/%{_bindir}/image-minimizer
rm -f $RPM_BUILD_ROOT/%{_bindir}/mk-s390-cdboot
rm -f $RPM_BUILD_ROOT/%{_sysconfdir}/lorax/lorax.conf
%pre
getent group weldr >/dev/null 2>&1 || groupadd -r weldr >/dev/null 2>&1 || :
getent passwd weldr >/dev/null 2>&1 || useradd -r -g weldr -d / -s /sbin/nologin -c "User for lorax-composer" weldr >/dev/null 2>&1 || :
%post
%systemd_post lorax-composer.service
%systemd_post lorax-composer.socket
%preun
%systemd_preun lorax-composer.service
%systemd_preun lorax-composer.socket
%postun
%systemd_postun_with_restart lorax-composer.service
%systemd_postun_with_restart lorax-composer.socket
%files
%defattr(-,root,root,-)
%doc COPYING AUTHORS
%doc docs/html
%dir %{_sysconfdir}/lorax/
%config(noreplace) %{_sysconfdir}/lorax/composer.conf
%{python_sitelib}/pylorax/api/*
%dir %{_datadir}/lorax/composer
%{_datadir}/lorax/composer/*
%{_sbindir}/lorax-composer
%{_unitdir}/lorax-composer.service
%{_unitdir}/lorax-composer.socket
%{_tmpfilesdir}/lorax-composer.conf
%dir %attr(0771, root, weldr) %{_sharedstatedir}/lorax/composer/
%dir %attr(0771, root, weldr) %{_sharedstatedir}/lorax/composer/blueprints/
%attr(0771, weldr, weldr) %{_sharedstatedir}/lorax/composer/blueprints/*
%files -n composer-cli
%{_bindir}/composer-cli
%{python_sitelib}/composer/*
%{_sysconfdir}/bash_completion.d/composer-cli
%changelog
* Thu Jun 18 2020 Brian C. Lane <bcl@redhat.com> 19.7.43-1
- composer-cli: Change timeout to 5 minutes (bcl)
Related: rhbz#1847490
- composer-cli: Disable retry counter on connection timeout (bcl)
Resolves: rhbz#1847490
- test: Put VM image overlay into /var/tmp (martin) (martin)
Related: rhbz#1825190
* Mon May 18 2020 Brian C. Lane <bcl@redhat.com> 19.7.42-1
- [tests] Remove vm-local-repos Makefile target (jikortus)
Related: rhbz#1810711
- [tests] Enable handling of rel-eng images (jikortus)
Related: rhbz#1810711
- tests: Unskip AWS test scenario (atodorov)
Related: rhbz#1785159
* Mon May 11 2020 Brian C. Lane <bcl@redhat.com> 19.7.41-1
- [tests] Fix repos files handling in test_repos_sanity.sh (jikortus)
Related: rhbz#1828808
- [tests] update glusterfs version to 6 (jikortus)
Related: rhbz#1828808
- [tests] Use rel-eng/nightly repo in test_repos_sanity.sh and vm.install (jikortus)
Related: rhbz#1828808
- [tests] Update download server URLs in tests (jikortus)
Related: rhbz#1828808
- Add test for running composer with --no-system-repos option (jikortus)
Related: rhbz#1785159
- [tests] don't add only rel-eng optional repo for live-iso (jikortus)
Resolves: rhbz#rhbz#1826029
* Mon Apr 20 2020 Brian C. Lane <bcl@redhat.com> 19.7.40-1
- Add --no-system-repos to lorax-composer (bcl)
Resolves: rhbz#1785388
- tests: update skip message for TestApi (atodorov)
Related: rhbz#1785159
- tests: remove --test=2 from compose_sanity (jrusz)
Related: rhbz#1789451
- Add test for canceling a running compose (jrusz)
Related: rhbz#1789451
- Update datastore for VMware testing (chrobert)
Related: rhbz#1785159
- tests: pip install future (atodorov)
Related: rhbz#1785159
- lorax-composer: Estimate metadata size required by Anaconda (bcl)
Resolves: rhbz#1761337
- composer: Add the yum cache archive size to the size estimate (bcl)
Related: rhbz#1761337
* Fri Dec 13 2019 Brian C. Lane <bcl@redhat.com> 19.7.39-1
- test: Turn TestLiveIso back on (bcl)
Related: rhbz#1770193
- Makefile: archive should not run git tag (bcl)
Related: rhbz#1770193
- lorax-composer: Add liveuser on live-iso to wheel group (bcl)
Related: rhbz#1770193
- tests: Boot the test images with graphics=True (bcl)
Related: rhbz#1770193
- tests: Add serial console to images we boot in CI (bcl)
Related: rhbz#1770193
* Mon Dec 09 2019 Brian C. Lane <bcl@redhat.com> 19.7.38-1
- lorax-composer: Change cockpit.socket examples to cockpit (bcl)
Related: rhbz#1718473
* Mon Dec 02 2019 Brian C. Lane <bcl@redhat.com> 19.7.37-1
- tests: If TEST_OS isn't specified then match the host OS (atodorov)
Related: rhbz#1770193
- Remove all repo files & install composer-cli from host repos (atodorov)
Related: rhbz#1770193
- Always remove lorax-composer & composer-cli RPMs before installing them (atodorov)
Related: rhbz#1770193
- Always remove existing VM image before building new one (atodorov)
Related: rhbz#1770193
- tests: enable compose_ext4 test to use CDN repos (atodorov)
Related: rhbz#1698366
* Tue Nov 19 2019 Brian C. Lane <bcl@redhat.com> 19.7.36-1
- tests: restart composer after adding optional reporsitory (atodorov)
Related: rhbz#1770193
- tests: Keep beakerlib repo on the VM for tests which need it (atodorov)
Related: rhbz#1770193
- tests: unskip Qcow2 scenario (atodorov)
Related: rhbz#1770193
- tests: Ensure failure if beakerlib results file not found (atodorov)
Related: rhbz#1770193
- tests: Documentation updates (atodorov)
Related: rhbz#1770193
- tests: Use host repositories for make vm (atodorov)
Related: rhbz#1770193
Remove unused make targets (atodorov)
Related: rhbz#1770193
- DRY when setting up, running & parsing results for beakerlib tests (atodorov)
Related: rhbz#1770193
- tests: Fix check_root_account when used with tar liveimg test (bcl)
Related: rhbz#1770193
- tests: Use the same asserts as before (atodorov)
Related: rhbz#1770193
- tests: switch to using podman instead of docker (atodorov)
Related: rhbz#1770193
- tests: Remove nested vm from tar liveimg kickstart test (bcl)
Related: rhbz#1770193
- tests: Use --http0.9 for curl ssh test (bcl)
Related: rhbz#1770193
- test: Boot the live-iso faster, and login using ssh key (bcl)
Related: rhbz#1770193
- tests: Split testing the image into a separate script (bcl)
Related: rhbz#1770193
- test: Split up the test class to allow booting other images (bcl)
Related: rhbz#1770193
- [tests] Collect compose logs after each build (atodorov)
Related: rhbz#1770193
- [tests] Use a function to wait for compose to finish (jikortus)
Related: rhbz#1770193
- [tests] Use functions for starting and stopping lorax-composer (atodorov)
Related: rhbz#1770193
- Update for differences from py3 in the backported code (bcl)
Related: rhbz#1718473
- Remove repos.git related tests (bcl)
Related: rhbz#1718473
- composer-cli: Update diff support for customizations and repos.git (bcl)
Related: rhbz#1718473
- Add support for customizations and repos.git to /blueprints/diff/ (bcl)
Related: rhbz#1718473
- tests: Update custom-base with customizations (bcl)
Related: rhbz#1718473
- Change customizations.firewall to append items instead of replace (bcl)
Related: rhbz#1718473
- Update customizations.services documentation (bcl)
Related: rhbz#1718473
- lorax-composer: Add services support to blueprints (bcl)
Related: rhbz#1718473
- lorax-composer: Add firewall support to blueprints (bcl)
Related: rhbz#1718473
- lorax-composer: Add locale support to blueprints (bcl)
Related: rhbz#1718473
- Update docs for new timezone section (bcl)
Related: rhbz#1718473
- lorax-composer: Add timezone support to blueprint (bcl)
Related: rhbz#1718473
- Proposal for adding to the blueprint customizations (bcl)
Related: rhbz#1718473
- tests: Document Azure setup (atodorov)
- tests: unskip Azure scenario (atodorov)
- Support CI testing against a bots project PR (martin)
- Makefile: Update bots target for moved GitHub project (sanne.raymaekers)
- tests: Add kickstart tar installation test (jikortus)
Related: rhbz#1733504
- tests: Increase test VM memory to 3 GB (jikortus)
Related: rhbz#1733504
- tests: add option to disable kernel command line parameters check (jikortus)
Related: rhbz#1733504
- tests: Use a loop to wait for VM and sshd to start (bcl)
Related: rhbz#1733504
- tests: Drop sort from compose types test (bcl)
Related: rhbz#1749802
- New test: assert toml files in git workspace (atodorov)
Related: rhbz#1749802
- Change paths for '/api/status' calls and skip this test (atodorov)
Related: rhbz#1698366
- Ignore Cockpit CI files when linting (atodorov)
Related: rhbz#1698366
- Use optional repository in Live ISO test (atodorov)
Related: rhbz#1698366
- Install test dependencies inside virtualenv (atodorov)
Related: rhbz#1698366
- Install python2-pip in the test VM and disable EPEL repo (atodorov)
Related: rhbz#1698366
- Use qemu-kvm in tests instead of qemu-system (atodorov)
Related: rhbz#1698366
- Skip AWS, Azure, qcow2 and live-iso tests (atodorov)
Related: rhbz#1698366
- Don't hard-code the path to toml-compare (atodorov)
Related: rhbz#1698366
- Install or remove packages in the test environment (atodorov)
Related: rhbz#1698366
- Install additional repositories for testing (atodorov)
Related: rhbz#1698366
- Prevent ssh asking for password when testing on interactive terminal (atodorov)
Related: rhbz#1704209
- Fail if number of excuted tests != number of dicovered tests (atodorov)
Related: rhbz#1698366
- Fix typo from test backport (atodorov)
Related: rhbz#1698366
- Use passwd --status for locked root account check (jikortus)
Related: rhbz#1687595
- Backport changes for Cockpit CI (atodorov)
Related: rhbz#1698366
* Mon Jun 24 2019 Brian C. Lane <bcl@redhat.com> 19.7.35-1
- test_compose_tar: Fix docker test (lars)
Related: rhbz#1720224
- tests: kill the qemu process name used to start it (bcl)
Related: rhbz#1710877
- Update local copy of lorax to current rhel7-branch (bcl)
Related: rhbz#1668520
Related: rhbz#1715116
Related: rhbz#1689314
- Update the lorax templates to match what lorax provides (bcl)
Related: rhbz#1689314
- Enable networking in lorax-composer templates (bcl)
Resolves: rhbz#1710877
* Thu Jun 13 2019 Brian C. Lane <bcl@redhat.com> 19.7.34-1
- [tests] Handle blueprints in setup_tests/teardown_tests correctly (atodorov)
Related: rhbz#1698366
- tests: Set BLUEPRINTS_DIR in all cases (lars)
Related: rhbz#1698366
- tests: Change the way how we remove pyOpenSSL (atodorov)
Related: rhbz#1715003
- Use a less strict regex for disabled root account check (jikortus)
Related: rhbz#1687595
- Add test for passing custom option on kernel command line (jikortus)
Related: rhbz#1688335
- Use verify_image function as a helper for generic tests (jikortus)
Related: rhbz#1704209
* Tue May 07 2019 Brian C. Lane <bcl@redhat.com> 19.7.33-1
- Pass ssl certificate options to anaconda (lars)
Resolves: rhbz#1701033
- Change [[modules]] to [[packages]] in tests (atodorov)
Related: rhbz#1698366
- Add new test to verify compose paths exist (atodorov)
Related: rhbz#1698366
- Add new sanity tests for blueprints (atodorov)
Related: rhbz#1698366
* Mon Apr 29 2019 Brian C. Lane <bcl@redhat.com> 19.7.32-1
- tests: Add a test for using [[customizations]] with [customizations.kernel] (bcl)
Related: rhbz#1688335
- lorax-composer: Fix customizations when creating a recipe (bcl)
Related: rhbz#1688335
* Mon Apr 29 2019 Brian C. Lane <bcl@redhat.com> 19.7.31-1
- Fixup print function usage with StringIO (bcl)
Related: rhbz#1688335
- lorax-composer: pass customization.kernel append to extra_boot_args (bcl)
Resolves: rhbz#1688335
- lorax-composer: Add the ability to append to the kernel command-line (bcl)
Related: rhbz#1688335
* Wed Apr 24 2019 Brian C. Lane <bcl@redhat.com> 19.7.30-1
- Add test for starting compose with deleted blueprint (jikortus)
Related: rhbz#1683442
- lorax-composer: Return UnknownBlueprint errors when using deleted blueprints (bcl)
Resolves: rhbz#1683442
- lorax-composer: Delete workspace copy when deleting blueprint (bcl)
Related: rhbz#1683442
- Use existing storage account (jstodola)
Related: rhbz#1673012
- Record date/time of VM creation (jstodola)
Related: rhbz#1673012
- Update datastore for VMware testing (chrobert)
Related: rhbz#1656105
- Fixes for locked root account test (jikortus)
Related: rhbz#1687595
- Add checks for disabled root account (jikortus)
Related: rhbz#1687595
- 'compose info' is 'compose details' on RHEL-7 (jikortus)
Related: rhbz#1687595
- Update some grammer issues in the test Bash scripts (chrobert)
Related: rhbz#1656105
- Update datastore for VMware testing (chrobert)
Related: rhbz#1656105
* Tue Mar 19 2019 Brian C. Lane <bcl@redhat.com> 19.7.29-1
- Allow overriding $CLI outside test scripts (atodorov)
Related: rhbz#1687595
- Use make ci inside test-in-copy target (atodorov)
Related: rhbz#1687595
- New test: Build live-iso and boot with KVM (atodorov)
Related: rhbz#1656105
- New test: Build qcow2 compose and test it with QEMU-KVM (atodorov)
Related: rhbz#1656105
- New test: Verify tar images with Docker and systemd-nspawn (atodorov)
Related: rhbz#1656105
- Update OpenStack flavor and network settings in tests (atodorov)
Related: rhbz#1656105
- Install ansible and openstacksdk inside virtualenv (atodorov)
Related: rhbz#1656105
- Remove python-requests, python-dateutil and pyOpenSSL (atodorov)
Related: rhbz#1656105
- Add /usr/local/bin to PATH for tests (atodorov) (atodorov)
- Do not generate journal.xml from beakerlib (atodorov)
Related: rhbz#1656105
- Expand parameters as separate words (jstodola) (jstodola)
* Mon Feb 25 2019 Brian C. Lane <bcl@redhat.com> 19.7.28-1
- lorax-composer: Check for STATUS before deleting (bcl)
Related: rhbz#1659129
- Check for existing CANCEL request, and exit on FINISHED (bcl)
Related: rhbz#1659129
- Add cancel_func to virt and novirt_install functions (bcl)
Resolves: rhbz#1659129
- Remove duplicate repositories from the sources list (bcl)
Resolves: rhbz#1664128
- Remove unneeded else from for/else loop. It confuses pylint (bcl)
Related: rhbz#1666517
- Allow customizations to be specified as a toml list (dshea)
Resolves: rhbz#1666517
- Make sure compose build tests run with SELinux in enforcing mode (jikortus)
Related: rhbz#1654795
- Add tests for metapackages and package name globs (bcl)
Related: rhbz#1641601
- Upgrade pip & setuptools b/c they are rather old (atodorov) (atodorov)
- Workaround openstacksdk dependency issue (atodorov) (atodorov)
- On Python 2 Azure needs the futures module (atodorov) (atodorov)
- On RHEL 7 we have Python 2, not Python 3 (atodorov) (atodorov)
- On RHEL 7 we have yum instead of dnf (atodorov) (atodorov)
- On RHEL 7 `compose info` is `compose details` (atodorov) (atodorov)
- Report an error if the blueprint doesn't exist (bcl) (bcl)
- Build the HTML docs before running tests (atodorov) (atodorov)
- Disable pylint errors with Flask and gevent (bcl) (bcl)
- Backport cloud image tests from master (atodorov) (atodorov)
- Fix compose_args for openstack image (bcl)
Related: rhbz#1656105
- Fix compose_args for vmdk image (bcl)
Related: rhbz#1656105
- Fix compose_args for vhd image (bcl)
Related: rhbz#1656105
- Fix compose_args for ami image (bcl)
Related: rhbz#1656105
- Update projects list to return only the unique projects (bcl)
Related: rhbz#1657055
- Change yaps_to_module to proj_to_module (bcl)
Related: rhbz#1657055
- lorax-composer: Handle packages with multiple builds (bcl)
Resolves: rhbz#1657055
- lorax-composer: Check the queue and results at startup (bcl)
Resolves: rhbz#1657054
- Add an openstack image type (bcl)
Resolves: rhbz#1656105
- Replace /etc/machine-id with an empty file (dshea)
Related: rhbz#1656105
- Add virt guest agents to the qcow2 compose (dshea)
Resolves: rhbz#1656105
- Add a vmdk compose type. (dshea)
Resolves: rhbz#1656105
- Add a vhd compose type for Azure images (dshea)
Resolves: rhbz#1656105
- Add an ami compose type for AWS images (dshea)
Resolves: rhbz#1656105
- Remove --fstype from the generated part line (dshea)
Related: rhbz#1656105
- lorax-composer: Install selinux-policy-targeted in images (bcl)
Resolves: rhbz#1654795
- Remove setfiles from mkrootfsimage (bcl)
Resolves: rhbz#1654795
- Remove SELinux Permissive checks (bcl)
Resolves: rhbz#1654795
* Mon Oct 22 2018 Brian C. Lane <bcl@redhat.com> 19.7.27-1
- Use matchPackageNames instead of searchNames (bcl)
Resolves: rhbz#1641601
* Mon Oct 08 2018 Brian C. Lane <bcl@redhat.com> 19.7.26-1
- Revert "Rename composer-cli to composer" (bcl)
Related: rhbz#1635760
* Fri Oct 05 2018 Brian C. Lane <bcl@redhat.com> 19.7.25-1
- Rename composer-cli to composer (lars)
Resolves: rhbz#1635760
* Mon Oct 01 2018 Brian C. Lane <bcl@redhat.com> 19.7.24-1
- Add a test for repo metadata expiration (bcl)
Related: rhbz#1632962
- Create a new YumBase object when repodata changes (bcl)
Resolves: rhbz#1632962
- Fix projects_depsolve_with_size version globbing (bcl)
Resolves: rhbz#1628114
- Add a version glob test forprojects_depsolve_with_size (bcl)
Resolves: rhbz#1628114
- Add tests for setting root password and ssh key with blueprints (bcl)
Related: rhbz#1626120
- Use rootpw for setting the root password instead of user (bcl)
Related: rhbz#1626120
- Lock the root account, except on live-iso (bcl)
Resolves: rhbz#1626120
* Wed Sep 19 2018 Brian C. Lane <bcl@redhat.com> 19.7.23-1
- Fix depsolve version globbing (bcl)
Resolves: rhbz#1628114
- Fix /compose/cancel API documentation (bcl)
* Mon Aug 27 2018 Brian C. Lane <bcl@redhat.com> 19.7.22-1
- Fix composer-cli blueprints changes to get correct total (bcl)
- Fix blueprints/list and blueprints/changes to return the correct total (bcl)
- Add tests for limit=0 routes (bcl)
- Add a function to get_url_json_unlimited to retrieve the total (bcl)
- Fix tests related to blueprint name changes (bcl)
- Add 'example' to the example blueprint names (bcl)
- Don't include glusterfs.toml as an example blueprint (bcl)
- Add a pylorax.api.version number (bcl)
- composer-cli should not log to a file by default (bcl)
- Add documentation for using a DVD as the package source (bcl)
- Set TCP listen backlog for API socket to SOMAXCONN (lars)
- Add a note about using lorax-composer.service (bcl)
- In composer-cli, request all results (dshea)
- Fix bash_completion.d typo (bcl)
- Fix a little bug in running "modules list". (clumens)
- Add tests for /compose/status filter arguments (dshea)
- Allow '*' as a uuid in /compose/status/<uuid> (dshea)
- Add filter arguments to /compose/status (dshea)
* Thu Aug 09 2018 Brian C. Lane <bcl@redhat.com> 19.7.21-1
- Move disklabel and UEFI support to compose.py (bcl)
- Fix more tests. (clumens)
- Change INVALID_NAME to INVALID_CHARS. (clumens)
- Update composer-cli for the new error return types. (clumens)
- Add default error IDs everywhere else. (clumens)
- Add error IDs to things that can go wrong when running a compose. (clumens)
- Add error IDs for common source-related errors. (clumens)
- Add error IDs for unknown modules and unknown projects. (clumens)
- Add error IDs for when an unknown commit is requested. (clumens)
- Add error IDs for when an unknown blueprint is requested. (clumens)
- Add error IDs for when an unknown build UUID is requested. (clumens)
- Add error IDs for bad state conditions. (clumens)
- Change the error return type for bad limit= and offset=. (clumens)
- Don't sort error messages. (clumens)
- Fix bash completion of compose info (bcl)
- Add + to the allowed API string character set (bcl)
- Add job_* timestamp support to compose status (bcl)
- Add a test for the pylorax.api.timestamp functions (bcl)
- Add etc/bash_completion.d/composer-cli (wwoods)
- composer-cli: clean up "list" commands (wwoods)
- Add input string checks to the branch and format arguments (bcl)
- Add a test for invalid characters in the API route (bcl)
- Return a JSON error instead of a 404 on certain malformed URLs. (clumens)
- Return an error if /modules/info doesn't return anything. (clumens)
- Update documentation (clumens).
Resolves: rhbz#409
- Use constants instead of strings (clumens).
Resolves: rhbz#409
- Write timestamps when important events happen during the compose (clumens).
Resolves: rhbz#409
- Return multiple timestamps in API results (clumens).
Resolves: rhbz#409
- Add a new timestamp.py file to the API directory (clumens).
Resolves: rhbz#409
- Run as root/weldr by default. (clumens)
- Use the first enabled system repo for the test (bcl)
- Show more details when the system repo delete test fails (bcl)
- Add composer-cli function tests (bcl)
- Add a test library (bcl)
- composer-cli: Add support for Group to blueprints diff (bcl)
- Adjust the tests so they will pass on CentOS7 and RHEL7 (bcl)
- Update status.py to use new handle_api_result (bcl)
- Update sources.py to use new handle_api_result (bcl)
- Update projects.py to use new handle_api_result (bcl)
- Update modules.py to use new handle_api_result (bcl)
- Update compose.py to use new handle_api_result (bcl)
- Update blueprints.py to use new handle_api_result (bcl)
- Modify handle_api_result so it can be used in more places (bcl)
- composer-cli: Fix non-zero epoch in projets info (bcl)
- Fix help output on the compose subcommand. (clumens)
- Add timestamps to "compose-cli compose status" output. (clumens)
- And then add real output to the status command. (clumens)
- Add the beginnings of a new status subcommand. (clumens)
* Fri Jul 20 2018 Brian C. Lane <bcl@redhat.com> 19.7.20-1
- Document that you shouldn't run lorax-composer twice. (clumens)
- Add PIDFile to the .service file. (clumens)
- Log and exit on metadata update errors at startup (bcl)
- Check /projects responses for null values. (bcl)
- Clarify error message from /source/new (bcl)
- Download metadata when updating or adding new repos (bcl)
* Fri Jul 13 2018 Brian C. Lane <bcl@redhat.com> 19.7.19-1
- Support loading groups from the kickstart template files. (clumens)
- Add group-based tests. (clumens)
- Include groups in depsolving. (clumens)
- Add support for groups to blueprints. (clumens)
- Check the compose templates at startup (bcl)
- List individual package install failures (bcl)
- lorax-composer: Update documentation (bcl)
- Add help output to each subcommand. (clumens)
- Split the help output into its own module. (clumens)
- If the help subcommand is given, print the help output. (clumens)
* Wed Jun 27 2018 Brian C. Lane <bcl@redhat.com> 19.7.18-1
- Only include some of the test blueprints (bcl)
- Include example blueprints in the rpm (bcl)
- Make sure /run/weldr has correct ownership and permissions (bcl)
* Wed Jun 20 2018 Brian C. Lane <bcl@redhat.com> 19.7.17-1
- new lorax-composer package built with tito
* Tue Jun 19 2018 Brian C. Lane <bcl@redhat.com> - 19.7.16-2
- New lorax-composer only package

View File

@ -1,576 +0,0 @@
%define debug_package %{nil}
Name: lorax
Version: 19.6
Release: 1%{?dist}
Summary: Tool for creating the anaconda install images
Group: Applications/System
License: GPLv2+
URL: http://git.fedorahosted.org/git/?p=lorax.git
Source0: https://fedorahosted.org/releases/l/o/%{name}/%{name}-%{version}.tar.gz
BuildRequires: python2-devel
Requires: GConf2
Requires: cpio
Requires: device-mapper
Requires: dosfstools
Requires: e2fsprogs
Requires: findutils
Requires: gawk
Requires: genisoimage
Requires: glib2
Requires: glibc
Requires: glibc-common
Requires: gzip
Requires: isomd5sum
Requires: libselinux-python
Requires: module-init-tools
Requires: parted
Requires: python-mako
Requires: squashfs-tools >= 4.2
Requires: util-linux
Requires: xz
Requires: yum
Requires: pykickstart
%if 0%{?fedora}
# Fedora specific deps
Requires: fedup-dracut
Requires: fedup-dracut-plymouth
%endif
%ifarch %{ix86} x86_64
Requires: syslinux >= 4.02-5
%endif
%ifarch ppc ppc64
Requires: kernel-bootwrapper
%endif
%ifarch s390 s390x
Requires: openssh
%endif
%description
Lorax is a tool for creating the anaconda install images.
It also includes livemedia-creator which is used to create bootable livemedia,
including live isos and disk images. It can use libvirtd for the install, or
Anaconda's image install feature.
%prep
%setup -q
%build
%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT mandir=%{_mandir} install
%files
%defattr(-,root,root,-)
%doc COPYING AUTHORS README.livemedia-creator
%{python_sitelib}/pylorax
%{python_sitelib}/*.egg-info
%{_sbindir}/lorax
%{_sbindir}/mkefiboot
%{_sbindir}/livemedia-creator
%dir %{_sysconfdir}/lorax
%config(noreplace) %{_sysconfdir}/lorax/lorax.conf
%dir %{_datadir}/lorax
%{_datadir}/lorax/*
%{_mandir}/man1/*.1*
%changelog
* Fri Jul 26 2013 Brian C. Lane <bcl@redhat.com> 19.6-1
- Add manpage for lorax (bcl@redhat.com)
- Add manpage for livemedia-creator (bcl@redhat.com)
- livemedia-creator: pass inst.cmdline for headless installs (#985487)
(bcl@redhat.com)
- Stop using /usr/bin/env (#987028) (bcl@redhat.com)
- livemedia-creator: clarify required package errors (#985340) (bcl@redhat.com)
- Include device-mapper-persistent-data in images for thinp support.
(dlehman@redhat.com)
* Thu Jun 13 2013 Brian C. Lane <bcl@redhat.com> 19.5-1
- Let sshd decide which keys to create (#971856) (bcl@redhat.com)
- Don't remove thbrk.tri (#886250) (bcl@redhat.com)
- Switch from xorg-x11-fonts-ethiopic to sil-abyssinica-fonts (#875664)
(bcl@redhat.com)
- Make ignoring yum_lock messages in anaconda easier. (clumens@redhat.com)
- Bump image size up to 2G (#967556) (bcl@redhat.com)
- livemedia-creator: Fix logic for anaconda test (#958036) (bcl@redhat.com)
* Tue May 21 2013 Brian C. Lane <bcl@redhat.com> 19.4-1
- Add command for opening anaconda log file to history (mkolman@gmail.com)
- Do not install chrony and rdate explicitly (vpodzime@redhat.com)
* Mon Apr 29 2013 Brian C. Lane <bcl@redhat.com> 19.3-1
- Remove /var/log/journal so journald won't write to overlay
(wwoods@redhat.com)
- Leave /etc/os-release in the initrd (#956241) (bcl@redhat.com)
- no standalone modutils package (dan@danny.cz)
- remove no longer supported arm kernel variants add the new lpae one
(dennis@ausil.us)
- livemedia-creator: Update example kickstarts (bcl@redhat.com)
- livemedia-creator: Ignore rescue kernels (bcl@redhat.com)
* Mon Apr 15 2013 Brian C. Lane <bcl@redhat.com> 19.2-1
- Let devices get detected and started automatically. (dlehman@redhat.com)
- Fix import of version (bcl@redhat.com)
- fix version query and add one to the log file (hamzy@us.ibm.com)
- Do not remove files required by tools from the s390utils-base package.
(jstodola@redhat.com)
* Tue Mar 19 2013 Brian C. Lane <bcl@redhat.com> 19.1-1
- Print & log messages on scriptlet/transaction errors (wwoods@redhat.com)
- sysutils: add -x to cp in linktree (wwoods@redhat.com)
- treebuilder: fix "Can't stat exclude path "/selinux"..." message
(wwoods@redhat.com)
- runtime: install dracut-{nohostonly,norescue} (wwoods@redhat.com)
- runtime-install: install shim-unsigned (wwoods@redhat.com)
- Add explicit install of net-tools (#921619) (bcl@redhat.com)
- Don't remove hmac files for ssh and sshd (#882153) (bcl@redhat.com)
- Raise an error when there are no initrds (bcl@redhat.com)
- Add yum logging to yum.log (bcl@redhat.com)
- remove sparc support (dennis@ausil.us)
- Change Makefile to produce .tgz (bcl@redhat.com)
* Thu Feb 28 2013 Brian C. Lane <bcl@redhat.com> 19.0-1
- New Version 19.0
- Remove some env variables (#907692) (bcl@redhat.com)
- Make sure tmpfs is enabled (#908253) (bcl@redhat.com)
* Tue Feb 12 2013 Brian C. Lane <bcl@redhat.com> 18.31-1
- add syslinux and ssm (bcl@redhat.com)
- Add filesystem image install support (bcl@redhat.com)
* Thu Jan 31 2013 Brian C. Lane <bcl@redhat.com> 18.30-1
- yum changed the callback info (bcl@redhat.com)
- tigervnc-server-module depends on Xorg, which doesn't exist on s390x
(dan@danny.cz)
- tools not existing on s390x (dan@danny.cz)
- specspo is dead for a long time (dan@danny.cz)
- no Xorg on s390x (dan@danny.cz)
- Make boot configs consistent. (dmach@redhat.com)
- Dynamically generate the list of installed platforms for .treeinfo
(dmarlin@redhat.com)
- Add a U-Boot wrapped image of 'upgrade.img'. (dmarlin@redhat.com)
- Add trigger for Anaconda's exception handling to bash_history
(vpodzime@redhat.com)
- livemedia-creator: update example kickstarts (bcl@redhat.com)
- livemedia-creator: don't pass console=ttyS0 (bcl@redhat.com)
- Fix gcdx64.efi path to work for other distros than Fedora. (dmach@redhat.com)
* Thu Dec 20 2012 Martin Gracik <mgracik@redhat.com> 18.29-1
- Do not remove gtk3 share files (mgracik@redhat.com)
* Wed Dec 19 2012 Martin Gracik <mgracik@redhat.com> 18.28-1
- Fix rexists (mgracik@redhat.com)
- Several 'doupgrade' fixes in the x86 template. (dmach@redhat.com)
- Missing semicolon (mgracik@redhat.com)
* Tue Dec 18 2012 Martin Gracik <mgracik@redhat.com> 18.27-1
- Only run installupgradeinitrd if upgrade on s390x (mgracik@redhat.com)
* Tue Dec 18 2012 Martin Gracik <mgracik@redhat.com> 18.26-1
- Only run installupgradeinitrd if upgrade (mgracik@redhat.com)
* Tue Dec 18 2012 Martin Gracik <mgracik@redhat.com> 18.25-1
- Add --noupgrade option (mgracik@redhat.com)
- Require fedup-dracut* only on Fedora. (dmach@redhat.com)
* Fri Dec 14 2012 Brian C. Lane <bcl@redhat.com> 18.24-1
- imgutils: use -s for kpartx, wait for device creation (bcl@redhat.com)
- livemedia-creator: Use SELinux Permissive mode (bcl@redhat.com)
- livemedia-creator: use cmdline mode (bcl@redhat.com)
- use correct variable for upgrade image on s390 (dan@danny.cz)
- only ix86/x86_64 and ppc/ppc64 need grub2 (dan@danny.cz)
- no mount (sub-)package since RHEL-2 (dan@danny.cz)
- Correct argument to installupgradeinitrd. (dmarlin@redhat.com)
- Added fedup requires to spec (bcl@redhat.com)
* Wed Dec 05 2012 Brian C. Lane <bcl@redhat.com> 18.23-1
- remove multipath rules (#880263) (bcl@redhat.com)
- add installupgradeinitrd function and use it to install the upgrade initrds
(dennis@ausil.us)
- use installinitrd to install the upgrade.img initramfs so that we get correct
permissions (dennis@ausil.us)
- ppc and arm need to use kernel.upgrade not kernel.upgrader (dennis@ausil.us)
- remove upgrade from the sparc and sysylinux config templates
(dennis@ausil.us)
- Add the 'fedup' plymouth theme if available (wwoods@redhat.com)
- make templates install upgrade.img (wwoods@redhat.com)
- build fedup upgrade.img (wwoods@redhat.com)
- treebuilder: improve findkernels() initrd search (wwoods@redhat.com)
- treebuilder: add 'prefix' to rebuild_initrds() (wwoods@redhat.com)
- Add thai-scalable-waree-fonts (#872468) (mgracik@redhat.com)
- Do not remove the fipscheck package (#882153) (mgracik@redhat.com)
- Add MokManager.efi to EFI/BOOT (#882101) (mgracik@redhat.com)
* Tue Nov 06 2012 Brian C. Lane <bcl@redhat.com> 18.22-1
- Install the yum-langpacks plugin (#868869) (jkeating@redhat.com)
- perl is required by some low-level tools on s390x (#868824) (dan@danny.cz)
* Thu Oct 11 2012 Brian C. Lane <bcl@redhat.com> 18.21-1
- Change the install user's shell for tmux (jkeating@redhat.com)
- Set permissions on the initrd (#863018) (mgracik@redhat.com)
- Remove the default word from boot menu (#848676) (mgracik@redhat.com)
- Disable a whole bunch more keyboard shortcuts (#863823). (clumens@redhat.com)
- use /var/tmp instead of /tmp (bcl@redhat.com)
- remove rv from unmount error log (bcl@redhat.com)
* Wed Sep 19 2012 Brian C. Lane <bcl@redhat.com> 18.20-1
- Remove grub 0.97 splash (bcl@redhat.com)
- livemedia-creator: use rd.live.image instead of liveimg (bcl@redhat.com)
* Mon Sep 17 2012 Brian C. Lane <bcl@redhat.com> 18.19-1
- There's no lang-table in anaconda anymore (#857925) (mgracik@redhat.com)
- add convienience functions for running commands (bcl@redhat.com)
- restore CalledProcessError handling (bcl@redhat.com)
- add CalledProcessError to execWith* functions (bcl@redhat.com)
- live uses root not inst.stage2 (bcl@redhat.com)
- Revert "X needs the DRI drivers" (#855289) (bcl@redhat.com)
* Fri Sep 07 2012 Brian C. Lane <bcl@redhat.com> 18.18-1
- Keep the dracut-lib.sh around for runtime (#851362) (jkeating@redhat.com)
- X needs the DRI drivers (#855289) (bcl@redhat.com)
* Fri Aug 31 2012 Brian C. Lane <bcl@redhat.com> 18.17-1
- use inst.stage2=hd:LABEL (#848641) (bcl@redhat.com)
- Disable the maximize/unmaximize key bindings (#853410). (clumens@redhat.com)
* Thu Aug 30 2012 Brian C. Lane <bcl@redhat.com> 18.16-1
- Revert "Mask the tmp.mount service to avoid tmpfs" (jkeating@redhat.com)
* Thu Aug 23 2012 Brian C. Lane <bcl@redhat.com> 18.15-1
- change grub-cd.efi to gcdx64.efi (#851326) (bcl@redhat.com)
- use wildcard for product path to efi binaries (#851196) (bcl@redhat.com)
- Add yum-plugin-fastestmirror (#849797) (bcl@redhat.com)
- livemedia-creator: update templates for grub2-efi support (bcl@redhat.com)
- imgutils: fix umount retry handling (bcl@redhat.com)
- livemedia-creator: use stage2 instead of root (bcl@redhat.com)
- livemedia-creator: add location option (bcl@redhat.com)
- nm-connection-editor was moved to separate package (#849056)
(rvykydal@redhat.com)
* Thu Aug 16 2012 Brian C. Lane <bcl@redhat.com> 18.14-1
- remove cleanup of some essential libraries (bcl@redhat.com)
- Mask the tmp.mount service to avoid tmpfs (jkeating@redhat.com)
* Wed Aug 15 2012 Brian C. Lane <bcl@redhat.com> 18.13-1
- Add a command line option to override the ARM platform. (dmarlin@redhat.com)
- Don't remove krb5-libs (#848227) (mgracik@redhat.com)
- Add grub2-efi support and Secure Boot shim support. (pjones@redhat.com)
- Fix GPT code to allocate space for /2/ tables. (pjones@redhat.com)
- Add platforms to the treeinfo for Beaker support. (dmarlin@redhat.com)
- add logging to lorax (bcl@redhat.com)
- move live templates into their own subdir of share (bcl@redhat.com)
- clean up command execution (bcl@redhat.com)
- livemedia-creator: cleanup logging a bit (bcl@redhat.com)
* Wed Jul 25 2012 Martin Gracik <mgracik@redhat.com> 18.12-1
- Add 'mvebu' to list of recognized ARM kernels. (dmarlin@redhat.com)
- Cleanup boot menus (#809663) (mgracik@redhat.com)
- Don't remove chvt from the install image (#838554) (mgracik@redhat.com)
- Add llvm-libs (#826351) (mgracik@redhat.com)
* Fri Jul 20 2012 Brian C. Lane <bcl@redhat.com> 18.11-1
- livemedia-creator: add some error checking (bcl@redhat.com)
* Tue Jul 10 2012 Martin Gracik <mgracik@redhat.com> 18.10-1
- Don't set a root= argument (wwoods@redhat.com)
Resolves: rhbz#837208
- Don't remove the id tool (mgracik@redhat.com)
Resolves: rhbz#836493
- Xauth is in bin (mgracik@redhat.com)
Resolves: rhbz#837317
- Actually add plymouth to the initramfs (wwoods@redhat.com)
- don't use --prefix with dracut anymore (wwoods@redhat.com)
- newui requires checkisomd5 to run media check. (clumens@redhat.com)
* Thu Jun 21 2012 Martin Gracik <mgracik@redhat.com> 18.9-1
- Add initial support for ARM based systems (dmarlin) (mgracik@redhat.com)
- Add plymouth to the installer runtime (wwoods@redhat.com)
- add 'systemctl' command and use it in postinstall (wwoods@redhat.com)
- add dracut-shutdown.service (and its dependencies) (wwoods@redhat.com)
- leave pregenerated locale files (save RAM) (wwoods@redhat.com)
- runtime-cleanup: log broken symlinks being removed (wwoods@redhat.com)
- Add some documentation to LoraxTemplateRunner (wwoods@redhat.com)
- fix '-runcmd' and improve logging (wwoods@redhat.com)
- mkefiboot: add --debug (wwoods@redhat.com)
- pylorax.imgutils: add retry loop and "lazy" to umount() (wwoods@redhat.com)
- pylorax.imgutils: add debug logging (wwoods@redhat.com)
- pylorax: set up logging as recommended by logging module (wwoods@redhat.com)
- remove dmidecode (wwoods@redhat.com)
- clean up net-tools properly (wwoods@redhat.com)
- runtime-cleanup: correctly clean up kbd (wwoods@redhat.com)
- runtime-cleanup: correctly clean up iproute (wwoods@redhat.com)
- runtime-cleanup: drop a bunch of do-nothing removals (wwoods@redhat.com)
- Create missing /etc/fstab (wwoods@redhat.com)
- Fix systemd unit cleanup in runtime-postinstall (wwoods@redhat.com)
- Disable Alt+Tab in metacity (mgracik@redhat.com)
- Add pollcdrom module to dracut (bcl@redhat.com)
* Wed Jun 06 2012 Martin Gracik <mgracik@redhat.com> 18.8-1
- Check if selinux is enabled before getting the mode (mgracik@redhat.com)
- Add grub2 so that rescue is more useful (bcl@redhat.com)
* Mon Jun 04 2012 Martin Gracik <mgracik@redhat.com> 18.7-1
- Comment on why selinux needs to be in permissive or disabled
(mgracik@redhat.com)
- Verify the yum transaction (mgracik@redhat.com)
- Do not remove shared-mime-info (#825960) (mgracik@redhat.com)
- Add a --required switch to installpkg (mgracik@redhat.com)
- livemedia-creator: Hook up arch option (bcl@redhat.com)
- livemedia-creator: Add appliance creation (bcl@redhat.com)
- livemedia-creator: handle failed mount for ami (bcl@redhat.com)
* Fri Jun 01 2012 Martin Gracik <mgracik@redhat.com> 18.6-1
- Fix the rpm call (mgracik@redhat.com)
- Use selinux python module to get enforcing mode (mgracik@redhat.com)
* Thu May 31 2012 Martin Gracik <mgracik@redhat.com> 18.5-1
- Don't remove sha256sum from the install image (mgracik@redhat.com)
- Check if selinux is not in Enforcing mode (#824835) (mgracik@redhat.com)
- Install rpcbind (#824835) (mgracik@redhat.com)
- Remove hfsplus-tools dependency (#818913) (mgracik@redhat.com)
- Copy mapping and magic to BOOTDIR on ppc (#815550) (mgracik@redhat.com)
- Automatic commit of package [lorax] release [18.4-1]. (mgracik@redhat.com)
* Fri May 25 2012 Martin Gracik <mgracik@redhat.com> 18.4-1
- Initialized to use tito.
- Use gz not bz2 for source
- remove 'loadkeys' stub (#804306)
- add name field to .treeinfo its a concatination of family and version
- Fix typo in help (#819476)
- include the new cmsfs-fuse interface
- linuxrc.s390 is dead in anaconda
- Add the ppc magic file
- Install proper branding packages from repo (#813969)
- Use --mac for isohybrid only if doing macboot images
- Add --nomacboot option
- Add packages needed for NTP functionality in the installer
- livemedia-creator: check kickstart for display modes (#819660)
- livemedia-creator: Removed unused ImageMount class
- livemedia-creator: cleanup after a crash
- livemedia-creator: start using /var/tmp instead of /tmp
- livemedia-creator: make libvirt module optional
- stop moving /run (#818918)
* Thu May 03 2012 Brian C. Lane <bcl@redhat.com> 18.3-1
- Added BCM4331 firmware (#817151) (mgracik)
- mkefiboot: Add support for disk label files (mjg)
- Add 'tmux' to runtime image (wwoods)
- Add /etc/sysctl.d/anaconda.conf, set kernel.printk=1 (#816022) (wwoods)
- reduce image size from 2GB to 1GB (wwoods)
- keep all filesystem tools (wwoods)
- Leave some of the grub2 utilities in the install image (#749323) (mgracik)
- add media check menu option (bcl)
- remove unneeded dracut bootargs (bcl)
- mkefiboot: Copy Mac bootloader, rather than linking it (mjg)
- Remove workdir if it was created by lorax (#807964) (mgracik)
- add gdisk to install image (#811083) (bcl)
- Don't use --allbut for xfsprogs cleanup (#804779) (mgracik)
- Log all removed files (mgracik)
- Add spice-vdagent to initrd (#804739) (mgracik)
- Add ntfs-3g to initrd (#804302) (mgracik)
- ntfs-3g now uses /usr/lib (#810039) (bcl)
* Fri Mar 30 2012 Brian C. Lane <bcl@redhat.com> 18.2-1
- Merge noloader commits from f17-branch (bcl)
- mkefiboot: Make Apple boot images appear in the startup preferences (mjg)
- add symlink from /mnt/install -> /run/install (wwoods)
- Don't trash all the initscripts 'fedora*' services (wwoods)
- remove anaconda-copy-ks.sh (wwoods)
- add anaconda dracut module (wwoods)
- runtime-postinstall: remove references to loader (wwoods)
- runtime-postinstall: remove keymap stuff (wwoods)
- Add the icfg package (#771733) (mgracik)
- Log the output of mkfs (#769928) (mgracik)
- Fix product name replacing in templates (#799919) (mgracik)
- Fix requires (mgracik)
- use cache outside the installtree (bcl)
- add iscsi-initiator-utils (#804522) (bcl)
- livemedia-creator: update TreeBuilder use for isolabel (bcl)
* Tue Mar 06 2012 Brian C. Lane <bcl@redhat.com> 18.1-1
- livemedia-creator: update README (bcl)
- example livemedia kickstart for ec2 (bcl)
- livemedia-creator: console=ttyS0 not /dev/ttyS0 (bcl)
- livemedia-creator: Add support for making ami images (bcl)
- Don't remove btrfs utils (#796511) (mgracik)
- Remove root and ip parameters from generic.prm (#796572) (mgracik)
- Check if the volume id is not longer than 32 chars (#786832) (mgracik)
- Add option to specify volume id on command line (#786834) (mgracik)
- Install nhn-nanum-gothic-fonts (#790266) (mgracik)
- Change the locale to C (#786833) (mgracik)
- iputils is small and required by dhclient-script (bcl)
- util-linux-ng is now util-linux (bcl)
* Mon Feb 20 2012 Brian C. Lane <bcl@redhat.com> 18.0-1
- use --prefix=/run/initramfs when building initramfs (wwoods)
- dhclient-script needs cut and arping (bcl)
- Fix missing CalledProcessError import (bcl)
- metacity now depends on gsettings-desktop-schemas (bcl)
- Add findiso to grub config (mjg)
- add memtest to the boot.iso for x86 (#787234) (bcl)
- Don't use mk-s390-cdboot (dhorak) (mgracik)
- Add dracut args to grub.conf (bcl)
- Change the squashfs image section in .treeinfo (mgracik)
- Add path to squashfs image to the treeinfo (mgracik)
- Add runtime basename variable to the template (mgracik)
- use internal implementation of the addrsize utility (dan)
- Make sure var/run is not a symlink on s390x (#787217) (mgracik)
- Create var/run/dbus directory on s390x (#787217) (mgracik)
* Wed Feb 08 2012 Brian C. Lane <bcl@redhat.com> 17.3-1
- keep convertfs.sh script in image (#787893) (bcl)
- Add dracut convertfs module (#787893) (bcl)
- fix templates to work with F17 usrmove (tflink)
- changing hfs to hfsplus so that the correct mkfs binary is called (tflink)
- Add luks, md and dm dracut args to bootloaders (bcl)
- update lorax and livemedia_creator to use isfinal (bcl)
- lorax: copy kickstarts into sysroot (#743135) (bcl)
- livemedia-creator: Mount iso if rootfs is LiveOS (bcl)
- Log output of failed command (mgracik)
- Add packages required for gtk3 and the new anaconda UI. (clumens)
* Thu Jan 12 2012 Martin Gracik <mgracik@redhat.com> 17.2-1
- Allow specifying buildarch on the command line (#771382) (mgracik)
- lorax: Don't touch /etc/mtab in cleanup (bcl)
- Update TODO and POLICY to reflect the current state of things (wwoods)
- consider %ghost files part of the filelists in templates (wwoods)
- lorax: Add option to exclude packages (bcl)
- dracut needs kbd directories (#769932) (bcl)
- better debug, handle relative output paths (bcl)
* Wed Dec 21 2011 Brian C. Lane <bcl@redhat.com> 17.1-1
- lorax: check for output directory early and quit (bcl)
- lorax: Add --proxy command (bcl)
- lorax: add --config option (bcl)
- Modify spec file for livemedia-creator (bcl)
- Add no-virt mode to livemedia-creator (bcl)
- Add livemedia-creator README and example ks (bcl)
- Add config files for live media (bcl)
- Add livemedia-creator (bcl)
- Allow a None to be passed as size to create_runtime (bcl)
- Add execWith utils from anaconda (bcl)
- Changes needed for livecd creation (bcl)
- dracut has moved to /usr/bin (bcl)
* Mon Oct 21 2011 Will Woods <wwoods@redhat.com> 17.0-1
- Merges the 'treebuilder' branch of lorax
- images are split into two parts again (initrd.img, LiveOS/squashfs.img)
- base memory use reduced to ~200M (was ~550M in F15, ~320MB in F16)
- initrd.img is now built by dracut
- booting now requires correct "root=live:..." argument
- boot.iso is EFI hybrid capable (copy iso to USB stick, boot from EFI)
- Better support for Apple EFI (now with custom boot icon!)
- new syslinux config (#734170)
- add fpaste to installer environment (#727842)
- rsyslog.conf: hardcode hostname for virtio forwarding (#744544)
- Use a predictable ISO Volume Label (#732298)
- syslinux-vesa-splash changed filename (#739345)
- don't create /etc/sysconfig/network (#733425)
- xauth and libXmu are needed for ssh -X (#731046)
- add libreport plugins (#729537), clean up libreport
- keep nss certs for libreport (#730438)
- keep ModemManager (#727946)
- keep vmmouse binaries (#723831)
- change isbeta to isfinal, default to isFinal=False (#723901)
- use pungi's installroot rather than making our own (#722481)
- keep ntfsresize around (#722711)
- replace cjkuni-uming-fonts with wqy-microhei-fonts (#709962)
- install all firmware packages (#703291, #705392)
- keep libmodman and libproxy (#701622)
- write the lorax verion in the .buildstamp (#689697)
- disable rsyslogd rate limiting on imuxsock (#696943)
- disable debuginfo package
* Wed Apr 13 2011 Martin Gracik <mgracik@redhat.com> 0.5-1
- Remove pungi patch
- Remove pseudo code
- Add a /bin/login shim for use only in the installation environment.
- Set the hostname from a config file, not programmatically.
- Add systemd and agetty to the installation environment.
- Specify "cpio -H newc" instead of "cpio -c".
- Provide shutdown on s390x (#694518)
- Fix arch specific requires in spec file
- Add s390 modules and do some cleanup of the template
- Generate ssh keys on s390
- Don't remove tr, needed for s390
- Do not check if we have all commands
- Change location of addrsize and mk-s390-cdboot
- Shutdown is in another location
- Do not skip broken packages
- Don't install network-manager-netbook
- Wait for subprocess to finish
- Have to call os.makedirs
- images dir already exists, we just need to set it
- Do not remove libassuan.
- The biarch is a function not an attribute
- Create images directory in outputtree
- Use gzip on ppc initrd
- Create efibootdir if doing efi images
- Get rid of create_gconf().
- gconf/metacity: have only one workspace.
- Add yum-langpacks yum plugin to anaconda environment (notting)
- Replace variables in yaboot.conf
- Add sparc specific packages
- Skip keymap creation on s390
- Copy shutdown and linuxrc.s390 on s390
- Add packages for s390
- Add support for sparc
- Use factory to get the image classes
- treeinfo has to be addressed as self.treeinfo
- Add support for s390
- Add the xen section to treeinfo on x86_64
- Fix magic and mapping paths
- Fix passing of prepboot and macboot arguments
- Small ppc fixes
- Check if the file we want to remove exists
- Install x86 specific packages only on x86
- Change the location of zImage.lds
- Added ppc specific packages
- memtest and efika.forth are in /boot
- Add support for ppc
- Minor sparc pseudo code changes
- Added sparc pseudo code (dgilmore)
- Added s390 and x86 pseudo code
- Added ppc pseudo code
* Mon Mar 14 2011 Martin Gracik <mgracik@redhat.com> 0.4-1
- Add the images-xen section to treeinfo on x86_64
- Print a message when no arguments given (#684463)
- Mako template returns unicode strings (#681003)
- The check option in options causes ValueError
- Disable all ctrl-alt-arrow metacity shortcuts
- Remove the locale-archive explicitly
- Use xz when compressing the initrd
- Keep the source files for locales and get rid of the binary form
- Add /sbin to $PATH (for the tty2 terminal)
- Create /var/run/dbus directory in installtree
- Add mkdir support to template
- gpart is present only on i386 arch (#672611)
- util-linux-ng changed to util-linux
* Mon Jan 24 2011 Martin Gracik <mgracik@redhat.com> 0.3-1
- Don't remove libmount package
- Don't create mtab symlink, already exists
- Exit with error if we have no lang-table
- Fix file logging
- Overwrite the /etc/shadow file
- Use [images-xen] section for PAE and xen kernels
* Fri Jan 14 2011 Martin Gracik <mgracik@redhat.com> 0.2-2
- Fix the gnome themes
- Add biosdevname package
- Edit .bash_history file
- Add the initrd and kernel lines to .treeinfo
- Don't remove the gamin package from installtree
* Wed Dec 01 2010 Martin Gracik <mgracik@redhat.com> 0.1-1
- First packaging of the new lorax tool.

View File

@ -0,0 +1,3 @@
from lorax_tito.tagger import LoraxRHELTagger
__all__ = ['LoraxRHELTagger']

View File

@ -0,0 +1,118 @@
import re
from tito.common import run_command
from tito.tagger import VersionTagger
class LoraxRHELTagger(VersionTagger):
"""
Tagger which is based on ReleaseTagger and use Red Hat Enterprise Linux
format of Changelog:
- description
Resolves/Related: rhbz#1111
Used for:
- Red Hat Enterprise Linux
If you want it put in tito.pros:
[buildconfig]
tagger = lorax_tito.LoraxRHELTagger
"""
def _getCommitDetail(self, commit, field):
""" Get specific details about the commit using git log format field specifiers.
"""
command = ['git', 'log', '-1', "--pretty=format:%s" % field, commit]
output = run_command(" ".join(command))
ret = output.strip('\n').split('\n')
if len(ret) == 1 and ret[0].find('@') != -1:
ret = [ret[0].split('@')[0]]
elif len(ret) == 1:
ret = [ret[0]]
else:
ret = [x for x in ret if x != '']
return ret
def _generate_default_changelog(self, last_tag):
"""
Run git-log and will generate changelog, which still can be edited by user
in _make_changelog.
use format:
- description
Resolves/Related: rhbz#1111
"""
patch_command = "git log --pretty=oneline --relative %s..%s -- %s" % (last_tag, "HEAD", ".")
output = filter(lambda x: x.find('l10n: ') != 41 and \
x.find('Merge commit') != 41 and \
x.find('Merge branch') != 41,
run_command(patch_command).strip('\n').split('\n'))
rpm_log = []
for line in output:
if not line:
continue
rhbz = set()
commit = line.split(' ')[0]
summary = self._getCommitDetail(commit, "%s")[0]
body = self._getCommitDetail(commit, "%b")
author = self._getCommitDetail(commit, "%aE")[0]
# prepend Related/Resolves if subject contains BZ number
m = re.search(r"\(#\d+(\,.*)*\)", summary)
if m:
fullbug = summary[m.start():m.end()]
bugstr = summary[m.start()+2:m.end()-1]
bug = ''
for c in bugstr:
if c.isdigit():
bug += c
else:
break
if len(bugstr) > len(bug):
tmp = bugstr[len(bug):]
for c in tmp:
if not c.isalpha():
tmp = tmp[1:]
else:
break
if len(tmp) > 0:
author = tmp
summary = summary.replace(fullbug, "(%s)" % author)
rhbz.add("Resolves: rhbz#%s" % bug)
summary_bug = bug
else:
summary = summary.strip()
summary += " (%s)" % author
summary_bug = None
for bodyline in body:
m = re.match(r"^(Resolves|Related|Conflicts):\ +rhbz#\d+.*$", bodyline)
if not m:
continue
actionre = re.search("(Resolves|Related|Conflicts)", bodyline)
bugre = re.search(r"\d+", bodyline)
if actionre and bugre:
action = actionre.group()
bug = bugre.group()
rhbz.add("%s: rhbz#%s" % (action, bug))
# Remove the summary bug's Resolves action if it is for the same bug
if action != 'Resolves':
summary_str = "Resolves: rhbz#%s" % summary_bug
if summary_bug and bug == summary_bug and summary_str in rhbz:
rhbz.remove(summary_str)
if rhbz:
rpm_log.append("%s\n%s" %(summary.strip(),"\n".join(rhbz)))
else:
rpm_log.append("%s (%s)" % (summary.strip(), author))
return "\n".join(rpm_log)

View File

@ -1 +0,0 @@
19.6-1 /

View File

@ -0,0 +1 @@
19.7.43-1 ./

View File

@ -1,5 +1,6 @@
[globalconfig] [buildconfig]
default_builder = tito.builder.Builder builder = tito.builder.Builder
default_tagger = tito.tagger.VersionTagger tagger = lorax_tito.LoraxRHELTagger
changelog_do_not_remove_cherrypick = 0 changelog_do_not_remove_cherrypick = 0
changelog_format = %s (%ae) changelog_format = %s (%ae)
lib_dir = ./rel-eng/

View File

@ -1,13 +1,16 @@
#!/usr/bin/python #!/usr/bin/python
from distutils.core import setup from distutils.core import setup
from glob import glob
import os import os
import sys import sys
# config file # config file
data_files = [("/etc/lorax", ["etc/lorax.conf"])] data_files = [("/etc/lorax", ["etc/lorax.conf"]),
("/etc/lorax", ["etc/composer.conf"]),
("/usr/lib/systemd/system", ["systemd/lorax-composer.service",
"systemd/lorax-composer.socket"]),
("/usr/lib/tmpfiles.d/", ["systemd/lorax-composer.conf"])]
# shared files # shared files
for root, dnames, fnames in os.walk("share"): for root, dnames, fnames in os.walk("share"):
@ -17,7 +20,10 @@ for root, dnames, fnames in os.walk("share"):
# executable # executable
data_files.append(("/usr/sbin", ["src/sbin/lorax", "src/sbin/mkefiboot", data_files.append(("/usr/sbin", ["src/sbin/lorax", "src/sbin/mkefiboot",
"src/sbin/livemedia-creator"])) "src/sbin/livemedia-creator", "src/sbin/lorax-composer"]))
data_files.append(("/usr/bin", ["src/bin/image-minimizer",
"src/bin/mk-s390-cdboot",
"src/bin/composer-cli"]))
# get the version # get the version
sys.path.insert(0, "src") sys.path.insert(0, "src")
@ -34,13 +40,13 @@ finally:
setup(name="lorax", setup(name="lorax",
version=vernum, version=vernum,
description="Lorax", description="Lorax",
long_description="", long_description="Tools for creating bootable images, including the Anaconda boot.iso",
author="Martin Gracik", author="Brian C. Lane, Will Woods, Martin Gracik",
author_email="mgracik@redhat.com", author_email="bcl@redhat.com",
url="http://", url="https://rhinstaller.github.io/lorax/",
download_url="http://", download_url="https://github.com/rhinstaller/lorax/releases",
license="GPLv2+", license="GPLv2+",
packages=["pylorax"], packages=["pylorax", "pylorax.api", "composer", "composer.cli"],
package_dir={"" : "src"}, package_dir={"" : "src"},
data_files=data_files data_files=data_files
) )

63
share/aarch64.tmpl Normal file
View File

@ -0,0 +1,63 @@
<%page args="kernels, runtime_img, basearch, outroot, product, isolabel"/>
<%
configdir="tmp/config_files/aarch64"
PXEBOOTDIR="images/pxeboot"
KERNELDIR=PXEBOOTDIR
LIVEDIR="LiveOS"
LORAXDIR="usr/share/lorax/"
%>
mkdir ${LIVEDIR}
install ${runtime_img} ${LIVEDIR}/squashfs.img
treeinfo stage2 mainimage ${LIVEDIR}/squashfs.img
## install kernels
mkdir ${KERNELDIR}
%for kernel in kernels:
## normal aarch64
installkernel images-${basearch} ${kernel.path} ${KERNELDIR}/vmlinuz
installinitrd images-${basearch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img
%if doupgrade:
installupgradeinitrd images-${basearch} ${kernel.upgrade.path} ${KERNELDIR}/upgrade.img
%endif
%endfor
#FIXME: this will need adjusted when we have a real bootloader.
## WHeeeeeeee, EFI.
## We could remove the basearch restriction someday..
<% efiargs=""; efigraft="" %>
%if exists("boot/efi/EFI/*/gcdaa64.efi"):
<%
efiarch = 'AA64'
efigraft="EFI/BOOT={0}/EFI/BOOT".format(outroot)
images = ["images/efiboot.img"]
for img in images:
efiargs += " -eltorito-alt-boot -e {0} -no-emul-boot".format(img)
efigraft += " {0}={1}/{0}".format(img,outroot)
%>
<%include file="efi.tmpl" args="configdir=configdir, KERNELDIR=KERNELDIR, efiarch32=None, efiarch64=efiarch, isolabel=isolabel"/>
# Create optional product.img and updates.img
<% imggraft=""; images=["product", "updates"] %>
%for img in images:
%if exists("%s/%s/" % (LORAXDIR, img)):
installimg ${LORAXDIR}/${img}/ images/${img}.img
<% imggraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %>
%endif
%endfor
# Inherit iso-graft/ if it exists from external templates
<%
import os
if os.path.exists(workdir + "/iso-graft"):
imggraft += " " + workdir + "/iso-graft"
%>
## make boot.iso
runcmd mkisofs -o ${outroot}/images/boot.iso \
${efiargs} -R -J -V '${isolabel}' -T -graft-points \
${KERNELDIR}=${outroot}/${KERNELDIR} \
${LIVEDIR}=${outroot}/${LIVEDIR} \
${efigraft} ${imggraft}
treeinfo images-${basearch} boot.iso images/boot.iso
%endif

View File

@ -112,5 +112,12 @@ mkdir ${KERNELDIR}
treeinfo ${basearch} platforms ${platforms} treeinfo ${basearch} platforms ${platforms}
# Inherit iso-graft/ if it exists from external templates
<%
import os
if os.path.exists(workdir + "/iso-graft"):
imggraft += " " + workdir + "/iso-graft"
%>
## FIXME: ARM may need some extra boot config ## FIXME: ARM may need some extra boot config

55
share/composer/ami.ks Normal file
View File

@ -0,0 +1,55 @@
# Lorax Composer AMI output kickstart template
# Add a separate /boot partition
part /boot --size=1024
# Firewall configuration
firewall --enabled
# NOTE: The root account is locked by default
# Network information
network --bootproto=dhcp --onboot=on --activate
# System authorization information
auth --useshadow --enablemd5
# NOTE: keyboard and lang can be replaced by blueprint customizations.locale settings
# System keyboard
keyboard --xlayouts=us --vckeymap=us
# System language
lang en_US.UTF-8
# SELinux configuration
selinux --enforcing
# Installation logging level
logging --level=info
# Shutdown after installation
shutdown
# System bootloader configuration
bootloader --location=mbr --append="no_timer_check console=ttyS0,115200n8 console=tty1 net.ifnames=0"
# Basic services
services --enabled=sshd,chronyd,cloud-init
%post
# Remove random-seed
rm /var/lib/systemd/random-seed
# Clear /etc/machine-id
rm /etc/machine-id
touch /etc/machine-id
# tell cloud-init to create the ec2-user account
sed -i 's/cloud-user/ec2-user/' /etc/cloud/cloud.cfg
%end
%packages
kernel
-dracut-config-rescue
# Enable networking by removing the config file that disables it
-NetworkManager-config-server
grub2
chrony
cloud-init
# NOTE lorax-composer will add the recipe packages below here, including the final %end

View File

@ -0,0 +1,38 @@
# Lorax Composer filesystem output kickstart template
# Firewall configuration
firewall --enabled
# NOTE: The root account is locked by default
# Network information
network --bootproto=dhcp --onboot=on --activate
# NOTE: keyboard and lang can be replaced by blueprint customizations.locale settings
# System keyboard
keyboard --xlayouts=us --vckeymap=us
# System language
lang en_US.UTF-8
# SELinux configuration
selinux --enforcing
# Installation logging level
logging --level=info
# Shutdown after installation
shutdown
# System bootloader configuration (unpartitioned fs image doesn't use a bootloader)
bootloader --location=none
%post
# Remove random-seed
rm /var/lib/systemd/random-seed
# Clear /etc/machine-id
rm /etc/machine-id
touch /etc/machine-id
%end
%packages --nobase
# Packages requires to support this output format go here
selinux-policy-targeted
# Enable networking by removing the config file that disables it
-NetworkManager-config-server
# NOTE lorax-composer will add the blueprint packages below here, including the final %end

364
share/composer/live-iso.ks Normal file
View File

@ -0,0 +1,364 @@
# Lorax Composer Live ISO output kickstart template
# Firewall configuration
firewall --enabled --service=mdns
# X Window System configuration information
xconfig --startxonboot
# Root password is removed for live-iso
rootpw --plaintext removethispw
# Network information
network --bootproto=dhcp --onboot=on --activate
# NOTE: keyboard and lang can be replaced by blueprint customizations.locale settings
# System keyboard
keyboard --xlayouts=us --vckeymap=us
# System language
lang en_US.UTF-8
# SELinux configuration
selinux --enforcing
# Installation logging level
logging --level=info
# Shutdown after installation
shutdown
# System services
services --disabled="network,sshd" --enabled="NetworkManager"
# System bootloader configuration
bootloader --location=mbr
# Clear the Master Boot Record
zerombr
%post
# FIXME: it'd be better to get this installed from a package
cat > /etc/rc.d/init.d/livesys << EOF
#!/bin/bash
#
# live: Init script for live image
#
# chkconfig: 345 00 99
# description: Init script for live image.
. /etc/init.d/functions
if ! strstr "\`cat /proc/cmdline\`" rd.live.image || [ "\$1" != "start" ]; then
exit 0
fi
if [ -e /.liveimg-configured ] ; then
configdone=1
fi
exists() {
which \$1 >/dev/null 2>&1 || return
\$*
}
touch /.liveimg-configured
# mount live image
if [ -b \`readlink -f /dev/live\` ]; then
mkdir -p /mnt/live
mount -o ro /dev/live /mnt/live 2>/dev/null || mount /dev/live /mnt/live
fi
livedir="LiveOS"
for arg in \`cat /proc/cmdline\` ; do
if [ "\${arg##live_dir=}" != "\${arg}" ]; then
livedir=\${arg##live_dir=}
return
fi
done
# enable swaps unless requested otherwise
swaps=\`blkid -t TYPE=swap -o device\`
if ! strstr "\`cat /proc/cmdline\`" noswap && [ -n "\$swaps" ] ; then
for s in \$swaps ; do
action "Enabling swap partition \$s" swapon \$s
done
fi
if ! strstr "\`cat /proc/cmdline\`" noswap && [ -f /mnt/live/\${livedir}/swap.img ] ; then
action "Enabling swap file" swapon /mnt/live/\${livedir}/swap.img
fi
mountPersistentHome() {
# support label/uuid
if [ "\${homedev##LABEL=}" != "\${homedev}" -o "\${homedev##UUID=}" != "\${homedev}" ]; then
homedev=\`/sbin/blkid -o device -t "\$homedev"\`
fi
# if we're given a file rather than a blockdev, loopback it
if [ "\${homedev##mtd}" != "\${homedev}" ]; then
# mtd devs don't have a block device but get magic-mounted with -t jffs2
mountopts="-t jffs2"
elif [ ! -b "\$homedev" ]; then
loopdev=\`losetup -f\`
if [ "\${homedev##/mnt/live}" != "\${homedev}" ]; then
action "Remounting live store r/w" mount -o remount,rw /mnt/live
fi
losetup \$loopdev \$homedev
homedev=\$loopdev
fi
# if it's encrypted, we need to unlock it
if [ "\$(/sbin/blkid -s TYPE -o value \$homedev 2>/dev/null)" = "crypto_LUKS" ]; then
echo
echo "Setting up encrypted /home device"
plymouth ask-for-password --command="cryptsetup luksOpen \$homedev EncHome"
homedev=/dev/mapper/EncHome
fi
# and finally do the mount
mount \$mountopts \$homedev /home
# if we have /home under what's passed for persistent home, then
# we should make that the real /home. useful for mtd device on olpc
if [ -d /home/home ]; then mount --bind /home/home /home ; fi
[ -x /sbin/restorecon ] && /sbin/restorecon /home
if [ -d /home/liveuser ]; then USERADDARGS="-M" ; fi
}
findPersistentHome() {
for arg in \`cat /proc/cmdline\` ; do
if [ "\${arg##persistenthome=}" != "\${arg}" ]; then
homedev=\${arg##persistenthome=}
return
fi
done
}
if strstr "\`cat /proc/cmdline\`" persistenthome= ; then
findPersistentHome
elif [ -e /mnt/live/\${livedir}/home.img ]; then
homedev=/mnt/live/\${livedir}/home.img
fi
# if we have a persistent /home, then we want to go ahead and mount it
if ! strstr "\`cat /proc/cmdline\`" nopersistenthome && [ -n "\$homedev" ] ; then
action "Mounting persistent /home" mountPersistentHome
fi
# make it so that we don't do writing to the overlay for things which
# are just tmpdirs/caches
mount -t tmpfs -o mode=0755 varcacheyum /var/cache/yum
mount -t tmpfs tmp /tmp
mount -t tmpfs vartmp /var/tmp
[ -x /sbin/restorecon ] && /sbin/restorecon /var/cache/yum /tmp /var/tmp >/dev/null 2>&1
if [ -n "\$configdone" ]; then
exit 0
fi
# add fedora user with no passwd
action "Adding live user" useradd \$USERADDARGS -c "Live System User" liveuser
passwd -d liveuser > /dev/null
usermod -aG wheel liveuser > /dev/null
# turn off firstboot for livecd boots
chkconfig --level 345 firstboot off 2>/dev/null
# We made firstboot a native systemd service, so it can no longer be turned
# off with chkconfig. It should be possible to turn it off with systemctl, but
# that doesn't work right either. For now, this is good enough: the firstboot
# service will start up, but this tells it not to run firstboot. I suspect the
# other services 'disabled' below are not actually getting disabled properly,
# with systemd, but we can look into that later. - AdamW 2010/08 F14Alpha
echo "RUN_FIRSTBOOT=NO" > /etc/sysconfig/firstboot
# don't start yum-updatesd for livecd boots
chkconfig --level 345 yum-updatesd off 2>/dev/null
# turn off mdmonitor by default
chkconfig --level 345 mdmonitor off 2>/dev/null
# turn off setroubleshoot on the live image to preserve resources
chkconfig --level 345 setroubleshoot off 2>/dev/null
# don't do packagekit checking by default
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t string /apps/gnome-packagekit/update-icon/frequency_get_updates never >/dev/null
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t string /apps/gnome-packagekit/update-icon/frequency_get_upgrades never >/dev/null
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t string /apps/gnome-packagekit/update-icon/frequency_refresh_cache never >/dev/null
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/update-icon/notify_available false >/dev/null
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/update-icon/notify_distro_upgrades false >/dev/null
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/enable_check_firmware false >/dev/null
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/enable_check_hardware false >/dev/null
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/enable_codec_helper false >/dev/null
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/enable_font_helper false >/dev/null
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-packagekit/enable_mime_type_helper false >/dev/null
# don't start cron/at as they tend to spawn things which are
# disk intensive that are painful on a live image
chkconfig --level 345 crond off 2>/dev/null
chkconfig --level 345 atd off 2>/dev/null
chkconfig --level 345 anacron off 2>/dev/null
chkconfig --level 345 readahead_early off 2>/dev/null
chkconfig --level 345 readahead_later off 2>/dev/null
# Stopgap fix for RH #217966; should be fixed in HAL instead
touch /media/.hal-mtab
# workaround clock syncing on shutdown that we don't want (#297421)
sed -i -e 's/hwclock/no-such-hwclock/g' /etc/rc.d/init.d/halt
# and hack so that we eject the cd on shutdown if we're using a CD...
if strstr "\`cat /proc/cmdline\`" CDLABEL= ; then
cat >> /sbin/halt.local << FOE
#!/bin/bash
# XXX: This often gets stuck during shutdown because /etc/init.d/halt
# (or something else still running) wants to read files from the block\
# device that was ejected. Disable for now. Bug #531924
# we want to eject the cd on halt, but let's also try to avoid
# io errors due to not being able to get files...
#cat /sbin/halt > /dev/null
#cat /sbin/reboot > /dev/null
#/usr/sbin/eject -p -m \$(readlink -f /dev/live) >/dev/null 2>&1
#echo "Please remove the CD from your drive and press Enter to finish restarting"
#read -t 30 < /dev/console
FOE
chmod +x /sbin/halt.local
fi
EOF
# bah, hal starts way too late
cat > /etc/rc.d/init.d/livesys-late << EOF
#!/bin/bash
#
# live: Late init script for live image
#
# chkconfig: 345 99 01
# description: Late init script for live image.
. /etc/init.d/functions
if ! strstr "\`cat /proc/cmdline\`" rd.live.image || [ "\$1" != "start" ] || [ -e /.liveimg-late-configured ] ; then
exit 0
fi
exists() {
which \$1 >/dev/null 2>&1 || return
\$*
}
touch /.liveimg-late-configured
# read some variables out of /proc/cmdline
for o in \`cat /proc/cmdline\` ; do
case \$o in
ks=*)
ks="--kickstart=\${o#ks=}"
;;
xdriver=*)
xdriver="\${o#xdriver=}"
;;
esac
done
# if liveinst or textinst is given, start anaconda
if strstr "\`cat /proc/cmdline\`" liveinst ; then
plymouth --quit
/usr/sbin/liveinst \$ks
fi
if strstr "\`cat /proc/cmdline\`" textinst ; then
plymouth --quit
/usr/sbin/liveinst --text \$ks
fi
# configure X, allowing user to override xdriver
if [ -n "\$xdriver" ]; then
cat > /etc/X11/xorg.conf.d/00-xdriver.conf <<FOE
Section "Device"
Identifier "Videocard0"
Driver "\$xdriver"
EndSection
FOE
fi
EOF
chmod 755 /etc/rc.d/init.d/livesys
/sbin/restorecon /etc/rc.d/init.d/livesys
/sbin/chkconfig --add livesys
chmod 755 /etc/rc.d/init.d/livesys-late
/sbin/restorecon /etc/rc.d/init.d/livesys-late
/sbin/chkconfig --add livesys-late
# work around for poor key import UI in PackageKit
rm -f /var/lib/rpm/__db*
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
echo "Packages within this LiveCD"
rpm -qa
# go ahead and pre-make the man -k cache (#455968)
/usr/bin/mandb
# make sure there aren't core files lying around
rm -f /core*
# convince readahead not to collect
rm -f /.readahead_collect
touch /var/lib/readahead/early.sorted
# Remove random-seed
rm /var/lib/systemd/random-seed
%end
%post
cat >> /etc/rc.d/init.d/livesys << EOF
# disable screensaver locking
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-screensaver/lock_enabled false >/dev/null
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /desktop/gnome/lockdown/disable_lock_screen true >/dev/null
# set up timed auto-login for after 60 seconds
cat >> /etc/gdm/custom.conf << FOE
[daemon]
AutomaticLoginEnable=True
AutomaticLogin=liveuser
FOE
# Show harddisk install on the desktop
sed -i -e 's/NoDisplay=true/NoDisplay=false/' /usr/share/applications/liveinst.desktop
mkdir /home/liveuser/Desktop
cp /usr/share/applications/liveinst.desktop /home/liveuser/Desktop
chown -R liveuser.liveuser /home/liveuser/Desktop
chmod a+x /home/liveuser/Desktop/liveinst.desktop
# But not trash and home
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/nautilus/desktop/trash_icon_visible false >/dev/null
gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/nautilus/desktop/home_icon_visible false >/dev/null
# Turn off PackageKit-command-not-found while uninstalled
sed -i -e 's/^SoftwareSourceSearch=true/SoftwareSourceSearch=false/' /etc/PackageKit/CommandNotFound.conf
EOF
# Remove root password
passwd -d root > /dev/null
# fstab from the install won't match anything. remove it and let dracut
# handle mounting.
cat /dev/null > /etc/fstab
%end
# NOTE Do NOT add any other sections after %packages
%packages
# Packages requires to support this output format go here
isomd5sum
kernel
memtest86+
syslinux
-dracut-config-rescue
selinux-policy-targeted
# Enable networking by removing the config file that disables it
-NetworkManager-config-server
# This package is needed to boot the iso on UEFI
shim
shim-ia32
grub2
grub2-efi
grub2-efi-*-cdboot
grub2-efi-ia32
efibootmgr
# NOTE lorax-composer will add the blueprint packages below here, including the final %end%packages

View File

@ -0,0 +1,47 @@
# Lorax Composer openstack output kickstart template
# Firewall configuration
firewall --disabled
# NOTE: The root account is locked by default
# Network information
network --bootproto=dhcp --onboot=on --activate
# NOTE: keyboard and lang can be replaced by blueprint customizations.locale settings
# System keyboard
keyboard --xlayouts=us --vckeymap=us
# System language
lang en_US.UTF-8
# SELinux configuration
selinux --enforcing
# Installation logging level
logging --level=info
# Shutdown after installation
shutdown
# System bootloader configuration
bootloader --location=mbr --append="no_timer_check console=ttyS0,115200n8 console=tty1 net.ifnames=0"
# Start sshd and cloud-init at boot time
services --enabled=sshd,cloud-init,cloud-init-local,cloud-config,cloud-final
%post
# Remove random-seed
rm /var/lib/systemd/random-seed
# Clear /etc/machine-id
rm /etc/machine-id
touch /etc/machine-id
%end
%packages
kernel
-dracut-config-rescue
grub2
# Enable networking by removing the config file that disables it
-NetworkManager-config-server
# Make sure virt guest agents are installed
qemu-guest-agent
spice-vdagent
cloud-init
# NOTE lorax-composer will add the recipe packages below here, including the final %end

View File

@ -0,0 +1,42 @@
# Lorax Composer partitioned disk output kickstart template
# Firewall configuration
firewall --enabled
# NOTE: The root account is locked by default
# Network information
network --bootproto=dhcp --onboot=on --activate
# NOTE: keyboard and lang can be replaced by blueprint customizations.locale settings
# System keyboard
keyboard --xlayouts=us --vckeymap=us
# System language
lang en_US.UTF-8
# SELinux configuration
selinux --enforcing
# Installation logging level
logging --level=info
# Shutdown after installation
shutdown
# System bootloader configuration
bootloader --location=mbr
# Clear the Master Boot Record
zerombr
%post
# Remove random-seed
rm /var/lib/systemd/random-seed
# Clear /etc/machine-id
rm /etc/machine-id
touch /etc/machine-id
%end
%packages
kernel
-dracut-config-rescue
selinux-policy-targeted
grub2
# Enable networking by removing the config file that disables it
-NetworkManager-config-server
# NOTE lorax-composer will add the blueprint packages below here, including the final %end

46
share/composer/qcow2.ks Normal file
View File

@ -0,0 +1,46 @@
# Lorax Composer qcow2 output kickstart template
# Firewall configuration
firewall --enabled
# NOTE: The root account is locked by default
# Network information
network --bootproto=dhcp --onboot=on --activate
# NOTE: keyboard and lang can be replaced by blueprint customizations.locale settings
# System keyboard
keyboard --xlayouts=us --vckeymap=us
# System language
lang en_US.UTF-8
# SELinux configuration
selinux --enforcing
# Installation logging level
logging --level=info
# Shutdown after installation
shutdown
# System bootloader configuration
bootloader --location=mbr
# Clear the Master Boot Record
zerombr
%post
# Remove random-seed
rm /var/lib/systemd/random-seed
# Clear /etc/machine-id
rm /etc/machine-id
touch /etc/machine-id
%end
%packages
kernel
-dracut-config-rescue
selinux-policy-targeted
grub2
# Enable networking by removing the config file that disables it
-NetworkManager-config-server
# Make sure virt guest agents are installed
qemu-guest-agent
spice-vdagent
# NOTE lorax-composer will add the blueprint packages below here, including the final %end

39
share/composer/tar.ks Normal file
View File

@ -0,0 +1,39 @@
# Lorax Composer tar output kickstart template
# Firewall configuration
firewall --enabled
# NOTE: The root account is locked by default
# Network information
network --bootproto=dhcp --onboot=on --activate
# NOTE: keyboard and lang can be replaced by blueprint customizations.locale settings
# System keyboard
keyboard --xlayouts=us --vckeymap=us
# System language
lang en_US.UTF-8
# SELinux configuration
selinux --enforcing
# Installation logging level
logging --level=info
# Shutdown after installation
shutdown
# System bootloader configuration (tar doesn't need a bootloader)
bootloader --location=none
%post
# Remove random-seed
rm /var/lib/systemd/random-seed
# Clear /etc/machine-id
rm /etc/machine-id
touch /etc/machine-id
%end
# NOTE Do NOT add any other sections after %packages
%packages
# Packages requires to support this output format go here
selinux-policy-targeted
# Enable networking by removing the config file that disables it
-NetworkManager-config-server
# NOTE lorax-composer will add the blueprint packages below here, including the final %end

75
share/composer/vhd.ks Normal file
View File

@ -0,0 +1,75 @@
# Lorax Composer VHD (Azure, Hyper-V) output kickstart template
# Add a separate /boot partition
part /boot --size=1024
# Firewall configuration
firewall --enabled
# NOTE: The root account is locked by default
# Network information
network --bootproto=dhcp --onboot=on --activate
# NOTE: keyboard and lang can be replaced by blueprint customizations.locale settings
# System keyboard
keyboard --xlayouts=us --vckeymap=us
# System language
lang en_US.UTF-8
# SELinux configuration
selinux --enforcing
# Installation logging level
logging --level=info
# Shutdown after installation
shutdown
# System bootloader configuration
bootloader --location=mbr --append="no_timer_check console=ttyS0,115200n8 earlyprintk=ttyS0,115200 rootdelay=300 net.ifnames=0"
# Basic services
services --enabled=sshd,chronyd,waagent
%post
# Remove random-seed
rm /var/lib/systemd/random-seed
# Clear /etc/machine-id
rm /etc/machine-id
touch /etc/machine-id
# This file is required by waagent in RHEL, but compatible with NetworkManager
cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << EOF
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=dhcp
TYPE=Ethernet
USERCTL=yes
PEERDNS=yes
IPV6INIT=no
EOF
# Add Hyper-V modules into initramfs
cat > /etc/dracut.conf.d/10-hyperv.conf << EOF
add_drivers+=" hv_vmbus hv_netvsc hv_storvsc "
EOF
# Regenerate the intramfs image
dracut -f -v --persistent-policy by-uuid
%end
%addon com_redhat_kdump --disable
%end
%packages
kernel
-dracut-config-rescue
# Enable networking by removing the config file that disables it
-NetworkManager-config-server
grub2
chrony
WALinuxAgent
# Requirements of WALinuxAgent
net-tools
# NOTE lorax-composer will add the recipe packages below here, including the final %end

46
share/composer/vmdk.ks Normal file
View File

@ -0,0 +1,46 @@
# Lorax Composer vmdk kickstart template
# Firewall configuration
firewall --enabled
# NOTE: The root account is locked by default
# Network information
network --bootproto=dhcp --onboot=on --activate
# NOTE: keyboard and lang can be replaced by blueprint customizations.locale settings
# System keyboard
keyboard --xlayouts=us --vckeymap=us
# System language
lang en_US.UTF-8
# SELinux configuration
selinux --enforcing
# Installation logging level
logging --level=info
# Shutdown after installation
shutdown
# System bootloader configuration
bootloader --location=mbr
# Basic services
services --enabled=sshd,chronyd,vmtoolsd
%post
# Remove random-seed
rm /var/lib/systemd/random-seed
# Clear /etc/machine-id
rm /etc/machine-id
touch /etc/machine-id
%end
%packages
kernel
-dracut-config-rescue
# Enable networking by removing the config file that disables it
-NetworkManager-config-server
grub2
chrony
open-vm-tools
# NOTE lorax-composer will add the recipe packages below here, including the final %end

View File

@ -0,0 +1,5 @@
splash.lss
- Press the 01<ENTER>07 key to begin the installation process.

View File

@ -0,0 +1,13 @@
#debug --graphics
default=0
splashimage=@SPLASHPATH@
timeout 5
hiddenmenu
title Install @PRODUCT@ @VERSION@
findiso
kernel @KERNELPATH@ @ROOT@ quiet
initrd @INITRDPATH@
title Test this media & install @PRODUCT@ @VERSION@
findiso
kernel @KERNELPATH@ @ROOT@ rd.live.check quiet
initrd @INITRDPATH@

View File

@ -0,0 +1,46 @@
set default="1"
function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod ext2
set timeout=60
### END /etc/grub.d/00_header ###
search --no-floppy --set=root -l '@ISOLABEL@'
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Install @PRODUCT@ @VERSION@' --class red --class gnu-linux --class gnu --class os {
linux @KERNELPATH@ @ROOT@ ro
initrd @INITRDPATH@
}
menuentry 'Test this media & install @PRODUCT@ @VERSION@' --class red --class gnu-linux --class gnu --class os {
linux @KERNELPATH@ @ROOT@ rd.live.check
initrd @INITRDPATH@
}
submenu 'Troubleshooting -->' {
menuentry 'Install @PRODUCT@ @VERSION@ in basic graphics mode' --class red --class gnu-linux --class gnu --class os {
linux @KERNELPATH@ @ROOT@ nomodeset
initrd @INITRDPATH@
}
menuentry 'Rescue a @PRODUCT@ system' --class red --class gnu-linux --class gnu --class os {
linux @KERNELPATH@ @ROOT@ rescue
initrd @INITRDPATH@
}
}

View File

@ -0,0 +1,2 @@
[main]
no-auto-default=*

View File

@ -0,0 +1,2 @@
[connection]
connection.autoconnect-slaves=1

View File

@ -0,0 +1,2 @@
[logging]
level=DEBUG

View File

@ -1 +1 @@
SYSFONT="latarcyrheb-sun16" SYSFONT="eurlatgr"

View File

@ -1,21 +0,0 @@
[org.gnome.desktop.wm.keybindings]
switch-to-workspace-left=[]
switch-to-workspace-right=[]
switch-to-workspace-up=[]
switch-to-workspace-down=[]
switch-group=[]
switch-windows=[]
switch-panels=[]
cycle-group=[]
cycle-windows=[]
cycle-panels=[]
activate-window-menu=[]
toggle-maximized=[]
maximize=[]
unmaximize=[]
begin-move=[]
begin-resize=[]
move-to-workspace-left=[]
move-to-workspace-right=[]
move-to-workspace-up=[]
move-to-workspace-down=[]

View File

@ -1,7 +1,24 @@
# rsyslog configuration file
# For more information see /usr/share/doc/rsyslog-*/rsyslog_conf.html
# If you experience problems, see http://www.rsyslog.com/doc/troubleshoot.html
#### MODULES #### #### MODULES ####
$ModLoad imuxsock.so # provides support for local system logging
# The imjournal module bellow is now used as a message source instead of imuxsock.
$ModLoad imuxsock # provides support for local system logging (e.g. via logger command)
$SystemLogRateLimitInterval 0 # disables message dropping, we need all of them $SystemLogRateLimitInterval 0 # disables message dropping, we need all of them
$ModLoad imklog.so # provides kernel logging support $ModLoad imjournal # provides access to the systemd journal
#$ModLoad imklog # reads kernel messages (the same are read from journald)
#$ModLoad immark # provides --MARK-- message capability
# Provides UDP syslog reception
#$ModLoad imudp
#$UDPServerRun 514
# Provides TCP syslog reception
#$ModLoad imtcp
#$InputTCPServerRun 514
$ModLoad imfile $ModLoad imfile
$InputFileName /tmp/X.log $InputFileName /tmp/X.log
@ -15,10 +32,29 @@ $InputFileStateFile anaconda-tb-statefile
$InputFileFacility local1 $InputFileFacility local1
$InputRunFileMonitor $InputRunFileMonitor
#### GLOBAL DIRECTIVES #### #### GLOBAL DIRECTIVES ####
# Where to place auxiliary files
#$WorkDirectory /var/lib/rsyslog
# Use default timestamp format # Use default timestamp format
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
# File syncing capability is disabled by default. This feature is usually not required,
# not useful and an extreme performance hit
#$ActionFileEnableSync on
# Include all config files in /etc/rsyslog.d/
$IncludeConfig /etc/rsyslog.d/*.conf
# Turn off message reception via local log socket;
# local messages are retrieved through imjournal now.
$OmitLocalLogging on
# File to store the position in the journal
$IMJournalStateFile imjournal.state
#### TEMPLATES #### #### TEMPLATES ####
$template anaconda_tty4, "%syslogseverity-text:::uppercase% %programname%:%msg%\n" $template anaconda_tty4, "%syslogseverity-text:::uppercase% %programname%:%msg%\n"
@ -26,24 +62,32 @@ $template anaconda_syslog, "%timestamp:8:$:date-rfc3164%,%timestamp:1:3:date-sub
$template virtio_ForwardFormat, "<%PRI%>%TIMESTAMP:::date-rfc3339% localhost %syslogtag:1:32%%msg:::sp-if-no-1st-sp%%msg%\n" $template virtio_ForwardFormat, "<%PRI%>%TIMESTAMP:::date-rfc3339% localhost %syslogtag:1:32%%msg:::sp-if-no-1st-sp%%msg%\n"
#### RULES #### #### RULES ####
# log everything except anaconda-specific records from local1 (those are stored # log everything except anaconda-specific records from local1 (those are stored
# directly into files via python logging) # directly into files via python logging)
# discard messages from dracut regenerating initrd
:programname,isequal,"dracut" ~
*.*;\ *.*;\
authpriv.none;\ authpriv.none;\
local1.none /tmp/syslog;anaconda_syslog local1.none /tmp/syslog;anaconda_syslog
& /dev/tty4;anaconda_tty4 & /dev/tty4;anaconda_tty4
# ### begin forwarding rule ### # ### begin forwarding rule ###
# The statement between the begin ... end define a SINGLE forwarding # The statement between the begin ... end define a SINGLE forwarding
# rule. They belong together, do NOT split them. If you create multiple # rule. They belong together, do NOT split them. If you create multiple
# forwarding rules, duplicate the whole block! # forwarding rules, duplicate the whole block!
# Remote Logging (we use TCP for reliable delivery)
# #
# An on-disk queue is created for this action. If the remote host is # An on-disk queue is created for this action. If the remote host is
# down, messages are spooled to disk and sent when it is up again. # down, messages are spooled to disk and sent when it is up again.
#$ActionQueueFileName fwdRule1 # unique name prefix for spool files
$ActionQueueMaxDiskSpace 1m # space limit (use as much as possible) $ActionQueueMaxDiskSpace 1m # space limit (use as much as possible)
$ActionQueueSaveOnShutdown off # do not save messages to disk on shutdown $ActionQueueSaveOnShutdown off # do not save messages to disk on shutdown
$ActionQueueType LinkedList # run asynchronously #$ActionQueueType LinkedList # run asynchronously
$ActionResumeRetryCount -1 # infinite retries if host is down #$ActionResumeRetryCount -1 # infinite retries if host is down
# remote host is: name/ip:port, e.g. 192.168.0.1:514, port optional # remote host is: name/ip:port, e.g. 192.168.0.1:514, port optional
#*.* @@remote-host:514
# ### end of the forwarding rule ### # ### end of the forwarding rule ###

View File

@ -0,0 +1 @@
SPICE_VDAGENTD_EXTRA_ARGS=-X

View File

@ -0,0 +1,2 @@
KEYMAP=us
FONT=eurlatgr

View File

@ -1,7 +1,8 @@
<chrp-boot> <description>Linux</description> <chrp-boot>
<os-name>Linux</os-name> <description>grub 2.00</description>
<boot-script>boot &device;:\ppc\chrp\yaboot</boot-script> <os-name>grub 2.00</os-name>
<icon size=64,64 color-space=3,3,2> <boot-script>boot &device;:\boot\grub\powerpc-ieee1275\core.elf</boot-script>
<icon size=64,64 color-space=3,3,2>
<bitmap> FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF <bitmap> FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF

View File

@ -0,0 +1,30 @@
set default=0
set timeout=5
echo -e "\nWelcome to the @PRODUCT@ @VERSION@ installer!\n\n"
menuentry "Install @PRODUCT@ @VERSION@ (64-bit kernel)" --class fedora --class gnu-linux --class gnu --class os {
linux /ppc/ppc64/vmlinuz @ROOT@ ro
initrd /ppc/ppc64/initrd.img
}
menuentry "Test this media & install @PRODUCT@ @VERSION@ (64-bit kernel)" --class fedora --class gnu-linux --class gnu --class os {
linux /ppc/ppc64/vmlinuz @ROOT@ rd.live.check ro
initrd /ppc/ppc64/initrd.img
}
menuentry "Rescue a @PRODUCT@ system (64-bit kernel)" --class fedora --class gnu-linux --class gnu --class os {
linux /ppc/ppc64/vmlinuz @ROOT@ rescue ro
initrd /ppc/ppc64/initrd.img
}
submenu 'Other options...' {
menuentry 'Reboot' {
reboot
}
menuentry 'Exit to Open Firmware' {
exit
}
}

View File

@ -0,0 +1 @@
ro

View File

@ -1,5 +1,5 @@
* minimal lpar ins file * minimal lpar ins file
images/kernel.img 0x00000000 images/kernel.img 0x00000000
images/initrd.img @INITRD_LOAD_ADDRESS@ images/initrd.img @INITRD_LOAD_ADDRESS@
images/generic.prm 0x00010480 images/genericdvd.prm 0x00010480
images/initrd.addrsize 0x00010408 images/initrd.addrsize 0x00010408

View File

@ -1 +1 @@
ro ramdisk_size=40000 cio_ignore=all,!0.0.0009 ro ramdisk_size=40000 cio_ignore=all,!condev

View File

@ -0,0 +1 @@
ro ramdisk_size=40000 cio_ignore=all,!condev rd.cmdline=ask

View File

@ -1,7 +1,7 @@
#debug --graphics #debug --graphics
default=0 default=1
splashimage=@SPLASHPATH@ splashimage=@SPLASHPATH@
timeout 5 timeout 60
hiddenmenu hiddenmenu
title Install @PRODUCT@ @VERSION@ title Install @PRODUCT@ @VERSION@
findiso findiso

View File

@ -0,0 +1,43 @@
set default="1"
function load_video {
insmod efi_gop
insmod efi_uga
insmod video_bochs
insmod video_cirrus
insmod all_video
}
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod ext2
set timeout=60
### END /etc/grub.d/00_header ###
search --no-floppy --set=root -l '@ISOLABEL@'
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Install @PRODUCT@ @VERSION@' --class fedora --class gnu-linux --class gnu --class os {
linuxefi @KERNELPATH@ @ROOT@ quiet
initrdefi @INITRDPATH@
}
menuentry 'Test this media & install @PRODUCT@ @VERSION@' --class fedora --class gnu-linux --class gnu --class os {
linuxefi @KERNELPATH@ @ROOT@ rd.live.check quiet
initrdefi @INITRDPATH@
}
submenu 'Troubleshooting -->' {
menuentry 'Install @PRODUCT@ @VERSION@ in basic graphics mode' --class fedora --class gnu-linux --class gnu --class os {
linuxefi @KERNELPATH@ @ROOT@ xdriver=vesa nomodeset quiet
initrdefi @INITRDPATH@
}
menuentry 'Rescue a @PRODUCT@ system' --class fedora --class gnu-linux --class gnu --class os {
linuxefi @KERNELPATH@ @ROOT@ rescue quiet
initrdefi @INITRDPATH@
}
menuentry '@PRODUCT@ @VERSION@ Secure Boot Lockdown' {
chainloader /EFI/BOOT/lockdown.efi
}
}

View File

@ -1,4 +1,4 @@
set default="0" set default="1"
function load_video { function load_video {
insmod efi_gop insmod efi_gop
@ -14,7 +14,7 @@ insmod gzio
insmod part_gpt insmod part_gpt
insmod ext2 insmod ext2
set timeout=5 set timeout=60
### END /etc/grub.d/00_header ### ### END /etc/grub.d/00_header ###
search --no-floppy --set=root -l '@ISOLABEL@' search --no-floppy --set=root -l '@ISOLABEL@'

View File

@ -1,5 +1,6 @@
<%page args="configdir, KERNELDIR, efiarch, isolabel"/> <%page args="configdir, KERNELDIR, efiarch32, efiarch64, isolabel"/>
<% <%
from string import lower
EFIBOOTDIR="EFI/BOOT" EFIBOOTDIR="EFI/BOOT"
APPLE_EFI_ICON=inroot+"/usr/share/pixmaps/bootloader/fedora.icns" APPLE_EFI_ICON=inroot+"/usr/share/pixmaps/bootloader/fedora.icns"
APPLE_EFI_DISKNAME=inroot+"/usr/share/pixmaps/bootloader/fedora-media.vol" APPLE_EFI_DISKNAME=inroot+"/usr/share/pixmaps/bootloader/fedora-media.vol"
@ -7,9 +8,19 @@ APPLE_EFI_DISKNAME=inroot+"/usr/share/pixmaps/bootloader/fedora-media.vol"
mkdir ${EFIBOOTDIR} mkdir ${EFIBOOTDIR}
mkdir ${EFIBOOTDIR}/fonts/ mkdir ${EFIBOOTDIR}/fonts/
install boot/efi/EFI/*/shim.efi ${EFIBOOTDIR}/BOOT${efiarch}.efi %if exists("usr/share/shim/lockdown.efi"):
install boot/efi/EFI/*/MokManager.efi ${EFIBOOTDIR}/ install usr/share/shim/lockdown.efi ${EFIBOOTDIR}/
install boot/efi/EFI/*/gcdx64.efi ${EFIBOOTDIR}/grubx64.efi %endif
%if efiarch64:
install boot/efi/EFI/*/shim${efiarch64|lower}.efi ${EFIBOOTDIR}/BOOT${efiarch64}.EFI
install boot/efi/EFI/*/mm${efiarch64|lower}.efi ${EFIBOOTDIR}/
install boot/efi/EFI/*/gcd${efiarch64|lower}.efi ${EFIBOOTDIR}/grub${efiarch64|lower}.efi
%endif
%if efiarch32:
install boot/efi/EFI/*/shim${efiarch32|lower}.efi ${EFIBOOTDIR}/BOOT${efiarch32}.EFI
install boot/efi/EFI/*/mm${efiarch32|lower}.efi ${EFIBOOTDIR}/
install boot/efi/EFI/*/gcd${efiarch32|lower}.efi ${EFIBOOTDIR}/grub${efiarch32|lower}.efi
%endif
install boot/efi/EFI/*/fonts/unicode.pf2 ${EFIBOOTDIR}/fonts/ install boot/efi/EFI/*/fonts/unicode.pf2 ${EFIBOOTDIR}/fonts/
## actually make the EFI images ## actually make the EFI images
@ -31,7 +42,11 @@ ${make_efiboot("images/efiboot.img")}
copy ${KERNELDIR}/vmlinuz ${EFIBOOTDIR} copy ${KERNELDIR}/vmlinuz ${EFIBOOTDIR}
copy ${KERNELDIR}/initrd.img ${EFIBOOTDIR} copy ${KERNELDIR}/initrd.img ${EFIBOOTDIR}
%endif %endif
install ${configdir}/grub2-efi.cfg ${eficonf} %if exists("usr/share/shim/lockdown.efi"):
install ${configdir}/grub2-efi-lockdown.cfg ${eficonf}
%else:
install ${configdir}/grub2-efi.cfg ${eficonf}
%endif
replace @PRODUCT@ '${product.name}' ${eficonf} replace @PRODUCT@ '${product.name}' ${eficonf}
replace @VERSION@ ${product.version} ${eficonf} replace @VERSION@ ${product.version} ${eficonf}
replace @KERNELNAME@ vmlinuz ${eficonf} replace @KERNELNAME@ vmlinuz ${eficonf}
@ -43,9 +58,6 @@ ${make_efiboot("images/efiboot.img")}
%else: %else:
replace @ROOT@ 'inst.stage2=hd:LABEL=${isolabel|udev}' ${eficonf} replace @ROOT@ 'inst.stage2=hd:LABEL=${isolabel|udev}' ${eficonf}
%endif %endif
%if efiarch == 'IA32':
copy ${eficonf} ${EFIBOOTDIR}/BOOT.conf
%endif
runcmd mkefiboot ${args} ${outroot}/${EFIBOOTDIR} ${outroot}/${img} runcmd mkefiboot ${args} ${outroot}/${EFIBOOTDIR} ${outroot}/${img}
%if include_kernel: %if include_kernel:
remove ${EFIBOOTDIR}/vmlinuz remove ${EFIBOOTDIR}/vmlinuz

85
share/live/aarch64.tmpl Normal file
View File

@ -0,0 +1,85 @@
<%page args="kernels, runtime_img, basearch, inroot, outroot, product, isolabel, extra_boot_args"/>
<%
configdir="tmp/config_files/aarch64"
PXEBOOTDIR="images/pxeboot"
KERNELDIR=PXEBOOTDIR
LIVEDIR="LiveOS"
LORAXDIR="usr/share/lorax/"
## Don't allow spaces or escape characters in the iso label
def valid_label(ch):
return ch.isalnum() or ch == '_'
isolabel = ''.join(ch if valid_label(ch) else '-' for ch in isolabel)
from os.path import basename
%>
## Test ${runtime_img} to see if udf is needed
<%
import os
from pylorax.sysutils import joinpaths
if os.stat(joinpaths(inroot, runtime_img)).st_size >= 4*1024**3:
udfargs = "-allow-limited-size"
else:
udfargs = ""
%>
mkdir ${LIVEDIR}
install ${runtime_img} ${LIVEDIR}/squashfs.img
treeinfo stage2 mainimage ${LIVEDIR}/squashfs.img
## install kernels
mkdir ${KERNELDIR}
%for kernel in kernels:
## normal aarch64
installkernel images-${basearch} ${kernel.path} ${KERNELDIR}/vmlinuz
installinitrd images-${basearch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img
%endfor
#FIXME: this will need adjusted when we have a real bootloader.
## WHeeeeeeee, EFI.
## We could remove the basearch restriction someday..
<% efiargs=""; efigraft="" %>
%if exists("boot/efi/EFI/*/gcdaa64.efi"):
<%
efiarch = 'AA64'
efigraft="EFI/BOOT={0}/EFI/BOOT".format(outroot)
images = ["images/efiboot.img"]
%>
%for img in images:
<%
efiargs += " -eltorito-alt-boot -e {0} -no-emul-boot".format(img)
efigraft += " {0}={1}/{0}".format(img,outroot)
%>
treeinfo images-${basearch} ${img|basename} ${img}
%endfor
<%include file="efi.tmpl" args="configdir=configdir, KERNELDIR=KERNELDIR, efiarch32=None, efiarch64=efiarch, isolabel=isolabel, extra_boot_args=extra_boot_args"/>
%endif
# Create optional product.img and updates.img
<% filegraft=""; images=["product", "updates"] %>
%for img in images:
%if exists("%s/%s/" % (LORAXDIR, img)):
installimg ${LORAXDIR}/${img}/ images/${img}.img
treeinfo images-${basearch} ${img}.img images/${img}.img
<% filegraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %>
%endif
%endfor
# Add the license files
%for f in glob("/usr/share/licenses/*-release/*"):
install ${f} ${f|basename}
<% filegraft += " {0}={1}/{0}".format(basename(f), outroot) %>
%endfor
%if exists("boot/efi/EFI/*/gcdaa64.efi"):
## make boot.iso
runcmd mkisofs -o ${outroot}/images/boot.iso \
${efiargs} -R -J -V '${isolabel}' -T ${udfargs} \
-graft-points \
${KERNELDIR}=${outroot}/${KERNELDIR} \
${LIVEDIR}=${outroot}/${LIVEDIR} \
${efigraft} ${filegraft}
treeinfo images-${basearch} boot.iso images/boot.iso
%endif

View File

@ -0,0 +1,42 @@
set default="1"
function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod ext2
set timeout=60
### END /etc/grub.d/00_header ###
search --no-floppy --set=root -l '@ISOLABEL@'
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Start @PRODUCT@ @VERSION@' --class red --class gnu-linux --class gnu --class os {
linux @KERNELPATH@ @ROOT@ @EXTRA@ rd.live.image quiet
initrd @INITRDPATH@
}
menuentry 'Test this media & start @PRODUCT@ @VERSION@' --class red --class gnu-linux --class gnu --class os {
linux @KERNELPATH@ @ROOT@ @EXTRA@ rd.live.image rd.live.check quiet
initrd @INITRDPATH@
}
submenu 'Troubleshooting -->' {
menuentry 'Install @PRODUCT@ @VERSION@ in basic graphics mode' --class red --class gnu-linux --class gnu --class os {
linux @KERNELPATH@ @ROOT@ @EXTRA@ rd.live.image nomodeset quiet
initrd @INITRDPATH@
}
}

View File

@ -0,0 +1,170 @@
<chrp-boot>
<description>grub 2.00</description>
<os-name>grub 2.00</os-name>
<boot-script>boot &device;:\boot\grub\powerpc-ieee1275\core.elf</boot-script>
<icon size=64,64 color-space=3,3,2>
<bitmap> FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 </bitmap> </icon> </chrp-boot>

View File

@ -0,0 +1,34 @@
set default=0
set timeout=5
echo -e "\nWelcome to the @PRODUCT@ @VERSION@ installer!\n\n"
for BITS in 32 64; do
if [ -d "/ppc/ppc${BITS}" ]; then
menuentry "Start @PRODUCT@ @VERSION@ (${BITS}-bit kernel)" $BITS --class fedora --class gnu-linux --class gnu --class os {
linux /ppc/ppc${2}/vmlinuz @ROOT@ @EXTRA@ ro rd.live.image quiet
initrd /ppc/ppc${2}/initrd.img
}
menuentry "Test this media & start @PRODUCT@ @VERSION@ (${BITS}-bit kernel)" $BITS --class fedora --class gnu-linux --class gnu --class os {
linux /ppc/ppc${2}/vmlinuz @ROOT@ @EXTRA@ rd.live.image rd.live.check ro quiet
initrd /ppc/ppc${2}/initrd.img
}
menuentry "Rescue a @PRODUCT@ system (${BITS}-bit kernel)" $BITS --class fedora --class gnu-linux --class gnu --class os {
linux /ppc/ppc${2}/vmlinuz @ROOT@ rd.live.image rescue ro
initrd /ppc/ppc${2}/initrd.img
}
fi
done
submenu 'Other options...' {
menuentry 'Reboot' {
reboot
}
menuentry 'Exit to Open Firmware' {
exit
}
}

View File

@ -0,0 +1,81 @@
#
# Example magic file for mkhybrid
#
# The "message" for the offset MUST be 4 characters for the CREATOR
# and 4 characters for the TYPE - white space is optional between them.
# Any other characters on this line are ignored. Continuation lines (starting
# with '>') are also ignored i.e. only the initial offset lines are used.
#
# The continuation lines are given here, but they do not need to exist.
#
# James Pearson 20/5/98
# off type test message
# GIF
0 string GIF8 8BIM GIFf
>4 string 7a \b, version 8%s,
>4 string 9a \b, version 8%s,
>6 leshort >0 %hd x
>8 leshort >0 %hd,
#>10 byte &0x80 color mapped,
#>10 byte&0x07 =0x00 2 colors
#>10 byte&0x07 =0x01 4 colors
#>10 byte&0x07 =0x02 8 colors
#>10 byte&0x07 =0x03 16 colors
#>10 byte&0x07 =0x04 32 colors
#>10 byte&0x07 =0x05 64 colors
#>10 byte&0x07 =0x06 128 colors
#>10 byte&0x07 =0x07 256 colors
# JPEG images
#
0 ubeshort 0xffd8 8BIM JPEG image data
# StuffIt
#
0 string SIT! SIT!SIT!
# standard unix compress
0 string \037\235 LZIV ZIVU
>2 byte&0x80 >0 block compressed
>2 byte&0x1f x %d bits
# gzip (GNU zip, not to be confused with Info-ZIP or PKWARE zip archiver)
0 string \037\213 GNUz ZIVU gzip compressed data
>2 byte <8 \b, reserved method,
>2 byte 8 \b, deflated,
>3 byte &0x01 ASCII,
>3 byte &0x02 continuation,
>3 byte &0x04 extra field,
>3 byte &0x08 original filename,
>3 byte &0x10 comment,
>3 byte &0x20 encrypted,
>4 ledate x last modified: %s,
>8 byte 2 max compression,
>8 byte 4 max speed,
>9 byte =0x00 os: MS-DOS
>9 byte =0x01 os: Amiga
>9 byte =0x02 os: VMS
>9 byte =0x03 os: Unix
>9 byte =0x05 os: Atari
>9 byte =0x06 os: OS/2
>9 byte =0x07 os: MacOS
>9 byte =0x0A os: Tops/20
>9 byte =0x0B os: Win/32
# Postscript
0 string %! ASPSTEXT
>2 string PS-Adobe- conforming
>>11 string >\0 at level %.3s
>>>15 string EPS - type %s
>>>15 string Query - type %s
>>>15 string ExitServer - type %s
# Some PCs have the annoying habit of adding a ^D as a document separator
0 string \004%! ASPS TEXT PostScript document text
>3 string PS-Adobe- conforming
>>12 string >\0 at level %.3s
>>>16 string EPS - type %s
>>>16 string Query - type %s
>>>16 string ExitServer - type %s

View File

@ -0,0 +1,27 @@
# Example filename mapping file
#
# yaboot Raw 'UNIX' 'boot' "Bootstrap"
# vmlinux Raw 'UNIX' 'boot' "Bootstrap"
#
# EXTN XLate CREATOR TYPE Comment
COPYING Ascii 'ttxt' 'ttro' "Text File"
CREDITS Ascii 'ttxt' 'ttro' "Text File"
README Ascii 'ttxt' 'ttro' "Text File"
RPM-GPG-KEY Ascii 'ttxt' 'ttro' "Text File"
RELEASE_NOTES Ascii 'ttxt' 'ttro' "Text File"
.b Raw 'chrp' 'tbxi' "Macintosh Toolbox ROM file"
.gif Raw '8BIM' 'GIFf' "Gif File"
.jpg Raw '8BIM' 'JPEG' "Jpeg File"
.tif Raw '8BIM' 'TIFF' "Photoshop TIFF image"
.hqx Ascii 'BnHq' 'TEXT' "BinHex file"
.doc Raw 'MSWD' 'WDBN' "Word file"
.mov Raw 'TVOD' 'MooV' "QuickTime Movie"
.html Ascii 'MOSS' 'TEXT' "HTML File"
.htm Ascii 'MOSS' 'TEXT' "HTML File"
.conf Ascii 'ttxt' 'TEXT' "config file"
.txt Ascii 'ttxt' 'TEXT' "Text File"
.tbxi Raw 'chrp' 'tbxi' "Macintosh Toolbox ROM file"
.sea Raw 'aust' 'APPL' "Self Expanding Archive"
.sit Raw 'SIT!' 'SITD' "Stuffit Expander file"
* Raw '????' '????' "Unknown"

View File

@ -0,0 +1,74 @@
<CHRP-BOOT>
<COMPATIBLE>
MacRISC MacRISC3 MacRISC4
</COMPATIBLE>
<DESCRIPTION>
Boot Chooser
</DESCRIPTION>
<BOOT-SCRIPT>
" screen" output
load-base release-load-area
" /cpus/@0" find-package if
" 64-bit" rot get-package-property 0= if
2drop
" boot cd:,\ppc\mac\yaboot conf=cd:,\ppc\ppc64\yaboot.conf" eval
else
" boot cd:,\ppc\mac\yaboot conf=cd:,\ppc\ppc32\yaboot.conf" eval
then
then
</BOOT-SCRIPT>
<OS-BADGE-ICONS>
1010
000000000000F8FEACF6000000000000
0000000000F5FFFFFEFEF50000000000
00000000002BFAFEFAFCF70000000000
0000000000F65D5857812B0000000000
0000000000F5350B2F88560000000000
0000000000F6335708F8FE0000000000
00000000005600F600F5FD8100000000
00000000F9F8000000F5FAFFF8000000
000000008100F5F50000F6FEFE000000
000000F8F700F500F50000FCFFF70000
00000088F70000F50000F5FCFF2B0000
0000002F582A00F5000008ADE02C0000
00090B0A35A62B0000002D3B350A0000
000A0A0B0B3BF60000505E0B0A0B0A00
002E350B0B2F87FAFCF45F0B2E090000
00000007335FF82BF72B575907000000
000000000000ACFFFF81000000000000
000000000081FFFFFFFF810000000000
0000000000FBFFFFFFFFAC0000000000
000000000081DFDFDFFFFB0000000000
000000000081DD5F83FFFD0000000000
000000000081DDDF5EACFF0000000000
0000000000FDF981F981FFFF00000000
00000000FFACF9F9F981FFFFAC000000
00000000FFF98181F9F981FFFF000000
000000ACACF981F981F9F9FFFFAC0000
000000FFACF9F981F9F981FFFFFB0000
00000083DFFBF981F9F95EFFFFFC0000
005F5F5FDDFFFBF9F9F983DDDD5F0000
005F5F5F5FDD81F9F9E7DF5F5F5F5F00
0083DD5F5F83FFFFFFFFDF5F835F0000
000000FBDDDFACFBACFBDFDFFB000000
000000000000FFFFFFFF000000000000
0000000000FFFFFFFFFFFF0000000000
0000000000FFFFFFFFFFFF0000000000
0000000000FFFFFFFFFFFF0000000000
0000000000FFFFFFFFFFFF0000000000
0000000000FFFFFFFFFFFF0000000000
0000000000FFFFFFFFFFFFFF00000000
00000000FFFFFFFFFFFFFFFFFF000000
00000000FFFFFFFFFFFFFFFFFF000000
000000FFFFFFFFFFFFFFFFFFFFFF0000
000000FFFFFFFFFFFFFFFFFFFFFF0000
000000FFFFFFFFFFFFFFFFFFFFFF0000
00FFFFFFFFFFFFFFFFFFFFFFFFFF0000
00FFFFFFFFFFFFFFFFFFFFFFFFFFFF00
00FFFFFFFFFFFFFFFFFFFFFFFFFF0000
000000FFFFFFFFFFFFFFFFFFFF000000
</OS-BADGE-ICONS>
</CHRP-BOOT>

View File

@ -0,0 +1,16 @@
init-message = "\nWelcome to the @PRODUCT@ @VERSION@ installer!\nUse 'linux32' for 32-bit kernel.\n\n"
timeout=6000
default=linux
image=/ppc/ppc64/vmlinuz
label=linux64
alias=linux
initrd=/ppc/ppc64/ramdisk.image.gz
read-only
append="@ROOT@"
image=/ppc/ppc32/vmlinuz
label=linux32
initrd=/ppc/ppc32/ramdisk.image.gz
read-only
append="@ROOT@"

View File

@ -0,0 +1,9 @@
init-message = "\nWelcome to the @BITS@-bit @PRODUCT@ @VERSION@ installer!\nHit <TAB> for boot options.\n\n"
timeout=6000
default=linux
image=/ppc/ppc@BITS@/vmlinuz
label=linux
initrd=/ppc/ppc@BITS@/initrd.img
read-only
append="@ROOT@ rd.live.image quiet"

View File

@ -0,0 +1,5 @@
* minimal lpar ins file
images/kernel.img 0x00000000
images/initrd.img @INITRD_LOAD_ADDRESS@
images/genericdvd.prm 0x00010480
images/initrd.addrsize 0x00010408

View File

@ -0,0 +1 @@
ro ramdisk_size=40000 cio_ignore=all,!condev @EXTRA@

View File

@ -0,0 +1 @@
ro ramdisk_size=40000 cio_ignore=all,!condev rd.cmdline=ask

View File

@ -0,0 +1,9 @@
/* */
'CL RDR'
'PURGE RDR ALL'
'SPOOL PUNCH * RDR'
'PUNCH KERNEL IMG A (NOH'
'PUNCH GENERIC PRM A (NOH'
'PUNCH INITRD IMG A (NOH'
'CH RDR ALL KEEP NOHOLD'
'I 00C'

View File

@ -1,13 +1,13 @@
#debug --graphics #debug --graphics
default=0 default=1
splashimage=@SPLASHPATH@ splashimage=@SPLASHPATH@
timeout 5 timeout 60
hiddenmenu hiddenmenu
title Start @PRODUCT@ @VERSION@ title Start @PRODUCT@ @VERSION@
findiso findiso
kernel @KERNELPATH@ @ROOT@ rd.live.image rd.luks=0 rd.md=0 rd.dm=0 quiet kernel @KERNELPATH@ @ROOT@ @EXTRA@ rd.live.image quiet
initrd @INITRDPATH@ initrd @INITRDPATH@
title Test this media & start @PRODUCT@ @VERSION@ title Test this media & start @PRODUCT@ @VERSION@
findiso findiso
kernel @KERNELPATH@ @ROOT@ rd.live.image rd.luks=0 rd.md=0 rd.dm=0 rd.live.check quiet kernel @KERNELPATH@ @ROOT@ @EXTRA@ rd.live.image rd.live.check quiet
initrd @INITRDPATH@ initrd @INITRDPATH@

View File

@ -0,0 +1,43 @@
set default="1"
function load_video {
insmod efi_gop
insmod efi_uga
insmod video_bochs
insmod video_cirrus
insmod all_video
}
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod ext2
set timeout=60
### END /etc/grub.d/00_header ###
search --no-floppy --set=root -l '@ISOLABEL@'
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Start @PRODUCT@ @VERSION@' --class fedora --class gnu-linux --class gnu --class os {
linuxefi @KERNELPATH@ @ROOT@ rd.live.image quiet
initrdefi @INITRDPATH@
}
menuentry 'Test this media & start @PRODUCT@ @VERSION@' --class fedora --class gnu-linux --class gnu --class os {
linuxefi @KERNELPATH@ @ROOT@ rd.live.image rd.live.check quiet
initrdefi @INITRDPATH@
}
submenu 'Troubleshooting -->' {
menuentry 'Start @PRODUCT@ @VERSION@ in basic graphics mode' --class fedora --class gnu-linux --class gnu --class os {
linuxefi @KERNELPATH@ @ROOT@ rd.live.image xdriver=vesa nomodeset quiet
initrdefi @INITRDPATH@
}
menuentry 'Rescue a @PRODUCT@ system' --class fedora --class gnu-linux --class gnu --class os {
linuxefi @KERNELPATH@ @ROOT@ rd.live.image rescue quiet
initrdefi @INITRDPATH@
}
menuentry '@PRODUCT@ @VERSION@ Secure Boot Lockdown' {
chainloader /EFI/BOOT/lockdown.efi
}
}

View File

@ -1,4 +1,4 @@
set default="0" set default="1"
function load_video { function load_video {
insmod efi_gop insmod efi_gop
@ -14,27 +14,27 @@ insmod gzio
insmod part_gpt insmod part_gpt
insmod ext2 insmod ext2
set timeout=5 set timeout=60
### END /etc/grub.d/00_header ### ### END /etc/grub.d/00_header ###
search --no-floppy --set=root -l '@ISOLABEL@' search --no-floppy --set=root -l '@ISOLABEL@'
### BEGIN /etc/grub.d/10_linux ### ### BEGIN /etc/grub.d/10_linux ###
menuentry 'Start @PRODUCT@ @VERSION@' --class fedora --class gnu-linux --class gnu --class os { menuentry 'Start @PRODUCT@ @VERSION@' --class fedora --class gnu-linux --class gnu --class os {
linuxefi @KERNELPATH@ @ROOT@ rd.live.image rd.luks=0 rd.md=0 rd.dm=0 quiet linuxefi @KERNELPATH@ @ROOT@ @EXTRA@ rd.live.image quiet
initrdefi @INITRDPATH@ initrdefi @INITRDPATH@
} }
menuentry 'Test this media & start @PRODUCT@ @VERSION@' --class fedora --class gnu-linux --class gnu --class os { menuentry 'Test this media & start @PRODUCT@ @VERSION@' --class fedora --class gnu-linux --class gnu --class os {
linuxefi @KERNELPATH@ @ROOT@ rd.live.image rd.luks=0 rd.md=0 rd.dm=0 rd.live.check quiet linuxefi @KERNELPATH@ @ROOT@ @EXTRA@ rd.live.image rd.live.check quiet
initrdefi @INITRDPATH@ initrdefi @INITRDPATH@
} }
submenu 'Troubleshooting -->' { submenu 'Troubleshooting -->' {
menuentry 'Start @PRODUCT@ @VERSION@ in basic graphics mode' --class fedora --class gnu-linux --class gnu --class os { menuentry 'Start @PRODUCT@ @VERSION@ in basic graphics mode' --class fedora --class gnu-linux --class gnu --class os {
linuxefi @KERNELPATH@ @ROOT@ rd.live.image rd.luks=0 rd.md=0 rd.dm=0 xdriver=vesa nomodeset quiet linuxefi @KERNELPATH@ @ROOT@ @EXTRA@ rd.live.image xdriver=vesa nomodeset quiet
initrdefi @INITRDPATH@ initrdefi @INITRDPATH@
} }
menuentry 'Rescue a @PRODUCT@ system' --class fedora --class gnu-linux --class gnu --class os { menuentry 'Rescue a @PRODUCT@ system' --class fedora --class gnu-linux --class gnu --class os {
linuxefi @KERNELPATH@ @ROOT@ rd.live.image rd.luks=0 rd.md=0 rd.dm=0 rescue quiet linuxefi @KERNELPATH@ @ROOT@ @EXTRA@ rd.live.image rescue quiet
initrdefi @INITRDPATH@ initrdefi @INITRDPATH@
} }
} }

View File

@ -61,13 +61,13 @@ menu separator # insert an empty line
label linux label linux
menu label ^Start @PRODUCT@ @VERSION@ menu label ^Start @PRODUCT@ @VERSION@
kernel vmlinuz kernel vmlinuz
append initrd=initrd.img @ROOT@ rd.live.image rd.luks=0 rd.md=0 rd.dm=0 quiet append initrd=initrd.img @ROOT@ @EXTRA@ rd.live.image quiet
label check label check
menu label Test this ^media & start @PRODUCT@ @VERSION@ menu label Test this ^media & start @PRODUCT@ @VERSION@
menu default menu default
kernel vmlinuz kernel vmlinuz
append initrd=initrd.img @ROOT@ rd.live.image rd.luks=0 rd.md=0 rd.dm=0 rd.live.check quiet append initrd=initrd.img @ROOT@ @EXTRA@ rd.live.image rd.live.check quiet
menu separator # insert an empty line menu separator # insert an empty line
@ -83,7 +83,7 @@ label vesa
@PRODUCT@ @VERSION@. @PRODUCT@ @VERSION@.
endtext endtext
kernel vmlinuz kernel vmlinuz
append initrd=initrd.img @ROOT@ rd.live.image rd.luks=0 rd.md=0 rd.dm=0 xdriver=vesa nomodeset quiet append initrd=initrd.img @ROOT@ @EXTRA@ rd.live.image xdriver=vesa nomodeset quiet
label rescue label rescue
menu indent count 5 menu indent count 5
@ -93,7 +93,7 @@ label rescue
and edit config files to try to get it booting again. and edit config files to try to get it booting again.
endtext endtext
kernel vmlinuz kernel vmlinuz
append initrd=initrd.img @ROOT@ rd.live.image rd.luks=0 rd.md=0 rd.dm=0 rescue quiet append initrd=initrd.img @ROOT@ @EXTRA@ rd.live.image rescue quiet
label memtest label memtest
menu label Run a ^memory test menu label Run a ^memory test

View File

@ -1,5 +1,6 @@
<%page args="configdir, KERNELDIR, efiarch, isolabel"/> <%page args="configdir, KERNELDIR, efiarch32, efiarch64, isolabel, extra_boot_args"/>
<% <%
from string import lower
EFIBOOTDIR="EFI/BOOT" EFIBOOTDIR="EFI/BOOT"
APPLE_EFI_ICON=inroot+"/usr/share/pixmaps/bootloader/fedora.icns" APPLE_EFI_ICON=inroot+"/usr/share/pixmaps/bootloader/fedora.icns"
APPLE_EFI_DISKNAME=inroot+"/usr/share/pixmaps/bootloader/fedora-media.vol" APPLE_EFI_DISKNAME=inroot+"/usr/share/pixmaps/bootloader/fedora-media.vol"
@ -7,8 +8,19 @@ APPLE_EFI_DISKNAME=inroot+"/usr/share/pixmaps/bootloader/fedora-media.vol"
mkdir ${EFIBOOTDIR} mkdir ${EFIBOOTDIR}
mkdir ${EFIBOOTDIR}/fonts/ mkdir ${EFIBOOTDIR}/fonts/
install boot/efi/EFI/*/shim.efi ${EFIBOOTDIR}/BOOT${efiarch}.efi %if exists("usr/share/shim/lockdown.efi"):
install boot/efi/EFI/*/gcdx64.efi ${EFIBOOTDIR}/grubx64.efi install usr/share/shim/lockdown.efi ${EFIBOOTDIR}/
%endif
%if efiarch64:
install boot/efi/EFI/*/shim${efiarch64|lower}.efi ${EFIBOOTDIR}/BOOT${efiarch64}.EFI
install boot/efi/EFI/*/mm${efiarch64|lower}.efi ${EFIBOOTDIR}/
install boot/efi/EFI/*/gcd${efiarch64|lower}.efi ${EFIBOOTDIR}/grub${efiarch64|lower}.efi
%endif
%if efiarch32:
install boot/efi/EFI/*/shim${efiarch32|lower}.efi ${EFIBOOTDIR}/BOOT${efiarch32}.EFI
install boot/efi/EFI/*/mm${efiarch32|lower}.efi ${EFIBOOTDIR}/
install boot/efi/EFI/*/gcd${efiarch32|lower}.efi ${EFIBOOTDIR}/grub${efiarch32|lower}.efi
%endif
install boot/efi/EFI/*/fonts/unicode.pf2 ${EFIBOOTDIR}/fonts/ install boot/efi/EFI/*/fonts/unicode.pf2 ${EFIBOOTDIR}/fonts/
## actually make the EFI images ## actually make the EFI images
@ -30,21 +42,23 @@ ${make_efiboot("images/efiboot.img")}
copy ${KERNELDIR}/vmlinuz ${EFIBOOTDIR} copy ${KERNELDIR}/vmlinuz ${EFIBOOTDIR}
copy ${KERNELDIR}/initrd.img ${EFIBOOTDIR} copy ${KERNELDIR}/initrd.img ${EFIBOOTDIR}
%endif %endif
install ${configdir}/grub2-efi.cfg ${eficonf} %if exists("usr/share/shim/lockdown.efi"):
install ${configdir}/grub2-efi-lockdown.cfg ${eficonf}
%else:
install ${configdir}/grub2-efi.cfg ${eficonf}
%endif
replace @PRODUCT@ '${product.name}' ${eficonf} replace @PRODUCT@ '${product.name}' ${eficonf}
replace @VERSION@ ${product.version} ${eficonf} replace @VERSION@ ${product.version} ${eficonf}
replace @KERNELNAME@ vmlinuz ${eficonf} replace @KERNELNAME@ vmlinuz ${eficonf}
replace @KERNELPATH@ /${kdir}/vmlinuz ${eficonf} replace @KERNELPATH@ /${kdir}/vmlinuz ${eficonf}
replace @INITRDPATH@ /${kdir}/initrd.img ${eficonf} replace @INITRDPATH@ /${kdir}/initrd.img ${eficonf}
replace @ISOLABEL@ '${isolabel}' ${eficonf} replace @ISOLABEL@ '${isolabel}' ${eficonf}
replace @EXTRA@ '${extra_boot_args}' ${eficonf}
%if disk: %if disk:
replace @ROOT@ root=live:LABEL=ANACONDA ${eficonf} replace @ROOT@ root=live:LABEL=ANACONDA ${eficonf}
%else: %else:
replace @ROOT@ 'root=live:CDLABEL=${isolabel|udev}' ${eficonf} replace @ROOT@ 'root=live:CDLABEL=${isolabel|udev}' ${eficonf}
%endif %endif
%if efiarch == 'IA32':
copy ${eficonf} ${EFIBOOTDIR}/BOOT.conf
%endif
runcmd mkefiboot ${args} ${outroot}/${EFIBOOTDIR} ${outroot}/${img} runcmd mkefiboot ${args} ${outroot}/${EFIBOOTDIR} ${outroot}/${img}
%if include_kernel: %if include_kernel:
remove ${EFIBOOTDIR}/vmlinuz remove ${EFIBOOTDIR}/vmlinuz

View File

@ -1,24 +1,17 @@
<%page args="kernels, runtime_img, basearch, libdir, inroot, outroot, product, isolabel"/> <%page args="kernels, runtime_img, basearch, libdir, inroot, outroot, product, isolabel, extra_boot_args"/>
<% <%
configdir="tmp/config_files/ppc" configdir="tmp/config_files/ppc"
BOOTDIR="ppc" BOOTDIR="ppc"
GRUBDIR="boot/grub"
LIVEDIR="LiveOS" LIVEDIR="LiveOS"
MACDIR=BOOTDIR+"/mac" MACDIR=BOOTDIR+"/mac"
NETBOOTDIR="images/netboot" NETBOOTDIR="images/netboot"
LORAXDIR="usr/share/lorax/"
WRAPPER="usr/sbin/wrapper" WRAPPER="usr/sbin/wrapper"
WRAPPER_DATA="usr/"+libdir+"/kernel-wrapper" WRAPPER_DATA="usr/"+libdir+"/kernel-wrapper"
bitsizes = set()
prepboot = "" prepboot = ""
## NOTE: yaboot freaks out and stops parsing its config if it sees a '\',
## so we can't use the udev escape sequences in the root arg.
## Instead we'll just replace any non-ASCII characters in the isolabel
## with '_', which means we won't need any udev escapes.
isolabel = ''.join(ch if ch.isalnum() else '_' for ch in isolabel)
rootarg = "root=live:CDLABEL=%s" % isolabel
%> %>
mkdir ${LIVEDIR} mkdir ${LIVEDIR}
@ -35,43 +28,40 @@ treeinfo stage2 mainimage ${LIVEDIR}/squashfs.img
mkdir ${BOOTDIR} mkdir ${BOOTDIR}
## boot stuff for normal (CHRP/PREP) PPC systems ## boot stuff for normal (CHRP/PREP) PPC systems
install ${configdir}/bootinfo.txt ${BOOTDIR} install ${configdir}/bootinfo.txt ${BOOTDIR}
install boot/efika.forth ${BOOTDIR}
mkdir ${BOOTDIR}/chrp mkdir ${GRUBDIR}/powerpc-ieee1275
install usr/lib/yaboot/yaboot ${BOOTDIR}/chrp runcmd grub2-mkimage -O powerpc-ieee1275 -d /usr/lib/grub/powerpc-ieee1275 -p '()/boot/grub' \
runcmd ${inroot}/usr/lib/yaboot/addnote ${outroot}/${BOOTDIR}/chrp/yaboot -o ${outroot}/${GRUBDIR}/powerpc-ieee1275/core.elf iso9660 ext2 ofnet net tftp http
## special boot dir for PowerMacs install /usr/lib/grub/powerpc-ieee1275/*.mod ${GRUBDIR}/powerpc-ieee1275
mkdir ${MACDIR} install /usr/lib/grub/powerpc-ieee1275/*.lst ${GRUBDIR}/powerpc-ieee1275
install usr/lib/yaboot/yaboot ${MACDIR}
install ${configdir}/ofboot.b ${MACDIR}
install ${configdir}/grub.cfg.in ${GRUBDIR}/grub.cfg
replace @PRODUCT@ '${product.name}' ${GRUBDIR}/grub.cfg
replace @VERSION@ ${product.version} ${GRUBDIR}/grub.cfg
replace @ROOT@ 'root=live:CDLABEL=${isolabel|udev}' ${GRUBDIR}/grub.cfg
replace @EXTRA@ '${extra_boot_args}' ${GRUBDIR}/grub.cfg
## copy mapping and magic files needed for isos ## copy mapping and magic files needed for isos
install ${configdir}/mapping ${BOOTDIR} install ${configdir}/mapping ${BOOTDIR}
install ${configdir}/magic ${BOOTDIR} install ${configdir}/magic ${BOOTDIR}
## NOTE: PPC is kind of funky. There's three possible "arch" setups here: ## NOTE: PPC is kind of funky. There's three possible "arch" setups here:
## ppc, ppc64, and 'hybrid' (ppc userspace, both ppc & ppc64 kernels). ## ppc, ppc64, ppc64le and 'hybrid' (ppc userspace, both ppc & ppc64 kernels).
## Install kernel and bootloader config (in separate places for each arch) ## Install kernel and bootloader config (in separate places for each arch)
%for kernel in kernels: %for kernel in kernels:
<% <%
bits = 64 if kernel.arch == "ppc64" else 32 bits = 64 if kernel.arch in ("ppc64", "ppc64le") else 32
## separate dirs/images for each arch ## separate dirs/images for each arch
KERNELDIR=BOOTDIR+"/ppc%s" % bits KERNELDIR=BOOTDIR+"/ppc%s" % bits
NETIMG=NETBOOTDIR+"/ppc%s.img" % bits NETIMG=NETBOOTDIR+"/ppc%s.img" % bits
bitsizes.add(bits)
%> %>
## install kernel ## install kernel
mkdir ${KERNELDIR} ${NETBOOTDIR} mkdir ${KERNELDIR} ${NETBOOTDIR}
installkernel images-${kernel.arch} ${kernel.path} ${KERNELDIR}/vmlinuz installkernel images-${kernel.arch} ${kernel.path} ${KERNELDIR}/vmlinuz
installinitrd images-${kernel.arch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img installinitrd images-${kernel.arch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img
## install arch-specific bootloader config
install ${configdir}/yaboot.conf.in ${KERNELDIR}/yaboot.conf
replace @BITS@ ${bits} ${KERNELDIR}/yaboot.conf
replace @PRODUCT@ '${product.name}' ${KERNELDIR}/yaboot.conf
replace @VERSION@ ${product.version} ${KERNELDIR}/yaboot.conf
replace @ROOT@ "${rootarg}" ${KERNELDIR}/yaboot.conf
## kernel-wrapper magic that makes the netboot combined ppc{32,64}.img ## kernel-wrapper magic that makes the netboot combined ppc{32,64}.img
runcmd ${inroot}/${WRAPPER} -p of \ runcmd ${inroot}/${WRAPPER} -p of \
-D ${inroot}/${WRAPPER_DATA} \ -D ${inroot}/${WRAPPER_DATA} \
@ -86,18 +76,14 @@ install ${configdir}/magic ${BOOTDIR}
%endif %endif
%endfor %endfor
## choose correct yaboot.conf # Create optional product.img and updates.img
mkdir etc <% imggraft=""; images=["product", "updates"] %>
%if len(bitsizes) == 2: %for img in images:
## both kernels means hybrid - use the magic hybrid config %if exists("%s/%s/" % (LORAXDIR, img)):
install ${configdir}/yaboot.conf.3264 etc/yaboot.conf installimg ${LORAXDIR}/${img}/ images/${img}.img
replace @PRODUCT@ ${product.name} etc/yaboot.conf <% imggraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %>
replace @VERSION@ ${product.version} etc/yaboot.conf %endif
replace @ROOT@ "${rootarg}" etc/yaboot.conf %endfor
%else:
## single arch - use the arch-specific yaboot.conf from above
copy ${KERNELDIR}/yaboot.conf etc/yaboot.conf
%endif
## make boot.iso ## make boot.iso
runcmd mkisofs -o ${outroot}/images/boot.iso -chrp-boot -U \ runcmd mkisofs -o ${outroot}/images/boot.iso -chrp-boot -U \
@ -107,10 +93,10 @@ runcmd mkisofs -o ${outroot}/images/boot.iso -chrp-boot -U \
-hfs-volid ${product.version} -hfs-bless ${outroot}/${MACDIR} \ -hfs-volid ${product.version} -hfs-bless ${outroot}/${MACDIR} \
-map ${inroot}/${configdir}/mapping \ -map ${inroot}/${configdir}/mapping \
-no-desktop -allow-multidot -graft-points \ -no-desktop -allow-multidot -graft-points \
etc=${outroot}/etc \
${BOOTDIR}=${outroot}/${BOOTDIR} \ ${BOOTDIR}=${outroot}/${BOOTDIR} \
${GRUBDIR}=${outroot}/${GRUBDIR} \
${NETBOOTDIR}=${outroot}/${NETBOOTDIR} \ ${NETBOOTDIR}=${outroot}/${NETBOOTDIR} \
${LIVEDIR}=${outroot}/${LIVEDIR} ${LIVEDIR}=${outroot}/${LIVEDIR} ${imggraft}
%for kernel in kernels: %for kernel in kernels:
treeinfo images-${kernel.arch} boot.iso images/boot.iso treeinfo images-${kernel.arch} boot.iso images/boot.iso

View File

@ -1,9 +1,10 @@
<%page args="kernels, runtime_img, runtime_base, basearch, outroot"/> <%page args="kernels, runtime_img, runtime_base, basearch, outroot, extra_boot_args"/>
<% <%
configdir="tmp/config_files/s390" configdir="tmp/config_files/s390"
BOOTDIR="images" BOOTDIR="images"
KERNELDIR=BOOTDIR KERNELDIR=BOOTDIR
INITRD_ADDRESS="0x02000000" INITRD_ADDRESS="0x02000000"
LORAXDIR="usr/share/lorax/"
# The assumption seems to be that there is only one s390 kernel, ever # The assumption seems to be that there is only one s390 kernel, ever
kernel = kernels[0] kernel = kernels[0]
%> %>
@ -15,10 +16,12 @@ treeinfo stage2 mainimage images/${runtime_base}
## install bootloader (such as it is) and bootloader config ## install bootloader (such as it is) and bootloader config
install ${configdir}/redhat.exec ${BOOTDIR} install ${configdir}/redhat.exec ${BOOTDIR}
install ${configdir}/generic.prm ${BOOTDIR} install ${configdir}/generic.prm ${BOOTDIR}
install ${configdir}/genericdvd.prm ${BOOTDIR}
install ${configdir}/generic.ins . install ${configdir}/generic.ins .
## configure bootloader ## configure bootloader
replace @INITRD_LOAD_ADDRESS@ ${INITRD_ADDRESS} generic.ins replace @INITRD_LOAD_ADDRESS@ ${INITRD_ADDRESS} generic.ins
replace @EXTRA@ '${extra_boot_args}' ${BOOTDIR}/generic.prm
## install kernel ## install kernel
installkernel images-${basearch} ${kernel.path} ${KERNELDIR}/kernel.img installkernel images-${basearch} ${kernel.path} ${KERNELDIR}/kernel.img
@ -30,4 +33,15 @@ createaddrsize ${INITRD_ADDRESS} ${outroot}/${BOOTDIR}/initrd.img ${outroot}/${B
## s390 also has some special treeinfo data ## s390 also has some special treeinfo data
treeinfo images-${basearch} initrd.addrsize ${BOOTDIR}/initrd.addrsize treeinfo images-${basearch} initrd.addrsize ${BOOTDIR}/initrd.addrsize
treeinfo images-${basearch} generic.prm ${BOOTDIR}/generic.prm treeinfo images-${basearch} generic.prm ${BOOTDIR}/generic.prm
treeinfo images-${basearch} genericdvd.prm ${BOOTDIR}/genericdvd.prm
treeinfo images-${basearch} generic.ins generic.ins treeinfo images-${basearch} generic.ins generic.ins
treeinfo images-${basearch} redhat.exec ${BOOTDIR}/redhat.exec
# Create optional product.img and updates.img
<% imggraft=""; images=["product", "updates"] %>
%for img in images:
%if exists("%s/%s/" % (LORAXDIR, img)):
installimg ${LORAXDIR}/${img}/ images/${img}.img
<% imggraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %>
%endif
%endfor

View File

@ -1,4 +1,4 @@
<%page args="kernels, runtime_img, basearch, outroot, product, isolabel"/> <%page args="kernels, runtime_img, basearch, outroot, product, isolabel, extra_boot_args"/>
<% <%
configdir="tmp/config_files/x86" configdir="tmp/config_files/x86"
SYSLINUXDIR="usr/share/syslinux" SYSLINUXDIR="usr/share/syslinux"
@ -6,6 +6,7 @@ PXEBOOTDIR="images/pxeboot"
BOOTDIR="isolinux" BOOTDIR="isolinux"
KERNELDIR=PXEBOOTDIR KERNELDIR=PXEBOOTDIR
LIVEDIR="LiveOS" LIVEDIR="LiveOS"
LORAXDIR="usr/share/lorax/"
%> %>
mkdir ${LIVEDIR} mkdir ${LIVEDIR}
@ -26,6 +27,7 @@ install boot/memtest* ${BOOTDIR}/memtest
replace @VERSION@ ${product.version} ${BOOTDIR}/grub.conf ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg replace @VERSION@ ${product.version} ${BOOTDIR}/grub.conf ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg
replace @PRODUCT@ '${product.name}' ${BOOTDIR}/grub.conf ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg replace @PRODUCT@ '${product.name}' ${BOOTDIR}/grub.conf ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg
replace @ROOT@ 'root=live:CDLABEL=${isolabel|udev}' ${BOOTDIR}/isolinux.cfg replace @ROOT@ 'root=live:CDLABEL=${isolabel|udev}' ${BOOTDIR}/isolinux.cfg
replace @EXTRA@ '${extra_boot_args}' ${BOOTDIR}/isolinux.cfg
## install kernels ## install kernels
mkdir ${KERNELDIR} mkdir ${KERNELDIR}
@ -47,11 +49,15 @@ hardlink ${KERNELDIR}/initrd.img ${BOOTDIR}
%endif %endif
## WHeeeeeeee, EFI. ## WHeeeeeeee, EFI.
## We could remove the basearch restriction someday.. <% efiargs=""; efigraft=""; efihybrid=""; efiarch32=None; efiarch64=None %>
<% efiargs=""; efigraft=""; efihybrid="" %> %if exists("boot/efi/EFI/*/gcdia32.efi"):
%if exists("boot/efi/EFI/fedora/gcdx64.efi") and basearch != 'i386': <% efiarch32 = 'IA32' %>
%endif
%if exists("boot/efi/EFI/*/gcdx64.efi"):
<% efiarch64 = 'X64' %>
%endif
%if efiarch32 or efiarch64:
<% <%
efiarch = 'X64' if basearch=='x86_64' else 'IA32'
efigraft="EFI/BOOT={0}/EFI/BOOT".format(outroot) efigraft="EFI/BOOT={0}/EFI/BOOT".format(outroot)
images = ["images/efiboot.img"] images = ["images/efiboot.img"]
if domacboot: if domacboot:
@ -61,9 +67,18 @@ hardlink ${KERNELDIR}/initrd.img ${BOOTDIR}
efigraft += " {0}={1}/{0}".format(img,outroot) efigraft += " {0}={1}/{0}".format(img,outroot)
efihybrid = "--uefi --mac" if domacboot else "--uefi" efihybrid = "--uefi --mac" if domacboot else "--uefi"
%> %>
<%include file="efi.tmpl" args="configdir=configdir, KERNELDIR=KERNELDIR, efiarch=efiarch, isolabel=isolabel"/> <%include file="efi.tmpl" args="configdir=configdir, KERNELDIR=KERNELDIR, efiarch32=efiarch32, efiarch64=efiarch64, isolabel=isolabel, extra_boot_args=extra_boot_args"/>
%endif %endif
# Create optional product.img and updates.img
<% imggraft=""; images=["product", "updates"] %>
%for img in images:
%if exists("%s/%s/" % (LORAXDIR, img)):
installimg ${LORAXDIR}/${img}/ images/${img}.img
<% imggraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %>
%endif
%endfor
## make boot.iso ## make boot.iso
runcmd mkisofs -o ${outroot}/images/boot.iso \ runcmd mkisofs -o ${outroot}/images/boot.iso \
-b ${BOOTDIR}/isolinux.bin -c ${BOOTDIR}/boot.cat \ -b ${BOOTDIR}/isolinux.bin -c ${BOOTDIR}/boot.cat \
@ -72,6 +87,6 @@ runcmd mkisofs -o ${outroot}/images/boot.iso \
${BOOTDIR}=${outroot}/${BOOTDIR} \ ${BOOTDIR}=${outroot}/${BOOTDIR} \
${KERNELDIR}=${outroot}/${KERNELDIR} \ ${KERNELDIR}=${outroot}/${KERNELDIR} \
${LIVEDIR}=${outroot}/${LIVEDIR} \ ${LIVEDIR}=${outroot}/${LIVEDIR} \
${efigraft} ${efigraft} ${imggraft}
runcmd isohybrid ${efihybrid} ${outroot}/images/boot.iso runcmd isohybrid ${efihybrid} ${outroot}/images/boot.iso
treeinfo images-${basearch} boot.iso images/boot.iso treeinfo images-${basearch} boot.iso images/boot.iso

View File

@ -2,24 +2,16 @@
<% <%
configdir="tmp/config_files/ppc" configdir="tmp/config_files/ppc"
BOOTDIR="ppc" BOOTDIR="ppc"
GRUBDIR="boot/grub"
LIVEDIR="LiveOS" LIVEDIR="LiveOS"
MACDIR=BOOTDIR+"/mac" MACDIR=BOOTDIR+"/mac"
NETBOOTDIR="images/netboot" NETBOOTDIR="images/netboot"
LORAXDIR="usr/share/lorax/"
WRAPPER="usr/sbin/wrapper" WRAPPER="usr/sbin/wrapper"
WRAPPER_DATA="usr/"+libdir+"/kernel-wrapper" WRAPPER_DATA="usr/"+libdir+"/kernel-wrapper"
bitsizes = set()
prepboot = "" prepboot = ""
## NOTE: yaboot freaks out and stops parsing its config if it sees a '\',
## so we can't use the udev escape sequences in the root arg.
## Instead we'll just replace any non-ASCII characters in the isolabel
## with '_', which means we won't need any udev escapes.
isolabel = ''.join(ch if ch.isalnum() else '_' for ch in isolabel)
## Anaconda finds the CDROM device automatically
rootarg = ""
%> %>
mkdir ${LIVEDIR} mkdir ${LIVEDIR}
@ -36,30 +28,33 @@ treeinfo stage2 mainimage ${LIVEDIR}/squashfs.img
mkdir ${BOOTDIR} mkdir ${BOOTDIR}
## boot stuff for normal (CHRP/PREP) PPC systems ## boot stuff for normal (CHRP/PREP) PPC systems
install ${configdir}/bootinfo.txt ${BOOTDIR} install ${configdir}/bootinfo.txt ${BOOTDIR}
install boot/efika.forth ${BOOTDIR}
mkdir ${BOOTDIR}/chrp mkdir ${GRUBDIR}/powerpc-ieee1275
install usr/lib/yaboot/yaboot ${BOOTDIR}/chrp runcmd grub2-mkimage -O powerpc-ieee1275 -d /usr/lib/grub/powerpc-ieee1275 -p '()/boot/grub' \
runcmd ${inroot}/usr/lib/yaboot/addnote ${outroot}/${BOOTDIR}/chrp/yaboot -o ${outroot}/${GRUBDIR}/powerpc-ieee1275/core.elf iso9660 ext2 ofnet net tftp http
## special boot dir for PowerMacs install /usr/lib/grub/powerpc-ieee1275/*.mod ${GRUBDIR}/powerpc-ieee1275
mkdir ${MACDIR} install /usr/lib/grub/powerpc-ieee1275/*.lst ${GRUBDIR}/powerpc-ieee1275
install usr/lib/yaboot/yaboot ${MACDIR}
install ${configdir}/ofboot.b ${MACDIR}
install ${configdir}/grub.cfg.in ${GRUBDIR}/grub.cfg
replace @PRODUCT@ '${product.name}' ${GRUBDIR}/grub.cfg
replace @VERSION@ ${product.version} ${GRUBDIR}/grub.cfg
replace @ROOT@ 'inst.stage2=hd:LABEL=${isolabel|udev}' ${GRUBDIR}/grub.cfg
## copy mapping and magic files needed for isos ## copy mapping and magic files needed for isos
install ${configdir}/mapping ${BOOTDIR} install ${configdir}/mapping ${BOOTDIR}
install ${configdir}/magic ${BOOTDIR} install ${configdir}/magic ${BOOTDIR}
## NOTE: PPC is kind of funky. There's three possible "arch" setups here: ## NOTE: PPC is kind of funky. There's three possible "arch" setups here:
## ppc, ppc64, and 'hybrid' (ppc userspace, both ppc & ppc64 kernels). ## ppc, ppc64, ppc64le, and 'hybrid' (ppc userspace, both ppc & ppc64 kernels).
## Install kernel and bootloader config (in separate places for each arch) ## Install kernel and bootloader config (in separate places for each arch)
%for kernel in kernels: %for kernel in kernels:
<% <%
bits = 64 if kernel.arch == "ppc64" else 32 bits = 64 if kernel.arch in ("ppc64", "ppc64le") else 32
## separate dirs/images for each arch ## separate dirs/images for each arch
KERNELDIR=BOOTDIR+"/ppc%s" % bits KERNELDIR=BOOTDIR+"/ppc%s" % bits
NETIMG=NETBOOTDIR+"/ppc%s.img" % bits NETIMG=NETBOOTDIR+"/ppc%s.img" % bits
bitsizes.add(bits)
%> %>
## install kernel ## install kernel
mkdir ${KERNELDIR} ${NETBOOTDIR} mkdir ${KERNELDIR} ${NETBOOTDIR}
@ -71,13 +66,6 @@ install ${configdir}/magic ${BOOTDIR}
installupgradeinitrd images-${kernel.arch} ${kernel.upgrade.path} ${KERNELDIR}/upgrade.img installupgradeinitrd images-${kernel.arch} ${kernel.upgrade.path} ${KERNELDIR}/upgrade.img
%endif %endif
## install arch-specific bootloader config
install ${configdir}/yaboot.conf.in ${KERNELDIR}/yaboot.conf
replace @BITS@ ${bits} ${KERNELDIR}/yaboot.conf
replace @PRODUCT@ '${product.name}' ${KERNELDIR}/yaboot.conf
replace @VERSION@ ${product.version} ${KERNELDIR}/yaboot.conf
replace @ROOT@ "${rootarg}" ${KERNELDIR}/yaboot.conf
## kernel-wrapper magic that makes the netboot combined ppc{32,64}.img ## kernel-wrapper magic that makes the netboot combined ppc{32,64}.img
runcmd ${inroot}/${WRAPPER} -p of \ runcmd ${inroot}/${WRAPPER} -p of \
-D ${inroot}/${WRAPPER_DATA} \ -D ${inroot}/${WRAPPER_DATA} \
@ -92,18 +80,21 @@ install ${configdir}/magic ${BOOTDIR}
%endif %endif
%endfor %endfor
## choose correct yaboot.conf # Create optional product.img and updates.img
mkdir etc <% imggraft=""; images=["product", "updates"] %>
%if len(bitsizes) == 2: %for img in images:
## both kernels means hybrid - use the magic hybrid config %if exists("%s/%s/" % (LORAXDIR, img)):
install ${configdir}/yaboot.conf.3264 etc/yaboot.conf installimg ${LORAXDIR}/${img}/ images/${img}.img
replace @PRODUCT@ ${product.name} etc/yaboot.conf <% imggraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %>
replace @VERSION@ ${product.version} etc/yaboot.conf %endif
replace @ROOT@ "${rootarg}" etc/yaboot.conf %endfor
%else:
## single arch - use the arch-specific yaboot.conf from above # Inherit iso-graft/ if it exists from external templates
copy ${KERNELDIR}/yaboot.conf etc/yaboot.conf <%
%endif import os
if os.path.exists(workdir + "/iso-graft"):
imggraft += " " + workdir + "/iso-graft"
%>
## make boot.iso ## make boot.iso
runcmd mkisofs -o ${outroot}/images/boot.iso -chrp-boot -U \ runcmd mkisofs -o ${outroot}/images/boot.iso -chrp-boot -U \
@ -113,10 +104,11 @@ runcmd mkisofs -o ${outroot}/images/boot.iso -chrp-boot -U \
-hfs-volid ${product.version} -hfs-bless ${outroot}/${MACDIR} \ -hfs-volid ${product.version} -hfs-bless ${outroot}/${MACDIR} \
-map ${inroot}/${configdir}/mapping \ -map ${inroot}/${configdir}/mapping \
-no-desktop -allow-multidot -graft-points \ -no-desktop -allow-multidot -graft-points \
etc=${outroot}/etc \
${BOOTDIR}=${outroot}/${BOOTDIR} \ ${BOOTDIR}=${outroot}/${BOOTDIR} \
${GRUBDIR}=${outroot}/${GRUBDIR} \
${NETBOOTDIR}=${outroot}/${NETBOOTDIR} \ ${NETBOOTDIR}=${outroot}/${NETBOOTDIR} \
${LIVEDIR}=${outroot}/${LIVEDIR} ${LIVEDIR}=${outroot}/${LIVEDIR} ${imggraft}
%for kernel in kernels: %for kernel in kernels:
treeinfo images-${kernel.arch} boot.iso images/boot.iso treeinfo images-${kernel.arch} boot.iso images/boot.iso

View File

@ -0,0 +1,3 @@
# PXE configuration template generated by livemedia-creator
kernel <PXE_DIR>${kernel}
append initrd=<PXE_DIR>${initrd} root=live:<URL>/${liveimg} ${addargs}

View File

@ -10,22 +10,27 @@ remove usr/share/i18n
removepkg perl* removepkg perl*
%endif %endif
## no sound support, thanks ## no sound support, thanks
removepkg alsa* flac gstreamer-tools libsndfile pulseaudio* sound-theme-freedesktop ## ...except alsa-libs, which are needed by spice-vdagent
removepkg alsa-*firmware* flac gstreamer-tools libsndfile pulseaudio* sound-theme-freedesktop
removepkg midisport-firmware removepkg midisport-firmware
## no fancy video, either ## no fancy video, either
removepkg libcrystalhd crystalhd-firmware ivtv-firmware cx18-firmware removepkg libcrystalhd crystalhd-firmware ivtv-firmware cx18-firmware
removepkg mesa-dri-drivers
## we don't create new initramfs/bootloader conf inside anaconda ## we don't create new initramfs/bootloader conf inside anaconda
## (that happens inside the target system after we install dracut/grubby) ## (that happens inside the target system after we install dracut/grubby)
removepkg dracut-network grubby anaconda-dracut removepkg dracut-network grubby anaconda-dracut
removefrom ${product.name}-logos /usr/share/plymouth/*
## In order to execute the /usr move on upgrades we need convertfs from dracut ## In order to execute the /usr move on upgrades we need convertfs from dracut
## We also need dracut-shutdown.service and dracut-initramfs-restore to reboot ## We also need dracut-shutdown.service and dracut-initramfs-restore to reboot
removefrom dracut --allbut /usr/lib/dracut/modules.d/30convertfs/convertfs.sh \ removefrom dracut --allbut /usr/lib/dracut/modules.d/30convertfs/convertfs.sh \
/usr/lib/dracut/modules.d/99base/dracut-lib.sh \ /usr/lib/dracut/modules.d/99base/dracut-lib.sh \
/usr/lib/systemd/* /usr/lib/dracut/dracut-initramfs-restore /usr/lib/systemd/* /usr/lib/dracut/modules.d/98systemd/*.service \
/usr/lib/dracut/dracut-initramfs-restore
## we don't run SELinux (not in enforcing, anyway) ## we don't run SELinux (not in enforcing, anyway)
removepkg checkpolicy selinux-policy libselinux-utils removepkg checkpolicy selinux-policy libselinux-utils
## selinux checks for the /etc/selinux/config file's existance
## The removepkg above removes it, create an empty one. See rhbz#1243168
append etc/selinux/config ""
## anaconda has its own repo files ## anaconda has its own repo files
removefrom fedora-release --allbut /etc/os-release removefrom fedora-release --allbut /etc/os-release
removepkg fedora-release-rawhide removepkg fedora-release-rawhide
@ -39,8 +44,6 @@ removepkg gnupg2 pinentry
removepkg cups-libs iscan-firmware removepkg cups-libs iscan-firmware
## no storage device monitoring ## no storage device monitoring
removepkg device-mapper-event dmraid-events sgpio removepkg device-mapper-event dmraid-events sgpio
## we don't (currently) support deltarpms in anaconda
removepkg deltarpm
## no notifications in anaconda ## no notifications in anaconda
removepkg notification-daemon removepkg notification-daemon
## logrotate isn't useful in anaconda ## logrotate isn't useful in anaconda
@ -48,13 +51,15 @@ removepkg logrotate
remove /etc/logrotate.d remove /etc/logrotate.d
## anaconda needs this to do media check ## anaconda needs this to do media check
removefrom isomd5sum --allbut /usr/bin/checkisomd5 removefrom isomd5sum --allbut /usr/bin/checkisomd5
## remove ntp keep only config file
removefrom ntp --allbut /etc/ntp.conf
## various other things we remove to save space ## various other things we remove to save space
removepkg avahi-autoipd coreutils-libs curl dash db4-utils diffutils file removepkg avahi-autoipd coreutils-libs dash db4-utils diffutils file
removepkg genisoimage gnome-python2 info iptables removepkg genisoimage gnome-python2 info iptables
removepkg jasper-libs libXt libXxf86misc removepkg jasper-libs libXxf86misc
removepkg libasyncns libdaemon libhbaapi libhbalinux removepkg libasyncns libhbaapi libhbalinux
removepkg libmcpp libpcap libtiff libutempter linux-atm-libs removepkg libmcpp libtiff libutempter linux-atm-libs
removepkg lvm2-libs m4 mailx makebootfat mcpp removepkg lvm2-libs m4 mailx makebootfat mcpp
removepkg mingetty mobile-broadband-provider-info pkgconfig ppp pth removepkg mingetty mobile-broadband-provider-info pkgconfig ppp pth
removepkg rmt rpcbind squashfs-tools system-config-firewall-base removepkg rmt rpcbind squashfs-tools system-config-firewall-base
@ -62,7 +67,7 @@ removepkg tigervnc-license ttmkfdir xml-common xorg-x11-font-utils
removepkg xorg-x11-server-common yum-utils removepkg xorg-x11-server-common yum-utils
## other removals ## other removals
remove /boot /home /media /opt /srv /tmp/* remove /home /media /opt /srv /tmp/*
remove /usr/etc /usr/games /usr/local /usr/tmp remove /usr/etc /usr/games /usr/local /usr/tmp
remove /usr/share/doc /usr/share/info /usr/share/man /usr/share/gnome remove /usr/share/doc /usr/share/info /usr/share/man /usr/share/gnome
remove /usr/share/mime/application /usr/share/mime/audio /usr/share/mime/image remove /usr/share/mime/application /usr/share/mime/audio /usr/share/mime/image
@ -77,22 +82,23 @@ remove /var/lib/rpm/* /var/lib/yum
remove /usr/share/icons/*/icon-theme.cache remove /usr/share/icons/*/icon-theme.cache
## clean up kernel modules ## clean up kernel modules
<% removekmod sound drivers/media drivers/hwmon \
removekmods = """ net/atm net/bluetooth net/sched net/sctp \
sound drivers/media drivers/hwmon drivers/video drivers/char net/rds net/l2tp net/decnet net/netfilter net/ipv4 net/ipv6 \
net/atm net/bluetooth net/sched net/sctp net/bridge drivers/watchdog drivers/rtc drivers/input/joystick \
net/rds net/l2tp net/decnet net/netfilter net/ipv4 net/ipv6 drivers/bluetooth drivers/edac drivers/usb/serial \
drivers/watchdog drivers/target drivers/rtc drivers/input/joystick drivers/usb/host drivers/usb/misc fs/ocfs2 fs/ceph fs/nfsd \
drivers/bluetooth drivers/hid drivers/edac drivers/staging fs/ubifs fs/nilfs2 arch/x86/kvm
drivers/usb/serial drivers/usb/host drivers/usb/misc ## Need to keep virtio_console.ko and ipmi stuff in drivers/char
fs/ocfs2 fs/ceph fs/nfsd fs/ubifs fs/nilfs2 ## Also keep virtio-rng so that the installer can get sufficient randomness for
arch/x86/kvm ## LUKS setup.
""" removekmod drivers/char --allbut virtio_console hw_random \
%> virtio-rng ipmi hmcdrv
%for kmodpath in removekmods.split(): removekmod drivers/staging --allbut zram
remove lib/modules/*/kernel/${kmodpath} removekmod drivers/video --allbut hyperv_fb syscopyarea sysfillrect sysimgblt fb_sys_fops
%endfor
remove lib/modules/*/{build,source,*.map} remove lib/modules/*/{build,source,*.map}
## Need to keep hid-multitouch and i2c-hid in drivers/hid, rhbz#1526323
removekmod drivers/hid --allbut hid-multitouch i2c-hid
## NOTE: depmod gets re-run after cleanup finishes ## NOTE: depmod gets re-run after cleanup finishes
## remove unused themes, theme engines, icons, etc. ## remove unused themes, theme engines, icons, etc.
@ -112,7 +118,8 @@ removefrom metacity --allbut /usr/bin/* /usr/${libdir}/* /etc/*
## filesystem tools ## filesystem tools
removefrom e2fsprogs /usr/share/locale/* removefrom e2fsprogs /usr/share/locale/*
removefrom xfsprogs /usr/share/locale/* removefrom xfsprogs /usr/share/locale/* /usr/share/doc/* /usr/share/man/*
removefrom xfsdump --allbut /usr/sbin/*
## other package specific removals ## other package specific removals
removefrom GConf2 /etc/rpm/* /etc/xdg/* /usr/bin/* removefrom GConf2 /etc/rpm/* /etc/xdg/* /usr/bin/*
@ -135,11 +142,11 @@ removefrom authconfig /usr/sbin/* /usr/share/*
removefrom bash /etc/* /usr/bin/bashbug* /usr/share/* removefrom bash /etc/* /usr/bin/bashbug* /usr/share/*
removefrom bind-libs-lite /usr/${libdir}/libirs* removefrom bind-libs-lite /usr/${libdir}/libirs*
removefrom bind-libs-lite /usr/${libdir}/libisccfg-export* removefrom bind-libs-lite /usr/${libdir}/libisccfg-export*
removefrom bind-utils /usr/bin/dig /usr/bin/host /usr/bin/nsupdate removefrom bind-utils /usr/bin/dig /usr/bin/host /usr/bin/nsupdate /usr/bin/delv
removefrom bitmap-fangsongti-fonts /usr/share/fonts/* removefrom bitmap-fangsongti-fonts /usr/share/fonts/*
removefrom ca-certificates /etc/pki/java/* removefrom ca-certificates /etc/pki/java/*
removefrom ca-certificates /etc/pki/tls/certs/ca-bundle.trust.crt /etc/ssl/* removefrom ca-certificates /etc/pki/tls/certs/ca-bundle.trust.crt /etc/ssl/*
removefrom cairo /usr/${libdir}/libcairo-script* removefrom cairo /usr/${libdir}/libcairo-script* /usr/bin/cairo-sphinx
removefrom coreutils /etc/* /usr/bin/link /usr/bin/nice /usr/bin/stty /usr/bin/su /usr/bin/unlink removefrom coreutils /etc/* /usr/bin/link /usr/bin/nice /usr/bin/stty /usr/bin/su /usr/bin/unlink
removefrom coreutils /usr/sbin/runuser /usr/bin/[ /usr/bin/base64 /usr/bin/chcon removefrom coreutils /usr/sbin/runuser /usr/bin/[ /usr/bin/base64 /usr/bin/chcon
removefrom coreutils /usr/bin/cksum /usr/bin/comm /usr/bin/csplit removefrom coreutils /usr/bin/cksum /usr/bin/comm /usr/bin/csplit
@ -148,9 +155,9 @@ removefrom coreutils /usr/bin/expand /usr/bin/factor
removefrom coreutils /usr/bin/fold /usr/bin/groups /usr/bin/hostid removefrom coreutils /usr/bin/fold /usr/bin/groups /usr/bin/hostid
removefrom coreutils /usr/bin/install /usr/bin/join /usr/bin/logname removefrom coreutils /usr/bin/install /usr/bin/join /usr/bin/logname
removefrom coreutils /usr/bin/mkfifo /usr/bin/nl /usr/bin/nohup /usr/bin/nproc removefrom coreutils /usr/bin/mkfifo /usr/bin/nl /usr/bin/nohup /usr/bin/nproc
removefrom coreutils /usr/bin/od /usr/bin/paste /usr/bin/pathchk removefrom coreutils /usr/bin/pathchk
removefrom coreutils /usr/bin/pinky /usr/bin/pr /usr/bin/printenv removefrom coreutils /usr/bin/pinky /usr/bin/pr /usr/bin/printenv
removefrom coreutils /usr/bin/printf /usr/bin/ptx /usr/bin/runcon /usr/bin/seq removefrom coreutils /usr/bin/printf /usr/bin/ptx /usr/bin/runcon
removefrom coreutils /usr/bin/sha224sum /usr/bin/sha384sum removefrom coreutils /usr/bin/sha224sum /usr/bin/sha384sum
removefrom coreutils /usr/bin/sha512sum /usr/bin/shuf /usr/bin/stat removefrom coreutils /usr/bin/sha512sum /usr/bin/shuf /usr/bin/stat
removefrom coreutils /usr/bin/stdbuf /usr/bin/sum /usr/bin/test removefrom coreutils /usr/bin/stdbuf /usr/bin/sum /usr/bin/test
@ -160,7 +167,6 @@ removefrom coreutils /usr/bin/who /usr/bin/whoami /usr/bin/yes /usr/share/*
removefrom cpio /usr/share/* removefrom cpio /usr/share/*
removefrom cracklib /usr/sbin/* removefrom cracklib /usr/sbin/*
removefrom cracklib-dicts /usr/${libdir}/* /usr/sbin/* removefrom cracklib-dicts /usr/${libdir}/* /usr/sbin/*
removefrom createrepo /usr/bin/* /usr/share/*
removefrom cryptsetup-luks /usr/share/* removefrom cryptsetup-luks /usr/share/*
removefrom cyrus-sasl-lib /usr/sbin/* removefrom cyrus-sasl-lib /usr/sbin/*
removefrom db4 /usr/* removefrom db4 /usr/*
@ -192,12 +198,14 @@ removefrom glibc /lib/*/nosegneg/* /${libdir}/libBrokenLocale*
removefrom glibc /${libdir}/libSegFault* /${libdir}/libanl* removefrom glibc /${libdir}/libSegFault* /${libdir}/libanl*
removefrom glibc /${libdir}/libcidn* /${libdir}/libnss_compat* removefrom glibc /${libdir}/libcidn* /${libdir}/libnss_compat*
removefrom glibc /${libdir}/libnss_hesiod* /${libdir}/libnss_nis* removefrom glibc /${libdir}/libnss_hesiod* /${libdir}/libnss_nis*
removefrom glibc /${libdir}/libthread* /${libdir}/rtkaio* /sbin/* # python-pyudev uses ctypes.util.find_library, which uses /sbin/ldconfig
removefrom glibc /${libdir}/rtkaio* /sbin/sln
removefrom glibc /usr/libexec/* /usr/sbin/* removefrom glibc /usr/libexec/* /usr/sbin/*
removefrom glibc-common /etc/* /usr/bin/catchsegv /usr/bin/gencat removefrom glibc-common /etc/* /usr/bin/catchsegv /usr/bin/gencat
removefrom glibc-common /usr/bin/getconf /usr/bin/getent removefrom glibc-common /usr/bin/getent
removefrom glibc-common /usr/bin/locale /usr/bin/rpcgen /usr/bin/sprof removefrom glibc-common /usr/bin/locale /usr/bin/rpcgen /usr/bin/sprof
removefrom glibc-common /usr/bin/tzselect /usr/bin/localedef # NB: we keep /usr/bin/localedef so anaconda can inspect payload locale info
removefrom glibc-common /usr/bin/tzselect
removefrom glibc-common /usr/libexec/* /usr/sbin/* removefrom glibc-common /usr/libexec/* /usr/sbin/*
removefrom gmp /usr/${libdir}/libgmpxx.* /usr/${libdir}/libmp.* removefrom gmp /usr/${libdir}/libgmpxx.* /usr/${libdir}/libmp.*
removefrom gnome-bluetooth-libs /usr/${libdir}/libgnome-bluetooth* removefrom gnome-bluetooth-libs /usr/${libdir}/libgnome-bluetooth*
@ -208,13 +216,11 @@ removefrom gnome-keyring /usr/share/glib-2.0/* /usr/share/gnome-keyring*
removefrom gnome-keyring /usr/share/locale/* removefrom gnome-keyring /usr/share/locale/*
removefrom gnome-python2-gconf /usr/share/pygtk/* removefrom gnome-python2-gconf /usr/share/pygtk/*
removefrom gnutls /usr/share/locale/* removefrom gnutls /usr/share/locale/*
removefrom gpgme /usr/${libdir}/libgpgme-*
removefrom grep /etc/* /usr/share/locale/* removefrom grep /etc/* /usr/share/locale/*
removefrom gstreamer /usr/bin/* /usr/${libdir}/gstreamer-0.10/* removefrom gstreamer /usr/bin/* /usr/${libdir}/gstreamer-0.10/*
removefrom gstreamer /usr/${libdir}/libgst* /usr/libexec/* /usr/share/locale/* removefrom gstreamer /usr/${libdir}/libgst* /usr/libexec/* /usr/share/locale/*
removefrom gtk2 /usr/bin/update-gtk-immodules removefrom gtk2 /usr/bin/update-gtk-immodules
removefrom gtk3 /usr/${libdir}/gtk-3.0/* removefrom gtk3 /usr/${libdir}/gtk-3.0/*
removefrom gtk3 /usr/${libdir}/libgailutil*
removefrom gzip /usr/bin/{gzexe,zcmp,zdiff,zegrep,zfgrep,zforce,zgrep,zless,zmore,znew} removefrom gzip /usr/bin/{gzexe,zcmp,zdiff,zegrep,zfgrep,zforce,zgrep,zless,zmore,znew}
removefrom hwdata /etc/* /usr/share/hwdata/oui.txt /usr/share/hwdata/pnp.ids removefrom hwdata /etc/* /usr/share/hwdata/oui.txt /usr/share/hwdata/pnp.ids
removefrom hwdata /usr/share/hwdata/upgradelist removefrom hwdata /usr/share/hwdata/upgradelist
@ -249,9 +255,8 @@ removefrom libvorbis /usr/${libdir}/libvorbisenc.*
removefrom libxml2 /usr/bin/* removefrom libxml2 /usr/bin/*
removefrom libxml2-python /usr/${libdir}/python?.?/site-packages/libxml2mod.a removefrom libxml2-python /usr/${libdir}/python?.?/site-packages/libxml2mod.a
removefrom libxml2-python /usr/${libdir}/python?.?/site-packages/libxml2mod.la removefrom libxml2-python /usr/${libdir}/python?.?/site-packages/libxml2mod.la
removefrom lldpad /etc/* /usr/sbin/lldptool removefrom lldpad /etc/*
removefrom lua /usr/bin/* removefrom lua /usr/bin/*
removefrom lzo /usr/${libdir}/liblzo2.*
removefrom madan-fonts /usr/share/fonts/madan/* removefrom madan-fonts /usr/share/fonts/madan/*
removefrom mdadm /etc/* removefrom mdadm /etc/*
removefrom module-init-tools /etc/* /usr/sbin/insmod.static /usr/sbin/weak-modules removefrom module-init-tools /etc/* /usr/sbin/insmod.static /usr/sbin/weak-modules
@ -287,7 +292,6 @@ removefrom openssh-clients /usr/libexec/*
removefrom openssh-server /etc/ssh/* /usr/libexec/* removefrom openssh-server /etc/ssh/* /usr/libexec/*
removefrom openssl /etc/pki/* /usr/bin/* /usr/${libdir}/openssl/* removefrom openssl /etc/pki/* /usr/bin/* /usr/${libdir}/openssl/*
removefrom pam /usr/sbin/* /usr/share/locale/* removefrom pam /usr/sbin/* /usr/share/locale/*
removefrom pciutils /usr/sbin/*
removefrom policycoreutils /etc/* /usr/bin/* /usr/share/locale/* removefrom policycoreutils /etc/* /usr/bin/* /usr/share/locale/*
removefrom polkit /usr/bin/* removefrom polkit /usr/bin/*
removefrom polkit-desktop-policy /var/lib/* removefrom polkit-desktop-policy /var/lib/*
@ -304,7 +308,7 @@ removefrom python-ethtool /usr/sbin/*
removefrom python-meh /usr/share/locale/* removefrom python-meh /usr/share/locale/*
removefrom readline /usr/${libdir}/* removefrom readline /usr/${libdir}/*
removefrom libreport /usr/bin/* /usr/share/locale/* removefrom libreport /usr/bin/* /usr/share/locale/*
removefrom rpm /usr/bin/* /usr/lib/rpm/platform/* /usr/share/locale/* removefrom rpm /usr/share/locale/*
removefrom rsync /etc/* removefrom rsync /etc/*
removefrom sed /usr/share/locale/* removefrom sed /usr/share/locale/*
removefrom smartmontools /etc/* /usr/sbin/smartd removefrom smartmontools /etc/* /usr/sbin/smartd
@ -320,11 +324,10 @@ removefrom util-linux --allbut \
/usr/bin/{dmesg,getopt,kill,login,lsblk,more,mount,umount,mountpoint} \ /usr/bin/{dmesg,getopt,kill,login,lsblk,more,mount,umount,mountpoint} \
/etc/mtab /etc/pam.d/login /etc/pam.d/remote \ /etc/mtab /etc/pam.d/login /etc/pam.d/remote \
/usr/sbin/{agetty,blkid,blockdev,clock,fdisk,fsck,fstrim,hwclock,losetup} \ /usr/sbin/{agetty,blkid,blockdev,clock,fdisk,fsck,fstrim,hwclock,losetup} \
/usr/sbin/{mkswap,nologin,sfdisk,swapoff,swapon,wipefs} \ /usr/sbin/{mkswap,nologin,sfdisk,swapoff,swapon,wipefs,partx,fsfreeze} \
/usr/bin/logger /usr/bin/{logger,hexdump,flock,chmem,lsmem}
removefrom volume_key-libs /usr/share/locale/* removefrom volume_key-libs /usr/share/locale/*
removefrom wget /etc/* /usr/share/locale/* removefrom wget /etc/* /usr/share/locale/*
removefrom xkeyboard-config /usr/share/locale/*
removefrom xorg-x11-drv-intel /usr/${libdir}/libI* removefrom xorg-x11-drv-intel /usr/${libdir}/libI*
removefrom xorg-x11-drv-openchrome /usr/${libdir}/libchrome* removefrom xorg-x11-drv-openchrome /usr/${libdir}/libchrome*
removefrom xorg-x11-drv-synaptics /usr/bin/* removefrom xorg-x11-drv-synaptics /usr/bin/*
@ -332,14 +335,24 @@ removefrom xorg-x11-drv-wacom /usr/bin/*
removefrom xorg-x11-fonts-misc --allbut /usr/share/X11/fonts/misc/{6x13,encodings,fonts,*cursor}* removefrom xorg-x11-fonts-misc --allbut /usr/share/X11/fonts/misc/{6x13,encodings,fonts,*cursor}*
removefrom xorg-x11-server-utils --allbut /usr/bin/xrandr /usr/share/X11/rgb.txt removefrom xorg-x11-server-utils --allbut /usr/bin/xrandr /usr/share/X11/rgb.txt
removefrom yum /etc/* /usr/share/locale/* /usr/share/yum-cli/* removefrom yum /etc/* /usr/share/locale/* /usr/share/yum-cli/*
removefrom ${product.name}-logos /etc/* removefrom redhat-logos /etc/*
removefrom ${product.name}-logos /usr/share/icons/{Bluecurve,oxygen}/* removefrom redhat-logos /usr/share/icons/{Bluecurve,oxygen}/*
removefrom ${product.name}-logos /usr/share/{firstboot,gnome-screensaver,kde4,pixmaps}/* removefrom redhat-logos /usr/share/{firstboot,gnome-screensaver,kde4,pixmaps}/*
removefrom redhat-logos /usr/share/{plymouth,backgrounds}*
## RHEL cleanups
removefrom subscription-manager --allbut /etc/rhsm/* /usr/share/rhsm/* /var/log/rhsm/* \
/etc/yum/pluginconf.d/product-id.conf /usr/lib/yum-plugins/product-id.py
## cleanup_python_files() ## cleanup_python_files()
runcmd find ${root} -name "*.pyo" -type f -delete runcmd find ${root} -name "*.pyo" -type f -delete
runcmd find ${root} -name "*.pyc" -type f -exec ln -sf /dev/null {} \; runcmd find ${root} -name "*.pyc" -type f -exec ln -sf /dev/null {} \;
## cleanup /boot/ leaving vmlinuz, and .*hmac files
runcmd chroot ${root} find /boot \! -name "vmlinuz*" \
-and \! -name ".vmlinuz*" \
-and \! -name boot -delete
## remove any broken links in /etc or /usr ## remove any broken links in /etc or /usr
## (broken systemd service links lead to confusing noise at boot) ## (broken systemd service links lead to confusing noise at boot)
## NOTE: not checking /var because we want to keep /var/run ## NOTE: not checking /var because we want to keep /var/run

View File

@ -3,24 +3,26 @@
## anaconda package ## anaconda package
installpkg anaconda anaconda-widgets installpkg anaconda anaconda-widgets
## anaconda deps that aren't in the RPM ## anaconda deps that aren't in the RPM
installpkg tmux installpkg tmux
installpkg firstboot installpkg firstboot
installpkg iscsi-initiator-utils installpkg iscsi-initiator-utils
## speed up compression on multicore systems
installpkg pigz
## firstaidkit (rescue mode) packages ## Other available payloads
installpkg firstaidkit-plugin-{passwd,key-recovery,mdadm-conf} installpkg rpm-ostree
## kernel and firmware ## kernel and firmware
installpkg kernel installpkg kernel
%if basearch != "s390x": %if basearch != "s390x":
installpkg *-firmware installpkg *-firmware
installpkg b43-openfwwf
%endif %endif
## arch-specific packages (bootloaders etc.) ## arch-specific packages (bootloaders etc.)
%if basearch == "aarch64":
installpkg efibootmgr grub2-efi-aa64-cdboot grubby shim-aa64
installpkg grub2-tools grub2-tools-minimal grub2-tools-extra
%endif
%if basearch in ("arm", "armhfp"): %if basearch in ("arm", "armhfp"):
installpkg kernel-lpae kernel-tegra installpkg kernel-lpae kernel-tegra
installpkg uboot-tools installpkg uboot-tools
@ -28,28 +30,37 @@ installpkg kernel
%if basearch == "i386": %if basearch == "i386":
installpkg kernel-PAE gpart installpkg kernel-PAE gpart
%endif %endif
%if basearch == "x86_64":
installpkg grub2-tools-efi
installpkg shim-x64 grub2-efi-x64-cdboot
%endif
%if basearch in ("i386", "x86_64"): %if basearch in ("i386", "x86_64"):
installpkg grub2 grub2-tools biosdevname memtest86+ syslinux installpkg biosdevname memtest86+ syslinux
installpkg efibootmgr grub2-efi shim shim-unsigned installpkg grub2-tools grub2-tools-minimal grub2-tools-extra
installpkg efibootmgr
installpkg shim-ia32 grub2-efi-ia32-cdboot
%endif %endif
%if basearch in ("ppc", "ppc64"): %if basearch in ("ppc", "ppc64", "ppc64le"):
installpkg grub2 grub2-tools yaboot fbset hfsutils kernel-bootwrapper ppc64-utils installpkg fbset hfsutils kernel-bootwrapper ppc64-utils
installpkg grub2-tools grub2-tools-minimal grub2-tools-extra
installpkg grub2-${basearch}
%endif %endif
%if basearch == "s390x": %if basearch == "s390x":
installpkg lsscsi s390utils-base s390utils-cmsfs-fuse installpkg lsscsi s390utils-base s390utils-cmsfs-fuse s390utils-hmcdrvfs
%endif %endif
## yay, plymouth ## yay, plymouth
installpkg plymouth installpkg plymouth
## extra dracut modules ## extra dracut modules
installpkg anaconda-dracut dracut-network dracut-nohostonly dracut-norescue installpkg anaconda-dracut dracut-network dracut-config-generic dracut-fips
## fedup-dracut handles upgrades ## redhat-upgrade-dracut handles upgrades on RHEL
installpkg fedup-dracut fedup-dracut-plymouth installpkg redhat-upgrade-dracut redhat-upgrade-dracut-plymouth
## install other fedup scripts, if there are any. It's OK if there aren't. log "Looking for extra redhat-upgrade-dracut packages..."
log "Looking for extra fedup-dracut packages..." -installpkg *-redhat-upgrade-dracut
-installpkg *-fedup-dracut installpkg redhat-release-eula
## rpcbind or portmap needed by dracut nfs module ## rpcbind or portmap needed by dracut nfs module
installpkg rpcbind installpkg rpcbind
@ -79,10 +90,11 @@ installpkg gnome-keyring
installpkg python-imaging installpkg python-imaging
## filesystem tools ## filesystem tools
installpkg btrfs-progs jfsutils xfsprogs reiserfs-utils gfs2-utils ntfs-3g ntfsprogs installpkg btrfs-progs xfsprogs gfs2-utils
installpkg python-volume_key volume_key installpkg python-volume_key volume_key
installpkg system-storage-manager installpkg system-storage-manager
installpkg device-mapper-persistent-data installpkg device-mapper-persistent-data
installpkg xfsdump
## SELinux support ## SELinux support
installpkg selinux-policy-targeted audit libsemanage-python installpkg selinux-policy-targeted audit libsemanage-python
@ -94,14 +106,20 @@ installpkg tigervnc-server-minimal
installpkg tigervnc-server-module installpkg tigervnc-server-module
%endif %endif
installpkg net-tools installpkg net-tools
installpkg bridge-utils
installpkg nmap-ncat
## ntp packages
installpkg ntp
## hardware utilities/libraries ## hardware utilities/libraries
installpkg pciutils usbutils installpkg pciutils usbutils ipmitool
installpkg mt-st smartmontools installpkg mt-st smartmontools
%if basearch != "s390x": %if basearch != "s390x":
installpkg hdparm pcmciautils installpkg hdparm
%endif %endif
installpkg libmlx4 installpkg libmlx4 rdma
installpkg rng-tools
## translations & language packs ## translations & language packs
installpkg yum-langpacks installpkg yum-langpacks
@ -124,22 +142,27 @@ installpkg xorg-x11-fonts-misc
installpkg gnome-themes-standard gnome-icon-theme-legacy installpkg gnome-themes-standard gnome-icon-theme-legacy
## branding & logos ## branding & logos
installpkg fedora-gnome-theme fedora-icon-theme installpkg gnome-themes-standard
## debugging/bug reporting tools ## debugging/bug reporting tools
installpkg gdb-gdbserver installpkg gdb-gdbserver
installpkg python-epdb
installpkg libreport-plugin-bugzilla libreport-plugin-reportuploader installpkg libreport-plugin-bugzilla libreport-plugin-reportuploader
installpkg fpaste
## extra tools not required by anaconda ## extra tools not required by anaconda
installpkg vim-minimal strace lsof dump xz less eject installpkg vim-minimal strace lsof dump xz less eject
installpkg wget rsync rsh bind-utils ftp mtr vconfig installpkg wget rsync rsh bind-utils ftp mtr
installpkg icfg spice-vdagent installpkg spice-vdagent
installpkg gdisk installpkg gdisk hexedit sg3_utils
## yum plugins ## yum plugins
installpkg yum-plugin-fastestmirror yum-langpacks installpkg yum-langpacks
## RHEL packages
installpkg subscription-manager
## addons
installpkg kexec-tools-anaconda-addon
installpkg oscap-anaconda-addon
## actually install all the requested packages ## actually install all the requested packages
run_pkg_transaction run_pkg_transaction

View File

@ -26,6 +26,10 @@ symlink /lib/systemd/system/anaconda.target etc/systemd/system/default.target
mkdir etc/systemd/system/local-fs.target.wants/ mkdir etc/systemd/system/local-fs.target.wants/
symlink /lib/systemd/system/tmp.mount etc/systemd/system/local-fs.target.wants/tmp.mount symlink /lib/systemd/system/tmp.mount etc/systemd/system/local-fs.target.wants/tmp.mount
## Start rngd
mkdir etc/systemd/system/basic.target.wants/
symlink /lib/systemd/system/rngd.service etc/systemd/system/basic.target.wants/rngd.service
## Disable unwanted systemd services ## Disable unwanted systemd services
systemctl disable systemd-readahead-collect.service \ systemctl disable systemd-readahead-collect.service \
systemd-readahead-replay.service \ systemd-readahead-replay.service \
@ -34,9 +38,17 @@ systemctl disable systemd-readahead-collect.service \
lvm2-monitor.service lvm2-monitor.service
## These services can't be disabled normally (they're linked into place in ## These services can't be disabled normally (they're linked into place in
## /usr/lib/systemd rather than /etc/systemd), so we have to mask them. ## /usr/lib/systemd rather than /etc/systemd), so we have to mask them.
systemctl mask fedora-configure.service fedora-loadmodules.service \ systemctl mask rhel-configure.service rhel-loadmodules.service \
fedora-autorelabel.service fedora-autorelabel-mark.service \ rhel-autorelabel.service rhel-autorelabel-mark.service \
fedora-wait-storage.service media.mount rhel-wait-storage.service media.mount \
systemd-tmpfiles-clean.service systemd-tmpfiles-clean.timer
## remove because it cannot be disabled
remove usr/lib/systemd/system-generators/lvm2-activation-generator
## Make logind activate anaconda-shell@.service on switch to empty VT
symlink anaconda-shell@.service lib/systemd/system/autovt@.service
replace "#ReserveVT=6" "ReserveVT=2" etc/systemd/logind.conf
## Don't write the journal to the overlay, just keep it in RAM ## Don't write the journal to the overlay, just keep it in RAM
remove var/log/journal remove var/log/journal
@ -50,9 +62,12 @@ install ${configdir}/bash_history root/.bash_history
install ${configdir}/profile root/.profile install ${configdir}/profile root/.profile
install ${configdir}/libuser.conf etc install ${configdir}/libuser.conf etc
install ${configdir}/sysctl.conf etc/sysctl.d/anaconda.conf install ${configdir}/sysctl.conf etc/sysctl.d/anaconda.conf
%if exists(root+"/etc/selinux/targeted"): install ${configdir}/spice-vdagentd etc/sysconfig
install ${configdir}/selinux.config etc/selinux/config mkdir etc/NetworkManager/conf.d
%endif install ${configdir}/90-anaconda-no-auto-default.conf etc/NetworkManager/conf.d
install ${configdir}/91-anaconda-autoconnect-slaves.conf etc/NetworkManager/conf.d
install ${configdir}/92-anaconda-loglevel-debug.conf etc/NetworkManager/conf.d
install ${configdir}/vconsole.conf etc
## set up sshd ## set up sshd
install ${configdir}/sshd_config.anaconda etc/ssh install ${configdir}/sshd_config.anaconda etc/ssh
@ -91,10 +106,6 @@ gconfset /apps/metacity/global_keybindings/switch_windows string disabled
gconfset /desktop/gnome/interface/accessibility bool true gconfset /desktop/gnome/interface/accessibility bool true
gconfset /desktop/gnome/interface/at-spi-corba bool true gconfset /desktop/gnome/interface/at-spi-corba bool true
## Some settings are controlled by gsettings now.
install ${configdir}/org.gnome.desktop.wm.keybindings.gschema.override usr/share/glib-2.0/schemas
runcmd chroot ${root} glib-compile-schemas /usr/share/glib-2.0/schemas
move usr/libexec/anaconda/auditd sbin move usr/libexec/anaconda/auditd sbin
## for compatibility with Ancient Anaconda Traditions ## for compatibility with Ancient Anaconda Traditions
@ -109,7 +120,13 @@ append etc/depmod.d/dd.conf "search updates built-in"
append etc/multipath.conf "defaults {\n\tfind_multipaths yes\n\tuser_friendly_names yes\n}\n" append etc/multipath.conf "defaults {\n\tfind_multipaths yes\n\tuser_friendly_names yes\n}\n"
## make lvm auto-activate ## make lvm auto-activate
remove etc/lvm/* remove etc/lvm/archive/*
remove etc/lvm/archive
remove etc/lvm/backup/*
remove etc/lvm/backup
remove etc/lvm/cache/*
remove etc/lvm/cache
remove etc/lvm/lvm.conf
append etc/lvm/lvm.conf "global {\n\tuse_lvmetad = 1\n}\n" append etc/lvm/lvm.conf "global {\n\tuse_lvmetad = 1\n}\n"
## TODO: we could run prelink here if we wanted? ## TODO: we could run prelink here if we wanted?

View File

@ -4,6 +4,7 @@ configdir="tmp/config_files/s390"
BOOTDIR="images" BOOTDIR="images"
KERNELDIR=BOOTDIR KERNELDIR=BOOTDIR
INITRD_ADDRESS="0x02000000" INITRD_ADDRESS="0x02000000"
LORAXDIR="usr/share/lorax/"
# The assumption seems to be that there is only one s390 kernel, ever # The assumption seems to be that there is only one s390 kernel, ever
kernel = kernels[0] kernel = kernels[0]
%> %>
@ -15,6 +16,8 @@ treeinfo stage2 mainimage images/${runtime_base}
## install bootloader (such as it is) and bootloader config ## install bootloader (such as it is) and bootloader config
install ${configdir}/redhat.exec ${BOOTDIR} install ${configdir}/redhat.exec ${BOOTDIR}
install ${configdir}/generic.prm ${BOOTDIR} install ${configdir}/generic.prm ${BOOTDIR}
install ${configdir}/genericdvd.prm ${BOOTDIR}
install ${configdir}/cdboot.prm ${BOOTDIR}
install ${configdir}/generic.ins . install ${configdir}/generic.ins .
## configure bootloader ## configure bootloader
@ -35,4 +38,36 @@ createaddrsize ${INITRD_ADDRESS} ${outroot}/${BOOTDIR}/initrd.img ${outroot}/${B
## s390 also has some special treeinfo data ## s390 also has some special treeinfo data
treeinfo images-${basearch} initrd.addrsize ${BOOTDIR}/initrd.addrsize treeinfo images-${basearch} initrd.addrsize ${BOOTDIR}/initrd.addrsize
treeinfo images-${basearch} generic.prm ${BOOTDIR}/generic.prm treeinfo images-${basearch} generic.prm ${BOOTDIR}/generic.prm
treeinfo images-${basearch} genericdvd.prm ${BOOTDIR}/genericdvd.prm
treeinfo images-${basearch} generic.ins generic.ins treeinfo images-${basearch} generic.ins generic.ins
treeinfo images-${basearch} redhat.exec ${BOOTDIR}/redhat.exec
# Create optional product.img and updates.img in /images/
<% imggraft=""; images=["product", "updates"] %>
%for img in images:
%if exists("%s/%s/" % (LORAXDIR, img)):
installimg ${LORAXDIR}/${img}/ images/${img}.img
%endif
%endfor
# Inherit iso-graft/ if it exists from external templates
<%
import os
if os.path.exists(workdir + "/iso-graft"):
imggraft += " " + workdir + "/iso-graft"
%>
## Make a combined kernel+initrd image for the iso
runcmd mk-s390-cdboot -i ${outroot}/${KERNELDIR}/kernel.img \
-r ${outroot}/${KERNELDIR}/initrd.img \
-p ${outroot}/${BOOTDIR}/cdboot.prm \
-o ${outroot}/${BOOTDIR}/cdboot.img
## make boot.iso
runcmd mkisofs -o ${outroot}/images/boot.iso \
-b ${BOOTDIR}/cdboot.img -c ${BOOTDIR}/boot.cat \
-boot-load-size 4 -no-emul-boot \
-R -J -V '${isolabel}' -T -graft-points \
${BOOTDIR}=${outroot}/${BOOTDIR} \
${imggraft}
treeinfo images-${basearch} boot.iso images/boot.iso

View File

@ -6,6 +6,7 @@ PXEBOOTDIR="images/pxeboot"
BOOTDIR="isolinux" BOOTDIR="isolinux"
KERNELDIR=PXEBOOTDIR KERNELDIR=PXEBOOTDIR
LIVEDIR="LiveOS" LIVEDIR="LiveOS"
LORAXDIR="usr/share/lorax/"
%> %>
mkdir ${LIVEDIR} mkdir ${LIVEDIR}
@ -61,11 +62,15 @@ hardlink ${KERNELDIR}/initrd.img ${BOOTDIR}
%endif %endif
## WHeeeeeeee, EFI. ## WHeeeeeeee, EFI.
## We could remove the basearch restriction someday.. <% efiargs=""; efigraft=""; efihybrid=""; efiarch32=None; efiarch64=None %>
<% efiargs=""; efigraft=""; efihybrid="" %> %if exists("boot/efi/EFI/*/gcdia32.efi"):
%if exists("boot/efi/EFI/*/gcdx64.efi") and basearch != 'i386': <% efiarch32 = 'IA32' %>
%endif
%if exists("boot/efi/EFI/*/gcdx64.efi"):
<% efiarch64 = 'X64' %>
%endif
%if efiarch32 or efiarch64:
<% <%
efiarch = 'X64' if basearch=='x86_64' else 'IA32'
efigraft="EFI/BOOT={0}/EFI/BOOT".format(outroot) efigraft="EFI/BOOT={0}/EFI/BOOT".format(outroot)
images = ["images/efiboot.img"] images = ["images/efiboot.img"]
if domacboot: if domacboot:
@ -75,9 +80,25 @@ hardlink ${KERNELDIR}/initrd.img ${BOOTDIR}
efigraft += " {0}={1}/{0}".format(img,outroot) efigraft += " {0}={1}/{0}".format(img,outroot)
efihybrid = "--uefi --mac" if domacboot else "--uefi" efihybrid = "--uefi --mac" if domacboot else "--uefi"
%> %>
<%include file="efi.tmpl" args="configdir=configdir, KERNELDIR=KERNELDIR, efiarch=efiarch, isolabel=isolabel"/> <%include file="efi.tmpl" args="configdir=configdir, KERNELDIR=KERNELDIR, efiarch32=efiarch32, efiarch64=efiarch64, isolabel=isolabel"/>
%endif %endif
# Create optional product.img and updates.img
<% imggraft=""; images=["product", "updates"] %>
%for img in images:
%if exists("%s/%s/" % (LORAXDIR, img)):
installimg ${LORAXDIR}/${img}/ images/${img}.img
<% imggraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %>
%endif
%endfor
# Inherit iso-graft/ if it exists from external templates
<%
import os
if os.path.exists(workdir + "/iso-graft"):
imggraft += " " + workdir + "/iso-graft"
%>
## make boot.iso ## make boot.iso
runcmd mkisofs -o ${outroot}/images/boot.iso \ runcmd mkisofs -o ${outroot}/images/boot.iso \
-b ${BOOTDIR}/isolinux.bin -c ${BOOTDIR}/boot.cat \ -b ${BOOTDIR}/isolinux.bin -c ${BOOTDIR}/boot.cat \
@ -86,6 +107,6 @@ runcmd mkisofs -o ${outroot}/images/boot.iso \
${BOOTDIR}=${outroot}/${BOOTDIR} \ ${BOOTDIR}=${outroot}/${BOOTDIR} \
${KERNELDIR}=${outroot}/${KERNELDIR} \ ${KERNELDIR}=${outroot}/${KERNELDIR} \
${LIVEDIR}=${outroot}/${LIVEDIR} \ ${LIVEDIR}=${outroot}/${LIVEDIR} \
${efigraft} ${efigraft} ${imggraft}
runcmd isohybrid ${efihybrid} ${outroot}/images/boot.iso runcmd isohybrid ${efihybrid} ${outroot}/images/boot.iso
treeinfo images-${basearch} boot.iso images/boot.iso treeinfo images-${basearch} boot.iso images/boot.iso

122
src/bin/composer-cli Executable file
View File

@ -0,0 +1,122 @@
#!/usr/bin/python
#
# composer-cli
#
# Copyright (C) 2018 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
import logging
log = logging.getLogger("composer-cli")
import os
import sys
import argparse
from composer import vernum
from composer.cli.help import epilog
from composer.cli import main
VERSION = "{0}-{1}".format(os.path.basename(sys.argv[0]), vernum)
def get_parser():
""" Return the ArgumentParser for composer-cli"""
parser = argparse.ArgumentParser(description="Lorax Composer commandline tool",
epilog=epilog,
formatter_class=argparse.RawDescriptionHelpFormatter,
fromfile_prefix_chars="@")
parser.add_argument("-j", "--json", action="store_true", default=False,
help="Output the raw JSON response instead of the normal output.")
parser.add_argument("-s", "--socket", default="/run/weldr/api.socket", metavar="SOCKET",
help="Path to the socket file to listen on")
parser.add_argument("--log", dest="logfile", default=None, metavar="LOG",
help="Path to optional logfile")
parser.add_argument("-a", "--api", dest="api_version", default="0", metavar="APIVER",
help="API Version to use")
parser.add_argument("--test", dest="testmode", default=0, type=int, metavar="TESTMODE",
help="Pass test mode to compose. 1=Mock compose with fail. 2=Mock compose with finished.")
parser.add_argument("-V", action="store_true", dest="showver",
help="show program's version number and exit")
# Commands are implemented by parsing the remaining arguments outside of argparse
parser.add_argument('args', nargs=argparse.REMAINDER)
return parser
def setup_logging(logfile=None):
""" Setup logging to console and to an optional logfile
:param logfile: Optional path to file to store logs in
:type logfile: None or str
"""
log.setLevel(logging.DEBUG)
sh = logging.StreamHandler()
sh.setLevel(logging.INFO)
fmt = logging.Formatter("%(asctime)s: %(message)s")
sh.setFormatter(fmt)
log.addHandler(sh)
if logfile != None:
fh = logging.FileHandler(filename=logfile)
fh.setLevel(logging.DEBUG)
fmt = logging.Formatter("%(asctime)s %(levelname)s %(name)s: %(message)s")
fh.setFormatter(fmt)
log.addHandler(fh)
if __name__ == '__main__':
# parse the arguments
arg_parser = get_parser()
opts = arg_parser.parse_args()
if opts.showver:
print(VERSION)
sys.exit(0)
if opts.logfile != None:
logpath = os.path.abspath(os.path.dirname(opts.logfile))
if not os.path.isdir(logpath):
os.makedirs(logpath)
setup_logging(opts.logfile)
log.debug("opts=%s", opts)
if len(opts.args) == 0:
log.error("Missing command")
sys.exit(1)
elif opts.args[0] == "help":
arg_parser.print_help()
sys.exit(0)
elif len(opts.args) == 1:
log.error("Missing %s sub-command", opts.args[0])
sys.exit(1)
errors = []
# Check to see if the socket exists and can be accessed
if not os.path.exists(opts.socket):
errors.append("%s does not exist" % opts.socket)
elif not os.access(opts.socket, os.R_OK|os.W_OK):
errors.append("This user cannot access %s" % opts.socket)
# No point in continuing if there are errors
if errors:
for e in errors:
log.error(e)
sys.exit(1)
sys.exit(main(opts))

197
src/bin/image-minimizer Executable file
View File

@ -0,0 +1,197 @@
#!/usr/bin/python
#
# image-minimizer: removes files and packages on the filesystem
#
# Copyright 2007-2010 Red Hat Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Library General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
import glob
import optparse
import os
import sys
import rpm
class ImageMinimizer:
filename = ''
dryrun = False
verbose = False
prefix = None
drops = set()
visited = set()
drops_rpm = set()
ts = None
def __init__(self, _filename, root, dryrun, verbose):
self.filename = _filename
self.prefix = root
self.dryrun = dryrun
self.verbose = verbose
self.ts = None
# Recursively adds all files and directories.
# This is done becuase globbing does not allow
# ** for arbitrary nesting.
def add_directory(self, files, dirname):
self.visited.add(dirname)
for root, dirs, items in os.walk(dirname):
for _dir in dirs:
self.visited.add(os.path.join(root, _dir))
for name in items:
files.add(os.path.join(root, name))
def add_pattern(self, files, pattern):
globs = glob.glob(pattern)
if self.verbose and len(globs) == 0:
print "%s file not found" % pattern
for g in globs:
if os.path.isdir(g):
self.add_directory(files, g)
else:
files.add(g)
def add_pattern_rpm(self, rpms, pattern):
if self.ts is None:
if self.prefix is None:
raise Exception ('Must specify installation root for droprpm/keeprpm')
self.ts = rpm.TransactionSet(self.prefix)
mi = self.ts.dbMatch()
mi.pattern('name', rpm.RPMMIRE_GLOB, pattern)
not_found = True
for hdr in mi:
not_found = False
rpms.add(hdr['name'])
if self.verbose and not_found:
print "%s package not found" % pattern
# Parses each line in the ifle
def parse_line(self, line):
command = ""
pattern = ""
tok = line.split(None,1)
if len(tok) > 0:
command = tok[0].lower()
if len(tok) > 1:
pattern = tok[1].strip()
# Strip out all the comments and blank lines
if not (command.startswith('#') or command==''):
if command == 'keep':
if self.prefix is not None :
pattern = pattern.lstrip('/')
pattern = os.path.join(self.prefix, pattern)
keeps = set()
self.add_pattern(keeps, pattern)
self.drops.difference_update(keeps)
keeps = None
elif command == 'drop':
if self.prefix is not None :
pattern = pattern.lstrip('/')
pattern = os.path.join(self.prefix, pattern)
self.add_pattern(self.drops, pattern)
elif command == 'keeprpm':
keeps_rpm = set()
self.add_pattern_rpm(keeps_rpm, pattern)
self.drops_rpm.difference_update(keeps_rpm)
keeps_rpm = None
elif command == 'droprpm':
self.add_pattern_rpm(self.drops_rpm, pattern)
else:
raise Exception ('Unknown Command: ' + command)
def remove(self):
for tag in sorted(self.drops, reverse=True):
self.visited.add(os.path.split(tag)[0])
if os.path.isdir(tag):
self.visited.add(tag)
else:
if self.dryrun:
print 'rm ' + tag
else:
if self.verbose:
print 'rm ' + tag
os.remove(tag)
#remove all empty directory. Every 8k counts!
for _dir in sorted(self.visited, reverse=True):
if len(os.listdir(_dir)) == 0:
if self.dryrun:
print 'rm -rf ' + _dir
else:
if self.verbose:
print 'rm -rf ' + _dir
os.rmdir(_dir)
def remove_rpm(self):
def runCallback(reason, amount, total, key, client_data):
if self.verbose and reason == rpm.RPMCALLBACK_UNINST_STOP:
print key, "erased"
if len(self.drops_rpm) == 0:
return
for pkg in self.drops_rpm:
if self.dryrun:
print "erasing ", pkg
else:
self.ts.addErase(pkg)
if not self.dryrun:
# skip ts.check(), equivalent to --nodeps
self.ts.run(runCallback, "erase")
def filter(self):
for line in (open(self.filename).readlines()):
self.parse_line(line.strip())
self.remove()
self.remove_rpm()
def parse_options():
usage = "usage: %prog [options] filename"
parser = optparse.OptionParser(usage=usage)
parser.set_defaults(root=os.environ.get('INSTALL_ROOT', '/mnt/sysimage/'), dry_run=False)
parser.add_option("-i", "--installroot", type="string", dest="root",
help="Root path to prepend to all file patterns and installation root for RPM "
"operations. Defaults to INSTALL_ROOT or /mnt/sysimage/")
parser.add_option("--dryrun", action="store_true", dest="dryrun",
help="If set, no filesystem changes are made.")
parser.add_option("-v", "--verbose", action="store_true", dest="verbose",
help="Display every action as it is performed.")
(_options, _args) = parser.parse_args()
if len(args) == 0:
parser.print_help()
sys.exit(1)
return (_options, _args)
if __name__ == "__main__":
try:
(options, args) = parse_options()
filename = args[0]
minimizer = ImageMinimizer(filename, options.root, options.dryrun,
options.verbose)
minimizer.filter()
except SystemExit, e:
sys.exit(e.code)
except KeyboardInterrupt, e:
print >> sys.stderr, "Aborted at user request"
except Exception, e:
print e
sys.exit(1)

113
src/bin/mk-s390-cdboot Executable file
View File

@ -0,0 +1,113 @@
#!/usr/bin/python
#
# mk-s390-cdboot
#
# Copyright (C) 2017 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
from __future__ import print_function
import argparse
import os
import shutil
from struct import pack
import sys
INITRD_START = 0x0000000000800000
START_PSW_ADDRESS = 0x80010000
KERNEL_PSW_ADDRESS = 0x04
KERNEL_INITRD_START = 0x10408
KERNEL_INITRD_SIZE = 0x10410
KERNEL_CMDLINE = 0x10480
# See https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/s390/include/uapi/asm/setup.h
KERNEL_CMDLINE_SIZE = 896
def setup_parser():
""" Setup the cmdline parser"""
parser = argparse.ArgumentParser(description="Create s390 boot image")
parser.add_argument("-i", dest="kernel", required=True, metavar="KERNEL",
help="The kernel.img file")
parser.add_argument("-r", dest="ramdisk", required=True, metavar="RAMDISK",
help="The initrd.img file")
parser.add_argument("-p", dest="parmfile", required=True, metavar="PARMFILE",
help="The parm file")
parser.add_argument("-o", dest="outfile", required=True, metavar="OUTFILE",
help="The output image file")
return parser
def copy_kernel(kernel, outfile):
""" Copy the kernel to the outfile"""
shutil.copy2(kernel, outfile)
def append_ramdisk(ramdisk, outfile):
""" Append the ramdisk to the kernel and return its size"""
with open(ramdisk, "rb") as ram_fd:
with open(outfile, "r+b") as out_fd:
out_fd.seek(INITRD_START)
out_fd.write(ram_fd.read())
return os.stat(ramdisk).st_size
def configure_kernel(outfile, parmfile, size):
""" Configure the kernel with the ramdisk start address and size."""
with open(outfile, "r+b") as out_fd:
# Change the start PSW address
out_fd.seek(KERNEL_PSW_ADDRESS)
out_fd.write(pack(">L", START_PSW_ADDRESS))
# Write the initrd start and size
out_fd.seek(KERNEL_INITRD_START)
out_fd.write(pack(">Q", INITRD_START))
out_fd.seek(KERNEL_INITRD_SIZE)
out_fd.write(pack(">Q", size))
# Erase the previous COMMAND_LINE, write zeros
out_fd.seek(KERNEL_CMDLINE)
out_fd.write("\0" * KERNEL_CMDLINE_SIZE)
# Write the first line of the parmfile
cmdline = open(parmfile, "r").readline().strip()
out_fd.seek(KERNEL_CMDLINE)
out_fd.write(cmdline)
def main():
parser = setup_parser()
args = parser.parse_args()
errors = []
for f in [args.kernel, args.ramdisk, args.parmfile]:
if not os.path.exists(f):
errors.append("ERROR: %s is missing" % f)
if errors:
map(print, errors)
sys.exit(1)
print("Creating bootable CD-ROM image...")
print("kernel is : %s" % args.kernel)
print("ramdisk is : %s" % args.ramdisk)
print("parmfile is: %s" % args.parmfile)
print("outfile is : %s" % args.outfile)
copy_kernel(args.kernel, args.outfile)
size = append_ramdisk(args.ramdisk, args.outfile)
configure_kernel(args.outfile, args.parmfile, size)
if __name__ == '__main__':
main()

27
src/composer/__init__.py Normal file
View File

@ -0,0 +1,27 @@
#!/usr/bin/python
#
# composer-cli
#
# Copyright (C) 2018 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# get composer version
try:
import composer.version
except ImportError:
vernum = "devel"
else:
vernum = composer.version.num

View File

@ -0,0 +1,56 @@
#
# composer-cli
#
# Copyright (C) 2018 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
import logging
log = logging.getLogger("composer-cli")
from composer.cli.blueprints import blueprints_cmd
from composer.cli.modules import modules_cmd
from composer.cli.projects import projects_cmd
from composer.cli.compose import compose_cmd
from composer.cli.sources import sources_cmd
from composer.cli.status import status_cmd
command_map = {
"blueprints": blueprints_cmd,
"modules": modules_cmd,
"projects": projects_cmd,
"compose": compose_cmd,
"sources": sources_cmd,
"status": status_cmd
}
def main(opts):
""" Main program execution
:param opts: Cmdline arguments
:type opts: argparse.Namespace
"""
# Making sure opts.args is not empty (thus, has a command and subcommand)
# is already handled in src/bin/composer-cli.
if opts.args[0] not in command_map:
log.error("Unknown command %s", opts.args[0])
return 1
else:
try:
return command_map[opts.args[0]](opts)
except Exception as e:
log.error(str(e))
return 1

Some files were not shown because too many files have changed in this diff Show More