Commit Graph

680 Commits

Author SHA1 Message Date
Brian C. Lane
d89f01af21 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 13:20:16 -08: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
Brian C. Lane
1f8aa84c5f 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-17 09:56:56 -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
Vratislav Podzimek
1d7eb09a53 Run compressions in multiple threads
This speeds up compression a lot on multicore systems.
2013-11-14 08:46:01 +01:00
Dennis Gilmore
8d84e9d25a ARM: Don't install or deal with in templates, no longer existing kernels
remove no longer used kernel variants from templates
dont try to install no longer existing kernel-tegra variant
2013-10-16 18:06:20 -05:00
Dennis Gilmore
7d3fafedf3 kernel changed seperator for flavours from . to + update regular expression 2013-10-16 18:05:56 -05:00
Brian C. Lane
abf27add37 Bump image size up to 2G (#967556) 2013-05-28 16:29:48 -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
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
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
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
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
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
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
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
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
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
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
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
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
Will Woods
467847e095 reduce image size from 2GB to 1GB
It's a sparse file, so this really just changes the size of the
squashfs.img by about 100kb. But hey - 100kb!
2012-04-24 14:47:42 -04:00
Matthew Garrett
0ec326eb3c mkefiboot: Copy Mac bootloader, rather than linking it
The Mac firmware needs special-casing for hardlinked bootloaders, and
it's kind of awkward to handle that in python. Just copy them for now
instead.
2012-04-13 12:54:41 -07:00
Martin Gracik
366cd617b2 Remove workdir if it was created by lorax (#807964) 2012-04-13 10:44:15 +02:00
Martin Gracik
b61927badc Log all removed files
This makes finding what glob removed some file easier.
2012-04-12 08:28:58 -07:00
Will Woods
562be7eaec remove anaconda-copy-ks.sh
anaconda-copy-ks.sh is included in the 'anaconda' dracut module, so we
don't need to install it here anymore.
2012-03-30 13:22:48 -07:00
Will Woods
2d9a56a9ec add anaconda dracut module
Install the anaconda dracut module during 'install', use it when
rebuilding initramfs, and clean it up afterward.

Also install '.buildstamp' into the initramfs (the anconda module wants
it).
2012-03-30 13:22:48 -07:00
Martin Gracik
d81ef79ffd Log the output of mkfs (#769928) 2012-03-30 13:22:48 -07:00
Martin Gracik
524dfa28db Check if the volume id is not longer than 32 chars (#786832)
This is a requirement of mkisofs.
Try to check it as soon as possible.
2012-02-28 12:50:34 +01:00
Martin Gracik
20fa29b32b Add option to specify volume id on command line (#786834) 2012-02-28 12:50:34 +01:00
Martin Gracik
84c56294bf Change the locale to C (#786833) 2012-02-28 12:50:34 +01:00
Will Woods
dcc6a41a31 use --prefix=/run/initramfs when building initramfs
Having the initramfs at /run/initramfs means that it will be retained at
/run/initramfs once we switch to the root image. We want that.
2012-02-20 14:16:52 -08:00
Brian C. Lane
ac6512a531 Fix missing CalledProcessError import 2012-02-17 08:32:00 -08:00
Martin Gracik
d26c41fee6 Add runtime basename variable to the template
Related: rhbz#782108
2012-02-09 16:27:51 +01:00
Dan Horák
17179f2120 use internal implementation of the addrsize utility
Anaconda dropped the addrsize utility in F-16, so we need to implement
it directly in lorax.
2012-02-09 14:08:56 +01:00
Brian C. Lane
a09806f607 Add dracut convertfs module (#787893)
Fedora 17 changes top level directories like /bin, /lib, etc. to
symlinks to the corresponding dirs in /usr/

dracut can convert old systems to the new layout using its convertfs
module.
2012-02-08 14:55:40 -08:00
Tim Flink
504cc236b1 changing hfs to hfsplus so that the correct mkfs binary is called 2012-02-07 17:27:27 -05:00
Brian C. Lane
2af864c438 lorax: copy kickstarts into sysroot (#743135)
The installer no longer has access to the initrd's root. We need to
copy any needed files over to /sysroot before switching root. This
copies *.cfg and *.ks files.

It also adds the ability to add dracut hook scripts to the initramfs
from /usr/share/lorax/dracut_hooks/

This re-adds commit af6d4e2c50 which was
lost during the switch to the treebuilder branch.
2012-01-25 21:59:48 -08:00
Martin Gracik
681f67f954 Log output of failed command
If we run a command from template with runcmd,
log it's output if it exits with non-zero return code.
2012-01-19 18:13:03 +01:00
Martin Gracik
1bbc546147 Allow specifying buildarch on the command line (#771382)
Some repos may contain anaconda packages for more architectures,
so it's not possible to get the right buildarch.
This patch allows optional specifying of the buildarch on the
command line when running lorax.
If the buildarch is not specified manually, lorax tries to get
it from the anaconda package as before.
If there's no anaconda package in the repository, don't fallback
to the system architecture and continue, because this is pointless.
We need the anaconda package.
2012-01-10 09:34:01 +01:00
Will Woods
5e411b09c0 consider %ghost files part of the filelists in templates
When considering a package's filelist (e.g. for things like removefrom
--allbut), we might need to also include the %ghost files, so make
_filelist() add them to its returned list.
2012-01-05 16:15:54 -05:00
root
dc815d10fb better debug, handle relative output paths 2012-01-03 16:32:50 -08:00
Brian C. Lane
7d1b7b4cc8 Allow a None to be passed as size to create_runtime
This is so that imgutils.mkext4img can dynamically calculate the size of
the image.
2011-12-20 14:59:57 -08:00
Brian C. Lane
035d49628c Add execWith utils from anaconda
The anaconda execWithRedirect and execWithCapture functions are too
useful not to include. They also allow you to log all the execuatable's
output to a logfile. Added them under executils.py module which uses
the pylorax and a new program logger.
2011-12-20 14:59:57 -08:00
Brian C. Lane
d6280b9cf0 Changes needed for livecd creation
Allow passing of size to create_runtime, add PartitionMount context
to use kpartx to mount partitioned file images. Add resetting the
selinux context on the newly created rootfs.
2011-12-20 14:59:57 -08:00
Brian C. Lane
c089b479f1 dracut has moved to /usr/bin 2011-12-20 15:01:52 -05:00
Will Woods
c8f06bd8ff ltmpl: be more careful about checking command names 2011-11-04 13:41:10 -04:00
Will Woods
bcc6f91f73 imgutils: reduce default overhead to 128 blocks
generally we don't need ~4MB extra space.
2011-11-01 15:58:09 -04:00
Will Woods
dfa7742a6d default to fatalerrors=True in LoraxTemplateRunner
This means that any (non-ignored) command error will cause lorax to
exit.

Do note, however, that some commands (e.g. remove, installpkg) don't
raise exceptions and therefore will not cause lorax to exit.
2011-10-26 13:09:50 -04:00
Will Woods
0e64f08ff8 Add '-cmd' syntax to ignore errors, drop copyif/moveif
Makefile-style "-cmd" syntax lets us run a command and ignore any
resulting errors. This is a more general version of what copyif/moveif
were trying to accomplish, so we can drop those commands.
2011-10-26 13:08:39 -04:00
Will Woods
305476eefe add comment about symlink root-escape problem 2011-10-25 16:19:23 -04:00
Will Woods
cd1225c5fb minor comment cleanups 2011-10-24 16:27:36 -04:00
Martin Gracik
73fc20b165 Write the lorax verion in the .buildstamp (#689697)
(cherry picked from commit 4271e0fc02)

Conflicts:
	src/pylorax/buildstamp.py

Signed-off-by: Will Woods <wwoods@redhat.com>
2011-10-24 16:07:25 -04:00
Will Woods
55b4b06268 treebuilder cleanup: remove hack for Fedora <= 15 2011-10-12 20:24:21 -04:00
Will Woods
f640a2faab Use a predictable ISO Volume Label (#732298)
New images find their root device by looking at the CDLABEL. Since pungi
is building ISO images separately from lorax, if it uses a different ISO
Volume Label we'll end up with unbootable images.

This changes the volume labels to match what pungi uses, so both should
boot OK.
2011-10-12 20:21:06 -04:00
Will Woods
b7269da23a Fix is_beta -> isfinal and add [Compose] to .buildstamp 2011-09-21 23:46:48 -04:00
Will Woods
262a05e539 ltmpl: continue loop if installpkg can't find something
Otherwise, something like:
  installpkg missing-thingy kernel kernel-firmware
will leave you without a kernel.
2011-09-15 19:27:31 -04:00
Will Woods
318c843e37 ltmpl: improve exception handling/reporting
- Log the error message (and the line causing the error) to console
- Log the whole exception (with some excess junk removed) to debuglog
- don't immediately SystemExit if the template won't parse
- clean up some comments
2011-09-15 19:24:35 -04:00
Will Woods
473f01c696 Add docstrings for the ltmpl commands in LoraxTemplateRunner 2011-09-14 18:33:30 -04:00
Will Woods
9699e25045 imgutils: make do_graft work for files too
This is needed to make --icon work in mkefiboot
2011-09-07 12:06:48 -04:00
Will Woods
faafd04dcb add '--allbut' flag to 'removefrom'
This lets us easily do whitelisting instead of blacklisting during
runtime cleanup. For example:
 removefrom xfsprogs --allbut /sbin/* /usr/sbin/xfs_admin
would remove everything from the xfsprogs package except files in /sbin
and /usr/sbin/xfs_admin.

A few things in runtime-cleanup have been converted to use --allbut. The
only difference in the created runtime image is that we're deleting
/usr/share/kde4 from fedora-logos.
2011-08-31 19:40:20 -04:00
Will Woods
df3bc79574 tweak umask for imgutils' mkdosimg 2011-08-29 17:10:58 -04:00
Will Woods
8a8ec59b75 add mkhfsimg to imgutils 2011-08-29 17:10:20 -04:00
Will Woods
e756e57b5d add "livenet" module to initramfs 2011-08-29 15:08:06 -04:00
Will Woods
ea31f4f23b add --noprefix to dracut invocation
--noprefix is the default, but fedora ships an /etc/dracut.conf that
changes the prefix. Set --noprefix to override this.

Discussed here:
https://www.redhat.com/archives/anaconda-devel-list/2011-August/msg00234.html
2011-08-29 13:23:20 -04:00
Will Woods
a6ea3d3747 add pkgsizes listings, and move debugging data to logdir 2011-08-09 20:01:31 -04:00
Will Woods
4f7584fe09 move pkglists to RuntimeBuilder and disable if not debugging 2011-08-09 17:59:57 -04:00
Will Woods
3153bdfa8a save debug setting as self.debug 2011-08-09 17:59:04 -04:00
Will Woods
76a7c2008a rb.postinstall(): don't allow configdir override
Since the templates need to match the contents of the configdir, it
doesn't really make sense to allow configdir to be different from
templatedir.
2011-08-08 19:03:53 -04:00
Will Woods
916402b023 handle templatedir more cleanly in ltmpl/treebuilder
make sure that runner.templatedir gets set to a useful default if
initialized with None, and and make sure we pass templatedir to
LoraxTemplateRunner.__init__ (so it'll get initialized properly)
2011-08-08 19:01:38 -04:00
Will Woods
297a572069 copy config_dir into root, rather than linking
workdir might be on a different device, and then hardlinks fail
2011-08-05 17:25:08 -04:00
Will Woods
9f6393c58e better logging for removepkg/removefrom
emit a useful log message if we attempt to removepkg something that
isn't installed, or if a glob used in a removefrom line matches no
files.

this will help us keep the templates cleaner.
2011-08-01 17:24:20 -04:00
Will Woods
52f7c5d37f fixup for bcj NameError 2011-07-22 16:59:56 -04:00
Will Woods
3099c0a44d Configurable compression type/speed/bcj use
* add bcj arch dict to ArchData
* add "compression" settings back to __init__.py
* pass them to treebuilder.create_runtime
* pass them through to imgutils.mksquashfs
2011-07-20 16:51:27 -04:00
Will Woods
7f087ead73 imgutils: allow mksquashfs to use its default compression 2011-07-20 16:42:06 -04:00
Will Woods
8f9f9944fe Use pungi's installroot rather than making our own (#722481)
Apparently messing with the installroot causes some serious problems
with yum, so.. don't do that.
2011-07-19 12:26:13 -04:00
Will Woods
6c7709e592 Don't install/start plymouth in the initramfs 2011-07-07 19:10:12 -04:00
Will Woods
497f63a041 debugging: write out dirnames as well as filenames in pkglist/ 2011-07-06 19:36:42 -04:00
Will Woods
f5164d6460 ltmpl: do brace expansion on the entire template
Handle brace expansion while parsing the template rather than
individually per-command. This is closer to how bash does things anyway.
2011-07-06 18:02:20 -04:00
Will Woods
d61ae8c1e6 fixup - correctly detect F15 builds
Yeah, for F16 you need to do "version > 15", not ">= 15". Oops.
Also, check product.version before using anaconda_dracut_hack().
2011-07-06 17:17:40 -04:00
Will Woods
ba686350ef Revive code/hacks for building F15 images
To build F15 images we need to remove systemd and set up loader as init
(see runtime-cleanup and runtime-postinstall).

We also need to add a hack to dracut so loader won't freak out when it
gets started by anaconda - see the file we're adding to the initramfs in
treebuilder.py.

(There's also an extra bonus hack for working around a bug in dracut if
/proc/cmdline is empty - SEE IF YOU CAN SPOT IT!!!)
2011-07-06 13:07:21 -04:00
Will Woods
51060f07f6 hacklet to hush dracut warnings about /proc/modules
We just touch ${inroot}/proc/modules before the chroot, and remove it
afterward.
2011-07-06 12:22:49 -04:00
Will Woods
5c0095cdc8 fixup: self.basearch, not basearch 2011-07-05 13:40:48 -04:00
Will Woods
fc6030edaa Fix libdir to match basearch (not buildarch), use getBaseArch
Let's let yum handle the magic of figuring out what basearch is. And
since basearch will match userspace, libdir should match basearch.

This fixes stuff on pre-F16 ppc64 (where basearch is ppc and thus has a
different libdir).
2011-07-05 13:32:48 -04:00
Will Woods
59b33150aa generate_module_data needs to happen before cleanup 2011-07-01 16:30:07 -04:00
Will Woods
d636b82783 Move generate_module_data before create_runtime
module-info and the updated depmod stuff need to be inside the runtime
image, so this needs to happen before create_runtime. Accordingly,
generate_module_data gets moved to RuntimeBuilder.
2011-07-01 15:44:11 -04:00
Will Woods
a8f627faab module-info fix: first line must be "Version 0" 2011-07-01 14:41:13 -04:00
Will Woods
446c45c8e5 fix path for module-info (should be /lib/modules/module-info) 2011-07-01 14:07:06 -04:00
Will Woods
41ca62d30b fixup: runner->_runner 2011-06-30 18:13:24 -04:00
Will Woods
416b7eef57 make glob() in templates return a list 2011-06-30 17:54:02 -04:00
Will Woods
2e8d5c78b8 move template 'exists' and 'glob' to self.builtins
otherwise, assigning to runner.defaults clobbers them. oops.
2011-06-30 16:59:55 -04:00
Will Woods
5cb7371cdf treebuilder refactor: rearrange functions to be easier to read 2011-06-30 13:40:26 -04:00
Will Woods
b39d90c688 Move LoraxTemplateRunner (and helpers) to ltmpl 2011-06-30 13:24:07 -04:00
Will Woods
be45950bd3 _glob/_exists -> rglob/rexists, rglob(fatal=False)
Also fix incorrect argument to _glob in LoraxTemplateRunner.defaults
2011-06-30 13:24:07 -04:00
Will Woods
75d1b6562b make _glob an iterator, and remove it from RuntimeBuilder.cleanup() 2011-06-30 13:24:07 -04:00
Will Woods
da2b53d91f Fix x86 "root=..." quoting problem and add udev_escape()
udev_escape gets passed to the arch templates so they can properly
escape the root=live:CDLABEL=... argument.
2011-06-30 13:24:07 -04:00
Will Woods
45c8f234ac Refactor: Merge TemplateParser+TemplateRunner into LoraxTemplateRunner
Also move 'glob' and 'exists' into the default args held by the template
runner.
2011-06-29 12:43:12 -04:00
Will Woods
9cd0ac09d1 treebuilder: decode escape sequences in the 'append' command
Note that this might not work in python3 (we might need to encode the
data to utf8 before we can decode the escape sequences).
2011-06-27 19:24:05 -04:00
Will Woods
e1a0e40ffa log message cleanup 2011-06-27 17:54:09 -04:00
Will Woods
3388c1c529 fix use of brace_expand in removefrom 2011-06-27 16:03:40 -04:00
Will Woods
741fbc7b43 fixup: import check_output for generate_module_info 2011-06-27 16:02:51 -04:00
Will Woods
6b218437c8 generate_module_info fixup: "join" should be "joindir" 2011-06-27 15:18:16 -04:00
Will Woods
c2631bd8e3 remove unused 'constants' module 2011-06-27 14:51:54 -04:00
Will Woods
9ac7db8cb1 Add TreeBuilder.generate_module_data() for depmod/module-info
generate_module_data() runs depmod for each kernel module in the install
root, then generates the (anaconda-specific) module-info files.
2011-06-27 14:46:47 -04:00
Will Woods
f8da53ac51 remove get_missing from LoraxRequiredCommands 2011-06-27 12:57:50 -04:00
Will Woods
2100445ad1 Expand braces (e.g. /usr/share/{doc,man,info}) in globs
The braces will be expanded as in the shell, before globbing. Note that
the output may include duplicates.
2011-06-24 18:12:59 -04:00
Will Woods
0fc63effd6 Remove TODO - doesn't need to be in git 2011-06-24 18:12:11 -04:00
Will Woods
ef8e0b4538 add DataHolder.copy()
Returns a DataHolder rather than a dict, so copy() works as expected.
2011-06-24 17:42:53 -04:00
Will Woods
8122690ab9 runtime is images/install.img, or LiveOS/squashfs.img on boot.iso
rename the runtime image in the tree and on the ISO.
2011-06-24 17:26:01 -04:00
Will Woods
30ac2e9aa5 Fix product.name.lower() in RuntimeBuilder changing TreeBuilder
Let RuntimeBuilder use a copy of the 'product' object instead.
2011-06-24 13:11:15 -04:00
Will Woods
99a612fb0a TreeBuilder: fix removelocales 2011-06-23 17:30:42 -04:00
Will Woods
5ebaccef4d fix create_runtime workdir path thinko
I used basename when I meant dirname. Duh.
2011-06-23 12:12:37 -04:00
Will Woods
b73132af75 rename "runtime" template arg to "runtime_img"
Mako uses "runtime" internally for things, and if you clobber it stuff
will just break in weird ways. So don't do that.
2011-06-23 10:46:28 -04:00
Will Woods
eda011a49c rename runtime "anaconda-squashfs.img", pass path to Treebuilder
dracut's dmsquash-live-root won't recognize the image as a squashfs live
image unless its name matches "*squashfs.img", so choose the filename
accordingly. Then pass the name to the TreeBuilder so it can move it
into place.
2011-06-22 20:07:08 -04:00
Will Woods
d322180dce instantiate RuntimeBuilder/TreeBuilder with keyword args 2011-06-22 19:22:33 -04:00
Will Woods
7ed705bf09 pass configdir to postinstall() 2011-06-22 17:20:00 -04:00
Will Woods
996208f1c8 make create_runtime() just build the image; remove initrd_append
create_runtime should just create the runtime image. We'll worry about
making the big combined boot image in the arch-specific templates.
2011-06-22 17:12:56 -04:00
Will Woods
f2814d5c90 treebuilder: add _filelist(*pkgs), use it in removepkg/removefrom 2011-06-22 17:12:56 -04:00
Will Woods
f724051499 whitespace cleanup 2011-06-22 17:12:56 -04:00
Will Woods
2096ebc551 remove unused LoraxTemplate.getdata() 2011-06-08 17:32:38 -04:00
Will Woods
f6b8893fd6 Fix passing kernels to template in TreeBuilder 2011-05-31 14:36:59 -04:00
Will Woods
303db540f1 bugfix for replace() globbing in _in 2011-05-31 12:24:17 -04:00
Will Woods
44583cd581 tb: make remove() and chmod() use globs (also fixes errors with missing files) 2011-05-31 12:24:17 -04:00
Will Woods
bdb35b7822 fix remove() on symlink-to-dir 2011-05-31 12:24:17 -04:00
Will Woods
dde2b9ae62 Remove comments (lines starting with '#') from templates 2011-05-31 12:24:17 -04:00
Will Woods
07695dff71 fix missing self.root in create_runtime() 2011-05-31 12:24:17 -04:00
Will Woods
bfc8dcdd7a add missing imports to treebuilder (imgutils, fnmatch) 2011-05-31 12:24:17 -04:00
Will Woods
f1963a2102 make treebuilder._glob return relative paths when using root= 2011-05-31 12:24:17 -04:00
Will Woods
0598b13ad1 tb: join->joinpaths. I learned my lesson. 2011-05-27 18:38:25 -04:00
Will Woods
76ecff7bf9 Revert "add --noscripts to run_pkg_transaction, use it in cleanup"
Doesn't help. Less code is better.

This reverts commit c9e23b8941.
2011-05-27 15:24:07 -04:00
Will Woods
acff5093b0 tb: Remove packages by removing their contents 2011-05-27 15:23:48 -04:00
Will Woods
c9e23b8941 add --noscripts to run_pkg_transaction, use it in cleanup 2011-05-27 12:57:31 -04:00
Will Woods
9f47eae26b another pkglists fixup 2011-05-26 18:53:51 -04:00
Will Woods
e1677432a3 tb: joinpaths->join 2011-05-26 18:28:08 -04:00
Will Woods
2121b03a0a treebuilder: use mvfile(), fix postinstall, product.name.lower() 2011-05-26 18:15:07 -04:00
Will Woods
7be79ceba2 Add mvfile() to sysutils
This adds mvfile(), which works basically like cpfile().
2011-05-26 18:14:10 -04:00
Will Woods
c4337815db treebuilder: use os.rename() for move(), make symlink clobber files 2011-05-26 16:49:39 -04:00
Will Woods
c1b3ed3c1f fix two typos in __init__ 2011-05-26 16:49:11 -04:00
Will Woods
87546a1f12 treebuilder typo fixup: Fatal->fatal 2011-05-26 14:11:03 -04:00
Will Woods
1d0155f3d2 __init__: fix get_buildarch to not pop() empty list 2011-05-26 14:09:46 -04:00
Will Woods
f13a5153e0 __init__: fix pkglists with --force 2011-05-26 14:09:23 -04:00
Will Woods
954af31c76 fixup rb.postinstall linktree for use with --force 2011-05-26 14:09:00 -04:00
Will Woods
17e5f9e19a Better tracebacks for LoraxTemplate 2011-05-26 14:08:01 -04:00
Will Woods
bf9ca1ddc7 treebuilder fixups: fix rb.postinstall(), inroot/root confusion 2011-05-26 13:35:28 -04:00
Will Woods
7feb3d4572 treebuilder fixups: correct args for parse() and RuntimeBuilder, add rb.yum 2011-05-26 13:07:30 -04:00
Will Woods
bbf3d23513 run() fix: inroot could exist if we're running with --force 2011-05-26 13:06:45 -04:00
Will Woods
eec6073ef0 move create_runtime into RuntimeBuilder 2011-05-18 13:53:54 -04:00
Will Woods
456492e0ee fixup: invoke RuntimeBuilder properly 2011-05-17 18:57:03 -04:00
Will Woods
398b3b0922 Remove module command from treebuilder and templates
Module whitelisting is silly. Let's blacklist the stuff we don't need.
2011-05-17 18:16:06 -04:00
Will Woods
e59e291725 LoraxYumHelper/installtree removal fixup: create self.inroot 2011-05-17 18:14:05 -04:00
Will Woods
d26c014279 RuntimeBuilder fixup 2011-05-17 15:29:23 -04:00
Will Woods
729511f06a Dracut hack for F15 image building in __init__
add lib/dracut/hooks/pre-pivot/99anaconda-umount.sh to unmount things
before starting anaconda (because loader explodes if /{dev,sys,proc}
are mounted when it starts)
2011-05-17 13:30:36 -04:00
Will Woods
905e05159d crazytime: replace installtree with runtimebuilder 2011-05-14 03:28:41 -04:00
Will Woods
46e18c3781 more treebuilder WIP 2011-05-14 03:27:25 -04:00
Will Woods
2293a7d569 treebuilder WIP: add commands for installtree 2011-05-13 23:58:46 -04:00
Will Woods
9be6dd2864 Revert "Add systemd and agetty to the installation environment."
Add setup_init() and setup_s390_init() to installtree.py to handle
init setup, and stop using systemd so we can make F15 images.

This reverts commit b58190d660.
2011-05-13 13:03:54 -04:00
Will Woods
3d1155f946 TODO updates 2011-05-12 17:32:44 -04:00
Will Woods
3faac26a93 treebuilder fixup: handle treeinfo_data as runner.results 2011-05-12 17:32:43 -04:00
Will Woods
7323749706 treebuilder fixup: pass template vars to runner 2011-05-12 17:32:43 -04:00
Will Woods
9b5ccc764b WIP: RuntimeBuilder 2011-05-12 17:32:43 -04:00
Will Woods
c4435b504a __init__ create_runtime fixup (correct paths) 2011-05-12 17:32:43 -04:00
Will Woods
1a9a83c393 img building fixup: show mksquashfs progress 2011-05-12 17:32:03 -04:00
Will Woods
72a3958a38 imgutils estimate_size fixups
count directories in estimate
msdos blocksize is 2048
round_to_blocksize rounds 0 -> blocksize
pass graft to estimate_size so we don't repeat overhead
2011-05-12 17:32:03 -04:00
Will Woods
8f45d48562 remove redundant treeinfo log message in __init__ 2011-05-12 17:32:03 -04:00
Will Woods
fa36b808d0 treebuilder fixup: remove unneeded log msg in runcmd 2011-05-12 17:32:03 -04:00
Will Woods
a66c877949 imgutils fixup: 512kb default overhead for vfat 2011-05-12 17:32:03 -04:00
Will Woods
fab2a091bc treebuilder fixup: fix argument order in replace() 2011-05-12 17:32:03 -04:00
Will Woods
f4107c632d treebuilder fixup: outroot, not outputdir 2011-05-12 17:32:03 -04:00
Will Woods
e77f142847 fix _glob and template glob() 2011-05-12 17:29:01 -04:00
Will Woods
b6a0b2351c fixup: make ArchData subclass of DataHolder 2011-05-12 17:29:01 -04:00
Will Woods
77f1ec738c treebuilder fix implantisomd5() 2011-05-12 17:29:01 -04:00
Will Woods
d4813816b7 treebuilder fixups: add _glob, use it in _exists, replace, install 2011-05-12 17:29:01 -04:00
Will Woods
d2203b348d fixup for hardlink() 2011-05-12 17:29:01 -04:00
Will Woods
4c91ef5f53 fixup: heh whoops, really fix replace 2011-05-12 17:29:01 -04:00
Will Woods
796659bb29 fixup for creating treeinfo from treebuilder 2011-05-12 17:29:01 -04:00
Will Woods
17c81d12d7 treebuilder fixups: fix replace, glob() for templates, etc.
"from glob import glob" instead of "import glob"
rename args to BaseBuilder.runtemplate
set up 'exists' and 'glob' in runtemplate rather than getdefaults
2011-05-12 17:29:01 -04:00
Will Woods
644e5f4b55 treeinfo fixup: fix treeinfo "instancemethod" error and hardlink() 2011-05-12 17:29:01 -04:00
Will Woods
9aa2e2c671 fixup: set templatedir for TreeBuilder in __init__ 2011-05-12 17:29:01 -04:00
Will Woods
411bea7d4e treebuilder fixup: use directories param for LoraxTemplate 2011-05-12 17:29:01 -04:00
Will Woods
a15c5ded9c Add "directories=[]" param to LoraxTemplate 2011-05-12 17:29:01 -04:00
Will Woods
10a91e5c85 fix runtemplate invocation of getdefaults() 2011-05-12 17:28:53 -04:00
Will Woods
96ce44708d fixup: correct argument signature for initrd_append 2011-05-12 17:28:53 -04:00
Will Woods
e7a89f6eeb __init__ cleanup: remove unneeded imports (subprocess, glob, math) 2011-05-12 17:28:53 -04:00
Will Woods
79f2a8e663 __init__ treebuilder fixup: yes, we need to backup installtree 2011-05-12 17:28:53 -04:00
Will Woods
b436479f97 Add linktree(src, dst) to sysutils 2011-05-12 17:28:53 -04:00
Will Woods
5e242925ec treebuilder fixup: update comments, import re 2011-05-12 17:28:53 -04:00
Will Woods
0a2df6bda9 fixup: instantiate TreeBuilder correctly 2011-05-12 17:28:53 -04:00
Will Woods
4cc05f995b fixup: import Treebuilder in __init__.py 2011-05-12 17:28:53 -04:00
Will Woods
cd684d2b3d fixup: add remove to sysutils.__all__ 2011-05-12 17:28:53 -04:00
Will Woods
1fe66c1d06 WIP: add TODO 2011-05-09 15:33:55 -04:00
Will Woods
bd1fd1e139 Create runtime using imgutils and merge it with initramfs 2011-05-09 15:33:55 -04:00
Will Woods
3d5a3edb67 Replace images with treebuilder 2011-05-09 15:33:55 -04:00
Will Woods
a5b7ac5e6e installtree: remove workdir and kernels
Since we want all the modules in the runtime image, there's no need
to deal with the individual kernels. And workdir was only being used
to mess with the modules, so we don't need that either.
2011-05-09 15:33:55 -04:00
Will Woods
756b44948e Remove workdir/path from BuildStamp, DiscInfo, TreeInfo
This allows us to create these objects without needing workdir,
which means we can use them outside of __init__.py.

We can also write them directly to their final destination
instead of writing them to the workdir and then copying them in.
2011-05-09 15:33:55 -04:00
Will Woods
9b9f021caf Move arch-specific logic out of installtree
Any decisions about arch-specific stuff should happen in the Lorax class
or the arch-specific templates/code. Move that logic up to Lorax.run()
and remove installtree.basearch.
2011-05-09 15:33:55 -04:00
Will Woods
051af505ae refactor: move big code chunks from Lorax.run to installtree
Move package removal code to installtree.remove_package and
the module install loop to installtree.install_kernel_modules.
2011-05-09 15:33:55 -04:00
Will Woods
a82da40015 Add "getdata" method to LoraxTemplate
getdata(cmd) will return a generator that yields every token on every
line that starts with the token "cmd". getdata(cmd, mode="lines") will
yield a list for each line rather than every individual token.

this simplifies some things in __init__.py.
2011-05-09 15:33:55 -04:00
Will Woods
b186317213 Make Lorax.arch and Lorax.product into objects
arch has three attributes: .buildarch, .basearch, and .libdir
product has six: .name, .version, .release, .variant, .bugurl, and
is_beta

This makes it easier to pass this data into functions/templates.
2011-05-09 15:33:54 -04:00
Will Woods
17c9c8bfaf Remove dead/commented code from __init__ and outputroot
Remove commented-out code, EFI-building code, some redundant comments,
and outputroot.
2011-05-09 15:33:54 -04:00
Will Woods
1350cd028f treebuilder.py: uses templates to create trees/images
TreeBuilder uses templates full of commands (like ramdisk.ltmpl) to
create the output tree and boot images. There are 4 arch-specific
templates, plus a bonus EFI template which can handle EFI image creation
for any arch that implements EFI.
2011-05-09 15:33:54 -04:00
Will Woods
b2b1c36167 imgutils.py: utilities for creating disk images
This contains simple functions for creating disk images:
  mkcpio, mksquashfs, mkdosimg, mkext4img, mkbtrfsimg

And the helper functions they use:
  truncate, loop_{attach,detach}, dm_{attach,detach},
  mount/umount, estimate_size, roundup, cpio_copytree
2011-05-09 10:49:09 -04:00
Will Woods
1e550f8227 Add remove() to sysutils
This adds the remove() function, which works a lot like rm -rf - if you
remove() a file, it uses os.unlink, and if you remove() a directory it
uses shutils.rmtree().
2011-05-09 10:29:00 -04:00
Martin Gracik
421e4c3a00 Allow compression type be specified in lorax.conf 2011-04-22 10:57:51 +02:00
Martin Gracik
79b6e5bfa1 Use xz and gzip commands instead of libraries
We're already using find and cpio subprocesses, so using
one more subprocess is not a problem. With this approach
we can pipe cpio to the xz/gzip command, which should
help with the memory issues.
2011-04-22 10:57:51 +02:00
Martin Gracik
19f60aebc8 use reqs not regs for files to backup (dgilmore) 2011-04-15 15:46:06 +02:00
Martin Gracik
713d6f94e7 getkeymaps resides in /usr/libexec/anaconda 2011-04-15 09:47:53 +02:00
Martin Gracik
4c25044020 workdir is a local variable, not a class attribute 2011-04-15 09:42:44 +02:00
Martin Gracik
06ac5762af Add sparcv9 to arch map 2011-04-13 16:14:32 +02:00
Martin Gracik
031e6bab10 Change the location of *.b files on sparc 2011-04-13 16:14:21 +02:00
Chris Lumens
706ac6a55c Add a /bin/login shim for use only in the installation environment. 2011-04-12 10:36:16 -04:00
Chris Lumens
b58190d660 Add systemd and agetty to the installation environment.
Also, set up anaconda.target to be the default systemd unit.
2011-04-12 10:36:04 -04:00