Compare commits

...

578 Commits

Author SHA1 Message Date
Brian C. Lane 21ab321558 Automatic commit of package [lorax] release [19.7.28-1].
Created by command:

/usr/bin/tito tag
2020-05-14 13:53:44 -07:00
Brian C. Lane 06a242aa0a rhel7-livemedia: Increase the rootfilesystem size
In some cases a livemedia-creator run doesn't have enough space to
install all the packages. Increase the size by 500M to increase the
chances of this working with the defaults.

Resolves: rhbz#1829204
2020-05-14 11:59:25 -07:00
Brian C. Lane 3d11e7026e Automatic commit of package [lorax] release [19.7.27-1].
Created by command:

/usr/bin/tito tag
2020-04-20 09:54:09 -07:00
Brian C. Lane 533a0cb309 Change --make-pxe-live --no-virt to use a fsimage
Instead of a partitioned disk image. This will allow a single pass
of lmc to be used to create an ostree live PXE image.

Resolves: rhbz#1802591
2020-04-17 09:33:09 -07:00
Brian C. Lane b81a8516a0 Makefile: Add the ability to use podman instead of docker
Run with 'DOCKER=podman make test-in-docker' to run the tests using
podman.

Related: rhbz#1472622
2020-03-04 17:37:55 -08:00
Brian C. Lane 6473143f44 tests: Add tests for _install_branding with and without variant
This adds tests to make sure that the changes to _install_branding are
working as expected.

Related: rhbz#1472622
2020-03-04 17:37:10 -08:00
Brian C. Lane d22ebad3d2 lorax: Move get_yum_base_object into pylorax.yumbase
This will make it easier to run tests.

Related: rhbz#1472622
2020-03-04 17:33:41 -08:00
Brian C. Lane bebec0cf58 lorax: Update how the release package is chosen
Previously the release package was chosen by picking the first package
that provides 'system-release' that isn't named generic. This can cause
branding issues with repos containing multiple system-release packages.

This patch changes _install_branding so that it will give preference to
a system-release package that ends with lowercase --variant name. If
there isn't one it will fall back to the previous behavior.

Resolves: rhbz#1472622
2020-03-03 17:18:34 -08:00
Brian C. Lane 970a39f296 Automatic commit of package [lorax] release [19.7.26-1].
Created by command:

/usr/bin/tito tag
2019-12-16 09:34:59 -08:00
Brian C. Lane 4defe98a0d Remove unneeded scap-security-guide files
This removes all of scap-security-guide except for ssg-rhel7-ds.xml

Related: rhbz#1779659
2019-12-13 10:46:59 -08:00
Brian C. Lane c8bb73d9a5 Automatic commit of package [lorax] release [19.7.25-1].
Created by command:

/bin/tito tag
2019-06-04 11:57:37 -07:00
Brian C. Lane 8f5444aad2 lorax: Add --rootfs-size
This controls how big the root filesystem is for the squashfs used in
the boot.iso, the default is 2GiB.

Note that larger rootfs sizes will require more memory and may cause the
build to fail.

(cherry picked from commit 37d36daa9c)

Resolves: rhbz#1715116
2019-06-04 10:33:03 -07:00
Brian C. Lane 2aa2ea4404 lorax: pass size from Lorax.run to create_runtime
This allows Lorax class users to specify the image size when calling
run()

(cherry picked from commit 9e979f760b)

Related: rhbz#1715116
2019-06-04 10:32:36 -07:00
Jan Stodola 15772acfd1 Fix path to generic.prm
Also quote ${extra_boot_args} as in the other templates

Resolves: rhbz#1712491
2019-05-23 11:06:19 +03:00
Brian C. Lane 5f050669e6 Automatic commit of package [lorax] release [19.7.24-1].
Created by command:

/bin/tito tag
2019-04-29 09:07:04 -07:00
Brian C. Lane f5b781a9e6 Update PPC isolabel to allow escaping spaces
Escaped spaces is supported, so remove the extra filtering of the
isolabel on PPC so that it uses the same form as the other arches.

eg. inst.stage2=hd:LABEL=RHEL-7.7\x20Server.ppc64le for an iso with a
label of 'RHEL-7.7 Server.ppc64le'

Resolves: rhbz#1402328
2019-04-29 08:57:25 -07:00
Brian C. Lane d2bf2edad2 Automatic commit of package [lorax] release [19.7.23-1].
Created by command:

/usr/bin/tito tag
2019-04-04 11:55:03 -07:00
Brian C. Lane 12da07a8f6 lorax: Install redhat-release-eula
Resolves: rhbz#1696335
2019-04-04 11:02:40 -07:00
Brian C. Lane a4f6f78c2c Automatic commit of package [lorax] release [19.7.22-1].
Created by command:

/bin/tito tag
2019-03-26 11:37:20 -07:00
Brian C. Lane 05128a76fd Improve logging for template syntax errors
The shlex splitting can fail, resulting in error messages like:

ERROR livemedia-creator: No closing quotation

without any context in the log files. This logs the line that failed to
be split and expanded.

Related: rhbz#1689314
2019-03-26 11:29:30 -07:00
Brian C. Lane c15a976832 Add extra boot args to the livemedia-creator iso templates
This adds a new livemedia-creator argument, --extra-boot-args, which can
be used to add arguments to the kernel command-line in the templates.

Resolves: rhbz#1689314
2019-03-26 11:29:30 -07:00
Brian C. Lane 7c1f29af5a Use hd:LABEL= for inst.stage2 on ppc
This allows USB drives to boot as well as the iso.  Also switch the
isolabel to follow the x86 format and use '-' instead of '_'.

Based on upstream commits:
c53de4e63c
372bef945f

Resolves: rhbz#1402328
2019-03-26 11:26:08 -07:00
Brian C. Lane 1f89fdbfe3 Don't remove chmem and lsmem from install.img
Resolves: rhbz#1511358
2019-03-18 16:21:50 -07:00
Brian C. Lane 3537fb784a Automatic commit of package [lorax] release [19.7.21-1].
Created by command:

/bin/tito tag
2019-03-18 09:31:41 -07:00
Brian C. Lane 376c480691 Do not include /usr/bin/delv
It changed packages, and was never included before so add it to the
binaries removed from bind-utils.

Resolves: rhbz#1688767
2019-03-18 09:24:57 -07:00
Brian C. Lane 69df5f2362 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
(cherry picked from commit 482d6277e0)
2019-03-15 16:24:19 -07:00
Brian C. Lane 4f373dcc10 Remove lorax-composer tests
The lorax-composer package handles running tests for itself, lorax should
only be running the lorax tests.

Resolves: rhbz#1679798
2019-02-27 09:10:39 -08:00
Brian C. Lane 3a1d7da06e Automatic commit of package [lorax] release [19.7.20-1].
Created by command:

/bin/tito tag
2019-02-25 11:09:26 -08:00
Brian C. Lane 18ee6a2a89 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.

Resolves: rhbz#1659129
2019-02-21 14:14:36 -08:00
Brian C. Lane 81ce55a1e5 lorax: Move default tmp dir to /var/tmp/lorax
If systemd's tmpfiles.d timer is executed while lorax is running it will
remove any files and directories older than 30 days. This is what has
been causing the occasional error where /proc/ would seem to vanish
during the install.

Upstream has proposed this solution, https://github.com/systemd/systemd/pull/11482
but until that is released we need a work-around to protect the lorax
files.

This commit does several things:

* Move the default tmpdir from /var/tmp/ to /var/tmp/lorax/
* Add a lorax.conf tmpfiles.d file that prevents systemd-tmpfiles from
  removing anything under /var/tmp/lorax/
* Add an exit handler to lorax so that temporary directories are removed on
  exit or on a python traceback.
* Use flock to lock access to the tempdir while lorax is running.
* Remove any unlocked tempdirs named /var/tmp/lorax/lorax.* at startup

Note that the exit handler will not remove the tempdir if lorax is
killed with a signal -- those are being caught by dnf and prevent the
exit handler from running.

systemd-tmpfiles cannot clean up the tempdirs at boot time because they
contain files labeled as shadow_t, so we have to remove those when lorax
runs. It uses the flock to prevent removing any directories created by
parallel instances of lorax and only removes ones that are unlocked.
Worst case they will be around until the first run of lorax after a
reboot.

If you want to keep the working directory around for debugging purposes
use --workdir /var/tmp/lorax/my-workdir and it won't be removed by
lorax.

Resolves: rhbz#1668520
2019-01-22 17:12:56 -08:00
Alexander Todorov fffb03d5c3 New cli test covering basic compose commands
- need to specify --sharedir so lorax-composer can find its
  kickstart files

- each test script writes results into a separate directory to
  avoid a passing test overwriting the results from a failing one.
  To avoid reporting failures in case of previously failing tests
  (e.g. during development) remove the temporary directories holding
  tets results before execution!
2018-10-01 12:35:23 +02:00
Alexander Todorov 1ba7613036 Execute bash tests for composer-cli
these are built on top of beakerlib and we use its internal
protocol to figure out the result without relying on the full
test runner that is tipically used inside of a RHEL environment!

Includes a disabled test snippet for Issue #460
2018-10-01 12:35:23 +02:00
Brian C. Lane ccf34b1913 Add pylint testing
This adds pylint testing via make check, using the framework from
Anaconda. False positives can be added to
./tests/pylint/pylint-false-positives
2018-10-01 12:35:23 +02:00
Brian C. Lane bbbd805909 Automatic commit of package [lorax] release [19.7.19-1].
Created by command:

/usr/bin/tito tag
2018-08-15 12:43:28 -07:00
Brian C. Lane 5499fed441 Add documentation for --dracut-arg to lorax.1
And update documentation for lorax-composer. Make it clear that to pass
the arguments you must single quote them. Like so:

--dracut-arg='--xz'

And that all dracut args must be passed, since it overrides the
defaults.

Related: rhbz#1452220
2018-08-15 09:03:32 -07:00
Brian C. Lane 245e0e84df Add the dracut options to the lorax help output
Related: rhbz#1452220
2018-08-15 09:03:32 -07:00
Brian C. Lane e3b1292262 Automatic commit of package [lorax] release [19.7.18-1].
Created by command:

/usr/bin/tito tag
2018-06-21 10:21:23 -07:00
Brian C. Lane 1566f3d10f Add redhat.exec to s390 .treeinfo
Resolves: rhbz#1593657
2018-06-21 08:24:31 -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
143 changed files with 14499 additions and 1600 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

8
.gitignore vendored
View File

@ -1,2 +1,10 @@
*.pyc
src/pylorax/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

24
Dockerfile.test Normal file
View File

@ -0,0 +1,24 @@
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 make libgit2-glib tito pylint \
python-nose python-mako python-flask \
python-coverage libselinux-python sudo \
pykickstart python2-pytoml python-sphinx \
python2-mock python-semantic_version \
anaconda-tui python-gevent beakerlib \
python2-rpmfluff && \
yum clean all && \
rm -rf /var/cache/yum && \
useradd weldr
RUN mkdir /lorax
COPY . /lorax
# remove byte-compiled files to avoid issues between Python 2/3
# this can happen when you switch between rhel7 and master branches
RUN find /lorax -name "*.pyc" -exec rm -f {} \;
WORKDIR /lorax
RUN make test

View File

@ -1,32 +1,64 @@
PYTHON ?= /usr/bin/python
DESTDIR ?= /
DOCKER ?= docker
PKGNAME = lorax
VERSION = $(shell awk '/Version:/ { print $$2 }' $(PKGNAME).spec)
RELEASE = $(shell awk '/Release:/ { print $$2 }' $(PKGNAME).spec | sed -e 's|%.*$$||g')
TAG = lorax-$(VERSION)-$(RELEASE)
PW_DIR ?= $(shell pwd)
USER_SITE_PACKAGES ?= $(shell sudo $(PYTHON) -m site --user-site)
default: all
src/composer/version.py: lorax.spec
echo "num = '$(VERSION)-$(RELEASE)'" > src/composer/version.py
src/pylorax/version.py: lorax.spec
echo "num = '$(VERSION)-$(RELEASE)'" > src/pylorax/version.py
all: src/pylorax/version.py
all: src/pylorax/version.py src/composer/version.py
$(PYTHON) setup.py build
install: all
$(PYTHON) setup.py install --root=$(DESTDIR)
mkdir -p $(DESTDIR)/$(mandir)/man1
install -m 644 docs/lorax.1 $(DESTDIR)/$(mandir)/man1
install -m 644 docs/livemedia-creator.1 $(DESTDIR)/$(mandir)/man1
install -m 644 docs/man/lorax.1 $(DESTDIR)/$(mandir)/man1
install -m 644 docs/man/livemedia-creator.1 $(DESTDIR)/$(mandir)/man1
check:
@echo "*** Running pylint ***"
PYTHONPATH=$(PYTHONPATH):./src/ ./tests/pylint/runpylint.py
# /api/docs/ tests require we have the documentation already built
test: docs
@echo "*** Running tests ***"
sudo mkdir -p $(USER_SITE_PACKAGES)
sudo cp ./tests/usercustomize.py $(USER_SITE_PACKAGES)
sudo COVERAGE_PROCESS_START=$(PW_DIR)/.coveragerc PYTHONPATH=$(PYTHONPATH):./src/ \
$(PYTHON) -m nose -v ./src/pylorax/ ./tests/pylorax/
sudo rm -rf $(USER_SITE_PACKAGES)
coverage combine
coverage report -m
[ -f "/usr/bin/coveralls" ] && [ -n "$(COVERALLS_REPO_TOKEN)" ] && coveralls || echo
check:
@echo "*** Running pylint ***"
./tests/pylint/runpylint.sh
clean:
-rm -rf build src/pylorax/version.py
-rm -rf build src/composer/version.py
tag:
git tag -f $(TAG)
docs:
$(MAKE) -C docs apidoc html
archive: tag
@git archive --format=tar --prefix=$(PKGNAME)-$(VERSION)/ $(TAG) > $(PKGNAME)-$(VERSION).tar
@gzip $(PKGNAME)-$(VERSION).tar
@ -40,3 +72,10 @@ local:
@dir=$$PWD; cd /var/tmp; tar --gzip -cSpf $$dir/$(PKGNAME)-$(VERSION).tar.gz $(PKGNAME)-$(VERSION)
@rm -rf /var/tmp/$(PKGNAME)-$(VERSION)
@echo "The archive is in $(PKGNAME)-$(VERSION).tar.gz"
test-in-docker:
sudo $(DOCKER) build -t welder/lorax-composer:latest -f Dockerfile.test .
ci: check test
.PHONY: all install check test clean tag docs archive local

View File

@ -16,6 +16,14 @@ minimum you need:
--iso to specify the Anaconda install media to use with virt-install
--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
----------
@ -74,13 +82,27 @@ written using the Mako template system which is very flexible.
KICKSTARTS
----------
Existing spin kickstarts can be used to create live media with a few changes.
Here are the steps I used to convert the XFCE spin.
The docs/ directory includes two example kickstarts, one to create a live desktop
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
2. Add zerombr so you don't get the disk init dialog
3. Add clearpart --all
4. Add swap and biosboot partitions
4. Add swap partition
5. bootloader target
6. Add shutdown to the kickstart
7. Add network --bootproto=dhcp --activate to activate the network
@ -96,7 +118,6 @@ network --bootproto=dhcp --activate
zerombr
clearpart --all
bootloader --location=mbr
part biosboot --size=1
part swap --size=512
shutdown
@ -110,8 +131,12 @@ passwd -d root > /dev/null
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. 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
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.
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
----------------------
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.
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>
Documentation on the Mako template system can be found here:
@ -203,6 +238,41 @@ title from --title
project from --project
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
------------------

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."

392
docs/conf.py Normal file
View File

@ -0,0 +1,392 @@
# -*- 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"""
import re
version_re = re.compile(r"Version:\s+(.*)")
with open("../lorax.spec", "rt") as f:
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

28
docs/index.rst Normal file
View File

@ -0,0 +1,28 @@
.. 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
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.

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

