Commit Graph

231 Commits

Author SHA1 Message Date
Brian C. Lane f320b3c8f4 livemedia-creator: Change defaults to Red Hat Enterprise Linux 9
This changes the releasever and project defaults to RHEL 9 values.

Resolves: rhbz#2019133
2021-11-02 11:22:02 -07:00
Radek Vykydal 17f4a79207 Add prefixdevname to Anaconda initramfs
Related: rhbz#1958173
2021-05-24 08:21:54 -07:00
Brian C. Lane eff7ab4009 Update the default release version to 34 2020-12-02 11:33:14 -08:00
Brian C. Lane f83ae2fed3 mksquashfs: Catch errors with mksquashfs and report them
The host system can run out of space while running mksquashfs, and while
this is logged to program.log it isn't detected by lorax or
livemedia-creator so it will continue running, possibly reporting
unrelated errors and causing confusion.

This adds checks for the return status when calling mksquashfs, logs it
to the log, and either exits or raises an error immediately.
2020-05-07 14:35:55 -07:00
Brian C. Lane c9c1283c56 lorax: Add --skip-branding cmdline argument
Also document how branding currently works. See docs/lorax.rst

Resolves: rhbz#1826479
2020-04-21 15:57:54 -07:00
Brian C. Lane 009c051003 Bump default platform and releasever to 32 2019-10-16 14:22:58 -07:00
Dan Horák a477db33d6 drop big endian ppc/ppc64 support 2019-01-07 13:52:46 -08:00
Dan Horák d34acfc14c don't reduce initrd size on ppc64/ppc64le 2019-01-07 13:52:46 -08:00
Brian C. Lane fd173f7265 Add timestamps to program.log and dnf.log
In lorax, lorax-composer, and livemedia-creator.
2018-12-19 12:13:24 -08:00
Brian C. Lane 35b8957f12 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.
2018-11-29 11:06:26 -08:00
Marek Marczykowski-Górecki 27e611629f Add --squashfs-only option to drop inner rootfs.img layer
Make runtime directly into squashfs image. This reduces largely
unreproducible ext4 layer, but requires anaconda's dracut module
modification to properly mount the image.
2018-10-29 13:16:38 -07:00
Brian C. Lane 4d9ef60460 Add support for DNF 3.2 module_platform_id config value
This borrows simpleconfig.py from Anaconda to make parsing os-release
easier.

