Commit Graph

44 Commits

Author SHA1 Message Date
Brian C. Lane ab9068c2d0 image-minimizer: Check for missing root directory 2021-12-21 13:17:37 -08:00
Brian C. Lane f8af828a80 image-minimizer: Fix utf8 error and add docs
rpm returns a header that is a string, no need to call decode() on it.

Also added documentation and a manpage for image-minimizer
2021-12-20 16:33:19 -08:00
Brian C. Lane f783ff77d4 Fix pylint warnings about string formatting
and one about unused exception value.
2021-09-27 09:08:37 -07:00
Brian C. Lane b75b692607 composer-cli: Remove all traces of composer-cli
weldr-client has replaced composer-cli so remove all of the code and
tests, adjust various things so they don't expect it to be available,
and rename some things like test/composertest.py to reflect its
exclusive use by lorax.
2021-04-26 15:59:35 -07:00
Brian C. Lane ee2496d672 Switch to using upstream mk-s390image for s390 cdboot.img creation
mk-s390-cdboot has stopped working because the kernel outgrew the
hard-coded offset it used when creating cdboot.img. IBM now has a script
in s390utils that can do the same thing so use the upstream script
instead.

This drops mk-s390-cdboot script, switches the s390 templates to use
mk-s390image from s390utils.

It adds @ROOT@ to cdboot.prm, and sets inst.stage2 so that the installer
image will be found when booting the iso.

Resolves: rhbz#1891778
2020-11-02 11:46:02 -08:00
Brian C. Lane 4b1a4f8f16 composer-cli: Add osbuild-composer to connection failure message 2020-06-01 11:27:57 -07:00
Brian C. Lane c017300ad6 Revert "Rename composer-cli to composer"
This reverts commit c9be91c879.

It conflicts with the PHP dependency manager project named 'composer'
2018-10-08 09:23:47 -07:00
Lars Karlitski 6a37f80f0f cli: Clarify error message for unprivileged access
`os.path.exists("/run/weldr/api.socket")` returns False for users which have no
access. This leads to composer printing that the file does not exist, which is
misleading.

Since it's no possible to distinguish the two cases, fix this problem by
combining them and showing a single error message.
2018-10-03 16:36:51 -07:00
Lars Karlitski 160044ba9d Fix pylint errors and warnings
Remove `except` block which immediately raises the same exception again (it's
not a subclass of another caught exception, so this is safe).

Remove a false positive, because it is not emitted from the code base.

Disable subprocess-popen-preexec-fn in startProgram, which is not used
internally.
2018-09-25 13:49:40 +03:00
Lars Karlitski c9be91c879 Rename composer-cli to composer 2018-09-20 12:02:03 +03:00
Brian C. Lane 844ff9998b composer-cli should not log to a file by default
The user can pass --log /path/to/logfile.log if they want logging
enabled.
2018-08-21 11:49:28 -07:00
Chris Lumens 3c6478e179 If the help subcommand is given, print the help output.
This isn't a real subcommand like the others.  The option processing
just intercepts it and prints the output.  Given that we're subcommand
based, it makes sense to support this in addition to --help.