@ -0,0 +1,156 @@
lorax-composer
==============
:Authors:
Brian C. Lane <bcl@redhat.com>
lorax-composer is an API server that 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>`_.
The server runs as root, and 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.
When starting the server it 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.
As of version 19.7.7 it will drop root privileges for the API thread. The queue
and compose thread still runs as root because it needs to be able to
mount/umount files and run Anaconda.
Logs
----
Logs are stored under ``/var/log/lorax-composer/`` and include all console
messages as well as extra debugging info and API requests.
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. Either start it via systemd with ``systemctl start lorax-composer`` or
run it directly with ``lorax-composer /path/to/blueprints/``
The ``/path/to/blueprints/`` is where the blueprint's 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.
Composing Images
----------------
As of version 19.7.7 lorax-composer can create ``tar`` output images. You can use curl to start
a compose like this::
curl --unix-socket /run/weldr/api.socket -X POST -H "Content-Type: application/json" -d '{"blueprint_name": "http-server", "compose_type": "tar", "branch": "master"}' http:///api/v0/compose
And then monitor it by passing the returned build UUID to ``/compose/status/<uuid>``.
Version 19.7.10 adds support for ``live-iso`` and ``partitioned-disk``
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.

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

@ -1,13 +1,17 @@
.TH LIVEMEDIA-CREATOR 1 2013\-07\-26
.TH LIVEMEDIA-CREATOR 1 2018\-08\-14
.SH NAME
livemedia-creator \- Create live install media
.SH SYNOPSIS
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]
[--fs-image FS_IMAGE] [--ks KS]
[--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]
[--anaconda-arg ANACONDA_ARGS]
[--armplatform ARMPLATFORM] [--location LOCATION]
@ -20,6 +24,7 @@ livemedia-creator [-h]
[--dracut-arg DRACUT_ARGS] [--title TITLE]
[--project PROJECT] [--releasever RELEASEVER]
[--volid VOLID] [--squashfs_args SQUASHFS_ARGS]
[--virt-uefi] [--ovmf-path OVMF_PATH]
.SH DESCRIPTION
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
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
\fB\-\-iso ISO\fR
Anaconda installation .iso path to use for virt-install
@ -73,7 +90,24 @@ Path to disk image to use for creating final image
.TP
\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
\fB\-\-ks KS\fR
@ -160,6 +194,15 @@ Path to template to use for appliance data.
\fB\-\-app\-file APP_FILE\fR
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:
.TP
\fB\-\-ram MEMORY\fR
@ -181,10 +224,20 @@ Passed to --arch command
\fB\-\-kernel\-args KERNEL_ARGS\fR
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:
.TP
\fB\-\-dracut\-arg DRACUT_ARGS\fR
Argument to pass to dracut when rebuilding the initramfs. Pass this once foreach argument. NOTE: this overrides the default.
\fB\-\-dracut-arg='ARG'\fR
Argument to pass to dracut when rebuilding the initramfs. Pass this once for each argument, single quoting
the arguments like this: '--xz' NOTE: this overrides the default, so all dracut arguments must be included.
.SH "SEE ALSO"
Documentation in /usr/share/docs/lorax/README.livemedia-creator

View File

@ -1,9 +1,9 @@
.TH LORAX 1 2013\-07\-26
.TH LORAX 1 2018\-08\-14
.SH NAME
lorax \- Create installer boot iso
.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
@ -37,6 +37,10 @@ release information
\fB\-s REPOSITORY, \-\-source=REPOSITORY\fR
source repository (may be listed multiple times)
.TP
\fB\--repo CONFIG\fR
repository configuration file (may be listed multiple times)
.SH
OPTIONAL ARGUMENTS:
@ -89,6 +93,16 @@ Path to logfile
\fB\-\-tmp=TMP\fR
Top level temporary directory
.TP
\fB\-\-noverifyssl\fR
This disables SSL certificate checking. eg. to allow using https: sources with self-signed certificates.
.SH DRACUT ARGUMENTS:
.TP
\fB\-\-dracut-arg='ARG'\fR
Argument to pass to dracut when rebuilding the initramfs. Pass this once for each argument, single quoting
the arguments like this: '--xz' NOTE: this overrides the default, so all dracut arguments must be included.
.SH AUTHORS
.nf
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 --enabled --service=mdns
# 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
xconfig --startxonboot
# Root password
rootpw --plaintext removethispw
# Network information
network --bootproto=dhcp --device=eth0 --onboot=on --activate
network --bootproto=dhcp --onboot=on --activate
# System authorization information
auth --useshadow --enablemd5
# System keyboard
keyboard us
keyboard --xlayouts=us --vckeymap=us
# System language
lang en_US.UTF-8
# SELinux configuration
@ -34,8 +35,9 @@ zerombr
# Partition clearing information
clearpart --all
# Disk partitioning information
reqpart
part biosboot --size=1
part / --fstype="ext4" --size=4000
part / --fstype="ext4" --size=5500
part swap --size=1000
%post
@ -307,16 +309,8 @@ rm -f /core*
rm -f /.readahead_collect
touch /var/lib/readahead/early.sorted
%end
%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
# Remove random-seed
rm /var/lib/systemd/random-seed
%end
%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
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
# Remove root password
@ -361,30 +352,23 @@ cat /dev/null > /etc/fstab
%end
%packages
@admin-tools
@standard
@base-x
# Packages needed by anaconda, but not directly required.
# Includes all of the grub2 and shim packages needed, except
# for the grub2-efi-*-cdboot package
@anaconda-tools --optional
@core
@dial-up
@fonts
@x11
@gnome-desktop
@graphical-internet
@hardware-support
@input-methods
#@office
#@printing
#@sound-and-video
anaconda
isomd5sum
kernel
laughlin-backgrounds-animated-gnome
memtest86+
nss-mdns
-ibus-pinyin-db-open-phrase
-smartmontools
grub2-efi
grub2
shim
syslinux
dracut-norescue
-dracut-config-rescue
# This package is needed to boot the iso on UEFI
grub2-efi-*-cdboot
grub2-efi-ia32
%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

1
etc/composer.conf Normal file
View File

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

View File

@ -1,16 +1,21 @@
%define debug_package %{nil}
Name: lorax
Version: 19.6
Version: 19.7.28
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
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
BuildRequires: python-sphinx yum python-mako pykickstart
Requires: GConf2
Requires: cpio
@ -34,6 +39,7 @@ Requires: util-linux
Requires: xz
Requires: yum
Requires: pykickstart
Requires: dracut >= 030
%if 0%{?fedora}
# Fedora specific deps
@ -41,18 +47,30 @@ Requires: fedup-dracut
Requires: fedup-dracut-plymouth
%endif
%if 0%{?el7}
# RHEL 7 specific deps
Requires: redhat-upgrade-dracut
Requires: redhat-upgrade-dracut-plymouth
%endif
%ifarch %{ix86} x86_64
Requires: syslinux >= 4.02-5
%endif
%ifarch ppc ppc64
%ifarch ppc ppc64 ppc64le
Requires: kernel-bootwrapper
Requires: grub2
Requires: grub2-tools
%endif
%ifarch s390 s390x
Requires: openssh
%endif
# Moved image-minimizer tool to lorax
Provides: appliance-tools-minimizer = %{version}-%{release}
Obsoletes: appliance-tools-minimizer < 007.7-3
%description
Lorax is a tool for creating the anaconda install images.
@ -64,26 +82,694 @@ Anaconda's image install feature.
%setup -q
%build
make docs
%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT mandir=%{_mandir} install
# Do Not Package lorax-composer or composer-cli files
rm -rf $RPM_BUILD_ROOT/%{python_sitelib}/pylorax/api
rm -rf $RPM_BUILD_ROOT/%{python_sitelib}/composer
rm -rf $RPM_BUILD_ROOT/%{_datadir}/lorax/composer
rm -f $RPM_BUILD_ROOT/%{_sysconfdir}/lorax/composer.conf
rm -f $RPM_BUILD_ROOT/%{_sbindir}/lorax-composer
rm -f $RPM_BUILD_ROOT/%{_bindir}/composer-cli
rm -f $RPM_BUILD_ROOT/%{_unitdir}/lorax-composer.*
rm -f $RPM_BUILD_ROOT/%{_tmpfilesdir}/lorax-composer.conf
%files
%defattr(-,root,root,-)
%doc COPYING AUTHORS README.livemedia-creator
%doc COPYING AUTHORS README.livemedia-creator README.product
%doc docs/*ks
%doc docs/html
%{python_sitelib}/pylorax
%exclude %{python_sitelib}/pylorax/api
%{python_sitelib}/*.egg-info
%{_sbindir}/lorax
%{_sbindir}/mkefiboot
%{_sbindir}/livemedia-creator
%{_bindir}/image-minimizer
%{_bindir}/mk-s390-cdboot
%dir %{_sysconfdir}/lorax
%config(noreplace) %{_sysconfdir}/lorax/lorax.conf
%dir %{_datadir}/lorax
%{_datadir}/lorax/*
%exclude %{_datadir}/lorax/composer
%{_mandir}/man1/*.1*
%{_tmpfilesdir}/lorax.conf
%changelog
* Thu May 14 2020 Brian C. Lane <bcl@redhat.com> 19.7.28-1
- rhel7-livemedia: Increase the rootfilesystem size (bcl)
Resolves: rhbz#1829204
* Mon Apr 20 2020 Brian C. Lane <bcl@redhat.com> 19.7.27-1
- Change --make-pxe-live --no-virt to use a fsimage (bcl)
Resolves: rhbz#1802591
- Makefile: Add the ability to use podman instead of docker (bcl)
Related: rhbz#1472622
- tests: Add tests for _install_branding with and without variant (bcl)
Related: rhbz#1472622
- lorax: Move get_yum_base_object into pylorax.yumbase (bcl)
Related: rhbz#1472622
- lorax: Update how the release package is chosen (bcl)
Resolves: rhbz#1472622
* Mon Dec 16 2019 Brian C. Lane <bcl@redhat.com> 19.7.26-1
- Remove unneeded scap-security-guide files (bcl)
Related: rhbz#1779659
* Tue Jun 04 2019 Brian C. Lane <bcl@redhat.com> 19.7.25-1
- lorax: Add --rootfs-size (bcl)
Resolves: rhbz#1715116
- lorax: pass size from Lorax.run to create_runtime (bcl)
Related: rhbz#1715116
- Fix path to generic.prm (jstodola)
Resolves: rhbz#1712491
* Mon Apr 29 2019 Brian C. Lane <bcl@redhat.com> 19.7.24-1
- Update PPC isolabel to allow escaping spaces (bcl)
Resolves: rhbz#1402328
* Thu Apr 04 2019 Brian C. Lane <bcl@redhat.com> 19.7.23-1
- lorax: Install redhat-release-eula (bcl)
Resolves: rhbz#1696335
* Tue Mar 26 2019 Brian C. Lane <bcl@redhat.com> 19.7.22-1
- Improve logging for template syntax errors (bcl)
Related: rhbz#1689314
- Add extra boot args to the livemedia-creator iso templates (bcl)
Resolves: rhbz#1689314
- Use hd:LABEL= for inst.stage2 on ppc (bcl)
Resolves: rhbz#1402328
- Don't remove chmem and lsmem from install.img (bcl)
Resolves: rhbz#1511358
* Mon Mar 18 2019 Brian C. Lane <bcl@redhat.com> 19.7.21-1
- Do not include /usr/bin/delv (bcl)
Resolves: rhbz#1688767
- Remove SELinux Permissive checks (bcl)
Resolves: rhbz#1654795
- Remove lorax-composer tests (bcl)
Resolves: rhbz#1679798
* Mon Feb 25 2019 Brian C. Lane <bcl@redhat.com> 19.7.20-1
- Add cancel_func to virt and novirt_install functions (bcl)
Resolves: rhbz#1659129
- lorax: Move default tmp dir to /var/tmp/lorax (bcl)
Resolves: rhbz#1668520
- New cli test covering basic compose commands (atodorov) (atodorov)
- Execute bash tests for composer-cli (atodorov) (atodorov)
- Add pylint testing (bcl) (bcl)
* Wed Aug 15 2018 Brian C. Lane <bcl@redhat.com> 19.7.19-1
- Add documentation for --dracut-arg to lorax.1 (bcl)
Related: rhbz#1452220
- Add the dracut options to the lorax help output (bcl)
Related: rhbz#1452220
* Thu Jun 21 2018 Brian C. Lane <bcl@redhat.com> 19.7.18-1
- Add redhat.exec to s390 .treeinfo (bcl)
Resolves: rhbz#1593657
* Tue Jun 19 2018 Brian C. Lane <bcl@redhat.com> 19.7.17-1
- Exclude lorax-composer and composer-cli code from the lorax build (bcl)
Resolves: rhbz#1547759
* Fri Jun 15 2018 Brian C. Lane <bcl@redhat.com> 19.7.16-2
- Fixup the lorax.spec after rebasing on 19.6.105-1 (bcl)
Resolves: rhbz#1547759
* Fri Jun 15 2018 Brian C. Lane <bcl@redhat.com> 19.7.16-2
- Rebase of lorax-composer branch onto 19.6.105-1
- See https://github.com/weldr/lorax/tree/lorax-composer for individual commits
for 19.7.1-1 thru 19.7.16-1
Resolves: rhbz#1547759
* Mon Jun 11 2018 Brian C. Lane <bcl@redhat.com> 19.6.105-1
- Retry losetup if loop_attach fails (bcl)
Resolves: rhbz#1589084
- Add reqpart to example kickstart files (bcl)
Resolves: rhbz#1545289
- Increase default ram used with lmc and virt to 2048 (bcl)
Resolves: rhbz#1538747
- Add --virt-uefi to boot the VM using OVMF (bcl)
Resolves: rhbz#1546715
Resolves: rhbz#1544805
- Add --dracut-arg support to lorax (bcl)
Resolves: rhbz#1452220
- livemedia-creator: Search for kernel/initrd under /images/pxeboot (bcl)
Resolves: rhbz#1522629
* Wed Jan 24 2018 Brian C. Lane <bcl@redhat.com> 19.6.104-1
- Replace fedora-gnome-theme with gnome-themes-standard (bcl)
Resolves: rhbz#1537573
* Thu Jan 11 2018 Brian C. Lane <bcl@redhat.com> 19.6.103-1
- Keep hid-multitouch and i2c-hid modules. (rhbz#1526323) (sbueno+anaconda)
Resolves: rhbz#1526323
* Tue Jan 02 2018 Brian C. Lane <bcl@redhat.com> 19.6.102-1
- Add grub2-tools to aarch64 (bcl)
Resolves: rhbz#1489707
* Tue Oct 17 2017 Brian C. Lane <bcl@redhat.com> 19.6.101-1
- Restore all of the grub2-tools on x86_64 and i386 (bcl)
Resolves: rhbz#1489707
* Mon Oct 09 2017 Brian C. Lane <bcl@redhat.com> 19.6.100-1
- Add dependencies for SE/HMC (vponcova)
Resolves: rhbz#1498834
* Fri Sep 29 2017 Brian C. Lane <bcl@redhat.com> 19.6.99-1
- s390 doesn't need to graft product.img and updates.img into /images (bcl)
Related: rhbz#1478448
* Wed Sep 27 2017 Brian C. Lane <bcl@redhat.com> 19.6.98-1
- Write a list of installed packages to /root/lorax-packages.log (bcl)
Resolves: rhbz#1416155
- Set the releasever and install gpg keys when using --repo (bcl)
Related: rhbz#1430479
* Fri Aug 18 2017 Brian C. Lane <bcl@redhat.com> 19.6.97-1
- Remove -boot-info-table from s390 boot.iso creation (bcl)
Related: rhbz#1478448
* Tue Aug 15 2017 Brian C. Lane <bcl@redhat.com> 19.6.96-1
- Install mk-s390-cdboot to /usr/bin/ (bcl)
Related: rhbz#1478448
* Fri Aug 11 2017 Brian C. Lane <bcl@redhat.com> 19.6.95-1
- IsoMountpoint: Add ppc64le kernel to search (bcl)
Resolves: rhbz#1373358
- livemedia-creator: Report correct results dir (bcl)
Resolves: rhbz#1374609
- Add creation of a bootable s390 iso (bcl)
Resolves: rhbz#1478448
- Add mk-s360-cdboot utility (bcl)
Related: rhbz#1478448
- Fix systemctl command (bcl)
Resolves: rhbz#1478247
- Add the version to the log (bcl)
Resolves: rhbz#1335456
- Include the dracut fips module in the initrd (bcl)
Resolves: rhbz#1341280
- Fix loop_wait (bcl)
Resolves: rhbz#1462150
- Document kickstart restrictions on %%include (bcl)
Resolves: rhbz#1418500
- Add support for --repo to read yum .repo files directly (bcl)
Resolves: rhbz#1430479
- Package grub2-efi-ia32 need to be added explicitly to example kickstarts.
(mhruscak)
Resolves: rhbz#1458937
* Fri Jun 23 2017 Brian C. Lane <bcl@redhat.com> 19.6.94-1
- Fix waiting for loop devices (bcl)
Resolves: rhbz#1462150
* Thu Jun 22 2017 Brian C. Lane <bcl@redhat.com> 19.6.93-1
- Make sure loop device is setup (bcl)
Resolves: rhbz#1462150
* Tue Jun 20 2017 Brian C. Lane <bcl@redhat.com> 19.6.92-1
- Remove the iso-graft check from the aarch64.tmpl (bcl)
Resolves: rhbz#1369014
* Thu Jun 15 2017 Brian C. Lane <bcl@redhat.com> 19.6.91-1
- Update livemedia-creator examples (bcl)
Resolves: rhbz#1458937
* Mon Jun 05 2017 Brian C. Lane <bcl@redhat.com> 19.6.90-1
- Fix aarch64 efi.tmpl invocation for live images (bcl)
Related: rhbz#1310775
* Wed May 31 2017 Brian C. Lane <bcl@redhat.com> 19.6.89-1
- Remove incorrect variables from rhel7-livemedia.ks example (bcl)
Resolves: rhbz#1430547
* Tue May 30 2017 Brian C. Lane <bcl@redhat.com> 19.6.88-1
- Add support for aarch64 live images (bcl)
Resolves: rhbz#1369014
* Thu May 18 2017 Brian C. Lane <bcl@redhat.com> 19.6.87-1
- Increase rootfs size for rhel7-livemedia.ks example (bcl)
Resolves: rhbz#1451760
* Tue Apr 11 2017 Brian C. Lane <bcl@redhat.com> 19.6.86-1
- lorax: Remove cairo-sphinx from the image (bcl)
Resolves: rhbz#1355681
* Fri Apr 07 2017 Brian C. Lane <bcl@redhat.com> 19.6.85-1
- Fix aarch64 efi.tmpl invocation (pjones)
Related: rhbz#1310775
* Tue Mar 28 2017 Brian C. Lane <bcl@redhat.com> 19.6.84-1
- runtime-cleanup.tmpl: don't delete localedef (jlebon)
Related: rhbz#1429576
* Wed Mar 22 2017 Brian C. Lane <bcl@redhat.com> 19.6.83-1
- Make 64-bit kernel on 32-bit firmware work for x86 efi machines (pjones)
Resolves: rhbz#1310775
* Fri Mar 17 2017 Brian C. Lane <bcl@redhat.com> 19.6.82-1
- Add --noverifyssl to lorax (bcl)
Resolves: rhbz#1430483
* Thu Mar 02 2017 Brian C. Lane <bcl@redhat.com> 19.6.81-1
- Keep fsfreeze in install environment (rmarshall)
Related: rhbz#1315468
- Fix duplicate kernel messages in /tmp/syslog (rvykydal)
Resolves: rhbz#1382611
* Wed Feb 22 2017 Brian C. Lane <bcl@redhat.com> 19.6.80-1
- Add dependency for lvmdump -l command (jkonecny)
Related: rhbz#1255659
* Fri Feb 17 2017 Brian C. Lane <bcl@redhat.com> 19.6.79-1
- templates: Enusre basic.target.wants dir exists for rngd (walters)
Resolves: rhbz#1377430
* Thu Sep 08 2016 Brian C. Lane <bcl@redhat.com> 19.6.78-1
- Don't log dracut initrd regeneration messages into /tmp/syslog (rvykydal)
Related: rhbz#1369439
- Use imjournal for rsyslogd instead of sharing /dev/log with journal (rvykydal)
Resolves: rhbz#1369439
* Mon Aug 01 2016 Brian C. Lane <bcl@redhat.com> 19.6.77-1
- livemedia-creator: Install genericdvd.prm (bcl)
Related: rhbz#1269213
- livemedia-creator: Use imgutils.copytree for results (bcl)
Resolves: rhbz#1362157
* Thu Jul 28 2016 Brian C. Lane <bcl@redhat.com> 19.6.76-1
- livemedia-creator: Fix logging (bcl)
Resolves: rhbz#1361031
* Tue Jul 26 2016 Brian C. Lane <bcl@redhat.com> 19.6.75-1
- livemedia-creator: Use hd:LABEL for stage2 iso (bcl)
Resolves: rhbz#1355882
* Mon Jul 18 2016 Brian C. Lane <bcl@redhat.com> 19.6.74-1
- Keep fb_sys_fops module needed for ast support (bcl)
Resolves: rhbz#1272658
* Fri Jun 24 2016 Brian C. Lane <bcl@redhat.com> 19.6.73-1
- Add back libraries needed by spice-vdagent (dshea)
Resolves: rhbz#1347737
* Wed Jun 22 2016 Brian C. Lane <bcl@redhat.com> 19.6.72-1
- Make sure cmdline config file exists (bcl)
Resolves: rhbz#1348302
- Keep all of the kernel drivers/target/ modules (bcl)
Resolves: rhbz#1348381
- Keep the pci utilities for use in kickstarts (bcl)
Resolves: rhbz#1344926
* Thu May 05 2016 Brian C. Lane <bcl@redhat.com> 19.6.71-1
- Create an empty selinux config file (bcl)
Resolves: rhbz#1332147
* Thu Apr 21 2016 Brian C. Lane <bcl@redhat.com> 19.6.70-1
- Use eurlatgr as the console font (bcl)
Resolves: rhbz#1265354
* Fri Apr 15 2016 Brian C. Lane <bcl@redhat.com> 19.6.69-1
- Remove Metacity override and theme (bcl)
Resolves: rhbz#1324890
- Copying same file shouldn't crash (bcl)
Resolves: rhbz#1269213
* Wed Mar 30 2016 Brian C. Lane <bcl@redhat.com> 19.6.68-1
- livemedia-creator: Use correct suffix on default image names (bcl)
Resolves: rhbz#1318958
- Fix livemedia-creator manpage (bcl)
Resolves: rhbz#1318952
* Tue Mar 01 2016 Brian C. Lane <bcl@redhat.com> 19.6.67-1
- templates: Reinstate gpgme-pthread.so for ostree (walters)
- Resolves: rhbz#1311793
- Add rng-tools and start rngd.service by default (bcl)
- Resolves: rhbz#1258516
- Add (bcl)
- Resolves: rhbz#1269891
- Include grub2-efi-modules on the boot.iso (bcl)
- Resolves: rhbz#1277227
- Keep modules needed for ast video driver support (bcl)
- Resolves: rhbz#1272658
- configure NetworkManager to loglevel=DEBUG (rvykydal)
- Resolves: rhbz#1274647
- Update docs for product.img (bcl)
- Resolves: rhbz#1272361
- paste is needed by os-prober (bcl)
- Resolves: rhbz#1275105
- Keep libthread so that gdb will work correctly (bcl)
- Resolves: rhbz#1269055
- Add --installpkgs argument (walters)
- Resolves: rhbz#1272222
- livemedia-creator: Clean up resultdir handling (bcl)
- Resolves: rhbz#1290552
- https is a sane package source URL scheme (walters)
- Resolves: rhbz#1292680
- Add product.img support for s390 templates (dan)
- Resolves: rhbz#1272359
* Wed Sep 02 2015 Brian C. Lane <bcl@redhat.com> 19.6.66-1
- livemedia-creator: Remove random-seed from images (bcl)
Resolves: rhbz#1258986
* Tue Sep 01 2015 Brian C. Lane <bcl@redhat.com> 19.6.65-1
- Don't include early microcode in initramfs (bcl)
- Resolves: rhbz#1258498
* Mon Aug 31 2015 Brian C. Lane <bcl@redhat.com> 19.6.64-1
- Fix metacity theme path (bcl)
Related: rhbz#1231856
- Run spice-vdagentd without systemd-logind integration (dshea)
Related: rhbz#1169991
* Thu Aug 27 2015 Brian C. Lane <bcl@redhat.com> 19.6.63-1
- Replace the metacity theme file. (dshea)
Related: rhbz#1231856
* Sun Aug 16 2015 Brian C. Lane <bcl@redhat.com> 19.6.62-1
- Change default releasever to 7 (bcl)
- Resolves: rhbz#1253242
* Wed Aug 12 2015 Brian C. Lane <bcl@redhat.com> 19.6.61-1
- Add lldptool (rvykydal)
Related: rhbz#1085325
* Wed Aug 05 2015 Brian C. Lane <bcl@redhat.com> 19.6.60-1
- Fix tito tagger to bump version, not release (bcl)
Related: rhbz#1085013
* Wed Aug 05 2015 Brian C. Lane <bcl@redhat.com> 19.6.59-2
- Fix chronyd not working in the installation (jkonecny)
Related: rhbz#1085013
* Tue Jul 14 2015 Brian C. Lane <bcl@redhat.com> 19.6.59-1
- Add installimg command for use in the templates (bcl@redhat.com)
Related: rhbz#1202278
* Tue Jun 30 2015 Brian C. Lane <bcl@redhat.com> 19.6.58-1
- Keep hyperv_fb driver in the image (bcl@redhat.com)
Resolves: rhbz#834791
* Fri Jun 26 2015 Brian C. Lane <bcl@redhat.com> 19.6.57-1
- livemedia-creator: fix base repo log monitor (#1196721) (bcl@redhat.com)
Related: rhbz#1196721
- network: turn slaves autoconnection on (rvykydal@redhat.com)
Resolves: rhbz#1172751
Resolves: rhbz#1134090
* Thu Jun 25 2015 Brian C. Lane <bcl@redhat.com> 19.6.56-1
- Add ability for external templates to graft content into boot.iso (walters@verbum.org)
Resolves: rhbz#1202278
- Update templates to use installimg for product and updates (bcl@redhat.com)
Related: rhbz#1202278
* Mon Jun 22 2015 Brian C. Lane <bcl@redhat.com> 19.6.55-1
- Add ntp configuration file to installation (jkonecny@redhat.com)
Related: rhbz#1085013
- livemedia-creator: Add option to create qcow2 disk images (bcl@redhat.com)
Resolves: rhbz#1210413
- Add support for creating qcow2 images (bcl@redhat.com)
Related: rhbz#1210413
- Install the oscap-anaconda-addon (vpodzime@redhat.com)
Resolves: rhbz#1190685
* Mon Jun 15 2015 Brian C. Lane <bcl@redhat.com> 19.6.54-1
- Add removekmod template command (bcl@redhat.com)
Resolves: rhbz#1230356
- Disable systemd-tmpfiles-clean (bcl@redhat.com)
Resolves: rhbz#1202545
- Add bridge-utils (bcl@redhat.com)
Resolves: rhbz#1188812
* Fri Jun 05 2015 Brian C. Lane <bcl@redhat.com> 19.6.53-1
- Keep the zram kernel module (bcl@redhat.com)
- Keep seq and getconf utilities in the image (vpodzime@redhat.com)
- Don't remove usr/lib/rpm/platform/ (#1116450) (bcl@redhat.com)
- Include /sbin/ldconfig from glibc. (dlehman@redhat.com)
* Fri Apr 17 2015 Brian C. Lane <bcl@redhat.com> 19.6.52-1
- Backport --make-ostree-live (rvykydal)
Resolves: rhbz#1184021
* Fri Jan 16 2015 Brian C. Lane <bcl@redhat.com> 19.6.51-1
- Remove imggraft from aarch64.tmpl (bcl@redhat.com)
Related: rhbz#1174475
* Wed Jan 14 2015 Brian C. Lane <bcl@redhat.com> 19.6.50-1
- Use gcdaa64.efi and make boot.iso on aarch64 (pjones@redhat.com)
Resolves: rhbz#1174475
* Wed Jan 07 2015 Brian C. Lane <bcl@redhat.com> 19.6.49-1
- runtime-cleanup.tmpl: keep virtio-rng (#1179000) (lersek@redhat.com)
Resolves: rhbz#1179000
* Fri Dec 19 2014 Brian C. Lane <bcl@redhat.com> 19.6.48-1
- aarch64 no longer needs explicit console setting (#1170413) (bcl@redhat.com)
Resolves: rhbz#1170413
* Tue Dec 02 2014 Brian C. Lane <bcl@redhat.com> 19.6.47-1
- Drop 32 bit for loop from ppc64 grub2 config (#1169878) (bcl@redhat.com)
Resolves: rhbz#1169878
* Thu Nov 20 2014 Brian C. Lane <bcl@redhat.com> 19.6.46-1
- Add --add-template{,-var} (walters@verbum.org)
Resolves: rhbz#1157777
* Fri Oct 31 2014 Brian C. Lane <bcl@redhat.com> 19.6.45-1
- Don't include the stock lvm.conf. (dlehman@redhat.com)
* Wed Oct 22 2014 Brian C. Lane <bcl@redhat.com> 19.6.44-1
- move image-minimizer to lorax (bcl@redhat.com)
Resolves: rhbz#1082642
* Thu Oct 16 2014 Brian C. Lane <bcl@redhat.com> 19.6.43-1
- Use all upper case for shim in live/efi.tmpl (bcl@redhat.com)
Related: rhbz#1100048
* Tue Oct 07 2014 Brian C. Lane <bcl@redhat.com> 19.6.42-1
- Revert "Don't remove /usr/share/doc/anaconda." (mkolman@redhat.com)
Related: rhbz#1072033
- Look for "BOOT${efiarch}.EFI" in mkefiboot as well. (pjones@redhat.com)
Related: rhbz#1100048
- Libgailutil is required yelp, don't remove it (mkolman@redhat.com)
Related: rhbz#1072033
* Fri Oct 03 2014 Brian C. Lane <bcl@redhat.com> 19.6.41-1
- Make sure shim is actually in the package list on aarch64 as well. (pjones@redhat.com)
Related: rhbz#1100048
* Thu Oct 02 2014 Brian C. Lane <bcl@redhat.com> 19.6.40-1
- Use shim on aarch64. (pjones@redhat.com)
Related: rhbz#1100048
- Keep the /etc/lvm/profiles directory in the image (vpodzime@redhat.com)
Related: rhbz#869456
* Tue Sep 30 2014 Brian C. Lane <bcl@redhat.com> 19.6.39-1
- Don't remove /usr/share/doc/anaconda. (clumens@redhat.com)
Resolves: rhbz#1147518
- Stop removing libXt from the installation media. (clumens@redhat.com)
Related: rhbz#1147518
- network: add support for bridge (#1075195) (rvykydal@redhat.com)
Related: rhbz#1075195
* Tue Sep 23 2014 Brian C. Lane <bcl@redhat.com> 19.6.38-1
- livemedia-creator: Make sure ROOT_PATH exists (bcl@redhat.com)
Related: rhbz#1144140
- livemedia-creator: Use RHEL7 version of kickstart (bcl@redhat.com)
Related: rhbz#1144140
- RHEL7 doesn't include pigz or pbzip2 (bcl@redhat.com)
Related: rhbz#1144140
- livemedia-creator: Add --no-recursion to mktar (bcl@redhat.com)
Related: rhbz#1144140
- livemedia-creator: Add support for making tarfiles (bcl@redhat.com)
Resolves: rhbz#1144140
- livemedia-creator: Check fsimage kickstart for single partition (bcl@redhat.com)
Related: rhbz#1144140
- livemedia-creator: Copy fsimage if hardlink fails (bcl@redhat.com)
Related: rhbz#1144140
- livemedia-creator: Make --make-fsimage work with virt-install (bcl@redhat.com)
Related: rhbz#1144140
* Mon Sep 15 2014 Brian C. Lane <bcl@redhat.com> 19.6.37-1
- Let the plymouth dracut module back into the ppc64 upgrade.img (dshea@redhat.com)
Resolves: rhbz#1069671
* Tue Sep 09 2014 Brian C. Lane <bcl@redhat.com> 19.6.36-1
- Add more tools for rescue mode (bcl@redhat.com)
Resolves: rhbz#1109785
- Add kexec anaconda addon (bcl@redhat.com)
Resolves: rhbz#1116335
* Wed Sep 03 2014 Brian C. Lane <bcl@redhat.com> 19.6.35-1
- Add ppc64le arch (bcl@redhat.com)
Resolves: rhbz#1136490
* Fri Aug 29 2014 Brian C. Lane <bcl@redhat.com> 19.6.34-1
- allow setting additional dracut parameters for DVD s390x installs (dan@danny.cz)
Resolves: rhbz#1132050
* Thu Aug 28 2014 Brian C. Lane <bcl@redhat.com> 19.6.33-1
- livemedia-creator: Update ppc64 live to use grub2 (bcl@redhat.com)
Related: rhbz#1102318
Related: rhbz#1131199
* Tue Aug 19 2014 Brian C. Lane <bcl@redhat.com> 19.6.32-1
- Yaboot to grub2 conversion cleanup. (dwa@redhat.com)
Related: rhbz#1131199
- GRUB2 as the ISO boot loader for POWER arch (#1131199) (pfsmorigo@br.ibm.com)
Resolves: rhbz#1131199
- Revert "Require 32bit glibc on ppc64" (bcl@redhat.com)
Related: rhbz#1131199
* Fri Aug 15 2014 Brian C. Lane <bcl@redhat.com> 19.6.31-1
- Add efibootmgr to installpkg list for aarch64. (dmarlin@redhat.com)
Resolves: rhbz#1130366
* Tue Aug 12 2014 Brian C. Lane <bcl@redhat.com> 19.6.30-1
- livemedia-creator: Cleanup temp yum files (bcl@redhat.com)
Resolves: rhbz#1073502
- Require 32bit glibc on ppc64 (bcl@redhat.com)
Resolves: rhbz#1105054
- Add xfsdump and remove extra files from xfsprogs (bcl@redhat.com)
Resolves: rhbz#1118654
- Add ipmitool and drivers (bcl@redhat.com)
Resolves: rhbz#1126009
- Update grub2-efi.cfg for aarch64 to more closely match x86 (dmarlin@redhat.com)
Resolves: rhbz#1089418
* Fri Aug 08 2014 Brian C. Lane <bcl@redhat.com> 19.6.29-1
- utf-8 encode yum actions before displaying them (#1072362) (bcl@redhat.com)
- Use BOOTAA64.efi for AARCH64 bootloader filename (#1080113) (bcl@redhat.com)
- Drop devicetree from aarch64 grub2-efi.cfg (#1089418) (bcl@redhat.com)
- livemedia-creator: Add ppc64 live creation support (#1102318)
(bcl@redhat.com)
- runtime-install: Add rpm-ostree (walters@verbum.org)
* Wed Apr 23 2014 Brian C. Lane <bcl@redhat.com> 19.6.28-1
- Install rdma so that dracut will use it along with libmlx4 (bcl)
Resolves: rhbz#1089564
* Thu Apr 03 2014 Brian C. Lane <bcl@redhat.com> 19.6.27-1
- Stop removing curl after adding it (#1083205) (bcl@redhat.com)
* Fri Feb 28 2014 Brian C. Lane <bcl@redhat.com> 19.6.26-1
- Use string for releasever not int (bcl@redhat.com)
Related: rhbz#1067746
- Make lorax's installation of lockdown.efi conditional on its existence. (pjones@redhat.com)
Resolves: rhbz#1071380
* Wed Feb 26 2014 Brian C. Lane <bcl@redhat.com> 19.6.25-1
- createrepo is needed by driver disks (bcl@redhat.com)
Related: rhbz#1016004
* Tue Feb 25 2014 Brian C. Lane <bcl@redhat.com> 19.6.24-1
- Improve aarch64 UEFI support (dmarlin@redhat.com)
Resolves: rhbz#1067671
* Fri Feb 21 2014 Brian C. Lane <bcl@redhat.com> 19.6.23-1
- livemedia-creator: Set the product and release version env variables (bcl@redhat.com)
Resolves: rhbz#1067746
- Remove unneeded images from the product -logos (bcl@redhat.com)
Resolves: rhbz#1068721
* Tue Feb 18 2014 Brian C. Lane <bcl@redhat.com> 19.6.22-1
- fedora- services are named rhel- (#1066118) (bcl@redhat.com)
- Remove unneeded packages from runtime-install (#1065557) (bcl@redhat.com)
* Thu Feb 13 2014 Brian C. Lane <bcl@redhat.com> 19.6.21-1
- Check initrd size on ppc64 and warn (#1060691) (bcl@redhat.com)
- Remove drivers and modules on ppc64 (#1060691) (bcl@redhat.com)
* Wed Feb 12 2014 Brian C. Lane <bcl@redhat.com> 19.6.20-1
- Include mesa-dri-drivers (#1053940) (bcl@redhat.com)
* Tue Feb 11 2014 Brian C. Lane <bcl@redhat.com> 19.6.19-1
- livemedia-creator: virt-image needs ram in MiB not KiB (#1061773)
(bcl@redhat.com)
- Include all the example kickstarts (#1019728) (bcl@redhat.com)
* Wed Feb 05 2014 Brian C. Lane <bcl@redhat.com> 19.6.18-1
- Remove floppy and scsi_debug from initrd (#1060691) (bcl@redhat.com)
* Fri Jan 31 2014 Brian C. Lane <bcl@redhat.com> 19.6.17-1
- Don't activate default auto connections after switchroot (#1012511)
(rvykydal@redhat.com)
Related: rhbz#1012511
* Fri Jan 24 2014 Brian C. Lane <bcl@redhat.com> 19.6.16-1
- Activate anaconda-shell@.service on switch to empty VT (#980062)
(wwoods@redhat.com)
- flush data to disk after mkfsimage (#1052175) (bcl@redhat.com)
* Tue Dec 17 2013 Brian C. Lane <bcl@redhat.com> 19.6.15-1
- Add initial 64-bit ARM (aarch64) support (#1034432) (dmarlin@redhat.com)
* Mon Dec 16 2013 Brian C. Lane <bcl@redhat.com> 19.6.14-1
- s390 switch to generic condev (#1042765) (bcl@redhat.com)
* Fri Nov 15 2013 Brian C. Lane <bcl@redhat.com> 19.6.13-1
- Add SB lockdown to EFI grub menu (#1030495) (bcl@redhat.com)
Resolves: rhbz#1030495
* Thu Nov 14 2013 Brian C. Lane <bcl@redhat.com> 19.6.12-1
- Include partx (#1022899) (bcl@redhat.com)
Resolves: rhbz#1022899
* Thu Nov 14 2013 Brian C. Lane <bcl@redhat.com> 19.6.11-1
- Create upgrade.img using redhat-upgrade-dracut (dshea@redhat.com)
* Mon Nov 11 2013 Vratislav Podzimek <vpodzime@redhat.com> 19.6.10-1
- Do not remove libdaemon from the runtime environment (vpodzime)
Resolves: rhbz#1028938
* Thu Nov 07 2013 Brian C. Lane <bcl@redhat.com> 19.6.9-1
- Install subscription-manager (#1026304) (bcl@redhat.com)
Resolves: rhbz#1026304
* Fri Nov 01 2013 Brian C. Lane <bcl@redhat.com> 19.6.8-1
- Set UEFI defaults to match BIOS (#1021451,#1021446) (bcl@redhat.com)
Resolves: rhbz#1021451
Resolves: rhbz#1021446
- livemedia-creator: Set default name to Red Hat Enterprise Linux 7 (#1002027)
(bcl@redhat.com)
Resolves: rhbz#1002027
- livemedia-creator: Add minimal disk example kickstart (#1019728)
(bcl@redhat.com)
Resolves: rhbz#1019728
* Thu Oct 17 2013 Brian C. Lane <bcl@redhat.com> 19.6.7-1
- Keep virtio_console module (#750231) (bcl@redhat.com)
* Mon Oct 07 2013 Brian C. Lane <bcl@redhat.com> 19.6.6-1
- livemedia-creator: Update minimal packages in README (#1003078) (bcl@redhat.com)
- macboot defaults to no on rhel7 (#1012529) (bcl@redhat.com)
- Add macboot option (#1012529) (bcl@redhat.com)
* Wed Sep 25 2013 Brian C. Lane <bcl@redhat.com> 19.6.5-1
- drop dracut args from config files (#1008054) (bcl@redhat.com)
* Fri Sep 20 2013 Brian C. Lane <bcl@redhat.com> 19.6.4-1
- livemedia-creator: Fix gcdx64.efi path to work for other distros than Fedora
(#1003078) (bcl@redhat.com)
- livemedia-creator: Update example kickstart for rhel7 (#922064)
(bcl@redhat.com)
* Fri Aug 23 2013 Brian C. Lane <bcl@redhat.com> 19.6.3-1
- Keep liblzo2.* (#997976) (dshea@redhat.com)
* Thu Aug 01 2013 Brian C. Lane <bcl@redhat.com> 19.6.2-1
- dracut-nohostonly and dracut-norescue got renamed for dracut >= 030 (#990305)
(harald@redhat.com)
- Don't remove xkeyboard-config message files (#989757) (dshea@redhat.com)
* Fri Jul 26 2013 Brian C. Lane <bcl@redhat.com> 19.6.1-1
- remove yum-plugin-fastestmirror (#876135) (bcl@redhat.com)
* 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)
@ -442,7 +1128,7 @@ make DESTDIR=$RPM_BUILD_ROOT mandir=%{_mandir} install
- 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)
- 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)
@ -461,7 +1147,7 @@ make DESTDIR=$RPM_BUILD_ROOT mandir=%{_mandir} install
- 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
* Fri 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)

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 +1 @@
19.6-1 /
19.7.28-1 ./

View File

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

View File

@ -1,13 +1,17 @@
#!/usr/bin/python
from distutils.core import setup
from glob import glob
import os
import sys
# 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",
"systemd/lorax.conf"])]
# shared files
for root, dnames, fnames in os.walk("share"):
@ -17,7 +21,10 @@ for root, dnames, fnames in os.walk("share"):
# executable
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
sys.path.insert(0, "src")
@ -34,13 +41,13 @@ finally:
setup(name="lorax",
version=vernum,
description="Lorax",
long_description="",
author="Martin Gracik",
author_email="mgracik@redhat.com",
url="http://",
download_url="http://",
long_description="Tools for creating bootable images, including the Anaconda boot.iso",
author="Brian C. Lane, Will Woods, Martin Gracik",
author_email="bcl@redhat.com",
url="https://rhinstaller.github.io/lorax/",
download_url="https://github.com/rhinstaller/lorax/releases",
license="GPLv2+",
packages=["pylorax"],
packages=["pylorax", "pylorax.api", "composer", "composer.cli"],
package_dir={"" : "src"},
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}
# 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

View File

@ -0,0 +1,46 @@
# Lorax Composer filesystem output kickstart template
#
sshpw --username=root --plaintext randOmStrinGhERE
# Firewall configuration
firewall --enabled
# 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=none
# 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 --nobase
# NOTE lorax-composer will add the recipe packages below here, including the final %end

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

@ -0,0 +1,368 @@
# Lorax Composer Live ISO output kickstart template
#
sshpw --username=root --plaintext randOmStrinGhERE
# Firewall configuration
firewall --enabled --service=mdns
# X Window System configuration information
xconfig --startxonboot
# 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 services
services --disabled="network,sshd" --enabled="NetworkManager"
# 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
%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
# 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
# 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 recipe packages below here, including the final %end%packages

View File

@ -0,0 +1,53 @@
# Lorax Composer partitioned disk output kickstart template
#
sshpw --username=root --plaintext randOmStrinGhERE
# Firewall configuration
firewall --enabled
# 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
%post
# Remove root password
passwd -d root > /dev/null
# Remove random-seed
rm /var/lib/systemd/random-seed
%end
%packages
kernel
-dracut-config-rescue
shim
shim-ia32
grub2
grub2-efi
grub2-efi-*-cdboot
grub2-efi-ia32
efibootmgr
# NOTE lorax-composer will add the recipe packages below here, including the final %end

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

@ -0,0 +1,53 @@
# Lorax Composer qcow2 output kickstart template
#
sshpw --username=root --plaintext randOmStrinGhERE
# Firewall configuration
firewall --enabled
# 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
%post
# Remove root password
passwd -d root > /dev/null
# Remove random-seed
rm /var/lib/systemd/random-seed
%end
%packages
kernel
-dracut-config-rescue
shim
shim-ia32
grub2
grub2-efi
grub2-efi-*-cdboot
grub2-efi-ia32
efibootmgr
# NOTE lorax-composer will add the recipe packages below here, including the final %end

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

@ -0,0 +1,46 @@
# Lorax Composer tar output kickstart template
#
sshpw --username=root --plaintext randOmStrinGhERE
# Firewall configuration
firewall --enabled
# 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
%post
# Remove root password
passwd -d root > /dev/null
# Remove random-seed
rm /var/lib/systemd/random-seed
%end
# NOTE Do NOT add any other sections after %packages
%packages
# Packages requires to support this output format go here
# 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 ####
$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
$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
$InputFileName /tmp/X.log
@ -15,10 +32,29 @@ $InputFileStateFile anaconda-tb-statefile
$InputFileFacility local1
$InputRunFileMonitor
#### GLOBAL DIRECTIVES ####
# Where to place auxiliary files
#$WorkDirectory /var/lib/rsyslog
# Use default timestamp format
$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 ####
$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"
#### RULES ####
# log everything except anaconda-specific records from local1 (those are stored
# directly into files via python logging)
# discard messages from dracut regenerating initrd
:programname,isequal,"dracut" ~
*.*;\
authpriv.none;\
local1.none /tmp/syslog;anaconda_syslog
& /dev/tty4;anaconda_tty4
# ### begin forwarding rule ###
# The statement between the begin ... end define a SINGLE forwarding
# rule. They belong together, do NOT split them. If you create multiple
# 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
# 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)
$ActionQueueSaveOnShutdown off # do not save messages to disk on shutdown
$ActionQueueType LinkedList # run asynchronously
$ActionResumeRetryCount -1 # infinite retries if host is down
#$ActionQueueType LinkedList # run asynchronously
#$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:514
# ### 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>
<os-name>Linux</os-name>
<boot-script>boot &device;:\ppc\chrp\yaboot</boot-script>
<icon size=64,64 color-space=3,3,2>
<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

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
images/kernel.img 0x00000000
images/initrd.img @INITRD_LOAD_ADDRESS@
images/generic.prm 0x00010480
images/genericdvd.prm 0x00010480
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
default=0
default=1
splashimage=@SPLASHPATH@
timeout 5
timeout 60
hiddenmenu
title Install @PRODUCT@ @VERSION@
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 {
insmod efi_gop
@ -14,7 +14,7 @@ insmod gzio
insmod part_gpt
insmod ext2
set timeout=5
set timeout=60
### END /etc/grub.d/00_header ###
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"
APPLE_EFI_ICON=inroot+"/usr/share/pixmaps/bootloader/fedora.icns"
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}/fonts/
install boot/efi/EFI/*/shim.efi ${EFIBOOTDIR}/BOOT${efiarch}.efi
install boot/efi/EFI/*/MokManager.efi ${EFIBOOTDIR}/
install boot/efi/EFI/*/gcdx64.efi ${EFIBOOTDIR}/grubx64.efi
%if exists("usr/share/shim/lockdown.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/
## actually make the EFI images
@ -31,7 +42,11 @@ ${make_efiboot("images/efiboot.img")}
copy ${KERNELDIR}/vmlinuz ${EFIBOOTDIR}
copy ${KERNELDIR}/initrd.img ${EFIBOOTDIR}
%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 @VERSION@ ${product.version} ${eficonf}
replace @KERNELNAME@ vmlinuz ${eficonf}
@ -43,9 +58,6 @@ ${make_efiboot("images/efiboot.img")}
%else:
replace @ROOT@ 'inst.stage2=hd:LABEL=${isolabel|udev}' ${eficonf}
%endif
%if efiarch == 'IA32':
copy ${eficonf} ${EFIBOOTDIR}/BOOT.conf
%endif
runcmd mkefiboot ${args} ${outroot}/${EFIBOOTDIR} ${outroot}/${img}
%if include_kernel:
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
default=0
default=1
splashimage=@SPLASHPATH@
timeout 5
timeout 60
hiddenmenu
title Start @PRODUCT@ @VERSION@
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@
title Test this media & start @PRODUCT@ @VERSION@
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@

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 {
insmod efi_gop
@ -14,27 +14,27 @@ insmod gzio
insmod part_gpt
insmod ext2
set timeout=5
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 rd.luks=0 rd.md=0 rd.dm=0 quiet
linuxefi @KERNELPATH@ @ROOT@ @EXTRA@ 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.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@
}
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 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@
}
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@
}
}

View File

@ -61,13 +61,13 @@ menu separator # insert an empty line
label linux
menu label ^Start @PRODUCT@ @VERSION@
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
menu label Test this ^media & start @PRODUCT@ @VERSION@
menu default
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
@ -83,7 +83,7 @@ label vesa
@PRODUCT@ @VERSION@.
endtext
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
menu indent count 5
@ -93,7 +93,7 @@ label rescue
and edit config files to try to get it booting again.
endtext
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
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"
APPLE_EFI_ICON=inroot+"/usr/share/pixmaps/bootloader/fedora.icns"
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}/fonts/
install boot/efi/EFI/*/shim.efi ${EFIBOOTDIR}/BOOT${efiarch}.efi
install boot/efi/EFI/*/gcdx64.efi ${EFIBOOTDIR}/grubx64.efi
%if exists("usr/share/shim/lockdown.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/
## actually make the EFI images
@ -30,21 +42,23 @@ ${make_efiboot("images/efiboot.img")}
copy ${KERNELDIR}/vmlinuz ${EFIBOOTDIR}
copy ${KERNELDIR}/initrd.img ${EFIBOOTDIR}
%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 @VERSION@ ${product.version} ${eficonf}
replace @KERNELNAME@ vmlinuz ${eficonf}
replace @KERNELPATH@ /${kdir}/vmlinuz ${eficonf}
replace @INITRDPATH@ /${kdir}/initrd.img ${eficonf}
replace @ISOLABEL@ '${isolabel}' ${eficonf}
replace @EXTRA@ '${extra_boot_args}' ${eficonf}
%if disk:
replace @ROOT@ root=live:LABEL=ANACONDA ${eficonf}
%else:
replace @ROOT@ 'root=live:CDLABEL=${isolabel|udev}' ${eficonf}
%endif
%if efiarch == 'IA32':
copy ${eficonf} ${EFIBOOTDIR}/BOOT.conf
%endif
runcmd mkefiboot ${args} ${outroot}/${EFIBOOTDIR} ${outroot}/${img}
%if include_kernel:
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"
BOOTDIR="ppc"
GRUBDIR="boot/grub"
LIVEDIR="LiveOS"
MACDIR=BOOTDIR+"/mac"
NETBOOTDIR="images/netboot"
LORAXDIR="usr/share/lorax/"
WRAPPER="usr/sbin/wrapper"
WRAPPER_DATA="usr/"+libdir+"/kernel-wrapper"
bitsizes = set()
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}
@ -35,43 +28,40 @@ treeinfo stage2 mainimage ${LIVEDIR}/squashfs.img
mkdir ${BOOTDIR}
## boot stuff for normal (CHRP/PREP) PPC systems
install ${configdir}/bootinfo.txt ${BOOTDIR}
install boot/efika.forth ${BOOTDIR}
mkdir ${BOOTDIR}/chrp
install usr/lib/yaboot/yaboot ${BOOTDIR}/chrp
runcmd ${inroot}/usr/lib/yaboot/addnote ${outroot}/${BOOTDIR}/chrp/yaboot
## special boot dir for PowerMacs
mkdir ${MACDIR}
install usr/lib/yaboot/yaboot ${MACDIR}
install ${configdir}/ofboot.b ${MACDIR}
mkdir ${GRUBDIR}/powerpc-ieee1275
runcmd grub2-mkimage -O powerpc-ieee1275 -d /usr/lib/grub/powerpc-ieee1275 -p '()/boot/grub' \
-o ${outroot}/${GRUBDIR}/powerpc-ieee1275/core.elf iso9660 ext2 ofnet net tftp http
install /usr/lib/grub/powerpc-ieee1275/*.mod ${GRUBDIR}/powerpc-ieee1275
install /usr/lib/grub/powerpc-ieee1275/*.lst ${GRUBDIR}/powerpc-ieee1275
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
install ${configdir}/mapping ${BOOTDIR}
install ${configdir}/magic ${BOOTDIR}
## 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)
%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
KERNELDIR=BOOTDIR+"/ppc%s" % bits
NETIMG=NETBOOTDIR+"/ppc%s.img" % bits
bitsizes.add(bits)
%>
## install kernel
mkdir ${KERNELDIR} ${NETBOOTDIR}
installkernel images-${kernel.arch} ${kernel.path} ${KERNELDIR}/vmlinuz
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
runcmd ${inroot}/${WRAPPER} -p of \
-D ${inroot}/${WRAPPER_DATA} \
@ -86,18 +76,14 @@ install ${configdir}/magic ${BOOTDIR}
%endif
%endfor
## choose correct yaboot.conf
mkdir etc
%if len(bitsizes) == 2:
## both kernels means hybrid - use the magic hybrid config
install ${configdir}/yaboot.conf.3264 etc/yaboot.conf
replace @PRODUCT@ ${product.name} etc/yaboot.conf
replace @VERSION@ ${product.version} etc/yaboot.conf
replace @ROOT@ "${rootarg}" etc/yaboot.conf
%else:
## single arch - use the arch-specific yaboot.conf from above
copy ${KERNELDIR}/yaboot.conf etc/yaboot.conf
%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
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} \
-map ${inroot}/${configdir}/mapping \
-no-desktop -allow-multidot -graft-points \
etc=${outroot}/etc \
${BOOTDIR}=${outroot}/${BOOTDIR} \
${GRUBDIR}=${outroot}/${GRUBDIR} \
${NETBOOTDIR}=${outroot}/${NETBOOTDIR} \
${LIVEDIR}=${outroot}/${LIVEDIR}
${LIVEDIR}=${outroot}/${LIVEDIR} ${imggraft}
%for kernel in kernels:
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"
BOOTDIR="images"
KERNELDIR=BOOTDIR
INITRD_ADDRESS="0x02000000"
LORAXDIR="usr/share/lorax/"
# The assumption seems to be that there is only one s390 kernel, ever
kernel = kernels[0]
%>
@ -15,10 +16,12 @@ treeinfo stage2 mainimage images/${runtime_base}
## install bootloader (such as it is) and bootloader config
install ${configdir}/redhat.exec ${BOOTDIR}
install ${configdir}/generic.prm ${BOOTDIR}
install ${configdir}/genericdvd.prm ${BOOTDIR}
install ${configdir}/generic.ins .
## configure bootloader
replace @INITRD_LOAD_ADDRESS@ ${INITRD_ADDRESS} generic.ins
replace @EXTRA@ '${extra_boot_args}' ${BOOTDIR}/generic.prm
## install kernel
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
treeinfo images-${basearch} initrd.addrsize ${BOOTDIR}/initrd.addrsize
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} 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"
SYSLINUXDIR="usr/share/syslinux"
@ -6,6 +6,7 @@ PXEBOOTDIR="images/pxeboot"
BOOTDIR="isolinux"
KERNELDIR=PXEBOOTDIR
LIVEDIR="LiveOS"
LORAXDIR="usr/share/lorax/"
%>
mkdir ${LIVEDIR}
@ -26,6 +27,7 @@ install boot/memtest* ${BOOTDIR}/memtest
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 @ROOT@ 'root=live:CDLABEL=${isolabel|udev}' ${BOOTDIR}/isolinux.cfg
replace @EXTRA@ '${extra_boot_args}' ${BOOTDIR}/isolinux.cfg
## install kernels
mkdir ${KERNELDIR}
@ -47,11 +49,15 @@ hardlink ${KERNELDIR}/initrd.img ${BOOTDIR}
%endif
## WHeeeeeeee, EFI.
## We could remove the basearch restriction someday..
<% efiargs=""; efigraft=""; efihybrid="" %>
%if exists("boot/efi/EFI/fedora/gcdx64.efi") and basearch != 'i386':
<% efiargs=""; efigraft=""; efihybrid=""; efiarch32=None; efiarch64=None %>
%if exists("boot/efi/EFI/*/gcdia32.efi"):
<% 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)
images = ["images/efiboot.img"]
if domacboot:
@ -61,9 +67,18 @@ hardlink ${KERNELDIR}/initrd.img ${BOOTDIR}
efigraft += " {0}={1}/{0}".format(img,outroot)
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
# 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
runcmd mkisofs -o ${outroot}/images/boot.iso \
-b ${BOOTDIR}/isolinux.bin -c ${BOOTDIR}/boot.cat \
@ -72,6 +87,6 @@ runcmd mkisofs -o ${outroot}/images/boot.iso \
${BOOTDIR}=${outroot}/${BOOTDIR} \
${KERNELDIR}=${outroot}/${KERNELDIR} \
${LIVEDIR}=${outroot}/${LIVEDIR} \
${efigraft}
${efigraft} ${imggraft}
runcmd isohybrid ${efihybrid} ${outroot}/images/boot.iso
treeinfo images-${basearch} boot.iso images/boot.iso

View File

@ -2,24 +2,16 @@
<%
configdir="tmp/config_files/ppc"
BOOTDIR="ppc"
GRUBDIR="boot/grub"
LIVEDIR="LiveOS"
MACDIR=BOOTDIR+"/mac"
NETBOOTDIR="images/netboot"
LORAXDIR="usr/share/lorax/"
WRAPPER="usr/sbin/wrapper"
WRAPPER_DATA="usr/"+libdir+"/kernel-wrapper"
bitsizes = set()
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}
@ -36,30 +28,33 @@ treeinfo stage2 mainimage ${LIVEDIR}/squashfs.img
mkdir ${BOOTDIR}
## boot stuff for normal (CHRP/PREP) PPC systems
install ${configdir}/bootinfo.txt ${BOOTDIR}
install boot/efika.forth ${BOOTDIR}
mkdir ${BOOTDIR}/chrp
install usr/lib/yaboot/yaboot ${BOOTDIR}/chrp
runcmd ${inroot}/usr/lib/yaboot/addnote ${outroot}/${BOOTDIR}/chrp/yaboot
## special boot dir for PowerMacs
mkdir ${MACDIR}
install usr/lib/yaboot/yaboot ${MACDIR}
install ${configdir}/ofboot.b ${MACDIR}
mkdir ${GRUBDIR}/powerpc-ieee1275
runcmd grub2-mkimage -O powerpc-ieee1275 -d /usr/lib/grub/powerpc-ieee1275 -p '()/boot/grub' \
-o ${outroot}/${GRUBDIR}/powerpc-ieee1275/core.elf iso9660 ext2 ofnet net tftp http
install /usr/lib/grub/powerpc-ieee1275/*.mod ${GRUBDIR}/powerpc-ieee1275
install /usr/lib/grub/powerpc-ieee1275/*.lst ${GRUBDIR}/powerpc-ieee1275
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
install ${configdir}/mapping ${BOOTDIR}
install ${configdir}/magic ${BOOTDIR}
## 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)
%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
KERNELDIR=BOOTDIR+"/ppc%s" % bits
NETIMG=NETBOOTDIR+"/ppc%s.img" % bits
bitsizes.add(bits)
%>
## install kernel
mkdir ${KERNELDIR} ${NETBOOTDIR}
@ -71,13 +66,6 @@ install ${configdir}/magic ${BOOTDIR}
installupgradeinitrd images-${kernel.arch} ${kernel.upgrade.path} ${KERNELDIR}/upgrade.img
%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
runcmd ${inroot}/${WRAPPER} -p of \
-D ${inroot}/${WRAPPER_DATA} \
@ -92,18 +80,21 @@ install ${configdir}/magic ${BOOTDIR}
%endif
%endfor
## choose correct yaboot.conf
mkdir etc
%if len(bitsizes) == 2:
## both kernels means hybrid - use the magic hybrid config
install ${configdir}/yaboot.conf.3264 etc/yaboot.conf
replace @PRODUCT@ ${product.name} etc/yaboot.conf
replace @VERSION@ ${product.version} etc/yaboot.conf
replace @ROOT@ "${rootarg}" etc/yaboot.conf
%else:
## single arch - use the arch-specific yaboot.conf from above
copy ${KERNELDIR}/yaboot.conf etc/yaboot.conf
%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
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} \
-map ${inroot}/${configdir}/mapping \
-no-desktop -allow-multidot -graft-points \
etc=${outroot}/etc \
${BOOTDIR}=${outroot}/${BOOTDIR} \
${GRUBDIR}=${outroot}/${GRUBDIR} \
${NETBOOTDIR}=${outroot}/${NETBOOTDIR} \
${LIVEDIR}=${outroot}/${LIVEDIR}
${LIVEDIR}=${outroot}/${LIVEDIR} ${imggraft}
%for kernel in kernels:
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*
%endif
## 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
## no fancy video, either
removepkg libcrystalhd crystalhd-firmware ivtv-firmware cx18-firmware
removepkg mesa-dri-drivers
## we don't create new initramfs/bootloader conf inside anaconda
## (that happens inside the target system after we install dracut/grubby)
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
## We also need dracut-shutdown.service and dracut-initramfs-restore to reboot
removefrom dracut --allbut /usr/lib/dracut/modules.d/30convertfs/convertfs.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)
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
removefrom fedora-release --allbut /etc/os-release
removepkg fedora-release-rawhide
@ -39,8 +44,6 @@ removepkg gnupg2 pinentry
removepkg cups-libs iscan-firmware
## no storage device monitoring
removepkg device-mapper-event dmraid-events sgpio
## we don't (currently) support deltarpms in anaconda
removepkg deltarpm
## no notifications in anaconda
removepkg notification-daemon
## logrotate isn't useful in anaconda
@ -48,13 +51,15 @@ removepkg logrotate
remove /etc/logrotate.d
## anaconda needs this to do media check
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
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 jasper-libs libXt libXxf86misc
removepkg libasyncns libdaemon libhbaapi libhbalinux
removepkg libmcpp libpcap libtiff libutempter linux-atm-libs
removepkg jasper-libs libXxf86misc
removepkg libasyncns libhbaapi libhbalinux
removepkg libmcpp libtiff libutempter linux-atm-libs
removepkg lvm2-libs m4 mailx makebootfat mcpp
removepkg mingetty mobile-broadband-provider-info pkgconfig ppp pth
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
## 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/share/doc /usr/share/info /usr/share/man /usr/share/gnome
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
## clean up kernel modules
<%
removekmods = """
sound drivers/media drivers/hwmon drivers/video drivers/char
net/atm net/bluetooth net/sched net/sctp net/bridge
net/rds net/l2tp net/decnet net/netfilter net/ipv4 net/ipv6
drivers/watchdog drivers/target drivers/rtc drivers/input/joystick
drivers/bluetooth drivers/hid drivers/edac drivers/staging
drivers/usb/serial drivers/usb/host drivers/usb/misc
fs/ocfs2 fs/ceph fs/nfsd fs/ubifs fs/nilfs2
arch/x86/kvm
"""
%>
%for kmodpath in removekmods.split():
remove lib/modules/*/kernel/${kmodpath}
%endfor
removekmod sound drivers/media drivers/hwmon \
net/atm net/bluetooth net/sched net/sctp \
net/rds net/l2tp net/decnet net/netfilter net/ipv4 net/ipv6 \
drivers/watchdog drivers/rtc drivers/input/joystick \
drivers/bluetooth drivers/edac drivers/usb/serial \
drivers/usb/host drivers/usb/misc fs/ocfs2 fs/ceph fs/nfsd \
fs/ubifs fs/nilfs2 arch/x86/kvm
## Need to keep virtio_console.ko and ipmi stuff in drivers/char
## Also keep virtio-rng so that the installer can get sufficient randomness for
## LUKS setup.
removekmod drivers/char --allbut virtio_console hw_random \
virtio-rng ipmi hmcdrv
removekmod drivers/staging --allbut zram
removekmod drivers/video --allbut hyperv_fb syscopyarea sysfillrect sysimgblt fb_sys_fops
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
## remove unused themes, theme engines, icons, etc.
@ -112,7 +118,8 @@ removefrom metacity --allbut /usr/bin/* /usr/${libdir}/* /etc/*
## filesystem tools
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
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 bind-libs-lite /usr/${libdir}/libirs*
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 ca-certificates /etc/pki/java/*
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 /usr/sbin/runuser /usr/bin/[ /usr/bin/base64 /usr/bin/chcon
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/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/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/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/sha512sum /usr/bin/shuf /usr/bin/stat
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 cracklib /usr/sbin/*
removefrom cracklib-dicts /usr/${libdir}/* /usr/sbin/*
removefrom createrepo /usr/bin/* /usr/share/*
removefrom cryptsetup-luks /usr/share/*
removefrom cyrus-sasl-lib /usr/sbin/*
removefrom db4 /usr/*
@ -192,12 +198,14 @@ removefrom glibc /lib/*/nosegneg/* /${libdir}/libBrokenLocale*
removefrom glibc /${libdir}/libSegFault* /${libdir}/libanl*
removefrom glibc /${libdir}/libcidn* /${libdir}/libnss_compat*
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-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/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 gmp /usr/${libdir}/libgmpxx.* /usr/${libdir}/libmp.*
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-python2-gconf /usr/share/pygtk/*
removefrom gnutls /usr/share/locale/*
removefrom gpgme /usr/${libdir}/libgpgme-*
removefrom grep /etc/* /usr/share/locale/*
removefrom gstreamer /usr/bin/* /usr/${libdir}/gstreamer-0.10/*
removefrom gstreamer /usr/${libdir}/libgst* /usr/libexec/* /usr/share/locale/*
removefrom gtk2 /usr/bin/update-gtk-immodules
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 hwdata /etc/* /usr/share/hwdata/oui.txt /usr/share/hwdata/pnp.ids
removefrom hwdata /usr/share/hwdata/upgradelist
@ -249,9 +255,8 @@ removefrom libvorbis /usr/${libdir}/libvorbisenc.*
removefrom libxml2 /usr/bin/*
removefrom libxml2-python /usr/${libdir}/python?.?/site-packages/libxml2mod.a
removefrom libxml2-python /usr/${libdir}/python?.?/site-packages/libxml2mod.la
removefrom lldpad /etc/* /usr/sbin/lldptool
removefrom lldpad /etc/*
removefrom lua /usr/bin/*
removefrom lzo /usr/${libdir}/liblzo2.*
removefrom madan-fonts /usr/share/fonts/madan/*
removefrom mdadm /etc/*
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 openssl /etc/pki/* /usr/bin/* /usr/${libdir}/openssl/*
removefrom pam /usr/sbin/* /usr/share/locale/*
removefrom pciutils /usr/sbin/*
removefrom policycoreutils /etc/* /usr/bin/* /usr/share/locale/*
removefrom polkit /usr/bin/*
removefrom polkit-desktop-policy /var/lib/*
@ -304,7 +308,7 @@ removefrom python-ethtool /usr/sbin/*
removefrom python-meh /usr/share/locale/*
removefrom readline /usr/${libdir}/*
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 sed /usr/share/locale/*
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} \
/etc/mtab /etc/pam.d/login /etc/pam.d/remote \
/usr/sbin/{agetty,blkid,blockdev,clock,fdisk,fsck,fstrim,hwclock,losetup} \
/usr/sbin/{mkswap,nologin,sfdisk,swapoff,swapon,wipefs} \
/usr/bin/logger
/usr/sbin/{mkswap,nologin,sfdisk,swapoff,swapon,wipefs,partx,fsfreeze} \
/usr/bin/{logger,hexdump,flock,chmem,lsmem}
removefrom volume_key-libs /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-openchrome /usr/${libdir}/libchrome*
removefrom xorg-x11-drv-synaptics /usr/bin/*
@ -332,14 +335,27 @@ 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-server-utils --allbut /usr/bin/xrandr /usr/share/X11/rgb.txt
removefrom yum /etc/* /usr/share/locale/* /usr/share/yum-cli/*
removefrom ${product.name}-logos /etc/*
removefrom ${product.name}-logos /usr/share/icons/{Bluecurve,oxygen}/*
removefrom ${product.name}-logos /usr/share/{firstboot,gnome-screensaver,kde4,pixmaps}/*
removefrom redhat-logos /etc/*
removefrom redhat-logos /usr/share/icons/{Bluecurve,oxygen}/*
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
## OSCAP cleanups
removefrom scap-security-guide --allbut /usr/share/xml/scap/ssg/content/ssg-rhel7-ds.xml
## cleanup_python_files()
runcmd find ${root} -name "*.pyo" -type f -delete
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
## (broken systemd service links lead to confusing noise at boot)
## NOTE: not checking /var because we want to keep /var/run

View File

@ -3,24 +3,26 @@
## anaconda package
installpkg anaconda anaconda-widgets
## anaconda deps that aren't in the RPM
installpkg tmux
installpkg firstboot
installpkg iscsi-initiator-utils
## speed up compression on multicore systems
installpkg pigz
## firstaidkit (rescue mode) packages
installpkg firstaidkit-plugin-{passwd,key-recovery,mdadm-conf}
## Other available payloads
installpkg rpm-ostree
## kernel and firmware
installpkg kernel
%if basearch != "s390x":
installpkg *-firmware
installpkg b43-openfwwf
%endif
## 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"):
installpkg kernel-lpae kernel-tegra
installpkg uboot-tools
@ -28,28 +30,37 @@ installpkg kernel
%if basearch == "i386":
installpkg kernel-PAE gpart
%endif
%if basearch == "x86_64":
installpkg grub2-tools-efi
installpkg shim-x64 grub2-efi-x64-cdboot
%endif
%if basearch in ("i386", "x86_64"):
installpkg grub2 grub2-tools biosdevname memtest86+ syslinux
installpkg efibootmgr grub2-efi shim shim-unsigned
installpkg biosdevname memtest86+ syslinux
installpkg grub2-tools grub2-tools-minimal grub2-tools-extra
installpkg efibootmgr
installpkg shim-ia32 grub2-efi-ia32-cdboot
%endif
%if basearch in ("ppc", "ppc64"):
installpkg grub2 grub2-tools yaboot fbset hfsutils kernel-bootwrapper ppc64-utils
%if basearch in ("ppc", "ppc64", "ppc64le"):
installpkg fbset hfsutils kernel-bootwrapper ppc64-utils
installpkg grub2-tools grub2-tools-minimal grub2-tools-extra
installpkg grub2-${basearch}
%endif
%if basearch == "s390x":
installpkg lsscsi s390utils-base s390utils-cmsfs-fuse
installpkg lsscsi s390utils-base s390utils-cmsfs-fuse s390utils-hmcdrvfs
%endif
## yay, plymouth
installpkg plymouth
## 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
installpkg fedup-dracut fedup-dracut-plymouth
## install other fedup scripts, if there are any. It's OK if there aren't.
log "Looking for extra fedup-dracut packages..."
-installpkg *-fedup-dracut
## redhat-upgrade-dracut handles upgrades on RHEL
installpkg redhat-upgrade-dracut redhat-upgrade-dracut-plymouth
log "Looking for extra redhat-upgrade-dracut packages..."
-installpkg *-redhat-upgrade-dracut
installpkg redhat-release-eula
## rpcbind or portmap needed by dracut nfs module
installpkg rpcbind
@ -79,10 +90,11 @@ installpkg gnome-keyring
installpkg python-imaging
## 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 system-storage-manager
installpkg device-mapper-persistent-data
installpkg xfsdump
## SELinux support
installpkg selinux-policy-targeted audit libsemanage-python
@ -94,14 +106,20 @@ installpkg tigervnc-server-minimal
installpkg tigervnc-server-module
%endif
installpkg net-tools
installpkg bridge-utils
installpkg nmap-ncat
## ntp packages
installpkg ntp
## hardware utilities/libraries
installpkg pciutils usbutils
installpkg pciutils usbutils ipmitool
installpkg mt-st smartmontools
%if basearch != "s390x":
installpkg hdparm pcmciautils
installpkg hdparm
%endif
installpkg libmlx4
installpkg libmlx4 rdma
installpkg rng-tools
## translations & language packs
installpkg yum-langpacks
@ -124,22 +142,27 @@ installpkg xorg-x11-fonts-misc
installpkg gnome-themes-standard gnome-icon-theme-legacy
## branding & logos
installpkg fedora-gnome-theme fedora-icon-theme
installpkg gnome-themes-standard
## debugging/bug reporting tools
installpkg gdb-gdbserver
installpkg python-epdb
installpkg libreport-plugin-bugzilla libreport-plugin-reportuploader
installpkg fpaste
## extra tools not required by anaconda
installpkg vim-minimal strace lsof dump xz less eject
installpkg wget rsync rsh bind-utils ftp mtr vconfig
installpkg icfg spice-vdagent
installpkg gdisk
installpkg wget rsync rsh bind-utils ftp mtr
installpkg spice-vdagent
installpkg gdisk hexedit sg3_utils
## 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
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/
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
systemctl disable systemd-readahead-collect.service \
systemd-readahead-replay.service \
@ -34,9 +38,17 @@ systemctl disable systemd-readahead-collect.service \
lvm2-monitor.service
## 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.
systemctl mask fedora-configure.service fedora-loadmodules.service \
fedora-autorelabel.service fedora-autorelabel-mark.service \
fedora-wait-storage.service media.mount
systemctl mask rhel-configure.service rhel-loadmodules.service \
rhel-autorelabel.service rhel-autorelabel-mark.service \
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
remove var/log/journal
@ -50,9 +62,12 @@ install ${configdir}/bash_history root/.bash_history
install ${configdir}/profile root/.profile
install ${configdir}/libuser.conf etc
install ${configdir}/sysctl.conf etc/sysctl.d/anaconda.conf
%if exists(root+"/etc/selinux/targeted"):
install ${configdir}/selinux.config etc/selinux/config
%endif
install ${configdir}/spice-vdagentd etc/sysconfig
mkdir etc/NetworkManager/conf.d
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
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/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
## 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"
## 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"
## TODO: we could run prelink here if we wanted?

View File

@ -4,6 +4,7 @@ configdir="tmp/config_files/s390"
BOOTDIR="images"
KERNELDIR=BOOTDIR
INITRD_ADDRESS="0x02000000"
LORAXDIR="usr/share/lorax/"
# The assumption seems to be that there is only one s390 kernel, ever
kernel = kernels[0]
%>
@ -15,6 +16,8 @@ treeinfo stage2 mainimage images/${runtime_base}
## install bootloader (such as it is) and bootloader config
install ${configdir}/redhat.exec ${BOOTDIR}
install ${configdir}/generic.prm ${BOOTDIR}
install ${configdir}/genericdvd.prm ${BOOTDIR}
install ${configdir}/cdboot.prm ${BOOTDIR}
install ${configdir}/generic.ins .
## configure bootloader
@ -35,4 +38,36 @@ createaddrsize ${INITRD_ADDRESS} ${outroot}/${BOOTDIR}/initrd.img ${outroot}/${B
## s390 also has some special treeinfo data
treeinfo images-${basearch} initrd.addrsize ${BOOTDIR}/initrd.addrsize
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} 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"
KERNELDIR=PXEBOOTDIR
LIVEDIR="LiveOS"
LORAXDIR="usr/share/lorax/"
%>
mkdir ${LIVEDIR}
@ -61,11 +62,15 @@ hardlink ${KERNELDIR}/initrd.img ${BOOTDIR}
%endif
## WHeeeeeeee, EFI.
## We could remove the basearch restriction someday..
<% efiargs=""; efigraft=""; efihybrid="" %>
%if exists("boot/efi/EFI/*/gcdx64.efi") and basearch != 'i386':
<% efiargs=""; efigraft=""; efihybrid=""; efiarch32=None; efiarch64=None %>
%if exists("boot/efi/EFI/*/gcdia32.efi"):
<% 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)
images = ["images/efiboot.img"]
if domacboot:
@ -75,9 +80,25 @@ hardlink ${KERNELDIR}/initrd.img ${BOOTDIR}
efigraft += " {0}={1}/{0}".format(img,outroot)
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
# 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 \
-b ${BOOTDIR}/isolinux.bin -c ${BOOTDIR}/boot.cat \
@ -86,6 +107,6 @@ runcmd mkisofs -o ${outroot}/images/boot.iso \
${BOOTDIR}=${outroot}/${BOOTDIR} \
${KERNELDIR}=${outroot}/${KERNELDIR} \
${LIVEDIR}=${outroot}/${LIVEDIR} \
${efigraft}
${efigraft} ${imggraft}
runcmd isohybrid ${efihybrid} ${outroot}/images/boot.iso
treeinfo images-${basearch} boot.iso images/boot.iso

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

@ -0,0 +1,142 @@
#!/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 import main
VERSION = "{0}-{1}".format(os.path.basename(sys.argv[0]), vernum)
# Documentation for the commands
epilog = """
compose start <blueprint> <type> Start a compose using the selected blueprint and output type.
types List the supported output types.
status List the status of all running and finished composes.
log <uuid> [<size>kB] Show the last 1kB of the compose log.
cancel <uuid> Cancel a running compose and delete any intermediate results.
delete <uuid,...> Delete the listed compose results.
details <uuid> Show detailed information on the compose.
metadata <uuid> Download the metadata use to create the compose to <uuid>-metadata.tar
logs <uuid> Download the compose logs to <uuid>-logs.tar
results <uuid> Download all of the compose results; metadata, logs, and image to <uuid>.tar
image <uuid> Download the output image from the compose. Filename depends on the type.
blueprints list List the names of the available blueprints.
show <blueprint,...> Display the blueprint in TOML format.
changes <blueprint,...> Display the changes for each blueprint.
diff <blueprint-name> Display the differences between 2 versions of a blueprint.
<from-commit> Commit hash or NEWEST
<to-commit> Commit hash, NEWEST, or WORKSPACE
save <blueprint,...> Save the blueprint to a file, <blueprint-name>.toml
delete <blueprint> Delete a blueprint from the server
depsolve <blueprint,...> Display the packages needed to install the blueprint.
push <blueprint> Push a blueprint TOML file to the server.
freeze <blueprint,...> Display the frozen blueprint's modules and packages.
freeze show <blueprint,...> Display the frozen blueprint in TOML format.
freeze save <blueprint,...> Save the frozen blueprint to a file, <blueprint-name>.frozen.toml.
tag <blueprint> Tag the most recent blueprint commit as a release.
undo <blueprint> <commit> Undo changes to a blueprint by reverting to the selected commit.
workspace <blueprint> Push the blueprint TOML to the temporary workspace storage.
modules list List the available modules.
projects list List the available projects.
info <project,...> Show details about the listed projects.
sources list List the available sources
sources info <source,...> Details about the source.
sources add <source.toml> Add a package source to the server.
sources change <source.toml> Change an existing source
sources delete <source> Delete a package source.
"""
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="./composer-cli.log", metavar="LOG",
help="Path to logfile (./composer-cli.log)")
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):
# Setup logging to console and to logfile
log.setLevel(logging.DEBUG)
sh = logging.StreamHandler()
sh.setLevel(logging.INFO)
fmt = logging.Formatter("%(asctime)s: %(message)s")
sh.setFormatter(fmt)
log.addHandler(sh)
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
opts = get_parser().parse_args()
if opts.showver:
print(VERSION)
sys.exit(0)
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)
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,57 @@
#
# 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
command_map = {
"blueprints": blueprints_cmd,
"modules": modules_cmd,
"projects": projects_cmd,
"compose": compose_cmd,
"sources": sources_cmd
}
def main(opts):
""" Main program execution
:param opts: Cmdline arguments
:type opts: argparse.Namespace
"""
if len(opts.args) == 0:
log.error("Missing command")
return 1
elif opts.args[0] not in command_map:
log.error("Unknown command %s", opts.args[0])
return 1
if len(opts.args) == 1:
log.error("Missing %s sub-command", opts.args[0])
return 1
else:
try:
return command_map[opts.args[0]](opts)
except Exception as e:
log.error(str(e))
return 1

View File

@ -0,0 +1,520 @@
#
# 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 json
from composer import http_client as client
from composer.cli.utilities import argify, frozen_toml_filename, toml_filename, handle_api_result
from composer.cli.utilities import packageNEVRA
def blueprints_cmd(opts):
"""Process blueprints commands
:param opts: Cmdline arguments
:type opts: argparse.Namespace
:returns: Value to return from sys.exit()
:rtype: int
This dispatches the blueprints commands to a function
"""
cmd_map = {
"list": blueprints_list,
"show": blueprints_show,
"changes": blueprints_changes,
"diff": blueprints_diff,
"save": blueprints_save,
"delete": blueprints_delete,
"depsolve": blueprints_depsolve,
"push": blueprints_push,
"freeze": blueprints_freeze,
"tag": blueprints_tag,
"undo": blueprints_undo,
"workspace": blueprints_workspace
}
if opts.args[1] not in cmd_map:
log.error("Unknown blueprints command: %s", opts.args[1])
return 1
return cmd_map[opts.args[1]](opts.socket, opts.api_version, opts.args[2:], opts.json)
def blueprints_list(socket_path, api_version, args, show_json=False):
"""Output the list of available blueprints
:param socket_path: Path to the Unix socket to use for API communication
:type socket_path: str
:param api_version: Version of the API to talk to. eg. "0"
:type api_version: str
:param args: List of remaining arguments from the cmdline
:type args: list of str
:param show_json: Set to True to show the JSON output instead of the human readable output
:type show_json: bool
blueprints list
"""
api_route = client.api_url(api_version, "/blueprints/list")
result = client.get_url_json(socket_path, api_route)
if show_json:
print(json.dumps(result, indent=4))
return 0
print("blueprints: " + ", ".join([r for r in result["blueprints"]]))
return 0
def blueprints_show(socket_path, api_version, args, show_json=False):
"""Show the blueprints, in TOML format
:param socket_path: Path to the Unix socket to use for API communication
:type socket_path: str
:param api_version: Version of the API to talk to. eg. "0"
:type api_version: str
:param args: List of remaining arguments from the cmdline
:type args: list of str
:param show_json: Set to True to show the JSON output instead of the human readable output
:type show_json: bool
blueprints show <blueprint,...> Display the blueprint in TOML format.
Multiple blueprints will be separated by \n\n
"""
for blueprint in argify(args):
api_route = client.api_url(api_version, "/blueprints/info/%s?format=toml" % blueprint)
print(client.get_url_raw(socket_path, api_route) + "\n\n")
return 0
def blueprints_changes(socket_path, api_version, args, show_json=False):
"""Display the changes for each of the blueprints
:param socket_path: Path to the Unix socket to use for API communication
:type socket_path: str
:param api_version: Version of the API to talk to. eg. "0"
:type api_version: str
:param args: List of remaining arguments from the cmdline
:type args: list of str
:param show_json: Set to True to show the JSON output instead of the human readable output
:type show_json: bool
blueprints changes <blueprint,...> Display the changes for each blueprint.
"""
api_route = client.api_url(api_version, "/blueprints/changes/%s" % (",".join(argify(args))))
result = client.get_url_json(socket_path, api_route)
if show_json:
print(json.dumps(result, indent=4))
return 0
for blueprint in result["blueprints"]:
print(blueprint["name"])
for change in blueprint["changes"]:
prettyCommitDetails(change)
return 0
def prettyCommitDetails(change, indent=4):
"""Print the blueprint's change in a nice way
:param change: The individual blueprint change dict
:type change: dict
:param indent: Number of spaces to indent
:type indent: int
"""
def revision():
if change["revision"]:
return " revision %d" % change["revision"]
else:
return ""
print " " * indent + change["timestamp"] + " " + change["commit"] + revision()
print " " * indent + change["message"] + "\n"
def blueprints_diff(socket_path, api_version, args, show_json=False):
"""Display the differences between 2 versions of a blueprint
:param socket_path: Path to the Unix socket to use for API communication
:type socket_path: str
:param api_version: Version of the API to talk to. eg. "0"
:type api_version: str
:param args: List of remaining arguments from the cmdline
:type args: list of str
:param show_json: Set to True to show the JSON output instead of the human readable output
:type show_json: bool
blueprints diff <blueprint-name> Display the differences between 2 versions of a blueprint.
<from-commit> Commit hash or NEWEST
<to-commit> Commit hash, NEWEST, or WORKSPACE
"""
if len(args) == 0:
log.error("blueprints diff is missing the blueprint name, from commit, and to commit")
return 1
elif len(args) == 1:
log.error("blueprints diff is missing the from commit, and the to commit")
return 1
elif len(args) == 2:
log.error("blueprints diff is missing the to commit")
return 1
api_route = client.api_url(api_version, "/blueprints/diff/%s/%s/%s" % (args[0], args[1], args[2]))
result = client.get_url_json(socket_path, api_route)
if show_json:
print(json.dumps(result, indent=4))
return 0
for err in result.get("errors", []):
log.error(err)
if result.get("errors", False):
return 1
for diff in result["diff"]:
print(prettyDiffEntry(diff))
return 0
def prettyDiffEntry(diff):
"""Generate nice diff entry string.
:param diff: Difference entry dict
:type diff: dict
:returns: Nice string
"""
def change(diff):
if diff["old"] and diff["new"]:
return "Changed"
elif diff["new"] and not diff["old"]:
return "Added"
elif diff["old"] and not diff["new"]:
return "Removed"
else:
return "Unknown"
def name(diff):
if diff["old"]:
return diff["old"].keys()[0]
elif diff["new"]:
return diff["new"].keys()[0]
else:
return "Unknown"
def details(diff):
if change(diff) == "Changed":
if name(diff) == "Description":
return '"%s" -> "%s"' % (diff["old"][name(diff)], diff["new"][name(diff)])
elif name(diff) == "Version":
return "%s -> %s" % (diff["old"][name(diff)], diff["new"][name(diff)])
elif name(diff) in ["Module", "Package"]:
return "%s %s -> %s" % (diff["old"][name(diff)]["name"], diff["old"][name(diff)]["version"],
diff["new"][name(diff)]["version"])
else:
return "Unknown"
elif change(diff) == "Added":
if name(diff) in ["Module", "Package"]:
return "%s %s" % (diff["new"][name(diff)]["name"], diff["new"][name(diff)]["version"])
else:
return " ".join([diff["new"][k] for k in diff["new"]])
elif change(diff) == "Removed":
if name(diff) in ["Module", "Package"]:
return "%s %s" % (diff["old"][name(diff)]["name"], diff["old"][name(diff)]["version"])
else:
return " ".join([diff["old"][k] for k in diff["old"]])
return change(diff) + " " + name(diff) + " " + details(diff)
def blueprints_save(socket_path, api_version, args, show_json=False):
"""Save the blueprint to a TOML file
:param socket_path: Path to the Unix socket to use for API communication
:type socket_path: str
:param api_version: Version of the API to talk to. eg. "0"
:type api_version: str
:param args: List of remaining arguments from the cmdline
:type args: list of str
:param show_json: Set to True to show the JSON output instead of the human readable output
:type show_json: bool
blueprints save <blueprint,...> Save the blueprint to a file, <blueprint-name>.toml
"""
for blueprint in argify(args):
api_route = client.api_url(api_version, "/blueprints/info/%s?format=toml" % blueprint)
blueprint_toml = client.get_url_raw(socket_path, api_route)
open(toml_filename(blueprint), "w").write(blueprint_toml)
return 0
def blueprints_delete(socket_path, api_version, args, show_json=False):
"""Delete a blueprint from the server
:param socket_path: Path to the Unix socket to use for API communication
:type socket_path: str
:param api_version: Version of the API to talk to. eg. "0"
:type api_version: str
:param args: List of remaining arguments from the cmdline
:type args: list of str
:param show_json: Set to True to show the JSON output instead of the human readable output
:type show_json: bool
delete <blueprint> Delete a blueprint from the server
"""
api_route = client.api_url(api_version, "/blueprints/delete/%s" % args[0])
result = client.delete_url_json(socket_path, api_route)
return handle_api_result(result, show_json)
def blueprints_depsolve(socket_path, api_version, args, show_json=False):
"""Display the packages needed to install the blueprint
:param socket_path: Path to the Unix socket to use for API communication
:type socket_path: str
:param api_version: Version of the API to talk to. eg. "0"
:type api_version: str
:param args: List of remaining arguments from the cmdline
:type args: list of str
:param show_json: Set to True to show the JSON output instead of the human readable output
:type show_json: bool
blueprints depsolve <blueprint,...> Display the packages needed to install the blueprint.
"""
api_route = client.api_url(api_version, "/blueprints/depsolve/%s" % (",".join(argify(args))))
result = client.get_url_json(socket_path, api_route)
if show_json:
print(json.dumps(result, indent=4))
return 0
for blueprint in result["blueprints"]:
if blueprint["blueprint"].get("version", ""):
print("blueprint: %s v%s" % (blueprint["blueprint"]["name"], blueprint["blueprint"]["version"]))
else:
print("blueprint: %s" % (blueprint["blueprint"]["name"]))
for dep in blueprint["dependencies"]:
print(" " + packageNEVRA(dep))
return 0
def blueprints_push(socket_path, api_version, args, show_json=False):
"""Push a blueprint TOML file to the server, updating the blueprint
:param socket_path: Path to the Unix socket to use for API communication
:type socket_path: str
:param api_version: Version of the API to talk to. eg. "0"
:type api_version: str
:param args: List of remaining arguments from the cmdline
:type args: list of str
:param show_json: Set to True to show the JSON output instead of the human readable output
:type show_json: bool
push <blueprint> Push a blueprint TOML file to the server.
"""
api_route = client.api_url(api_version, "/blueprints/new")
rval = 0
for blueprint in argify(args):
if not os.path.exists(blueprint):
log.error("Missing blueprint file: %s", blueprint)
continue
blueprint_toml = open(blueprint, "r").read()
result = client.post_url_toml(socket_path, api_route, blueprint_toml)
if handle_api_result(result, show_json):
rval = 1
return rval
def blueprints_freeze(socket_path, api_version, args, show_json=False):
"""Handle the blueprints freeze commands
:param socket_path: Path to the Unix socket to use for API communication
:type socket_path: str
:param api_version: Version of the API to talk to. eg. "0"
:type api_version: str
:param args: List of remaining arguments from the cmdline
:type args: list of str
:param show_json: Set to True to show the JSON output instead of the human readable output
:type show_json: bool
blueprints freeze <blueprint,...> Display the frozen blueprint's modules and packages.
blueprints freeze show <blueprint,...> Display the frozen blueprint in TOML format.
blueprints freeze save <blueprint,...> Save the frozen blueprint to a file, <blueprint-name>.frozen.toml.
"""
if args[0] == "show":
return blueprints_freeze_show(socket_path, api_version, args[1:], show_json)
elif args[0] == "save":
return blueprints_freeze_save(socket_path, api_version, args[1:], show_json)
if len(args) == 0:
log.error("freeze is missing the blueprint name")
return 1
api_route = client.api_url(api_version, "/blueprints/freeze/%s" % (",".join(argify(args))))
result = client.get_url_json(socket_path, api_route)
if show_json:
print(json.dumps(result, indent=4))
else:
for entry in result["blueprints"]:
blueprint = entry["blueprint"]
if blueprint.get("version", ""):
print("blueprint: %s v%s" % (blueprint["name"], blueprint["version"]))
else:
print("blueprint: %s" % (blueprint["name"]))
for m in blueprint["modules"]:
print(" %s-%s" % (m["name"], m["version"]))
for p in blueprint["packages"]:
print(" %s-%s" % (p["name"], p["version"]))
# Print any errors
for err in result.get("errors", []):
log.error(err)
# Return a 1 if there are any errors
if result.get("errors", []):
return 1
else:
return 0
def blueprints_freeze_show(socket_path, api_version, args, show_json=False):
"""Show the frozen blueprint in TOML format
:param socket_path: Path to the Unix socket to use for API communication
:type socket_path: str
:param api_version: Version of the API to talk to. eg. "0"
:type api_version: str
:param args: List of remaining arguments from the cmdline
:type args: list of str
:param show_json: Set to True to show the JSON output instead of the human readable output
:type show_json: bool
blueprints freeze show <blueprint,...> Display the frozen blueprint in TOML format.
"""
if len(args) == 0:
log.error("freeze show is missing the blueprint name")
return 1
for blueprint in argify(args):
api_route = client.api_url(api_version, "/blueprints/freeze/%s?format=toml" % blueprint)
print(client.get_url_raw(socket_path, api_route))
return 0
def blueprints_freeze_save(socket_path, api_version, args, show_json=False):
"""Save the frozen blueprint to a TOML file
:param socket_path: Path to the Unix socket to use for API communication
:type socket_path: str
:param api_version: Version of the API to talk to. eg. "0"
:type api_version: str
:param args: List of remaining arguments from the cmdline
:type args: list of str
:param show_json: Set to True to show the JSON output instead of the human readable output
:type show_json: bool
blueprints freeze save <blueprint,...> Save the frozen blueprint to a file, <blueprint-name>.frozen.toml.
"""
if len(args) == 0:
log.error("freeze save is missing the blueprint name")
return 1
for blueprint in argify(args):
api_route = client.api_url(api_version, "/blueprints/freeze/%s?format=toml" % blueprint)
blueprint_toml = client.get_url_raw(socket_path, api_route)
open(frozen_toml_filename(blueprint), "w").write(blueprint_toml)
return 0
def blueprints_tag(socket_path, api_version, args, show_json=False):
"""Tag the most recent blueprint commit as a release
:param socket_path: Path to the Unix socket to use for API communication
:type socket_path: str
:param api_version: Version of the API to talk to. eg. "0"
:type api_version: str
:param args: List of remaining arguments from the cmdline
:type args: list of str
:param show_json: Set to True to show the JSON output instead of the human readable output
:type show_json: bool
blueprints tag <blueprint> Tag the most recent blueprint commit as a release.
"""
api_route = client.api_url(api_version, "/blueprints/tag/%s" % args[0])
result = client.post_url(socket_path, api_route, "")
return handle_api_result(result, show_json)
def blueprints_undo(socket_path, api_version, args, show_json=False):
"""Undo changes to a blueprint
:param socket_path: Path to the Unix socket to use for API communication
:type socket_path: str
:param api_version: Version of the API to talk to. eg. "0"
:type api_version: str
:param args: List of remaining arguments from the cmdline
:type args: list of str
:param show_json: Set to True to show the JSON output instead of the human readable output
:type show_json: bool
blueprints undo <blueprint> <commit> Undo changes to a blueprint by reverting to the selected commit.
"""
if len(args) == 0:
log.error("undo is missing the blueprint name and commit hash")
return 1
elif len(args) == 1:
log.error("undo is missing commit hash")
return 1
api_route = client.api_url(api_version, "/blueprints/undo/%s/%s" % (args[0], args[1]))
result = client.post_url(socket_path, api_route, "")
return handle_api_result(result, show_json)
def blueprints_workspace(socket_path, api_version, args, show_json=False):
"""Push the blueprint TOML to the temporary workspace storage
:param socket_path: Path to the Unix socket to use for API communication
:type socket_path: str
:param api_version: Version of the API to talk to. eg. "0"
:type api_version: str
:param args: List of remaining arguments from the cmdline
:type args: list of str
:param show_json: Set to True to show the JSON output instead of the human readable output
:type show_json: bool
blueprints workspace <blueprint> Push the blueprint TOML to the temporary workspace storage.
"""
api_route = client.api_url(api_version, "/blueprints/workspace")
rval = 0
for blueprint in argify(args):
if not os.path.exists(blueprint):
log.error("Missing blueprint file: %s", blueprint)
continue
blueprint_toml = open(blueprint, "r").read()
result = client.post_url_toml(socket_path, api_route, blueprint_toml)
if show_json:
print(json.dumps(result, indent=4))
for err in result.get("errors", []):
log.error(err)
# Any errors results in returning a 1, but we continue with the rest first
if not result.get("status", False):
rval = 1
return rval

457
src/composer/cli/compose.py Normal file
View File

@ -0,0 +1,457 @@
#
# 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 sys
import json
from composer import http_client as client
from composer.cli.utilities import argify, handle_api_result, packageNEVRA
def compose_cmd(opts):
"""Process compose commands
:param opts: Cmdline arguments
:type opts: argparse.Namespace
:returns: Value to return from sys.exit()
:rtype: int
This dispatches the compose commands to a function
"""
cmd_map = {
"status": compose_status,
"types": compose_types,
"start": compose_start,
"log": compose_log,
"cancel": compose_cancel,
"delete": compose_delete,
"details": compose_details,
"metadata": compose_metadata,
"results": compose_results,
"logs": compose_logs,
"image": compose_image,
}
if opts.args[1] not in cmd_map:
log.error("Unknown compose command: %s", opts.args[1])
return 1
return cmd_map[opts.args[1]](opts.socket, opts.api_version, opts.args[2:], opts.json, opts.testmode)
def compose_status(socket_path, api_version, args, show_json=False, testmode=0):
"""Return the status of all known composes
:param socket_path: Path to the Unix socket to use for API communication
:type socket_path: str
:param api_version: Version of the API to talk to. eg. "0"
:type api_version: str
:param args: List of remaining arguments from the cmdline
:type args: list of str
:param show_json: Set to True to show the JSON output instead of the human readable output
:type show_json: bool
:param testmode: unused in this function
:type testmode: int
This doesn't map directly to an API command, it combines the results from queue, finished,
and failed so raw JSON output is not available.
"""
def get_status(compose):
return {"id": compose["id"],
"blueprint": compose["blueprint"],
"version": compose["version"],
"compose_type": compose["compose_type"],
"image_size": compose["image_size"],
"status": compose["queue_status"]}
# Sort the status in a specific order
def sort_status(a):
order = ["RUNNING", "WAITING", "FINISHED", "FAILED"]
return (order.index(a["status"]), a["blueprint"], a["version"], a["compose_type"])
status = []
# Get the composes currently in the queue
api_route = client.api_url(api_version, "/compose/queue")
result = client.get_url_json(socket_path, api_route)
status.extend(map(get_status, result["run"] + result["new"]))
# Get the list of finished composes
api_route = client.api_url(api_version, "/compose/finished")
result = client.get_url_json(socket_path, api_route)
status.extend(map(get_status, result["finished"]))
# Get the list of failed composes
api_route = client.api_url(api_version, "/compose/failed")
result = client.get_url_json(socket_path, api_route)
status.extend(map(get_status, result["failed"]))
# Sort them by status (running, waiting, finished, failed) and then by name and version.
status.sort(key=sort_status)
if show_json:
print(json.dumps(status, indent=4))
return 0
# Print them as UUID blueprint STATUS
for c in status:
if c["image_size"] > 0:
image_size = str(c["image_size"])
else:
image_size = ""
print("%s %-8s %-15s %s %-16s %s" % (c["id"], c["status"], c["blueprint"], c["version"], c["compose_type"],
image_size))
def compose_types(socket_path, api_version, args, show_json=False, testmode=0):
"""Return information about the supported compose types
:param socket_path: Path to the Unix socket to use for API communication
:type socket_path: str
:param api_version: Version of the API to talk to. eg. "0"
:type api_version: str
:param args: List of remaining arguments from the cmdline
:type args: list of str
:param show_json: Set to True to show the JSON output instead of the human readable output
:type show_json: bool
:param testmode: unused in this function
:type testmode: int
Add additional details to types that are known to composer-cli. Raw JSON output does not
include this extra information.
"""
api_route = client.api_url(api_version, "/compose/types")
result = client.get_url_json(socket_path, api_route)
if show_json:
print(json.dumps(result, indent=4))
return 0
print("Compose Types: " + ", ".join([t["name"] for t in result["types"]]))
def compose_start(socket_path, api_version, args, show_json=False, testmode=0):
"""Start a new compose using the selected blueprint and type
:param socket_path: Path to the Unix socket to use for API communication
:type socket_path: str
:param api_version: Version of the API to talk to. eg. "0"
:type api_version: str
:param args: List of remaining arguments from the cmdline
:type args: list of str
:param show_json: Set to True to show the JSON output instead of the human readable output
:type show_json: bool
:param testmode: Set to 1 to simulate a failed compose, set to 2 to simulate a finished one.
:type testmode: int
compose start <blueprint-name> <compose-type>
"""
if len(args) == 0:
log.error("start is missing the blueprint name and output type")
return 1
if len(args) == 1:
log.error("start is missing the output type")
return 1
config = {
"blueprint_name": args[0],
"compose_type": args[1],
"branch": "master"
}
if testmode:
test_url = "?test=%d" % testmode
else:
test_url = ""
api_route = client.api_url(api_version, "/compose" + test_url)
result = client.post_url_json(socket_path, api_route, json.dumps(config))
if show_json:
print(json.dumps(result, indent=4))
return 0
for err in result.get("errors", []):
log.error(err)
if result["status"] == False or result.get("errors", False):
return 1
print("Compose %s added to the queue" % result["build_id"])
return 0
def compose_log(socket_path, api_version, args, show_json=False, testmode=0):
"""Show the last part of the compose log
:param socket_path: Path to the Unix socket to use for API communication
:type socket_path: str
:param api_version: Version of the API to talk to. eg. "0"
:type api_version: str
:param args: List of remaining arguments from the cmdline
:type args: list of str
:param show_json: Set to True to show the JSON output instead of the human readable output
:type show_json: bool
:param testmode: unused in this function
:type testmode: int
compose log <uuid> [<size>kB]
This will display the last 1kB of the compose's log file. Can be used to follow progress
during the build.
"""
if len(args) == 0:
log.error("log is missing the compose build id")
return 1
if len(args) == 2:
try:
log_size = int(args[1])
except ValueError:
log.error("Log size must be an integer.")
return 1
else:
log_size = 1024
api_route = client.api_url(api_version, "/compose/log/%s?size=%d" % (args[0], log_size))
try:
result = client.get_url_raw(socket_path, api_route)
except RuntimeError as e:
print(str(e))
return 1
print(result)
return 0
def compose_cancel(socket_path, api_version, args, show_json=False, testmode=0):
"""Cancel a running compose
:param socket_path: Path to the Unix socket to use for API communication
:type socket_path: str
:param api_version: Version of the API to talk to. eg. "0"
:type api_version: str
:param args: List of remaining arguments from the cmdline
:type args: list of str
:param show_json: Set to True to show the JSON output instead of the human readable output
:type show_json: bool
:param testmode: unused in this function
:type testmode: int
compose cancel <uuid>
This will cancel a running compose. It does nothing if the compose has finished.
"""
if len(args) == 0:
log.error("cancel is missing the compose build id")
return 1
api_route = client.api_url(api_version, "/compose/cancel/%s" % args[0])
result = client.delete_url_json(socket_path, api_route)
return handle_api_result(result, show_json)
def compose_delete(socket_path, api_version, args, show_json=False, testmode=0):
"""Delete a finished compose's results
:param socket_path: Path to the Unix socket to use for API communication
:type socket_path: str
:param api_version: Version of the API to talk to. eg. "0"
:type api_version: str
:param args: List of remaining arguments from the cmdline
:type args: list of str
:param show_json: Set to True to show the JSON output instead of the human readable output
:type show_json: bool
:param testmode: unused in this function
:type testmode: int
compose delete <uuid,...>
Delete the listed compose results. It will only delete results for composes that have finished
or failed, not a running compose.
"""
if len(args) == 0:
log.error("delete is missing the compose build id")
return 1
api_route = client.api_url(api_version, "/compose/delete/%s" % (",".join(argify(args))))
result = client.delete_url_json(socket_path, api_route)
if show_json:
print(json.dumps(result, indent=4))
return 0
# Print any errors
for err in result.get("errors", []):
log.error(err)
if result.get("errors", []):
return 1
else:
return 0
def compose_details(socket_path, api_version, args, show_json=False, testmode=0):
"""Return detailed information about the compose
:param socket_path: Path to the Unix socket to use for API communication
:type socket_path: str
:param api_version: Version of the API to talk to. eg. "0"
:type api_version: str
:param args: List of remaining arguments from the cmdline
:type args: list of str
:param show_json: Set to True to show the JSON output instead of the human readable output
:type show_json: bool
:param testmode: unused in this function
:type testmode: int
compose details <uuid>
This returns information about the compose, including the blueprint and the dependencies.
"""
if len(args) == 0:
log.error("details is missing the compose build id")
return 1
api_route = client.api_url(api_version, "/compose/info/%s" % args[0])
result = client.get_url_json(socket_path, api_route)
if show_json:
print(json.dumps(result, indent=4))
return 0
for err in result.get("errors", []):
log.error(err)
if result.get("errors", []):
return 1
if result["image_size"] > 0:
image_size = str(result["image_size"])
else:
image_size = ""
print("%s %-8s %-15s %s %-16s %s" % (result["id"],
result["queue_status"],
result["blueprint"]["name"],
result["blueprint"]["version"],
result["compose_type"],
image_size))
print("Packages:")
for p in result["blueprint"]["packages"]:
print(" %s-%s" % (p["name"], p["version"]))
print("Modules:")
for m in result["blueprint"]["modules"]:
print(" %s-%s" % (m["name"], m["version"]))
print("Dependencies:")
for d in result["deps"]["packages"]:
print(" " + packageNEVRA(d))
def compose_metadata(socket_path, api_version, args, show_json=False, testmode=0):
"""Download a tar file of the compose's metadata
:param socket_path: Path to the Unix socket to use for API communication
:type socket_path: str
:param api_version: Version of the API to talk to. eg. "0"
:type api_version: str
:param args: List of remaining arguments from the cmdline
:type args: list of str
:param show_json: Set to True to show the JSON output instead of the human readable output
:type show_json: bool
:param testmode: unused in this function
:type testmode: int
compose metadata <uuid>
Saves the metadata as uuid-metadata.tar
"""
if len(args) == 0:
log.error("metadata is missing the compose build id")
return 1
api_route = client.api_url(api_version, "/compose/metadata/%s" % args[0])
return client.download_file(socket_path, api_route)
def compose_results(socket_path, api_version, args, show_json=False, testmode=0):
"""Download a tar file of the compose's results
:param socket_path: Path to the Unix socket to use for API communication
:type socket_path: str
:param api_version: Version of the API to talk to. eg. "0"
:type api_version: str
:param args: List of remaining arguments from the cmdline
:type args: list of str
:param show_json: Set to True to show the JSON output instead of the human readable output
:type show_json: bool
:param testmode: unused in this function
:type testmode: int
compose results <uuid>
The results includes the metadata, output image, and logs.
It is saved as uuid.tar
"""
if len(args) == 0:
log.error("results is missing the compose build id")
return 1
api_route = client.api_url(api_version, "/compose/results/%s" % args[0])
return client.download_file(socket_path, api_route, sys.stdout.isatty())
def compose_logs(socket_path, api_version, args, show_json=False, testmode=0):
"""Download a tar of the compose's logs
:param socket_path: Path to the Unix socket to use for API communication
:type socket_path: str
:param api_version: Version of the API to talk to. eg. "0"
:type api_version: str
:param args: List of remaining arguments from the cmdline
:type args: list of str
:param show_json: Set to True to show the JSON output instead of the human readable output
:type show_json: bool
:param testmode: unused in this function
:type testmode: int
compose logs <uuid>
Saves the logs as uuid-logs.tar
"""
if len(args) == 0:
log.error("logs is missing the compose build id")
return 1
api_route = client.api_url(api_version, "/compose/logs/%s" % args[0])
return client.download_file(socket_path, api_route, sys.stdout.isatty())
def compose_image(socket_path, api_version, args, show_json=False, testmode=0):
"""Download the compose's output image
:param socket_path: Path to the Unix socket to use for API communication
:type socket_path: str
:param api_version: Version of the API to talk to. eg. "0"
:type api_version: str
:param args: List of remaining arguments from the cmdline
:type args: list of str
:param show_json: Set to True to show the JSON output instead of the human readable output
:type show_json: bool
:param testmode: unused in this function
:type testmode: int
compose image <uuid>
This downloads only the result image, saving it as the image name, which depends on the type
of compose that was selected.
"""
if len(args) == 0:
log.error("logs is missing the compose build id")
return 1
api_route = client.api_url(api_version, "/compose/image/%s" % args[0])
return client.download_file(socket_path, api_route, sys.stdout.isatty())

View File

@ -0,0 +1,44 @@
#
# 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 json
from composer import http_client as client
def modules_cmd(opts):
"""Process modules commands
:param opts: Cmdline arguments
:type opts: argparse.Namespace
:returns: Value to return from sys.exit()
:rtype: int
"""
if opts.args[1] != "list":
log.error("Unknown modules command: %s", opts.args[1])
return 1
api_route = client.api_url(opts.api_version, "/modules/list")
result = client.get_url_json(opts.socket, api_route)
if opts.json:
print(json.dumps(result, indent=4))
return 0
print("Modules:\n" + "\n".join([" "+r["name"] for r in result["modules"]]))
return 0

View File

@ -0,0 +1,106 @@
#
# 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 json
import textwrap
from composer import http_client as client
def projects_cmd(opts):
"""Process projects commands
:param opts: Cmdline arguments
:type opts: argparse.Namespace
:returns: Value to return from sys.exit()
:rtype: int
"""
cmd_map = {
"list": projects_list,
"info": projects_info,
}
if opts.args[1] not in cmd_map:
log.error("Unknown projects command: %s", opts.args[1])
return 1
return cmd_map[opts.args[1]](opts.socket, opts.api_version, opts.args[2:], opts.json)
def projects_list(socket_path, api_version, args, show_json=False):
"""Output the list of available projects
:param socket_path: Path to the Unix socket to use for API communication
:type socket_path: str
:param api_version: Version of the API to talk to. eg. "0"
:type api_version: str
:param args: List of remaining arguments from the cmdline
:type args: list of str
:param show_json: Set to True to show the JSON output instead of the human readable output
:type show_json: bool
projects list
"""
api_route = client.api_url(api_version, "/projects/list")
result = client.get_url_json(socket_path, api_route)
if show_json:
print(json.dumps(result, indent=4))
return 0
for proj in result["projects"]:
for k in ["name", "summary", "homepage", "description"]:
print("%s: %s" % (k.title(), textwrap.fill(proj[k], subsequent_indent=" " * (len(k)+2))))
print("\n\n")
return 0
def projects_info(socket_path, api_version, args, show_json=False):
"""Output info on a list of projects
:param socket_path: Path to the Unix socket to use for API communication
:type socket_path: str
:param api_version: Version of the API to talk to. eg. "0"
:type api_version: str
:param args: List of remaining arguments from the cmdline
:type args: list of str
:param show_json: Set to True to show the JSON output instead of the human readable output
:type show_json: bool
projects info <project,...>
"""
if len(args) == 0:
log.error("projects info is missing the packages")
return 1
api_route = client.api_url(api_version, "/projects/info/%s" % ",".join(args))
result = client.get_url_json(socket_path, api_route)
if show_json:
print(json.dumps(result, indent=4))
return 0
for proj in result["projects"]:
for k in ["name", "summary", "homepage", "description"]:
print("%s: %s" % (k.title(), textwrap.fill(proj[k], subsequent_indent=" " * (len(k)+2))))
print("Builds: ")
for build in proj["builds"]:
print(" %s%s-%s.%s at %s for %s" % ("" if not build["epoch"] else build["epoch"] + ":",
build["source"]["version"],
build["release"],
build["arch"],
build["build_time"],
build["changelog"]))
print("")
return 0

143
src/composer/cli/sources.py Normal file
View File

@ -0,0 +1,143 @@
#
# 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 json
from composer import http_client as client
from composer.cli.utilities import argify, handle_api_result
def sources_cmd(opts):
"""Process sources commands
:param opts: Cmdline arguments
:type opts: argparse.Namespace
:returns: Value to return from sys.exit()
:rtype: int
"""
cmd_map = {
"list": sources_list,
"info": sources_info,
"add": sources_add,
"change": sources_add,
"delete": sources_delete,
}
if opts.args[1] not in cmd_map:
log.error("Unknown sources command: %s", opts.args[1])
return 1
return cmd_map[opts.args[1]](opts.socket, opts.api_version, opts.args[2:], opts.json)
def sources_list(socket_path, api_version, args, show_json=False):
"""Output the list of available sources
:param socket_path: Path to the Unix socket to use for API communication
:type socket_path: str
:param api_version: Version of the API to talk to. eg. "0"
:type api_version: str
:param args: List of remaining arguments from the cmdline
:type args: list of str
:param show_json: Set to True to show the JSON output instead of the human readable output
:type show_json: bool
sources list
"""
api_route = client.api_url(api_version, "/projects/source/list")
result = client.get_url_json(socket_path, api_route)
if show_json:
print(json.dumps(result, indent=4))
return 0
print("Sources: %s" % ", ".join(result["sources"]))
return 0
def sources_info(socket_path, api_version, args, show_json=False):
"""Output info on a list of projects
:param socket_path: Path to the Unix socket to use for API communication
:type socket_path: str
:param api_version: Version of the API to talk to. eg. "0"
:type api_version: str
:param args: List of remaining arguments from the cmdline
:type args: list of str
:param show_json: Set to True to show the JSON output instead of the human readable output
:type show_json: bool
sources info <source-name>
"""
if len(args) == 0:
log.error("sources info is missing the name of the source")
return 1
if show_json:
api_route = client.api_url(api_version, "/projects/source/info/%s" % ",".join(args))
result = client.get_url_json(socket_path, api_route)
print(json.dumps(result, indent=4))
return 0
else:
api_route = client.api_url(api_version, "/projects/source/info/%s?format=toml" % ",".join(args))
result = client.get_url_raw(socket_path, api_route)
print(result)
return 0
def sources_add(socket_path, api_version, args, show_json=False):
"""Add or change a source
:param socket_path: Path to the Unix socket to use for API communication
:type socket_path: str
:param api_version: Version of the API to talk to. eg. "0"
:type api_version: str
:param args: List of remaining arguments from the cmdline
:type args: list of str
:param show_json: Set to True to show the JSON output instead of the human readable output
:type show_json: bool
sources add <source.toml>
"""
api_route = client.api_url(api_version, "/projects/source/new")
rval = 0
for source in argify(args):
if not os.path.exists(source):
log.error("Missing source file: %s", source)
continue
source_toml = open(source, "r").read()
result = client.post_url_toml(socket_path, api_route, source_toml)
if handle_api_result(result, show_json):
rval = 1
return rval
def sources_delete(socket_path, api_version, args, show_json=False):
"""Delete a source
:param socket_path: Path to the Unix socket to use for API communication
:type socket_path: str
:param api_version: Version of the API to talk to. eg. "0"
:type api_version: str
:param args: List of remaining arguments from the cmdline
:type args: list of str
:param show_json: Set to True to show the JSON output instead of the human readable output
:type show_json: bool
sources delete <source-name>
"""
api_route = client.api_url(api_version, "/projects/source/delete/%s" % args[0])
result = client.delete_url_json(socket_path, api_route)
return handle_api_result(result, show_json)

View File

@ -0,0 +1,84 @@
#
# 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 json
def argify(args):
"""Take a list of human args and return a list with each item
:param args: list of strings with possible commas and spaces
:type args: list of str
:returns: List of all the items
:rtype: list of str
Examples:
["one,two", "three", ",four", ",five,"] returns ["one", "two", "three", "four", "five"]
"""
return filter(lambda i: i, [arg for entry in args for arg in entry.split(",")])
def toml_filename(blueprint_name):
"""Convert a blueprint name into a filename.toml
:param blueprint_name: The blueprint's name
:type blueprint_name: str
:returns: The blueprint name with ' ' converted to - and .toml appended
:rtype: str
"""
return blueprint_name.replace(" ", "-") + ".toml"
def frozen_toml_filename(blueprint_name):
"""Convert a blueprint name into a filename.toml
:param blueprint_name: The blueprint's name
:type blueprint_name: str
:returns: The blueprint name with ' ' converted to - and .toml appended
:rtype: str
"""
return blueprint_name.replace(" ", "-") + ".frozen.toml"
def handle_api_result(result, show_json=False):
"""Log any errors, return the correct value
:param result: JSON result from the http query
:type result: dict
"""
if show_json:
print(json.dumps(result, indent=4))
for err in result.get("errors", []):
log.error(err)
if result["status"] == True:
return 0
else:
return 1
def packageNEVRA(pkg):
"""Return the package info as a NEVRA
:param pkg: The package details
:type pkg: dict
:returns: name-[epoch:]version-release-arch
:rtype: str
"""
if pkg["epoch"]:
return "%s-%s:%s-%s.%s" % (pkg["name"], pkg["epoch"], pkg["version"], pkg["release"], pkg["arch"])
else:
return "%s-%s-%s.%s" % (pkg["name"], pkg["version"], pkg["release"], pkg["arch"])

201
src/composer/http_client.py Normal file
View File

@ -0,0 +1,201 @@
#
# 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 json
from composer.unix_socket import UnixHTTPConnectionPool
def api_url(api_version, url):
"""Return the versioned path to the API route
:param api_version: The version of the API to talk to. eg. "0"
:type api_version: str
:param url: The API route to talk to
:type url: str
:returns: The full url to use for the route and API version
:rtype: str
"""
return os.path.normpath("/api/v%s/%s" % (api_version, url))
def get_url_raw(socket_path, url):
"""Return the raw results of a GET request
:param socket_path: Path to the Unix socket to use for API communication
:type socket_path: str
:param url: URL to request
:type url: str
:returns: The raw response from the server
:rtype: str
"""
http = UnixHTTPConnectionPool(socket_path)
r = http.request("GET", url)
if r.status == 400:
err = json.loads(r.data.decode("utf-8"))
if "status" in err and err["status"] == False:
raise RuntimeError(", ".join(err["errors"]))
return r.data.decode('utf-8')
def get_url_json(socket_path, url):
"""Return the JSON results of a GET request
:param socket_path: Path to the Unix socket to use for API communication
:type socket_path: str
:param url: URL to request
:type url: str
:returns: The json response from the server
:rtype: dict
"""
http = UnixHTTPConnectionPool(socket_path)
r = http.request("GET", url)
return json.loads(r.data.decode('utf-8'))
def delete_url_json(socket_path, url):
"""Send a DELETE request to the url and return JSON response
:param socket_path: Path to the Unix socket to use for API communication
:type socket_path: str
:param url: URL to send DELETE to
:type url: str
:returns: The json response from the server
:rtype: dict
"""
http = UnixHTTPConnectionPool(socket_path)
r = http.request("DELETE", url)
return json.loads(r.data.decode("utf-8"))
def post_url(socket_path, url, body):
"""POST raw data to the URL
:param socket_path: Path to the Unix socket to use for API communication
:type socket_path: str
:param url: URL to send POST to
:type url: str
:param body: The data for the body of the POST
:type body: str
:returns: The json response from the server
:rtype: dict
"""
http = UnixHTTPConnectionPool(socket_path)
r = http.request("POST", url,
body=body.encode("utf-8"))
return json.loads(r.data.decode("utf-8"))
def post_url_toml(socket_path, url, body):
"""POST a TOML string to the URL
:param socket_path: Path to the Unix socket to use for API communication
:type socket_path: str
:param url: URL to send POST to
:type url: str
:param body: The data for the body of the POST
:type body: str
:returns: The json response from the server
:rtype: dict
"""
http = UnixHTTPConnectionPool(socket_path)
r = http.request("POST", url,
body=body.encode("utf-8"),
headers={"Content-Type": "text/x-toml"})
return json.loads(r.data.decode("utf-8"))
def post_url_json(socket_path, url, body):
"""POST some JSON data to the URL
:param socket_path: Path to the Unix socket to use for API communication
:type socket_path: str
:param url: URL to send POST to
:type url: str
:param body: The data for the body of the POST
:type body: str
:returns: The json response from the server
:rtype: dict
"""
http = UnixHTTPConnectionPool(socket_path)
r = http.request("POST", url,
body=body.encode("utf-8"),
headers={"Content-Type": "application/json"})
return json.loads(r.data.decode("utf-8"))
def get_filename(headers):
"""Get the filename from the response header
:param response: The urllib3 response object
:type response: Response
:raises: RuntimeError if it cannot find a filename in the header
:returns: Filename from content-disposition header
:rtype: str
"""
log.debug("Headers = %s", headers)
if "content-disposition" not in headers:
raise RuntimeError("No Content-Disposition header; cannot get filename")
try:
k, _, v = headers["content-disposition"].split(";")[1].strip().partition("=")
if k != "filename":
raise RuntimeError("No filename= found in content-disposition header")
except RuntimeError:
raise
except Exception as e:
raise RuntimeError("Error parsing filename from content-disposition header: %s" % str(e))
return os.path.basename(v)
def download_file(socket_path, url, progress=True):
"""Download a file, saving it to the CWD with the included filename
:param socket_path: Path to the Unix socket to use for API communication
:type socket_path: str
:param url: URL to send POST to
:type url: str
"""
http = UnixHTTPConnectionPool(socket_path)
r = http.request("GET", url, preload_content=False)
if r.status == 400:
err = json.loads(r.data.decode("utf-8"))
if not err["status"]:
raise RuntimeError(", ".join(err["errors"]))
filename = get_filename(r.headers)
if os.path.exists(filename):
msg = "%s exists, skipping download" % filename
log.error(msg)
raise RuntimeError(msg)
with open(filename, "wb") as f:
while True:
data = r.read(10 * 1024**2)
if not data:
break
f.write(data)
if progress:
data_written = f.tell()
if data_written > 5 * 1024**2:
sys.stdout.write("%s: %0.2f MB \r" % (filename, data_written / 1024**2))
else:
sys.stdout.write("%s: %0.2f kB\r" % (filename, data_written / 1024))
sys.stdout.flush()
print("")
r.release_conn()
return 0

View File

@ -0,0 +1,61 @@
#
# 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 httplib
import socket
import urllib3
# These 2 classes were adapted and simplified for use with just urllib3.
# Originally from https://github.com/msabramo/requests-unixsocket/blob/master/requests_unixsocket/adapters.py
# The following was adapted from some code from docker-py
# https://github.com/docker/docker-py/blob/master/docker/transport/unixconn.py
class UnixHTTPConnection(httplib.HTTPConnection, object):
def __init__(self, socket_path, timeout=60):
"""Create an HTTP connection to a unix domain socket
:param socket_path: The path to the Unix domain socket
:param timeout: Number of seconds to timeout the connection
"""
super(UnixHTTPConnection, self).__init__('localhost', timeout=timeout)
self.socket_path = socket_path
self.sock = None
def __del__(self): # base class does not have d'tor
if self.sock:
self.sock.close()
def connect(self):
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
sock.settimeout(self.timeout)
sock.connect(self.socket_path)
self.sock = sock
class UnixHTTPConnectionPool(urllib3.connectionpool.HTTPConnectionPool):
def __init__(self, socket_path, timeout=60):
"""Create a connection pool using a Unix domain socket
:param socket_path: The path to the Unix domain socket
:param timeout: Number of seconds to timeout the connection
"""
super(UnixHTTPConnectionPool, self).__init__('localhost', timeout=timeout)
self.socket_path = socket_path
def _new_conn(self):
return UnixHTTPConnection(self.socket_path, self.timeout)

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