It defaults to platform:el8
2018-08-29 11:04:50 -07:00
Brian C. Lane d8ce013a2b 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:10:35 -07:00
Brian C. Lane dc635a97f6 Write the --variant string to .buildstamp as 'Variant=' 2018-01-17 09:38:16 -08:00
Brian C. Lane e3dcb1e329 Add version output (#1335456)
Add -V to livemedia-creator, and log the running version when lorax or
lmc is started.
2017-08-14 13:54:02 -07:00
Brian C. Lane 8154b3f7a3 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.
2017-08-14 13:20:27 -07:00
Stephen Gallagher 2c3007beb8 Use anaconda-core to detect buildarch
For historical reasons, lorax used the 'anaconda' package as a
touchstone to determine the architecture for the build. At some
point, this package became a metapackage that pulls in both the
GUI and headless installers.

In the modular world, it's possible that only the core and TUI bits
may be available for use. The only subpackage of anaconda that is
guaranteed to be on any viable system is anaconda-core, so let's
switch to using that for the touchstone instead of the metapackage.

Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
2017-05-31 10:07:41 -07:00
Pat Riehecky 7ca356845b Added option to remove packages (parallel to installpkgs) 2016-11-14 09:06:10 -08:00
Brian C. Lane 442d0a0140 Revert "Use size=10 by default"
This reverts commit e61223d486.

On systems with less RAM (eg. ARM with 4G) this size change causes the
build to get stuck.
2016-08-22 16:17:35 -07:00
Colin Walters e61223d486 Use size=10 by default
I'm working on
https://fedoraproject.org/wiki/Changes/WorkstationOstree and when
using lorax to make an installer ISO with content embedded, I run out
of disk space since the desktop+various apps is large.

Since this ends up being compressed anyways, let's just bump the
currently arbitrary `2` to `10` - the only real cost I can think of is
going to be a few more superblock entries.
2016-08-12 13:05:40 -07:00
Brian C. Lane 8085395678 Change location of basearch to dnf.rpm.basearch (#1312087)
The dnf fix for the busted API change is also busted, so just change it
everywhere.
2016-03-09 16:41:11 -08:00
Brian C. Lane c15349c3da livemedia-creator: Add /usr/share/lorax/templates.d/ support 2016-02-11 10:54:54 -08:00
Brian C. Lane c86bd205c3 Add check for templates.d in the sharedir
This allows lorax to support multiple templates.

If there is no templates.d under the sharedir (/usr/share/lorax or the
directory passed by --sharedir) then the templates in that directory
will be used as they were previously.

If there are directories under templates.d the first one will be used,
unless --sharedir points to a specific one.
2016-02-10 17:14:11 -08:00
Brian C. Lane e728e9ccee Include qemu modules in the initrd
This includes, among other things, virtio-rng. Without it the initrd may
take longer to initialize the random non-blocking pool on KVM
installations.
2015-11-23 09:33:42 -08:00
Brian C. Lane bf255a41a5 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:51:47 -07:00
Will Woods a3e1a275ff don't build upgrade.img anymore
fedup is deprecated and abandoned. Let's save time and disk by not
building `upgrade.img` when nothing is going to use it anymore.

For the record, performing upgrades using an initramfs from the new
system turns out to be fragile and hard to support:

* dracut initramfs isn't generic enough to handle booting all systems
  (e.g. missing vconsole.conf means you get keymaps wrong, so users
  can't unlock encrypted disks)

* The ABI differences between the two versions of plymouth, systemd,
  etc. requires nasty workarounds at best and causes nightmarish
  systemd crashes at worst

This patch removes all the code that built and installed `upgrade.img`.

For backwards compatibility, the API retains the `doupgrade` keyword
argument, and the `--noupgrade` flag is still accepted.
2015-08-31 16:24:39 -07:00
David Shea 04d170bb09 Add a verification step to Lorax.run.
After the cleanup step, check that everything in /usr/bin and /usr/sbin
can still run. Currently, this just checks that ELF files have
everything they need to link, and scripts have an interpreter.

Verifying is on by default but can be skipped with --noverify
2015-07-20 16:18:20 -04:00
Chris Lumens d23605d3cc Move setup_logging into pylorax/__init__.py. 2015-06-01 14:27:29 -04:00
Brian C. Lane 7cd329a065 Fix bug with product DataHolder overwriting product string. 2015-05-18 08:24:23 -07:00
Brian C. Lane 1a92b1b05e Convert to using pocketlint for pylint rules
Also cleanup some warnings.
2015-05-15 17:11:20 -07:00
Brian C. Lane de0e662f51 Convert pylorax to python3
Fix up 2to3 complaints. I've decided to do with wrapping list
comprehension inside list() to get the generators to run in several
places instead of list(map( or list(filter( which seem less readable to
me.
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
Colin Walters 67217f5642 Add ability for external templates to graft content into boot.iso
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.
2015-03-19 16:48:16 -04:00
Brian C. Lane 9ff5897eee Get the log directory from the configfile
In the lorax script create it if missing and override it with the
path of --logfile
2015-02-16 08:47:30 -08:00
Brian C. Lane 345cc89ee0 dnf: remove files from installed packages
This is a workaround for a current dnf bug, it doesn't update the state
of the packages after they are installed so we tear down the base dnf
object and create a new one pointing to the installroot.

There is an additional issue with the list of files returned, hawkey and
dnf don't appear to make a distinction between files, dirs and ghosted
dirs like yum did, this can result in too much being removed (eg. all of
/etc/selinux/) so we only remove files not directories.
2015-02-16 08:47:30 -08:00
Brian C. Lane 431ca6cea4 Switch lorax to use dnf instead of yum
pylorax users will need to change to using dnf and pass a dnf.Base()
object as the dbo argument instead of a yum object as the yum or ybo
argument. See the lorax script for an example of how to do this.

The lorax cmdline argument --excludepkgs has been removed since dnf
doesn't appear to have any way to support it and packages should be
controlled using templates anyway.
2015-02-16 08:47:30 -08:00
Colin Walters 52d962d613 Add --includepkg argument
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 --includepkg (and we should probably add an
option to remove the implicit lorax-product-* glob).
2014-12-05 15:58:58 -08:00
David Shea 25b4d539ac 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.
2014-09-15 11:27:58 -04:00
Brian C. Lane 364ce363f7 Add ppc64le arch (#1136490)
basearch is ppc64le so we needs to check for that in addition to ppc64.

Resolves:rhbz#1136490
2014-09-03 10:41:42 -07:00
Peter Jones c789f20b66 Don't emit media labels with spaces in them.
Spaces cause various bugs like #923374 and #855849 , and it would be
better if we just didn't use them.

Note that there's a corresponding pungi change to go with this.

Signed-off-by: Peter Jones <pjones@redhat.com>
2014-07-01 11:59:19 -04:00
Colin Walters 66359415be 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.
2014-05-12 16:04:28 -07:00
Brian C. Lane d25c0b0594 Update copyright statements 2014-05-09 15:13:39 -07:00
Brian C. Lane 6d47689a33 Cleanup pylorax pylint warnings 2014-05-09 08:10:41 -07:00
Brian C. Lane 9e15705bb9 Clean up download and install output
Commit d2ae92b4b3 patched up the download counter and progress
display. Yum no longer provides the needed information so now we get the
total number of packages from the start of the transaction.

This also turns off colors when stdout is not a tty, and only prints the
install progress once so that piping to a logfile isn't flooded with
useless characters.
2014-04-25 06:55:56 -07:00
Mark Hamzy cc2f98bfc5 support ppc64le in lorax
Add support for the ppc64le architecture in lorax.

Signed-off-by: Brian C. Lane <bcl@redhat.com>
2014-03-27 10:06:41 -07:00
Brian C. Lane 03217e4eee 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 13:20:16 -08:00
Brian C. Lane 9c1372564c 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:46:41 -08:00
d.marlin f0d1c76ea4 Add initial 64-bit ARM (aarch64) support (#1034432)
Signed-off-by: Brian C. Lane <bcl@redhat.com>

Resolves: rhbz#1034432
2013-12-17 10:07:32 -08:00
Brian C. Lane 9e979f760b lorax: pass size from Lorax.run to create_runtime (#903385)
This allows Lorax class users to specify the image size when calling
run()
2013-11-19 10:23:12 -08:00
Mark Hamzy 52070f045c fix version query and add one to the log file
Fix "lorax -V" and add a "version is ???" to the log file so we can easily know
what version of lorax is used to build an iso.
Changed to try/import for versioning because the version file is autogenerated.
2013-04-03 15:43:09 -07:00