(cherry picked from commit 3743d6d208)
2018-07-18 11:49:16 -07:00
Brian C. Lane db67c1267a Move lorax-composer and composer-cli argument parsing into modules
This allows sphinx-argparse to document them automatically.
2018-05-14 13:00:15 -07:00
Brian C. Lane 825d1931e4 Add composer-cli and tests 2018-05-14 13:00:15 -07:00
Brian C. Lane 6147d58ccf Use bytes when writing strings in mk-s390-cdboot (#1504026)
python3 needs bytes when calling .write()
2017-10-19 14:37:12 -07:00
Brian C. Lane aa0067e32c Convert mk-s390-cdboot to python3 (#1497141)
It was pulling in py2 along with py3. Fix #! and make sure code works
with py3.
2017-10-11 10:27:52 -07:00
Brian C. Lane 9181d69098 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
(cherry picked from commit 6007b35096)
2017-08-14 14:29:47 -07:00
Brian C. Lane f616d37f59 image-minimizer: Fix argument parsing
Can't pass metavar to args that are just switches.
2016-03-29 09:44:53 -07:00
Brian C. Lane cb7dadb35f Update image-minimizer for py3
Also switch to using argparse instead of optparse.
2015-05-15 17:11:20 -07:00
Brian C. Lane a6e469e0e6 Clean up some pylint warnings
Mostly logging, using .format() on the strings.
2015-05-15 17:11:20 -07:00
Brian C. Lane 3f77b80d6c Use /usr/bin/python2 in scripts
New packaging guidelines:

https://fedoraproject.org/wiki/Packaging:Python#Multiple_Python_Runtimes
https://fedorahosted.org/fpc/ticket/327#comment:9
2015-02-09 08:48:22 -08:00
Brian C. Lane d25c0b0594 Update copyright statements 2014-05-09 15:13:39 -07:00
Brian C. Lane 0094fab0d4 Cleanup other misc pylint warnings 2014-05-09 08:10:41 -07:00
Brian C. Lane 99f2ab9137 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.
2014-03-31 17:02:55 -07:00
Martin Gracik d0f2c1a936 Move lorax executable to sbin 2010-12-17 16:46:44 +01:00
Martin Gracik a1d0a53aa1 Initrd tree modifications 2010-11-08 13:52:11 +01:00
Martin Gracik 45c5ef566c Experimental single initrd image 2010-10-12 18:32:35 +02:00
Martin Gracik 01a1f80b79 Add the pedantic option
By default copy file errors are ignored,
when pedantic is set to True, they result in an exception.
2010-05-21 09:40:30 +02:00
Martin Gracik a4c638f132 New version 2010-02-23 14:20:05 +01:00
Martin Gracik 7eecf20703 Added the license 2010-01-12 12:45:54 +01:00
Martin Gracik b672d9936e New version
Added support for Mako templates.
Changed the Lorax class to require an yumbase object as a parameter.
Changed a lot of unnecessary system calls to native python code.
Moved most of the file paths into a separate object.
The output and config objects are now singletons.
Also done a lot of code cleanup.
2009-12-15 15:26:01 +01:00
Martin Gracik 272ec190c7 New version
I fixed a lot of bugs with copying files to the initrd, and getting the symlinks.
Also I moved some of the code around, to get a clearer flow.
2009-09-23 12:21:33 +02:00
Martin Gracik 0301ace495 Added the GPL license to all files 2009-08-27 09:19:49 +02:00
Martin Gracik 87f9575d8f Huge commit; moved a lot of stuff around; added code for install.img 2009-08-19 16:51:32 +02:00
Martin Gracik b0b696d66d Wrote a templating system for initrd creation.
A lot of stuff got changed and rewritten. Using a different approach now, so no point of tracking changes to the older commits.
2009-06-04 15:36:56 +02:00
Martin Gracik d3fd188841 Rewrote some parts of the source.
Added all functionality from upd-instroot and scrubtree.
Rewrote most of the old utils/ scripts.
2009-04-29 15:24:23 +02:00
David Cantrell 291bf4492a More fixes for importing Lorax. 2008-10-09 21:48:46 -10:00
David Cantrell 3377bc22e4 Reference the conf has in Lorax rather than globally. 2008-10-09 21:46:41 -10:00
David Cantrell 81e7702393 Introduce class Lorax and class InstRoot.
The lorax driver program will instantiate the Lorax class, which
drives the creation of the install images.  The InstRoot class is
the main object that represents the contents of the instroot
image (the tree that boot and stage2 images are made from).
2008-10-09 17:04:13 -10:00
David Cantrell 5ef8b9eafb Add some banner messages explaining the major steps of lorax. 2008-10-04 21:53:13 -10:00
David Cantrell 6bac20bb66 Make cleanup optional. 2008-10-04 21:35:03 -10:00
David Cantrell 3ec372e546 Make the cleanup() function just remove the tmpdir location. 2008-10-04 20:59:46 -10:00
David Cantrell e85f18bb5b Rename lorax.py to lorax. 2008-10-04 19:50:56 -10:00
David Cantrell 9c3e0a79af Move code in to the src/ subdirectory. 2008-10-04 19:45:34 -10:00