Commit Graph

601 Commits

Author SHA1 Message Date
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
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 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 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 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 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
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
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 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 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 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 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
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
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
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 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
Harald Hoyer 22a36d3a81 dracut-nohostonly and dracut-norescue got renamed for dracut >= 030 (#990305) 2013-08-01 10:05:08 -07:00
Brian C. Lane 31dd8048ab livemedia-creator: pass inst.cmdline for headless installs (#985487)
Also add console=ttyS0 so you can run virsh console XX to follow the
install/look for errors.
2013-07-25 15:34:23 -07:00
Brian C. Lane 14fa40556c Stop using /usr/bin/env (#987028) 2013-07-24 13:41:03 -07:00
Brian C. Lane f88d42a03f livemedia-creator: clarify required package errors (#985340) 2013-07-17 10:34:43 -07:00
Brian C. Lane abf27add37 Bump image size up to 2G (#967556) 2013-05-28 16:29:48 -07:00
Brian C. Lane 23b2ddeb5c livemedia-creator: Fix logic for anaconda test (#958036) 2013-05-24 12:20:56 -07:00
Dennis Gilmore d751ac82db remove no longer supported arm kernel variants add the new lpae one 2013-04-17 16:21:23 -07:00
Brian C. Lane 67863bbf03 livemedia-creator: Ignore rescue kernels 2013-04-16 16:31:33 -07:00
Brian C. Lane 12bad32223 Fix import of version
If the import fails it wipes out the global pylorax import.
2013-04-03 16:28:29 -07: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
Will Woods 26c77b4fba Print & log messages on scriptlet/transaction errors
We should probably let the user know if something goes wrong with the
transaction or if a scriptlet fails. So: log the messages so we can find
(and, one hopes, fix) them later.
2013-03-19 15:03:49 -07:00
Will Woods 3a1e176cbb sysutils: add -x to cp in linktree
Since you can't make cross-device links, you'd think that cp -l (make
links) would imply -x (don't cross devices).

You'd be wrong.
2013-03-19 00:47:58 -04:00
Will Woods ad3d1e6278 treebuilder: fix "Can't stat exclude path "/selinux"..." message
/selinux has been gone for *years*. Drop the exclude.
2013-03-19 00:47:58 -04:00
Brian C. Lane 93c4a8b830 Raise an error when there are no initrds 2013-03-12 15:39:25 -07:00
Brian C. Lane fd8684f1af Add yum logging to yum.log 2013-03-12 14:09:21 -07:00
Dennis Gilmore a4cf3c3c7c remove sparc support
Signed-off-by: Dennis Gilmore <dennis@ausil.us>
2013-03-04 14:18:45 +01:00
Brian C. Lane bcdd43997b Remove some env variables (#907692)
Some package scripts may call utilities using dbus. Since this is just a
chroot that will fail. This unsets DESKTOP and DBUS_SESSION_BUS_ADDRESS
to keep them from crashing.
2013-02-15 05:47:11 -08:00
Brian C. Lane 8e84ef10c1 Add filesystem image install support
This adds support for installing to a filesystem image instead of a
partitioned disk image. It requires Anaconda's --dirinstall support.
Also re-organized the code to break it up into smaller methods.

This speeds up iso creation in no-virt mode by removing the need to copy
the filesystem from the partitioned disk image to the filesystem image
that is used to make the squashfs image.
2013-02-12 10:35:52 -08:00
Brian C. Lane d2ae92b4b3 yum changed the callback info
It used to give us (x/y) packagename, but now it only sends package
name. This was changed in yum commit 7e8c76173. For now default to
showing the zeros along with the package name so that it doesn't look
like an error.
2013-01-31 10:06:14 -08:00
Brian C. Lane 5afa0c631d livemedia-creator: don't pass console=ttyS0
passing console=ttyS0 makes the virt hang until there is input. Remove
it and now it will run unattended in text mode.
2013-01-09 16:31:49 -08:00
Martin Gracik 62920272c7 Fix rexists 2012-12-19 12:39:39 +01:00
Martin Gracik a0791d3074 Only run installupgradeinitrd if upgrade 2012-12-18 14:31:45 +01:00
Martin Gracik 263618e12a Add --noupgrade option 2012-12-18 12:04:03 +01:00
Brian C. Lane 665ee8be7e imgutils: use -s for kpartx, wait for device creation
kpartx can return before the devices are created. Use -s to wait.
Also remove -p p and let kpartx handle adding pX if needed, we use
whatever it outputs so there is no need to force a name.
2012-12-14 13:56:36 -08:00
Brian C. Lane 07c99ae8d0 livemedia-creator: Use SELinux Permissive mode 2012-12-13 15:58:18 -08:00
Brian C. Lane 591891c303 livemedia-creator: use cmdline mode 2012-12-13 15:52:08 -08:00
Dennis Gilmore 78e3d0f115 add installupgradeinitrd function and use it to install the upgrade initrds 2012-11-30 13:28:38 -06:00
Will Woods ff42fbd57e Add the 'fedup' plymouth theme if available 2012-11-30 13:28:38 -06:00
Will Woods b5eb38ae97 build fedup upgrade.img
Use rebuild_initrds() with prefix='upgrade' to build upgrade.img with
the fedup "system-upgrade" module(s) inside.
2012-11-30 13:28:38 -06:00
Will Woods 1c91eab12b treebuilder: improve findkernels() initrd search
This makes findkernels() look for any image named something like:

  $PREFIX-$KERNELVER.img

and adds a corresponding entry to its returned data like:

  kernel.$PREFIX.path = [path]

As a special backwards-compatibility case we use 'initrd' for the
attribute name if $PREFIX is 'initramfs'.

This gives us any extra initramfs images that may have been built using
the 'prefix' argument to rebuild_initrds().
2012-11-30 13:28:38 -06:00
Will Woods 5b48574d5e treebuilder: add 'prefix' to rebuild_initrds()
If 'prefix' is passed to rebuild_initrds(), it will build a *new*
initramfs with a name like $PREFIX-$KERNELVER.img, rather than
overwriting the existing initramfs.
2012-11-30 13:28:38 -06:00
Martin Gracik 91afe5883f Set permissions on the initrd (#863018)
Dracut now makes the initrd with 600 permissions
for security reasons. These reasons do not apply
to install images, and we want the other tools
that use lorax to be able to read the initrd file.
2012-10-11 10:24:11 +02:00
Brian C. Lane 2b8075af3a use /var/tmp instead of /tmp
Also add a --tmp option so users can specify a top level tmp dir.
2012-10-02 11:35:16 -07:00
Brian C. Lane a83c8c1df0 remove rv from unmount error log
You obviously cannot reference it when it hasn't been set.
2012-09-21 09:19:09 -07:00
Martin Gracik fb69670ea8 There's no lang-table in anaconda anymore (#857925) 2012-09-17 11:41:39 -07:00
Brian C. Lane 43bd549480 add convienience functions for running commands
Adds runcmd() and runcmd_output() which set raise_err=True
2012-09-17 11:26:53 -07:00
Brian C. Lane 12ad7d0d99 restore CalledProcessError handling
When I switched execution over to execWith* functions I failed to
account for the use of CalledProcessError in various places. This
patch restores that behavior. All places that used check_call or
check_output now pass raise_err=True to the execWith* call.
2012-09-17 11:26:50 -07:00
Brian C. Lane 381c4276ba add CalledProcessError to execWith* functions
This adds a raise_err argument that when set to True will raise a
CalledProcessError if the process's returncode is not 0
2012-09-17 11:26:41 -07:00
Brian C. Lane 340349b763 imgutils: fix umount retry handling
When umount fails it doesn't throw an error, so retry when the rv is
non-zero instead.
2012-08-21 07:12:23 -07:00
Brian C. Lane 97cfc71664 livemedia-creator: use stage2 instead of root 2012-08-21 07:12:23 -07:00
Brian C. Lane 91ff02eae3 livemedia-creator: add location option
--location specifies an iso directory tree to be used by virt-install
instead of the iso. This allows you to update the initrd in the tree for
debugging.

virt-install uses the images/pxeboot/ directory for initrd.img and
vmlinux.

An iso is still required for the LiveOS/squashfs.img stage2 file.
2012-08-21 07:12:23 -07:00
d.marlin 5e677160cd Add a command line option to override the ARM platform.
Passed on to anaconda to make ARM images where the compose hardware
does not match the target hardware.

Signed-off-by: Brian C. Lane <bcl@redhat.com>
2012-08-15 11:09:50 -07:00
Peter Jones 72c1aa9cd3 Add grub2-efi support and Secure Boot shim support.
This adds grub2-efi support in general as well as using the Secure Boot
shim loader on uefi media.
2012-08-13 11:03:40 -04:00
Peter Jones 0f2c6ed007 Fix GPT code to allocate space for /2/ tables.
17408 is the size of the table being made, but there's one at the
beginning and one at the end.
2012-08-13 11:03:40 -04:00
Brian C. Lane 700d5007a3 add logging to lorax 2012-07-30 09:22:10 -07:00
Brian C. Lane 505d5bf164 move live templates into their own subdir of share
live media isn't exactly the same as the Anaconda install media. Right
now this amounts to needing a root= cmdline argument but in the future
there may be other differences.

This also reverts 5437557846 on the new copies of the templates.
2012-07-30 09:22:10 -07:00
Brian C. Lane 134eec24d5 clean up command execution
Switch to using execWith* so that the command and its output can be
logged. To capture the output setup a logger named "program"

livemedia-creator captures all of this into program.log
2012-07-30 09:22:10 -07:00
Brian C. Lane 994ff776c7 livemedia-creator: cleanup logging a bit 2012-07-30 09:22:10 -07:00
d.marlin f170b6dc49 Add 'mvebu' to list of recognized ARM kernels.
Signed-off-by: David A. Marlin <dmarlin@redhat.com>
2012-07-25 12:43:23 +02:00
Brian C. Lane de3d3e17b7 livemedia-creator: add some error checking
- Add a check to livemedia-creator for /usr/bin/virt-install (#841566)
- Suggest the correct package for livemedia-creator's libvirt (#841552)
- Add to list of packages needed to build a livemedia-creator iso (#841594)
2012-07-20 17:50:00 -07:00
Will Woods 90ab7bfcfd Actually add plymouth to the initramfs
One more piece to get plymouth in place - we have to stop omitting it
from the initramfs so it's available at boot.
2012-07-06 00:19:48 -04:00
Will Woods 8e71bb045a don't use --prefix with dracut anymore
systemd in F18 doesn't work with --prefix anymore, so drop it.

(patch from haraldh - thanks Harald!)
2012-07-06 00:19:48 -04:00
Martin Gracik 30cb18a9ec Add initial support for ARM based systems (dmarlin) 2012-06-21 09:33:53 +02:00
Will Woods 3a75b2e07d add 'systemctl' command and use it in postinstall
The 'systemctl' command can be used to enable, disable, or mask systemd
units inside the runtime being modified. Modify runtime-postinstall.tmpl
to use the 'systemctl' command.

We also no longer remove quota*.service or kexec*.service, since
these aren't enabled by default. And systemd-remount-api-vfs.service
should work correctly now, so we can leave it alone as well.
2012-06-19 20:00:00 -04:00
Will Woods 3fda56b499 Add some documentation to LoraxTemplateRunner 2012-06-19 19:59:59 -04:00
Will Woods daacb4465d fix '-runcmd' and improve logging
The '-cmd' functionality depends on the individual lorax template
commands raising errors, so they shouldn't do sys.exit().

Also, capture stderr along with stdout, and put both in the log.
2012-06-19 19:59:59 -04:00
Will Woods 6080ff3b2a mkefiboot: add --debug
You can use the --debug flag to get debugging output from mkefiboot and
pylorax.imgutils. Helpful!
2012-06-19 19:59:59 -04:00
Will Woods 1c2c8ec4a8 pylorax.imgutils: add retry loop and "lazy" to umount()
There's something strange going on where unmounting a hfsplus volume
immediately after mounting it will fail with EBUSY.

This makes the umount fail, which makes the rmdir fail, which causes a
traceback, which breaks mkefiboot --apple.

It works fine if you wait a second and retry.. so do that.

Also, add the "lazy" argument so you can do lazy unmounts if you like.
2012-06-19 19:59:59 -04:00
Will Woods 2aae30e691 pylorax.imgutils: add debug logging
Add some useful debug logging info to various functions in
pylorax.imgutils.
2012-06-19 19:59:59 -04:00
Will Woods 329432b58e pylorax: set up logging as recommended by logging module
Generally it's not a good idea for python libraries to set up loggers in
the body of the library.

Set up a NullHandler by default (as the logging module suggests), and
add a function to do the current logging setup during run().
2012-06-19 19:59:59 -04:00
Brian C. Lane c143d5b72d Add pollcdrom module to dracut
From Harald Hoyer <harald@redhat.com>:

pollcdrom is used to poll for the install medium. A lot of CDROM drives
are not polled by the kernel correctly, so we have to actively poll for
the medium.
2012-06-11 10:31:57 -07:00
Martin Gracik 0123377d9b Check if selinux is enabled before getting the mode 2012-06-06 10:48:29 +02:00
Martin Gracik 2e907c072c Comment on why selinux needs to be in permissive or disabled 2012-06-04 16:14:38 +02:00
Martin Gracik cbe001638e Verify the yum transaction
Check if all packages that were supposed to be installed,
ended up installed.
2012-06-04 16:14:38 +02:00
Martin Gracik 7446d0d1e2 Add a --required switch to installpkg
Some packages are critical to the compose. If --required
is specified in the template's installpkg command, lorax
will exit if the package is not available.
2012-06-04 16:14:38 +02:00
Brian C. Lane cc384f6e7a livemedia-creator: Hook up arch option
Pass arch to virt-install and make_appliance.
2012-06-01 11:15:31 -07:00
Brian C. Lane 6e2fdfe23f livemedia-creator: Add appliance creation
This adds support for creating an appliance description file for the
disk image. Mako templates are used to make it easy to support other
appliance targets. The included example works with virt-image.
2012-06-01 11:15:21 -07:00
Brian C. Lane 7a23c600c6 livemedia-creator: handle failed mount for ami 2012-06-01 11:15:17 -07:00
Martin Gracik 3ed82f3eb0 Fix the rpm call 2012-06-01 08:58:34 +02:00
Martin Gracik bad0b469a5 Use selinux python module to get enforcing mode
No need to call getenforce via subprocess.
2012-06-01 08:42:13 +02:00
Martin Gracik 141a25801c Check if selinux is not in Enforcing mode (#824835)
Selinux causes problems for rpm scriptlets in the installroot.
2012-05-29 12:59:46 +02:00
Martin Gracik a9e5630322 Remove hfsplus-tools dependency (#818913)
Mac boot images are optional. Don't require hfsplus-tools
by default, but warn the user that he needs to install them
if he wants to create mac boot images.
2012-05-29 12:59:46 +02:00
Dennis Gilmore 066b0d3780 add name field to .treeinfo its a concatination of family and version 2012-05-25 08:53:57 +02:00
Martin Gracik 7e133c7e86 Fix typo in help (#819476) 2012-05-25 08:51:29 +02:00
Martin Gracik 910c54e394 Install proper branding packages from repo (#813969)
The product string is not the best source for package names.
2012-05-25 08:48:14 +02:00
Martin Gracik 6f3d8b55f3 Add --nomacboot option
Needed for systems without hfsplus support.
2012-05-25 08:47:52 +02:00
Brian C. Lane c336f4ed06 livemedia-creator: check kickstart for display modes (#819660)
lmc uses script mode. Putting one of these into the kickstart will
confuse it, especially when running in no-virt mode.
2012-05-15 13:38:56 -07:00
Brian C. Lane 9b8c2f9d19 livemedia-creator: Removed unused ImageMount class 2012-05-14 15:09:10 -07:00
Brian C. Lane eb82d0dccf livemedia-creator: cleanup after a crash
Make sure we don't leave any device-mapper or loop devices laying around
after a crash.
2012-05-14 15:08:59 -07:00
Brian C. Lane 84fdff0e50 livemedia-creator: start using /var/tmp instead of /tmp 2012-05-14 15:08:54 -07:00