Compare commits
105 Commits
master
...
f17-branch
Author | SHA1 | Date | |
---|---|---|---|
|
86f71b337c | ||
|
fb65e9c1ea | ||
|
bbae64ea4f | ||
|
8fa2a31049 | ||
|
177c0b8047 | ||
|
69cda43b0c | ||
|
60644c7adc | ||
|
e7c3366745 | ||
|
b6b7646245 | ||
|
91ba75ea86 | ||
|
01edaa8fbd | ||
|
572bd2ee6f | ||
|
38342fedc1 | ||
|
7cb33d8c63 | ||
|
20cc7dc954 | ||
|
01f6f9f242 | ||
|
4b368aab87 | ||
|
db6b4a2a76 | ||
|
96a2cceb53 | ||
|
1bafc44de8 | ||
|
5caf9620c8 | ||
|
9ec086e0f6 | ||
|
90e2405647 | ||
|
e5258f57e3 | ||
|
2ed2e345b6 | ||
|
48b8f6fb50 | ||
|
e2d0ce403e | ||
|
ba016dc162 | ||
|
983d150c96 | ||
|
f43034828e | ||
|
de48c0fa45 | ||
|
45ee5bf23b | ||
|
93b0654d25 | ||
|
0053514cf0 | ||
|
cc93b338d5 | ||
|
48f3858423 | ||
|
4df59e77b2 | ||
|
d909789b95 | ||
|
db744fef93 | ||
|
4c2894684b | ||
|
7cd2104694 | ||
|
4ca853cae3 | ||
|
3859368b0e | ||
|
cf24dc01a8 | ||
|
9348023769 | ||
|
839017cda1 | ||
|
afa6fa41cc | ||
|
613822a228 | ||
|
cf1c3a8d66 | ||
|
23650163a6 | ||
|
488339235a | ||
|
c9438ac117 | ||
|
9c97371391 | ||
|
5bce2001d5 | ||
|
d7956e52a0 | ||
|
4ea8d3b402 | ||
|
0823441886 | ||
|
e686b67882 | ||
|
b389d87c8d | ||
|
73beff011f | ||
|
f7e8de8c66 | ||
|
309bbbb4da | ||
|
761f183714 | ||
|
58228ab5f7 | ||
|
00c0009e14 | ||
|
e8894b64fa | ||
|
a077587eb8 | ||
|
3a0b059577 | ||
|
b4ce329235 | ||
|
92a145dd18 | ||
|
084e0e032b | ||
|
7fa9bda94c | ||
|
4c2bc290e2 | ||
|
16d32f6d4f | ||
|
56a24dd698 | ||
|
04394ae2cd | ||
|
ec00ea7039 | ||
|
8c52cd751f | ||
|
54dd513ed8 | ||
|
c2c4762df2 | ||
|
97038f1ab2 | ||
|
a82acb9145 | ||
|
c4c2f09c0b | ||
|
e59ff3802f | ||
|
0e9d3e0c1c | ||
|
2879908cde | ||
|
04ac7e7e9e | ||
|
6cce4fd330 | ||
|
2e08d3706c | ||
|
ca5454d131 | ||
|
96870e96f8 | ||
|
e5cccf05c0 | ||
|
e0db7264a6 | ||
|
e580c2a8b0 | ||
|
a060705479 | ||
|
7853936a48 | ||
|
3f1a6762a5 | ||
|
7c2e04b848 | ||
|
053d35cc11 | ||
|
6ad642ff5d | ||
|
0cb07b75f9 | ||
|
e49ef2d8bf | ||
|
614a2af0fd | ||
|
6c6a8c15ad | ||
|
20eff8a77d |
@ -24,7 +24,7 @@ If you are using the lorax git repo you can run it like so:
|
||||
|
||||
sudo PATH=./src/sbin/:$PATH PYTHONPATH=./src/ ./src/sbin/livemedia-creator \
|
||||
--make-iso --iso=/extra/iso/Fedora-16-x86_64-netinst.iso \
|
||||
--ks=./docs/livemedia-example.ks --lorax-templates=./share/
|
||||
--ks=./docs/fedora-livemedia.ks --lorax-templates=./share/
|
||||
|
||||
If you want to watch the install you can pass '--vnc vnc' and use a vnc
|
||||
client to connect to localhost:0
|
||||
@ -35,8 +35,7 @@ to monitor the logs for fatal errors, but may not catch everything.
|
||||
|
||||
HOW IT WORKS
|
||||
------------
|
||||
The --make-* switches define the final output. Currently only --make-iso
|
||||
and --make-disk are working.
|
||||
The --make-* switches define the final output.
|
||||
|
||||
You then need to either pass --iso and --ks in order to create a disk image
|
||||
using virt-install, or --disk-image to use a disk image from a previous run
|
||||
@ -48,19 +47,19 @@ 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 passing
|
||||
--vnc vnc and 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.
|
||||
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 passing --vnc vnc and 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.
|
||||
|
||||
Once the disk image is created it copies the / partition into a formatted
|
||||
disk image which is then used as the input to lorax for creation of the
|
||||
final media.
|
||||
When creating an iso the disk image's / partition is copied into a formatted
|
||||
disk 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/
|
||||
or the directory specified by --lorax-templates
|
||||
@ -109,19 +108,19 @@ passwd -d root > /dev/null
|
||||
cat /dev/null > /dev/fstab
|
||||
|
||||
11. Don't delete initramfs files from /boot in %post
|
||||
12. Have grub-efi in the package list
|
||||
12. Have grub-efi, memtest86+ and syslinux in the package list
|
||||
|
||||
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 so:
|
||||
|
||||
--kernel-args="proxy=http://proxy.yourdomain.com:3128"
|
||||
--proxy=http://proxy.yourdomain.com:3128
|
||||
|
||||
You also need to use a specific mirror instead of mirrormanager so that the
|
||||
packages will get cached:
|
||||
packages will get cached, so your kickstart url would look like:
|
||||
|
||||
url --url="http://download.fedora.redhat.com/pub/fedora/linux/development/16/x86_64/os/"
|
||||
url --url="http://dl.fedoraproject.org/pub/fedora/linux/development/17/x86_64/os/"
|
||||
|
||||
You can also add an update repo, but don't name it updates. Add --proxy to
|
||||
it as well.
|
||||
@ -154,6 +153,53 @@ Example cmdline:
|
||||
sudo livemedia-creator --make-iso --no-virt --ks=./fedora-livemedia.ks
|
||||
|
||||
|
||||
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/fedora-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 we 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/virt-image.xml You can use a different template by
|
||||
passing --app-template <template path>
|
||||
|
||||
Documentation on the Mako template system can be found here:
|
||||
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
|
||||
|
||||
|
||||
DEBUGGING PROBLEMS
|
||||
------------------
|
||||
Cleaning up an aborted (ctrl-c) virt-install run (as root):
|
||||
@ -175,21 +221,6 @@ Cleaning up aborted --no-virt installs can sometimes be accomplished by running
|
||||
the anaconda-cleanup script.
|
||||
|
||||
|
||||
THE FUTURE
|
||||
----------
|
||||
The current release only supports creating live iso's. In the future
|
||||
I want it to be able to create ami images as well as appliance images.
|
||||
|
||||
It is also limited to x86 architectures because of it's use of virt-install.
|
||||
I hope to be able to support other arches by using Anaconda's image install
|
||||
feature instead of virt-install. This will require that livemedia-creator
|
||||
be running on the same release as is being created in order to avoid odd
|
||||
problems.
|
||||
|
||||
I would like to provide a set of alternate lorax template scripts to create
|
||||
other media.
|
||||
|
||||
|
||||
HACKING
|
||||
-------
|
||||
Development on this will take place as part of the lorax project, and on the
|
||||
|
119
docs/fedora-livemedia-ec2.ks
Normal file
119
docs/fedora-livemedia-ec2.ks
Normal file
@ -0,0 +1,119 @@
|
||||
# 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/17/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
|
||||
%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
|
||||
|
@ -3,7 +3,8 @@ sshpw --username=root --plaintext randOmStrinGhERE
|
||||
# Firewall configuration
|
||||
firewall --enabled --service=mdns
|
||||
# Use network installation
|
||||
url --url="http://download.fedora.redhat.com/pub/fedora/linux/releases/16/Everything/x86_64/os/"
|
||||
url --url="http://dl.fedoraproject.org/pub/fedora/linux/development/18/x86_64/os/"
|
||||
|
||||
# X Window System configuration information
|
||||
xconfig --startxonboot
|
||||
# Root password
|
||||
|
144
lorax.spec
144
lorax.spec
@ -1,14 +1,14 @@
|
||||
%define debug_package %{nil}
|
||||
|
||||
Name: lorax
|
||||
Version: 17.3
|
||||
Version: 17.27
|
||||
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.bz2
|
||||
Source0: https://fedorahosted.org/releases/l/o/%{name}/%{name}-%{version}.tar.gz
|
||||
|
||||
BuildRequires: python2-devel
|
||||
Requires: python-mako
|
||||
@ -21,7 +21,7 @@ Requires: findutils
|
||||
Requires: GConf2
|
||||
Requires: isomd5sum
|
||||
Requires: glibc
|
||||
Requires: util-linux-ng
|
||||
Requires: util-linux
|
||||
Requires: dosfstools
|
||||
Requires: hfsplus-tools
|
||||
Requires: genisoimage
|
||||
@ -30,6 +30,8 @@ Requires: gzip
|
||||
Requires: xz
|
||||
Requires: squashfs-tools >= 4.2
|
||||
Requires: e2fsprogs
|
||||
Requires: yum
|
||||
Requires: pykickstart
|
||||
|
||||
%ifarch %{ix86} x86_64
|
||||
Requires: syslinux >= 4.02-5
|
||||
@ -40,10 +42,13 @@ Requires: silo
|
||||
%endif
|
||||
|
||||
%ifarch ppc ppc64
|
||||
Requires: yaboot
|
||||
Requires: kernel-bootwrapper
|
||||
%endif
|
||||
|
||||
%ifarch s390 s390x
|
||||
Requires: openssh
|
||||
%endif
|
||||
|
||||
%description
|
||||
Lorax is a tool for creating the anaconda install images.
|
||||
|
||||
@ -75,6 +80,137 @@ make DESTDIR=$RPM_BUILD_ROOT install
|
||||
|
||||
|
||||
%changelog
|
||||
* Thu Sep 13 2012 Brian C. Lane <bcl@redhat.com> 17.27-1
|
||||
- Do not remove shared-mime-info (#825960)
|
||||
- livemedia-creator: add some error checking (bcl@redhat.com)
|
||||
|
||||
* Mon Jun 11 2012 Brian C. Lane <bcl@redhat.com> 17.26-1
|
||||
- livemedia-creator: Hook up arch option (bcl@redhat.com)
|
||||
- livemedia-creator: Add appliance creation (bcl@redhat.com)
|
||||
- livemedia-creator: handle failed mount for ami (bcl@redhat.com)
|
||||
- Add the ppc magic file (mgracik@redhat.com)
|
||||
- Install proper branding packages from repo (#813969) (mgracik@redhat.com)
|
||||
|
||||
* Fri May 18 2012 Martin Gracik <mgracik@redhat.com> 17.25-1
|
||||
- Use --mac for isohybrid only if doing macboot images (mgracik@redhat.com)
|
||||
|
||||
* Fri May 18 2012 Martin Gracik <mgracik@redhat.com> 17.24-1
|
||||
- Add --nomacboot option (mgracik@redhat.com)
|
||||
- linuxrc.s390 is dead in anaconda (dan@danny.cz)
|
||||
- livemedia-creator: check kickstart for display modes (#819660)
|
||||
(bcl@redhat.com)
|
||||
- livemedia-creator: Removed unused ImageMount class (bcl@redhat.com)
|
||||
- livemedia-creator: cleanup after a crash (bcl@redhat.com)
|
||||
- livemedia-creator: start using /var/tmp instead of /tmp (bcl@redhat.com)
|
||||
- livemedia-creator: make libvirt module optional (bcl@redhat.com)
|
||||
|
||||
* Thu May 10 2012 Martin Gracik <mgracik@redhat.com> 17.23-1
|
||||
- Use gz not bz2 for source (mgracik@redhat.com)
|
||||
|
||||
* Thu May 10 2012 Martin Gracik <mgracik@redhat.com> 17.22-1
|
||||
- Rebuild. (mgracik@redhat.com)
|
||||
|
||||
* Thu May 10 2012 Martin Gracik <mgracik@redhat.com> 17.21-1
|
||||
- new package built with tito
|
||||
|
||||
* Wed May 09 2012 Martin Gracik <mgracik@redhat.com> 17.19-1
|
||||
- Add nhn-nanum-fonts
|
||||
Resolves: rhbz#818127
|
||||
- add name field to .treeinfo its a concatination of family and version (dgilmore)
|
||||
- include the new cmsfs-fuse interface (dhorak)
|
||||
- Fix typo in help
|
||||
Resolves: rhbz#819476
|
||||
|
||||
* Wed May 09 2012 Daniel Mach <dmach@redhat.com> 17.18-2
|
||||
- Disable macboot.img on RHEL
|
||||
|
||||
* Tue May 08 2012 Brian C. Lane <bcl@redhat.com> 17.18-1
|
||||
- stop moving /run (#818918) (bcl)
|
||||
|
||||
* Thu May 03 2012 Brian C. Lane <bcl@redhat.com> 17.17-1
|
||||
- Added BCM4331 firmware (#817151) (mgracik)
|
||||
- mkefiboot: Add support for disk label files (mjg)
|
||||
- Include /usr/bin/ntfsinfo. (#816664) (dlehman)
|
||||
- Add /etc/sysctl.d/anaconda.conf, set kernel.printk=1 (#816022) (wwoods)
|
||||
|
||||
* Mon Apr 23 2012 Brian C. Lane <bcl@redhat.com> 17.16-1
|
||||
- add media check menu option (bcl)
|
||||
- remove unneeded dracut bootargs (bcl)
|
||||
- remove 'loadkeys' stub (#804306) (wwoods)
|
||||
|
||||
* Fri Apr 20 2012 Martin Gracik <mgracik@redhat.com> 17.15-1
|
||||
- Don't remove dosfstools (#806648)
|
||||
- Leave some of the grub2 utilities in the install image (#749323)
|
||||
- mkefiboot: Copy Mac bootloader, rather than linking it (mjg)
|
||||
- Remove workdir if it was created by lorax (#807964)
|
||||
- add gdisk to install image (#811083) (bcl)
|
||||
|
||||
* Wed Apr 11 2012 Martin Gracik <mgracik@redhat.com> 17.14-1
|
||||
- Don't use --allbut for xfsprogs cleanup (#804779)
|
||||
- Log all removed files
|
||||
- Add spice-vdagent to initrd (#804739)
|
||||
- Add ntfs-3g to initrd (#804302)
|
||||
- ntfs-3g now uses /usr/lib (#810039) (bcl)
|
||||
|
||||
* Wed Mar 28 2012 Brian C. Lane <bcl@redhat.com> 17.13-1
|
||||
- add iscsi-initiator-utils (#804522) (bcl)
|
||||
- use cache outside the installtree (bcl)
|
||||
|
||||
* Wed Mar 21 2012 Brian C. Lane <bcl@redhat.com> 17.12-1
|
||||
- mkefiboot: Make Apple boot images appear in the startup preferences (mjg)
|
||||
- add symlink from /mnt/install -> /run/install (wwoods)
|
||||
|
||||
* Fri Mar 16 2012 Brian C. Lane <bcl@redhat.com> 17.10-1
|
||||
- merge noloader patches
|
||||
- Don't trash all the initscripts 'fedora*' services (wwoods)
|
||||
- remove anaconda-copy-ks.sh (wwoods)
|
||||
- add anaconda dracut module (wwoods)
|
||||
- runtime-postinstall: remove references to loader (wwoods)
|
||||
- runtime-postinstall: remove keymap stuff (wwoods)
|
||||
- Add the icfg package (#771733) (mgracik)
|
||||
- Log the output of mkfs (#769928) (mgracik)
|
||||
- livemedia-creator: update TreeBuilder use for isolabel (bcl)
|
||||
|
||||
* Wed Mar 07 2012 Martin Gracik <mgracik@redhat.com> 17.9-1
|
||||
- Fix product name replacing in templates
|
||||
Resolves: rhbz#799919
|
||||
|
||||
* Tue Mar 06 2012 Brian C. Lane <bcl@redhat.com> 17.8-1
|
||||
- livemedia-creator: update README (bcl)
|
||||
- example livemedia kickstart for ec2 (bcl)
|
||||
- livemedia-creator: console=ttyS0 not /dev/ttyS0 (bcl)
|
||||
- livemedia-creator: Add support for making ami images (bcl)
|
||||
|
||||
* Tue Feb 28 2012 Martin Gracik <mgracik@redhat.com> 17.7-1
|
||||
- Don't remove btrfs utils (#796511)
|
||||
- Remove root and ip parameters from generic.prm (#796572)
|
||||
- Check if the volume id is not longer than 32 chars (#786832)
|
||||
- Add option to specify volume id on command line (#786834)
|
||||
- Install nhn-nanum-gothic-fonts (#790266)
|
||||
- Change the locale to C (#786833)
|
||||
- Don't use mk-s390-cdboot (dhorak)
|
||||
- use internal implementation of the addrsize utility
|
||||
- Make sure var/run is not a symlink on s390x (#787217)
|
||||
- Create var/run/dbus directory on s390x (#787217)
|
||||
- iputils is small and required by dhclient-script
|
||||
- missing version bump in specfile
|
||||
|
||||
* Mon Feb 20 2012 Brian C. Lane <bcl@redhat.com> 17.6-1
|
||||
- use --prefix=/run/initramfs when building initramfs (wwoods)
|
||||
- dhclient-script needs cut and arping (bcl)
|
||||
- Fix missing CalledProcessError import (bcl)
|
||||
|
||||
* Wed Feb 15 2012 Brian C. Lane <bcl@redhat.com> 17.5-1
|
||||
- metacity now depends on gsettings-desktop-schemas (bcl)
|
||||
- Add findiso to grub config (mjg)
|
||||
|
||||
* Mon Feb 13 2012 Brian C. Lane <bcl@redhat.com> 17.4-1
|
||||
- Change the squashfs image section in .treeinfo (mgracik)
|
||||
- Add path to squashfs image to the treeinfo (mgracik)
|
||||
- Add runtime basename variable to the template (mgracik)
|
||||
- add memtest to the boot.iso for x86 (#787234) (bcl)
|
||||
- Add dracut args to grub.conf (bcl)
|
||||
|
||||
* Wed Feb 08 2012 Brian C. Lane <bcl@redhat.com> 17.3-1
|
||||
- keep convertfs.sh script in image (#787893) (bcl)
|
||||
- Add dracut convertfs module (#787893) (bcl)
|
||||
|
3
rel-eng/packages/.readme
Normal file
3
rel-eng/packages/.readme
Normal file
@ -0,0 +1,3 @@
|
||||
the rel-eng/packages directory contains metadata files
|
||||
named after their packages. Each file has the latest tagged
|
||||
version and the project's relative directory.
|
1
rel-eng/packages/lorax
Normal file
1
rel-eng/packages/lorax
Normal file
@ -0,0 +1 @@
|
||||
17.27-1 /
|
5
rel-eng/tito.props
Normal file
5
rel-eng/tito.props
Normal file
@ -0,0 +1,5 @@
|
||||
[globalconfig]
|
||||
default_builder = tito.builder.Builder
|
||||
default_tagger = tito.tagger.VersionTagger
|
||||
changelog_do_not_remove_cherrypick = 0
|
||||
changelog_format = %s (%ae)
|
35
share/appliance/libvirt.tmpl
Normal file
35
share/appliance/libvirt.tmpl
Normal file
@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<image>
|
||||
<name>${name}</name>
|
||||
<domain>
|
||||
<boot type='hvm'>
|
||||
<guest>
|
||||
<arch>${arch}</arch>
|
||||
</guest>
|
||||
<os>
|
||||
<loader dev='hd'/>
|
||||
</os>
|
||||
%for disk, letter in zip(disks, xrange(97, 123)):
|
||||
<drive disk='${disk.name}' target='hd${chr(letter)}'/>
|
||||
%endfor
|
||||
</boot>
|
||||
<devices>
|
||||
<vcpu>${vcpus}</vcpu>
|
||||
<memory>${memory}</memory>
|
||||
%for net in networks:
|
||||
<interface/>
|
||||
%endfor
|
||||
<graphics/>
|
||||
</devices>
|
||||
</domain>
|
||||
<storage>
|
||||
%for disk in disks:
|
||||
<disk file='${disk.name}' use='system' format='${disk.format}'>
|
||||
%if disk.checksum:
|
||||
<checksum type='${disk.checksum_type}'>${disk.checksum}</checksum>
|
||||
%endif
|
||||
</disk>
|
||||
%endfor
|
||||
</storage>
|
||||
</image>
|
||||
|
1
share/config_files/common/sysctl.conf
Normal file
1
share/config_files/common/sysctl.conf
Normal file
@ -0,0 +1 @@
|
||||
kernel.printk=1
|
@ -4,5 +4,10 @@ splashimage=@SPLASHPATH@
|
||||
timeout 5
|
||||
hiddenmenu
|
||||
title @PRODUCT@ @VERSION@
|
||||
kernel @KERNELPATH@ @ROOT@
|
||||
findiso
|
||||
kernel @KERNELPATH@ @ROOT@ liveimg rd.luks=0 rd.md=0 rd.dm=0
|
||||
initrd @INITRDPATH@
|
||||
title Test this media & start @PRODUCT@
|
||||
findiso
|
||||
kernel @KERNELPATH@ @ROOT@ quiet liveimg rd.live.check rd.luks=0 rd.md=0 rd.dm=0
|
||||
initrd @INITRDPATH@
|
||||
|
@ -74,6 +74,10 @@ label vesa
|
||||
endtext
|
||||
kernel vmlinuz
|
||||
append initrd=initrd.img @ROOT@ xdriver=vesa nomodeset quiet liveimg rd.luks=0 rd.md=0 rd.dm=0
|
||||
label check
|
||||
menu label ^Test this media & start @PRODUCT@
|
||||
kernel vmlinuz
|
||||
append initrd=initrd.img @ROOT@ quiet liveimg rd.live.check rd.luks=0 rd.md=0 rd.dm=0
|
||||
label memtest
|
||||
menu label Run a ^memory test.
|
||||
text help
|
||||
|
81
share/config_files/ppc/magic
Normal file
81
share/config_files/ppc/magic
Normal 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
|
@ -6,4 +6,4 @@ image=/ppc/ppc@BITS@/vmlinuz
|
||||
label=linux
|
||||
initrd=/ppc/ppc@BITS@/initrd.img
|
||||
read-only
|
||||
append="@ROOT@ rd.luks=0 rd.md=0 rd.dm=0"
|
||||
append="@ROOT@"
|
||||
|
@ -1 +1 @@
|
||||
root=/dev/ram0 ro ip=off ramdisk_size=40000 cio_ignore=all,!0.0.0009
|
||||
ro ramdisk_size=40000 cio_ignore=all,!0.0.0009
|
||||
|
@ -6,13 +6,13 @@ message=/boot/boot.msg
|
||||
image[sun4u]=/boot/vmlinuz
|
||||
label=linux
|
||||
alias=install
|
||||
append="@ROOT@ rd.luks=0 rd.md=0 rd.dm=0"
|
||||
append="@ROOT@"
|
||||
initrd=/boot/initrd.img
|
||||
image[sun4u]=/boot/vmlinuz
|
||||
label=text
|
||||
append="@ROOT@ text rd.luks=0 rd.md=0 rd.dm=0"
|
||||
append="@ROOT@ text"
|
||||
initrd=/boot/initrd.img
|
||||
image[sun4u]=/boot/vmlinuz
|
||||
label=ks
|
||||
append="@ROOT@ ks rd.luks=0 rd.md=0 rd.dm=0"
|
||||
append="@ROOT@ ks"
|
||||
initrd=/boot/initrd.img
|
||||
|
@ -4,5 +4,10 @@ splashimage=@SPLASHPATH@
|
||||
timeout 5
|
||||
hiddenmenu
|
||||
title @PRODUCT@ @VERSION@
|
||||
findiso
|
||||
kernel @KERNELPATH@ @ROOT@
|
||||
initrd @INITRDPATH@
|
||||
title Test this media & start @PRODUCT@
|
||||
findiso
|
||||
kernel @KERNELPATH@ @ROOT@ quiet rd.live.check
|
||||
initrd @INITRDPATH@
|
||||
|
@ -60,7 +60,7 @@ label linux
|
||||
menu label ^Install or upgrade @PRODUCT@
|
||||
menu default
|
||||
kernel vmlinuz
|
||||
append initrd=initrd.img @ROOT@ quiet rd.luks=0 rd.md=0 rd.dm=0
|
||||
append initrd=initrd.img @ROOT@ quiet
|
||||
menu separator # insert an empty line
|
||||
# utilities submenu
|
||||
menu begin ^Troubleshooting
|
||||
@ -73,7 +73,11 @@ label vesa
|
||||
@PRODUCT@.
|
||||
endtext
|
||||
kernel vmlinuz
|
||||
append initrd=initrd.img @ROOT@ xdriver=vesa nomodeset quiet rd.luks=0 rd.md=0 rd.dm=0
|
||||
append initrd=initrd.img @ROOT@ xdriver=vesa nomodeset quiet
|
||||
label check
|
||||
menu label ^Test this media & start @PRODUCT@
|
||||
kernel vmlinuz
|
||||
append initrd=initrd.img @ROOT@ quiet rd.live.check
|
||||
label rescue
|
||||
menu indent count 5
|
||||
menu label ^Rescue a @PRODUCT@ system.
|
||||
|
@ -1,4 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Copy over kickstart files from the initrd to the sysroot before pivot
|
||||
cp /*cfg /*ks /sysroot/ 2> /dev/null
|
||||
|
@ -2,6 +2,7 @@
|
||||
<%
|
||||
EFIBOOTDIR="EFI/BOOT"
|
||||
APPLE_EFI_ICON=inroot+"/usr/share/pixmaps/bootloader/fedora.icns"
|
||||
APPLE_EFI_DISKNAME=inroot+"/usr/share/pixmaps/bootloader/fedora-media.vol"
|
||||
%>
|
||||
|
||||
mkdir ${EFIBOOTDIR}
|
||||
@ -10,7 +11,9 @@ install boot/grub/splash.xpm.gz ${EFIBOOTDIR}
|
||||
|
||||
## actually make the EFI images
|
||||
${make_efiboot("images/efiboot.img")}
|
||||
${make_efiboot("images/macboot.img", imgtype="apple")}
|
||||
%if domacboot:
|
||||
${make_efiboot("images/macboot.img", imgtype="apple")}
|
||||
%endif
|
||||
|
||||
## This is kinda gross, but then... so's EFI.
|
||||
<%def name="make_efiboot(img, include_kernel=False, disk=False, imgtype='default')">
|
||||
@ -19,14 +22,14 @@ ${make_efiboot("images/macboot.img", imgtype="apple")}
|
||||
eficonf = "%s/BOOT%s.conf" % (EFIBOOTDIR, efiarch)
|
||||
args = "--label=ANACONDA"
|
||||
if disk: args += " --disk"
|
||||
if imgtype == "apple": args += " --apple --icon=%s" % APPLE_EFI_ICON
|
||||
if imgtype == "apple": args += ' --apple --icon=%s --diskname=%s --product="%s %s"' % (APPLE_EFI_ICON, APPLE_EFI_DISKNAME, product.name, product.version)
|
||||
%>
|
||||
%if include_kernel:
|
||||
copy ${KERNELDIR}/vmlinuz ${EFIBOOTDIR}
|
||||
copy ${KERNELDIR}/initrd.img ${EFIBOOTDIR}
|
||||
%endif
|
||||
install ${configdir}/grub.conf ${eficonf}
|
||||
replace @PRODUCT@ ${product.name} ${eficonf}
|
||||
replace @PRODUCT@ '${product.name}' ${eficonf}
|
||||
replace @VERSION@ ${product.version} ${eficonf}
|
||||
replace @KERNELPATH@ /${kdir}/vmlinuz ${eficonf}
|
||||
replace @INITRDPATH@ /${kdir}/initrd.img ${eficonf}
|
||||
|
@ -23,6 +23,7 @@ rootarg = "root=live:CDLABEL=%s" % isolabel
|
||||
|
||||
mkdir ${LIVEDIR}
|
||||
install ${runtime_img} ${LIVEDIR}/squashfs.img
|
||||
treeinfo stage2 mainimage ${LIVEDIR}/squashfs.img
|
||||
|
||||
## install bootloaders.
|
||||
## NOTE: there's two different bootloader setups here:
|
||||
@ -63,7 +64,7 @@ install ${configdir}/ofboot.b ${MACDIR}
|
||||
## 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 @PRODUCT@ '${product.name}' ${KERNELDIR}/yaboot.conf
|
||||
replace @VERSION@ ${product.version} ${KERNELDIR}/yaboot.conf
|
||||
replace @ROOT@ "${rootarg}" ${KERNELDIR}/yaboot.conf
|
||||
|
||||
|
@ -21,7 +21,7 @@ removepkg plymouth*
|
||||
removefrom ${product.name}-logos /usr/share/plymouth/*
|
||||
## 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
|
||||
removepkg dracut-network grubby anaconda-dracut
|
||||
## In order to execute the /usr move on upgrades we need convertfs from dracut
|
||||
removefrom dracut --allbut /usr/lib/dracut/modules.d/30convertfs/convertfs.sh
|
||||
## we don't run SELinux (not in enforcing, anyway)
|
||||
@ -54,12 +54,12 @@ removepkg libasyncns libdaemon libevent libhbaapi libhbalinux
|
||||
removepkg libmcpp libpcap libtiff libutempter linux-atm-libs
|
||||
removepkg lvm2-libs m4 mailx makebootfat mcpp
|
||||
removepkg mingetty mobile-broadband-provider-info pkgconfig ppp pth
|
||||
removepkg rmt rpcbind shared-mime-info squashfs-tools system-config-firewall-base
|
||||
removepkg rmt rpcbind squashfs-tools system-config-firewall-base
|
||||
removepkg tigervnc-license ttmkfdir xml-common xorg-x11-font-utils
|
||||
removepkg xorg-x11-server-common yum-utils
|
||||
|
||||
## other removals
|
||||
remove /boot /home /media /mnt /opt /srv /tmp/*
|
||||
remove /boot /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
|
||||
@ -137,13 +137,13 @@ 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 bitmap-fangsongti-fonts /usr/share/fonts/*
|
||||
removefrom btrfs-progs /sbin/btrfs /sbin/btrfs-* /sbin/btrfstune
|
||||
removefrom btrfs-progs /sbin/btrfs-* /sbin/btrfstune
|
||||
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 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 /usr/bin/cut
|
||||
removefrom coreutils /usr/bin/cksum /usr/bin/comm /usr/bin/csplit
|
||||
removefrom coreutils /usr/bin/dir /usr/bin/dircolors /usr/bin/dirname
|
||||
removefrom coreutils /usr/bin/expand /usr/bin/factor /usr/bin/fmt
|
||||
removefrom coreutils /usr/bin/fold /usr/bin/groups /usr/bin/hostid /usr/bin/id
|
||||
@ -172,7 +172,6 @@ removefrom dejavu-sans-mono-fonts --allbut *.conf */DejaVuSansMono.ttf
|
||||
removefrom device-mapper-multipath /etc/* /sbin/mpathconf /sbin/multipathd
|
||||
removefrom dhclient /usr/lib/* /usr/share/*
|
||||
removefrom dnsmasq /etc/rc.d/* /usr/sbin/*
|
||||
removefrom dosfstools /sbin/dosfsck /sbin/fsck.*
|
||||
removefrom dump /etc/*
|
||||
removefrom e2fsprogs /usr/sbin/* /usr/share/locale/*
|
||||
removefrom elfutils-libelf /usr/share/locale/*
|
||||
@ -188,6 +187,7 @@ removefrom firstboot /lib/systemd/* /usr/sbin/* /usr/share/firstboot/*
|
||||
removefrom firstboot /usr/share/locale/*
|
||||
removefrom fontconfig /usr/bin/*
|
||||
removefrom gawk /usr/bin/{igawk,pgawk} /usr/libexec/* /usr/share/*
|
||||
removefrom gdisk /usr/share/*
|
||||
removefrom gdk-pixbuf2 /usr/share/locale*
|
||||
removefrom gfs2-utils /usr/sbin/*
|
||||
removefrom glib2 /etc/* /usr/bin/* /usr/share/locale/*
|
||||
@ -213,7 +213,7 @@ removefrom gnome-python2-gconf /usr/share/pygtk/*
|
||||
removefrom gnutls /usr/share/locale/*
|
||||
removefrom gpgme /usr/${libdir}/libgpgme-*
|
||||
removefrom grep /etc/* /usr/share/locale/*
|
||||
removefrom grub2 /sbin/* /usr/bin/*
|
||||
removefrom grub2 /sbin/grub2-bios-setup /sbin/grub2-sparc64-setup /usr/bin/*
|
||||
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
|
||||
@ -225,8 +225,6 @@ removefrom hwdata /etc/* /usr/share/hwdata/oui.txt /usr/share/hwdata/pnp.ids
|
||||
removefrom hwdata /usr/share/hwdata/upgradelist
|
||||
removefrom initscripts /etc/ppp/* /usr/sbin/* /usr/share/locale/*
|
||||
removefrom iproute /etc/* /sbin/cbq /sbin/ifcfg /sbin/rtmon /sbin/tc /usr/*
|
||||
removefrom iputils /etc/* /usr/bin/ping6 /usr/bin/tracepath* /usr/sbin/ifenslave
|
||||
removefrom iputils /usr/sbin/*
|
||||
removefrom iscsi-initiator-utils /etc/rc.d/*
|
||||
removefrom jfsutils /sbin/jfs_fsck /sbin/jfs_fscklog /sbin/jfs_logdump
|
||||
removefrom jfsutils /sbin/jfs_mkfs
|
||||
@ -295,9 +293,10 @@ removefrom nfs-utils /usr/sbin/rpc.svcgssd /usr/sbin/rpcdebug
|
||||
removefrom nfs-utils /usr/sbin/showmount /usr/sbin/sm-notify
|
||||
removefrom nfs-utils /usr/sbin/start-statd /var/lib/nfs/etab
|
||||
removefrom nfs-utils /var/lib/nfs/rmtab /var/lib/nfs/state /var/lib/nfs/xtab
|
||||
removefrom nhn-nanum-gothic-fonts /usr/share/fonts/nhn-nanum/NanumGothic*Bold.ttf
|
||||
removefrom nss-softokn /usr/${libdir}/nss/*
|
||||
removefrom ntfs-3g --allbut /usr/sbin/mount.ntfs* /${libdir}/*
|
||||
removefrom ntfsprogs --allbut /usr/sbin/ntfsresize
|
||||
removefrom ntfs-3g --allbut /usr/sbin/mount.ntfs* /usr/${libdir}/*
|
||||
removefrom ntfsprogs --allbut /usr/sbin/ntfsresize /usr/bin/ntfsinfo
|
||||
removefrom openldap /etc/openldap/* /usr/${libdir}/libldap_r-*
|
||||
removefrom openssh /etc/ssh/* /usr/libexec/*
|
||||
removefrom openssh-clients /etc/ssh/* /usr/bin/slogin /usr/bin/ssh-*
|
||||
@ -336,7 +335,6 @@ removefrom system-config-date /etc/* /usr/bin/* /usr/share/icons/*
|
||||
removefrom system-config-keyboard /etc/* /usr/bin/* /usr/share/icons/*
|
||||
removefrom sysvinit-tools /usr/bin/*
|
||||
removefrom tar /usr/share/locale/*
|
||||
removefrom un-core-dotum-fonts /usr/share/fonts/un-core/UnDotumBold.ttf
|
||||
removefrom usbutils /usr/bin/*
|
||||
removefrom util-linux --allbut \
|
||||
/usr/bin/{dmesg,kill,login,lsblk,more,mount,umount,mountpoint} \
|
||||
@ -346,7 +344,8 @@ removefrom util-linux --allbut \
|
||||
/usr/bin/logger
|
||||
removefrom volume_key-libs /usr/share/locale/*
|
||||
removefrom wget /etc/* /usr/share/locale/*
|
||||
removefrom xfsprogs --allbut /usr/sbin/{fsck.xfs,mkfs.xfs,xfs_repair} /usr/sbin/xfs_{admin,check,copy,db}
|
||||
removefrom xfsprogs /usr/sbin/xfs_{bmap,estimate,freeze,fsr,growfs,info,io,logprint,mdrestore,metadump,mkfile,ncheck,quota,rtcp}
|
||||
removefrom xfsprogs /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*
|
||||
|
@ -5,6 +5,7 @@
|
||||
installpkg anaconda anaconda-widgets
|
||||
## anaconda deps that aren't in the RPM
|
||||
installpkg firstboot
|
||||
installpkg iscsi-initiator-utils
|
||||
|
||||
## firstaidkit (rescue mode) packages
|
||||
installpkg firstaidkit-plugin-{passwd,key-recovery,mdadm-conf}
|
||||
@ -13,6 +14,7 @@ installpkg firstaidkit-plugin-{passwd,key-recovery,mdadm-conf}
|
||||
installpkg kernel
|
||||
%if basearch != "s390x":
|
||||
installpkg *-firmware
|
||||
installpkg b43-openfwwf
|
||||
%endif
|
||||
|
||||
## arch-specific packages (bootloaders etc.)
|
||||
@ -26,17 +28,19 @@ installpkg kernel
|
||||
installpkg yaboot fbset hfsutils kernel-bootwrapper ppc64-utils
|
||||
%endif
|
||||
%if basearch == "s390x":
|
||||
installpkg lsscsi modutils mount s390utils-base s390utils-cmsfs
|
||||
installpkg lsscsi modutils mount s390utils-base s390utils-cmsfs-fuse
|
||||
%endif
|
||||
%if basearch == "sparc":
|
||||
installpkg silo tilo
|
||||
%endif
|
||||
|
||||
## extra dracut modules
|
||||
installpkg dracut-network
|
||||
installpkg dracut-network anaconda-dracut
|
||||
|
||||
## required for dracut
|
||||
installpkg kbd kbd-misc
|
||||
## required for anaconda-dracut (img-lib etc.)
|
||||
installpkg tar xz dmidecode curl
|
||||
|
||||
## basic system stuff
|
||||
installpkg systemd-sysv systemd-units
|
||||
@ -45,7 +49,7 @@ installpkg rsyslog
|
||||
## xorg/GUI packages
|
||||
installpkg xorg-x11-drivers xorg-x11-server-Xorg
|
||||
installpkg xorg-x11-server-utils xorg-x11-xauth
|
||||
installpkg dbus-x11 metacity
|
||||
installpkg dbus-x11 metacity gsettings-desktop-schemas
|
||||
installpkg NetworkManager-gnome
|
||||
installpkg at-spi at-spi2-atk pyatspi
|
||||
installpkg gnome-python2-gconf
|
||||
@ -56,7 +60,7 @@ installpkg gnome-keyring
|
||||
installpkg python-imaging
|
||||
|
||||
## filesystem tools
|
||||
installpkg btrfs-progs jfsutils xfsprogs reiserfs-utils gfs2-utils ntfsprogs
|
||||
installpkg btrfs-progs jfsutils xfsprogs reiserfs-utils gfs2-utils ntfs-3g ntfsprogs
|
||||
installpkg python-volume_key volume_key
|
||||
|
||||
## SELinux support
|
||||
@ -82,8 +86,8 @@ installpkg kacst-qurn-fonts
|
||||
installpkg lklug-fonts
|
||||
installpkg lohit-*-fonts
|
||||
installpkg madan-fonts
|
||||
installpkg nhn-nanum-gothic-fonts
|
||||
installpkg smc-meera-fonts
|
||||
installpkg un-core-dotum-fonts
|
||||
installpkg vlgothic-fonts
|
||||
installpkg wqy-microhei-fonts
|
||||
installpkg xorg-x11-fonts-ethiopic xorg-x11-fonts-misc
|
||||
@ -91,8 +95,6 @@ installpkg gnome-themes-standard gnome-icon-theme-legacy
|
||||
|
||||
## branding & logos
|
||||
installpkg fedora-gnome-theme fedora-icon-theme
|
||||
installpkg ${product.name}-logos
|
||||
installpkg ${product.name}-release
|
||||
|
||||
## debugging/bug reporting tools
|
||||
installpkg gdb-gdbserver
|
||||
@ -103,6 +105,8 @@ 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 rdate
|
||||
installpkg icfg spice-vdagent
|
||||
installpkg gdisk
|
||||
|
||||
## actually install all the requested packages
|
||||
run_pkg_transaction
|
||||
|
@ -3,23 +3,11 @@
|
||||
|
||||
<%page args="root, basearch, libdir, configdir"/>
|
||||
<%
|
||||
# TODO: make systemd handle the keymaps and drop this from lorax/anaconda
|
||||
filearch = 'ppc' if basearch == 'ppc64' else basearch
|
||||
KEYMAP_OVERRIDE = "usr/share/anaconda/keymaps-override-%s" % filearch
|
||||
PYTHONDIR = glob("usr/"+libdir+"/python?.?")[0]
|
||||
stubs = ("list-harddrives", "loadkeys", "raidstart", "raidstop")
|
||||
stubs = ("list-harddrives", "raidstart", "raidstop")
|
||||
configdir = configdir + "/common"
|
||||
%>
|
||||
|
||||
## create_keymaps()
|
||||
%if basearch not in ("s390", "s390x"):
|
||||
%if exists(KEYMAP_OVERRIDE):
|
||||
move ${KEYMAP_OVERRIDE} etc/keymaps.gz
|
||||
%else:
|
||||
runcmd ${root}/usr/libexec/anaconda/getkeymaps ${basearch} ${root}/etc/keymaps.gz ${root}
|
||||
%endif
|
||||
%endif
|
||||
|
||||
## move_stubs()
|
||||
move usr/share/anaconda/restart-anaconda usr/bin
|
||||
move ${PYTHONDIR}/site-packages/pyanaconda/sitecustomize.py ${PYTHONDIR}/site-packages
|
||||
@ -34,7 +22,7 @@ move etc/yum.repos.d etc/anaconda.repos.d
|
||||
remove etc/systemd/system/default.target
|
||||
remove etc/systemd/system/default.target.wants/*
|
||||
symlink /lib/systemd/system/anaconda.target etc/systemd/system/default.target
|
||||
## remove unwanted systemd services
|
||||
## remove/disable unwanted systemd services
|
||||
removefrom systemd-units /lib/systemd/system/kexec*
|
||||
removefrom systemd-units /lib/systemd/system/local-fs.target.wants/media.mount
|
||||
removefrom systemd-units /lib/systemd/system/media.mount
|
||||
@ -42,11 +30,9 @@ removefrom systemd-units /lib/systemd/system/*plymouth*
|
||||
removefrom systemd-units /lib/systemd/system/quota*.service
|
||||
removefrom systemd-units /lib/systemd/system/systemd-remount-api-vfs.service
|
||||
removefrom ConsoleKit /lib/systemd/system/*
|
||||
removefrom initscripts /lib/systemd/system/fedora* /lib/systemd/fedora*
|
||||
removefrom initscripts /lib/systemd/system/local-fs.target.wants/fedora-storage* /lib/systemd/system/basic.target.wants/*
|
||||
removefrom lvm2 /lib/systemd/system/*
|
||||
removefrom mdadm /lib/systemd/system/*
|
||||
## finally, make /init -> /sbin/init symlink
|
||||
symlink /sbin/init init
|
||||
|
||||
## install some basic configuration files
|
||||
append etc/resolv.conf ""
|
||||
@ -56,6 +42,7 @@ install ${configdir}/rsyslog.conf etc
|
||||
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
|
||||
@ -67,15 +54,13 @@ install ${configdir}/pam.sshd etc/pam.d/login
|
||||
install ${configdir}/pam.sshd etc/pam.d/remote
|
||||
|
||||
## set up "install" user account
|
||||
append etc/passwd "install:x:0:0:root:/root:/sbin/loader"
|
||||
append etc/passwd "install:x:0:0:root:/root:/sbin/anaconda"
|
||||
append etc/shadow "install::14438:0:99999:7:::"
|
||||
## remove root password
|
||||
replace "root:\*:" "root::" etc/shadow
|
||||
|
||||
## s390-specific setup
|
||||
%if basearch in ("s390", "s390x"):
|
||||
remove sbin/init
|
||||
move usr/share/anaconda/linuxrc.s390 sbin/init
|
||||
## generate ssh keys
|
||||
runcmd ssh-keygen -q -C "" -N "" -t rsa1 -f ${root}/etc/ssh/ssh_host_key
|
||||
runcmd ssh-keygen -q -C "" -N "" -t rsa -f ${root}/etc/ssh/ssh_host_rsa_key
|
||||
@ -98,14 +83,12 @@ gconfset /apps/metacity/global_keybindings/switch_to_workspace_right string disa
|
||||
gconfset /desktop/gnome/interface/accessibility bool true
|
||||
gconfset /desktop/gnome/interface/at-spi-corba bool true
|
||||
|
||||
## get_anaconda_portions()
|
||||
move usr/${libdir}/anaconda/loader sbin
|
||||
move usr/share/anaconda/loader.tr etc
|
||||
move usr/libexec/anaconda/auditd sbin
|
||||
|
||||
## for compatibility with Ancient Anaconda Traditions
|
||||
symlink lib/modules /modules
|
||||
symlink lib/firmware /firmware
|
||||
symlink ../run/install mnt/install
|
||||
|
||||
## create_depmod_conf()
|
||||
append etc/depmod.d/dd.conf "search updates built-in"
|
||||
|
@ -1,16 +1,16 @@
|
||||
<%page args="kernels, runtime_img, basearch, outroot"/>
|
||||
<%page args="kernels, runtime_img, runtime_base, basearch, outroot"/>
|
||||
<%
|
||||
configdir="tmp/config_files/s390"
|
||||
BOOTDIR="images"
|
||||
KERNELDIR=BOOTDIR
|
||||
INITRD_ADDRESS="0x02000000"
|
||||
MKCDBOOT="usr/libexec/anaconda/mk-s390-cdboot"
|
||||
# The assumption seems to be that there is only one s390 kernel, ever
|
||||
kernel = kernels[0]
|
||||
%>
|
||||
|
||||
mkdir images
|
||||
install ${runtime_img} images
|
||||
treeinfo stage2 mainimage images/${runtime_base}
|
||||
|
||||
## install bootloader (such as it is) and bootloader config
|
||||
install ${configdir}/redhat.exec ${BOOTDIR}
|
||||
@ -25,16 +25,9 @@ installkernel images-${basearch} ${kernel.path} ${KERNELDIR}/kernel.img
|
||||
installinitrd images-${basearch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img
|
||||
|
||||
## s390 needs some extra boot config
|
||||
runcmd usr/libexec/anaconda/addrsize ${INITRD_ADDRESS} ${KERNELDIR}/initrd.img ${outroot}/${BOOTDIR}/initrd_addrsize
|
||||
createaddrsize ${INITRD_ADDRESS} ${outroot}/${BOOTDIR}/initrd.img ${outroot}/${BOOTDIR}/initrd.addrsize
|
||||
|
||||
## s390 also has some special treeinfo data
|
||||
treeinfo images-${basearch} initrd.addrsize ${BOOTDIR}/initrd_addrsize
|
||||
treeinfo images-${basearch} initrd.addrsize ${BOOTDIR}/initrd.addrsize
|
||||
treeinfo images-${basearch} generic.prm ${BOOTDIR}/generic.prm
|
||||
treeinfo images-${basearch} generic.ins generic.ins
|
||||
|
||||
## make cdboot.img
|
||||
runcmd ${MKCDBOOT} \
|
||||
-i ${outroot}/${kernel.path} \
|
||||
-r ${outroot}/${kernel.initrd.path} \
|
||||
-p ${outroot}/${BOOTDIR}/generic.prm \
|
||||
-o ${outroot}/${BOOTDIR}/cdboot.img
|
||||
|
@ -7,6 +7,7 @@ LIVEDIR="LiveOS"
|
||||
|
||||
mkdir ${LIVEDIR}
|
||||
install ${runtime_img} ${LIVEDIR}/squashfs.img
|
||||
treeinfo stage2 mainimage ${LIVEDIR}/squashfs.img
|
||||
|
||||
## install bootloader and config files
|
||||
install boot/*.b ${BOOTDIR}
|
||||
@ -15,7 +16,7 @@ install ${configdir}/boot.msg ${BOOTDIR}
|
||||
|
||||
## configure bootloader
|
||||
replace @VERSION@ ${product.version} ${BOOTDIR}/boot.msg
|
||||
replace @PRODUCT@ ${product.name} ${BOOTDIR}/boot.msg
|
||||
replace @PRODUCT@ '${product.name}' ${BOOTDIR}/boot.msg
|
||||
replace @ROOT@ 'root=live:CDLABEL=${isolabel|udev}' ${BOOTDIR}/silo.conf
|
||||
|
||||
## install kernels
|
||||
|
@ -10,6 +10,7 @@ LIVEDIR="LiveOS"
|
||||
|
||||
mkdir ${LIVEDIR}
|
||||
install ${runtime_img} ${LIVEDIR}/squashfs.img
|
||||
treeinfo stage2 mainimage ${LIVEDIR}/squashfs.img
|
||||
|
||||
## install bootloader and config files
|
||||
mkdir ${BOOTDIR}
|
||||
@ -19,10 +20,11 @@ install ${configdir}/isolinux.cfg ${BOOTDIR}
|
||||
install ${configdir}/boot.msg ${BOOTDIR}
|
||||
install ${configdir}/grub.conf ${BOOTDIR}
|
||||
install usr/share/anaconda/boot/syslinux-splash.png ${BOOTDIR}/splash.png
|
||||
install boot/memtest* ${BOOTDIR}/memtest
|
||||
|
||||
## configure bootloader
|
||||
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 @PRODUCT@ '${product.name}' ${BOOTDIR}/grub.conf ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg
|
||||
replace @ROOT@ 'root=live:CDLABEL=${isolabel|udev}' ${BOOTDIR}/isolinux.cfg
|
||||
|
||||
## install kernels
|
||||
@ -51,10 +53,13 @@ hardlink ${KERNELDIR}/initrd.img ${BOOTDIR}
|
||||
<%
|
||||
efiarch = 'X64' if basearch=='x86_64' else 'IA32'
|
||||
efigraft="EFI/BOOT={0}/EFI/BOOT".format(outroot)
|
||||
for img in ("images/efiboot.img", "images/macboot.img"):
|
||||
images = ["images/efiboot.img"]
|
||||
if domacboot:
|
||||
images.append("images/macboot.img")
|
||||
for img in images:
|
||||
efiargs += " -eltorito-alt-boot -e {0} -no-emul-boot".format(img)
|
||||
efigraft += " {0}={1}/{0}".format(img,outroot)
|
||||
efihybrid="--uefi --mac"
|
||||
efihybrid = "--uefi --mac" if domacboot else "--uefi"
|
||||
%>
|
||||
<%include file="efi.tmpl" args="configdir=configdir, KERNELDIR=KERNELDIR, efiarch=efiarch"/>
|
||||
%endif
|
||||
|
@ -34,6 +34,7 @@ import sys
|
||||
import os
|
||||
import ConfigParser
|
||||
import tempfile
|
||||
import locale
|
||||
|
||||
from base import BaseLoraxClass, DataHolder
|
||||
import output
|
||||
@ -67,6 +68,9 @@ class Lorax(BaseLoraxClass):
|
||||
BaseLoraxClass.__init__(self)
|
||||
self._configured = False
|
||||
|
||||
# set locale to C
|
||||
locale.setlocale(locale.LC_ALL, 'C')
|
||||
|
||||
def configure(self, conf_file="/etc/lorax/lorax.conf"):
|
||||
self.conf = ConfigParser.SafeConfigParser()
|
||||
|
||||
@ -125,7 +129,8 @@ class Lorax(BaseLoraxClass):
|
||||
logger.addHandler(fh)
|
||||
|
||||
def run(self, ybo, product, version, release, variant="", bugurl="",
|
||||
isfinal=False, workdir=None, outputdir=None, buildarch=None):
|
||||
isfinal=False, workdir=None, outputdir=None, buildarch=None, volid=None,
|
||||
domacboot=True, remove_temp=False):
|
||||
|
||||
assert self._configured
|
||||
|
||||
@ -135,7 +140,7 @@ class Lorax(BaseLoraxClass):
|
||||
os.makedirs(self.workdir)
|
||||
|
||||
# set up log directory
|
||||
logdir = joinpaths(self.workdir, "log")
|
||||
logdir = '/var/log/lorax'
|
||||
if not os.path.isdir(logdir):
|
||||
os.makedirs(logdir)
|
||||
|
||||
@ -177,6 +182,15 @@ class Lorax(BaseLoraxClass):
|
||||
self.product = product
|
||||
logger.debug("product data: %s" % product)
|
||||
|
||||
# NOTE: if you change isolabel, you need to change pungi to match, or
|
||||
# the pungi images won't boot.
|
||||
isolabel = volid or "{0.name} {0.version} {1.basearch}".format(self.product,
|
||||
self.arch)
|
||||
|
||||
if len(isolabel) > 32:
|
||||
logger.fatal("the volume id cannot be longer than 32 characters")
|
||||
sys.exit(1)
|
||||
|
||||
templatedir = self.conf.get("lorax", "sharedir")
|
||||
# NOTE: rb.root = ybo.conf.installroot (== self.inroot)
|
||||
rb = RuntimeBuilder(product=self.product, arch=self.arch,
|
||||
@ -231,10 +245,12 @@ class Lorax(BaseLoraxClass):
|
||||
logger.info("preparing to build output tree and boot images")
|
||||
treebuilder = TreeBuilder(product=self.product, arch=self.arch,
|
||||
inroot=installroot, outroot=self.outputdir,
|
||||
runtime=runtime, templatedir=templatedir)
|
||||
runtime=runtime, isolabel=isolabel,
|
||||
domacboot=domacboot, templatedir=templatedir)
|
||||
|
||||
logger.info("rebuilding initramfs images")
|
||||
dracut_args=["--xz", "--add", "livenet", "--add", "convertfs", "--omit", "plymouth"]
|
||||
dracut_args=["--xz", "--add", "anaconda", "--omit", "plymouth",
|
||||
"--install", "/.buildstamp"]
|
||||
treebuilder.rebuild_initrds(add_args=dracut_args)
|
||||
|
||||
logger.info("populating output tree and building boot images")
|
||||
@ -247,6 +263,11 @@ class Lorax(BaseLoraxClass):
|
||||
treeinfo.add_section(section, data)
|
||||
treeinfo.write(joinpaths(self.outputdir, ".treeinfo"))
|
||||
|
||||
# cleanup
|
||||
if remove_temp:
|
||||
remove(self.workdir)
|
||||
|
||||
|
||||
def get_buildarch(ybo):
|
||||
# get architecture of the available anaconda package
|
||||
buildarch = None
|
||||
|
@ -24,6 +24,7 @@ import os, tempfile
|
||||
from os.path import join, dirname
|
||||
from pylorax.sysutils import cpfile
|
||||
from subprocess import *
|
||||
import sys
|
||||
import traceback
|
||||
|
||||
######## Functions for making container images (cpio, squashfs) ##########
|
||||
@ -71,6 +72,16 @@ def loop_detach(loopdev):
|
||||
'''Detach the given loop device. Return False on failure.'''
|
||||
return (call(["losetup", "--detach", loopdev]) == 0)
|
||||
|
||||
def get_loop_name(path):
|
||||
'''Return the loop device associated with the path.
|
||||
Raises RuntimeError if more than one loop is associated'''
|
||||
buf = check_output(["losetup", "-j", path], stderr=PIPE)
|
||||
if len(buf.splitlines()) > 1:
|
||||
# there should never be more than one loop device listed
|
||||
raise RuntimeError("multiple loops associated with %s" % path)
|
||||
name = os.path.basename(buf.split(":")[0])
|
||||
return name
|
||||
|
||||
def dm_attach(dev, size, name=None):
|
||||
'''Attach a devicemapper device to the given device, with the given size.
|
||||
If name is None, a random name will be chosen. Returns the device name.
|
||||
@ -146,6 +157,8 @@ def estimate_size(rootdir, graft={}, fstype=None, blocksize=4096, overhead=128):
|
||||
getsize = lambda f: os.lstat(f).st_size
|
||||
if fstype == "btrfs":
|
||||
overhead = 64*1024 # don't worry, it's all sparse
|
||||
if fstype == "hfsplus":
|
||||
overhead = 200 # hack to deal with two bootloader copies
|
||||
if fstype in ("vfat", "msdos"):
|
||||
blocksize = 2048
|
||||
getsize = lambda f: os.stat(f).st_size # no symlinks, count as copies
|
||||
@ -267,8 +280,13 @@ def mkfsimage(fstype, rootdir, outfile, size=None, mkfsargs=[], mountargs="", gr
|
||||
if not size:
|
||||
size = estimate_size(rootdir, graft, fstype)
|
||||
with LoopDev(outfile, size) as loopdev:
|
||||
check_call(["mkfs.%s" % fstype] + mkfsargs + [loopdev],
|
||||
stdout=PIPE, stderr=PIPE)
|
||||
try:
|
||||
check_output(["mkfs.%s" % fstype] + mkfsargs + [loopdev])
|
||||
except CalledProcessError as e:
|
||||
logger.error("mkfs exited with a non-zero return code: %d" % e.returncode)
|
||||
logger.error(e.output)
|
||||
sys.exit(e.returncode)
|
||||
|
||||
with Mount(loopdev, mountargs) as mnt:
|
||||
if rootdir:
|
||||
copytree(rootdir, mnt, preserve)
|
||||
|
@ -25,7 +25,7 @@ logger = logging.getLogger("pylorax.ltmpl")
|
||||
|
||||
import os, re, glob, shlex, fnmatch
|
||||
from os.path import basename, isdir
|
||||
from subprocess import check_call, check_output
|
||||
from subprocess import check_call, check_output, CalledProcessError
|
||||
|
||||
from sysutils import joinpaths, cpfile, mvfile, replace, remove
|
||||
from yumhelper import * # Lorax*Callback classes
|
||||
@ -34,6 +34,7 @@ from base import DataHolder
|
||||
from mako.lookup import TemplateLookup
|
||||
from mako.exceptions import text_error_template
|
||||
import sys, traceback
|
||||
import struct
|
||||
|
||||
class LoraxTemplate(object):
|
||||
def __init__(self, directories=["/usr/share/lorax"]):
|
||||
@ -308,6 +309,7 @@ class LoraxTemplateRunner(object):
|
||||
for g in fileglobs:
|
||||
for f in rglob(self._out(g)):
|
||||
remove(f)
|
||||
logger.debug("removed %s", f)
|
||||
|
||||
def chmod(self, fileglob, mode):
|
||||
'''
|
||||
@ -460,3 +462,15 @@ class LoraxTemplateRunner(object):
|
||||
self.remove(*remove)
|
||||
else:
|
||||
logger.debug("%s: no files to remove!", cmd)
|
||||
|
||||
def createaddrsize(self, addr, src, dest):
|
||||
'''
|
||||
createaddrsize INITRD_ADDRESS INITRD ADDRSIZE
|
||||
Create the initrd.addrsize file required in LPAR boot process.
|
||||
Examples:
|
||||
createaddrsize ${INITRD_ADDRESS} ${outroot}/${BOOTDIR}/initrd.img ${outroot}/${BOOTDIR}/initrd.addrsize
|
||||
'''
|
||||
addrsize = open(dest, "wb")
|
||||
addrsize_data = struct.pack(">iiii", 0, int(addr, 16), 0, os.stat(src).st_size)
|
||||
addrsize.write(addrsize_data)
|
||||
addrsize.close()
|
||||
|
@ -76,8 +76,30 @@ class RuntimeBuilder(object):
|
||||
yum=yum, templatedir=templatedir)
|
||||
self._runner.defaults = self.vars
|
||||
|
||||
def _install_branding(self):
|
||||
release = None
|
||||
for pkg in self.yum.whatProvides('/etc/system-release', None, None):
|
||||
if pkg.name.startswith('generic'):
|
||||
continue
|
||||
else:
|
||||
release = pkg.name
|
||||
break
|
||||
|
||||
if not release:
|
||||
logger.error('could not get the release')
|
||||
return
|
||||
|
||||
# release
|
||||
logger.info('got release: %s', release)
|
||||
self._runner.installpkg(release)
|
||||
|
||||
# logos
|
||||
release, _suffix = release.split('-', 1)
|
||||
self._runner.installpkg('%s-logos' % release)
|
||||
|
||||
def install(self):
|
||||
'''Install packages and do initial setup with runtime-install.tmpl'''
|
||||
self._install_branding()
|
||||
self._runner.run("runtime-install.tmpl")
|
||||
|
||||
def writepkglists(self, pkglistdir):
|
||||
@ -151,16 +173,14 @@ class RuntimeBuilder(object):
|
||||
class TreeBuilder(object):
|
||||
'''Builds the arch-specific boot images.
|
||||
inroot should be the installtree root (the newly-built runtime dir)'''
|
||||
def __init__(self, product, arch, inroot, outroot, runtime, templatedir=None):
|
||||
# NOTE: if you change isolabel, you need to change pungi to match, or
|
||||
# the pungi images won't boot.
|
||||
isolabel = "{0.name} {0.version} {1.basearch}".format(product, arch)
|
||||
def __init__(self, product, arch, inroot, outroot, runtime, isolabel, domacboot=True, templatedir=None):
|
||||
# NOTE: if you pass an arg named "runtime" to a mako template it'll
|
||||
# clobber some mako internal variables - hence "runtime_img".
|
||||
self.vars = DataHolder(arch=arch, product=product, runtime_img=runtime,
|
||||
runtime_base=basename(runtime),
|
||||
inroot=inroot, outroot=outroot,
|
||||
basearch=arch.basearch, libdir=arch.libdir,
|
||||
isolabel=isolabel, udev=udev_escape)
|
||||
isolabel=isolabel, udev=udev_escape, domacboot=domacboot)
|
||||
self._runner = LoraxTemplateRunner(inroot, outroot, templatedir=templatedir)
|
||||
self._runner.defaults = self.vars
|
||||
self.templatedir = templatedir
|
||||
@ -173,11 +193,10 @@ class TreeBuilder(object):
|
||||
'''Rebuild all the initrds in the tree. If backup is specified, each
|
||||
initrd will be renamed with backup as a suffix before rebuilding.
|
||||
If backup is empty, the existing initrd files will be overwritten.'''
|
||||
dracut = ["dracut", "--noprefix", "--nomdadmconf", "--nolvmconf"] + add_args
|
||||
dracut = ["dracut", "--prefix=/run/initramfs",
|
||||
"--nomdadmconf", "--nolvmconf"] + add_args
|
||||
if not backup:
|
||||
dracut.append("--force")
|
||||
hooks = [("99anaconda-copy-ks.sh", "/lib/dracut/hooks/pre-pivot")]
|
||||
hook_commands = self.copy_dracut_hooks(hooks)
|
||||
|
||||
# Hush some dracut warnings. TODO: bind-mount proc in place?
|
||||
open(joinpaths(self.vars.inroot,"/proc/modules"),"w")
|
||||
@ -187,7 +206,7 @@ class TreeBuilder(object):
|
||||
initrd = joinpaths(self.vars.inroot, kernel.initrd.path)
|
||||
os.rename(initrd, initrd + backup)
|
||||
check_call(["chroot", self.vars.inroot] + \
|
||||
dracut + hook_commands + [kernel.initrd.path, kernel.version])
|
||||
dracut + [kernel.initrd.path, kernel.version])
|
||||
os.unlink(joinpaths(self.vars.inroot,"/proc/modules"))
|
||||
|
||||
def build(self):
|
||||
|
@ -37,6 +37,7 @@ class TreeInfo(object):
|
||||
data = {"timestamp": time.time(),
|
||||
"family": product,
|
||||
"version": version,
|
||||
"name": "%s-%s" % (product, version),
|
||||
"variant": variant or "",
|
||||
"arch": basearch,
|
||||
"packagedir": packagedir}
|
||||
|
@ -32,23 +32,33 @@ import subprocess
|
||||
import socket
|
||||
import threading
|
||||
import SocketServer
|
||||
import libvirt
|
||||
from time import sleep
|
||||
import shutil
|
||||
import traceback
|
||||
import argparse
|
||||
import hashlib
|
||||
|
||||
# Use pykickstart to calculate disk image size
|
||||
from pykickstart.parser import KickstartParser
|
||||
from pykickstart.version import makeVersion
|
||||
|
||||
# Use Mako templates for appliance builder descriptions
|
||||
from mako.template import Template
|
||||
from mako.exceptions import text_error_template
|
||||
|
||||
# Use the Lorax treebuilder branch for iso creation
|
||||
from pylorax.base import DataHolder
|
||||
from pylorax.treebuilder import TreeBuilder, RuntimeBuilder, udev_escape
|
||||
from pylorax.sysutils import joinpaths, remove, linktree
|
||||
from pylorax.imgutils import PartitionMount, mksparse
|
||||
from pylorax.imgutils import PartitionMount, mksparse, mkext4img, loop_detach
|
||||
from pylorax.imgutils import get_loop_name, dm_detach
|
||||
from pylorax.executils import execWithRedirect, execWithCapture
|
||||
|
||||
# no-virt mode doesn't need libvirt, so make it optional
|
||||
try:
|
||||
import libvirt
|
||||
except ImportError:
|
||||
libvirt = None
|
||||
|
||||
# Default parameters for rebuilding initramfs, override with --dracut-args
|
||||
DRACUT_DEFAULT = ["--xz", "--add", "livenet", "--add", "dmsquash-live",
|
||||
@ -211,80 +221,12 @@ class IsoMountpoint(object):
|
||||
return
|
||||
|
||||
|
||||
class ImageMount(object):
|
||||
"""
|
||||
# kpartx -p p -v -a /tmp/diskV2DiCW.im
|
||||
# add map loop2p1 (253:2): 0 3481600 linear /dev/loop2 2048
|
||||
# add map loop2p2 (253:3): 0 614400 linear /dev/loop2 3483648
|
||||
|
||||
Find the / partition and only mount that
|
||||
"""
|
||||
def __init__(self, disk_img):
|
||||
"""
|
||||
Use kpartx to mount an image onto temporary directories
|
||||
return a list of the dirs
|
||||
"""
|
||||
self.disk_img = disk_img
|
||||
|
||||
# call kpartx and parse the output
|
||||
cmd = [ "kpartx", "-v", "-p", "p", "-a", disk_img ]
|
||||
log.debug( cmd )
|
||||
kpartx_output = execWithCapture( cmd[0], cmd[1:] )
|
||||
log.debug( kpartx_output )
|
||||
self.loop_devices = []
|
||||
for line in kpartx_output.splitlines():
|
||||
# add map loop2p3 (253:4): 0 7139328 linear /dev/loop2 528384
|
||||
# 3rd element is size in 512 byte blocks
|
||||
if line.startswith("add map "):
|
||||
fields = line[8:].split()
|
||||
self.loop_devices.append((fields[0], int(fields[3])*512))
|
||||
|
||||
log.debug( self.loop_devices )
|
||||
|
||||
# Mount the devices, if possible
|
||||
self.mount_dir = None
|
||||
mount_dir = tempfile.mkdtemp()
|
||||
for dev, size in self.loop_devices:
|
||||
cmd = ["mount", "/dev/mapper/"+dev, mount_dir]
|
||||
log.debug( cmd )
|
||||
try:
|
||||
execWithRedirect( cmd[0], cmd[1:] )
|
||||
if os.path.isfile(mount_dir+"/etc/fstab"):
|
||||
self.mount_dir = mount_dir
|
||||
self.mount_dev = dev
|
||||
self.mount_size = size
|
||||
break
|
||||
cmd = ["umount", mount_dir]
|
||||
execWithRedirect( cmd[0], cmd[1:] )
|
||||
except subprocess.CalledProcessError:
|
||||
log.debug( traceback.format_exc() )
|
||||
|
||||
if self.mount_dir:
|
||||
log.info( "Found root partition, mounted on {0}".format(self.mount_dir) )
|
||||
log.info( "size = {0}".format(self.mount_size) )
|
||||
|
||||
def umount(self):
|
||||
"""
|
||||
unmount the disk image
|
||||
"""
|
||||
if self.mount_dir:
|
||||
cmd = ["umount", self.mount_dir]
|
||||
log.debug( cmd )
|
||||
execWithRedirect( cmd[0], cmd[1:] )
|
||||
os.rmdir(self.mount_dir)
|
||||
self.mount_dir = None
|
||||
|
||||
cmd = ["kpartx", "-d", self.disk_img]
|
||||
log.debug( cmd )
|
||||
execWithRedirect( cmd[0], cmd[1:] )
|
||||
|
||||
|
||||
class VirtualInstall( object ):
|
||||
"""
|
||||
Run virt-install using an iso and kickstart(s)
|
||||
"""
|
||||
def __init__( self, iso, ks_paths, disk_img, img_size=2,
|
||||
kernel_args=None, memory=1024, vnc=None,
|
||||
kernel_args=None, memory=1024, vnc=None, arch=None,
|
||||
log_check=None, virtio_host="127.0.0.1", virtio_port=6080 ):
|
||||
"""
|
||||
|
||||
@ -296,6 +238,7 @@ class VirtualInstall( object ):
|
||||
kernel_args are extra arguments to pass on the kernel cmdline
|
||||
memory is the amount of ram to assign to the virt
|
||||
vnc is passed to the --graphics command verbatim
|
||||
arch is the optional architecture to use in the virt
|
||||
log_check is a method that returns True of the log indicates an error
|
||||
virtio_host and virtio_port are used to communicate with the log monitor
|
||||
"""
|
||||
@ -332,10 +275,10 @@ class VirtualInstall( object ):
|
||||
extra_args = "ks=file:/{0}".format(os.path.basename(ks_paths[0]))
|
||||
if kernel_args:
|
||||
extra_args += " "+kernel_args
|
||||
if not vnc:
|
||||
extra_args += " console=/dev/ttyS0"
|
||||
if iso.liveos:
|
||||
extra_args += " root=live:CDLABEL={0}".format(udev_escape(iso.label))
|
||||
if not vnc:
|
||||
extra_args += " console=ttyS0"
|
||||
cmd.append("--extra-args")
|
||||
cmd.append(extra_args)
|
||||
|
||||
@ -348,6 +291,10 @@ class VirtualInstall( object ):
|
||||
cmd.append("--channel")
|
||||
cmd.append(channel_args)
|
||||
|
||||
if arch:
|
||||
cmd.append("--arch")
|
||||
cmd.append(arch)
|
||||
|
||||
log.debug( cmd )
|
||||
|
||||
rc = execWithRedirect( cmd[0], cmd[1:] )
|
||||
@ -381,10 +328,25 @@ class VirtualInstall( object ):
|
||||
subprocess.call(["virsh","destroy",self.virt_name])
|
||||
subprocess.call(["virsh","undefine",self.virt_name])
|
||||
|
||||
def is_image_mounted(disk_img):
|
||||
"""
|
||||
Return True if the disk_img is mounted
|
||||
"""
|
||||
with open("/proc/mounts") as mounts:
|
||||
for mount in mounts:
|
||||
fields = mount.split()
|
||||
if len(fields) > 2 and fields[1] == disk_img:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def anaconda_install( disk_img, disk_size, kickstart, repo, args ):
|
||||
"""
|
||||
|
||||
disk_img Full path of the disk image
|
||||
disk_size Disk size in GB
|
||||
kickstart Full path to kickstart file
|
||||
repo URL of repository
|
||||
args Extra args to pass to anaconda --image install
|
||||
"""
|
||||
# Create the sparse image
|
||||
mksparse( disk_img, disk_size * 1024**3 )
|
||||
@ -406,8 +368,77 @@ def get_kernels( boot_dir ):
|
||||
return [f[8:] for f in files if f.startswith("vmlinuz-")]
|
||||
|
||||
|
||||
def make_appliance(disk_img, name, template, outfile, networks=None, ram=1024,
|
||||
vcpus=1, arch=None, title="Linux", project="Linux",
|
||||
releasever=17):
|
||||
"""
|
||||
Generate an appliance description file
|
||||
|
||||
disk_img Full path of the disk image
|
||||
name Name of the appliance, passed to the template
|
||||
template Full path of Mako template
|
||||
outfile Full path of file to write, using template
|
||||
networks List of networks from the kickstart
|
||||
ram Ram, in MB, passed to template. Default is 1024
|
||||
vcpus CPUs, passed to template. Default is 1
|
||||
arch CPU architecture. Default is 'x86_64'
|
||||
title Title, passed to template. Default is 'Linux'
|
||||
project Project, passed to template. Default is 'Linux'
|
||||
releasever Release version, passed to template. Default is 17
|
||||
"""
|
||||
if not (disk_img and template and outfile):
|
||||
return None
|
||||
|
||||
log.info("Creating appliance definition using ${0}".format(template))
|
||||
|
||||
if not arch:
|
||||
arch = "x86_64"
|
||||
|
||||
log.info("Calculating SHA256 checksum of {0}".format(disk_img))
|
||||
sha256 = hashlib.sha256()
|
||||
with open(disk_img) as f:
|
||||
while True:
|
||||
data = f.read(1024*1024)
|
||||
if not data:
|
||||
break
|
||||
sha256.update(data)
|
||||
log.info("SHA256 of {0} is {1}".format(disk_img, sha256.hexdigest()))
|
||||
disk_info = DataHolder(name=os.path.basename(disk_img), format="raw",
|
||||
checksum_type="sha256", checksum=sha256.hexdigest())
|
||||
try:
|
||||
result = Template(filename=template).render(disks=[disk_info], name=name,
|
||||
arch=arch, memory=ram*1024, vcpus=vcpus, networks=networks,
|
||||
title=title, project=project, releasever=releasever)
|
||||
except Exception:
|
||||
log.error(text_error_template().render())
|
||||
raise
|
||||
|
||||
with open(outfile, "w") as f:
|
||||
f.write(result)
|
||||
|
||||
|
||||
def make_ami( disk_img, ami_img="ami-root.img", ami_label="AMI" ):
|
||||
"""
|
||||
Copy the / partition to an un-partitioned disk image
|
||||
|
||||
ami_img is the filename to write, defaults to ami-root.img
|
||||
ami_label is the FS label to apply to the image
|
||||
|
||||
All other AMI setup is handled by the kickstart's %post
|
||||
"""
|
||||
with PartitionMount( disk_img ) as img_mount:
|
||||
if not img_mount or not img_mount.mount_dir:
|
||||
return None
|
||||
|
||||
work_dir = tempfile.mkdtemp()
|
||||
log.info("working dir is {0}".format(work_dir))
|
||||
log.info("creating {0}".format(ami_img))
|
||||
mkext4img(img_mount.mount_dir, joinpaths(work_dir, ami_img), label=ami_label)
|
||||
return work_dir
|
||||
|
||||
|
||||
def make_livecd( disk_img, squashfs_args="", templatedir=None,
|
||||
title="Linux", project="Linux", releasever=16 ):
|
||||
title="Linux", project="Linux", releasever=16, isolabel=None ):
|
||||
"""
|
||||
Take the content from the disk image and make a livecd out of it
|
||||
|
||||
@ -423,6 +454,9 @@ def make_livecd( disk_img, squashfs_args="", templatedir=None,
|
||||
|
||||
"""
|
||||
with PartitionMount( disk_img ) as img_mount:
|
||||
if not img_mount or not img_mount.mount_dir:
|
||||
return None
|
||||
|
||||
kernel_list = get_kernels( joinpaths( img_mount.mount_dir, "boot" ) )
|
||||
log.debug( "kernel_list = {0}".format(kernel_list) )
|
||||
if kernel_list:
|
||||
@ -467,9 +501,14 @@ def make_livecd( disk_img, squashfs_args="", templatedir=None,
|
||||
subprocess.check_call(["/bin/ln", "-s", joinpaths( work_dir, "images" ),
|
||||
joinpaths( installroot, "images" )])
|
||||
|
||||
isolabel = isolabel or "{0.name} {0.version} {1.basearch}".format(product, arch)
|
||||
if len(isolabel) > 32:
|
||||
isolabel = isolabel[:32]
|
||||
log.error("Truncating isolabel to 32 chars: %s" % (isolabel,))
|
||||
|
||||
tb = TreeBuilder( product=product, arch=arch,
|
||||
inroot=installroot, outroot=work_dir,
|
||||
runtime=runtime, templatedir=templatedir)
|
||||
runtime=runtime, isolabel=isolabel, templatedir=templatedir)
|
||||
log.info( "Rebuilding initrds" )
|
||||
if not opts.dracut_args:
|
||||
dracut_args = DRACUT_DEFAULT
|
||||
@ -507,6 +546,8 @@ if __name__ == '__main__':
|
||||
|
||||
parser.add_argument( "--ks", action="append", type=os.path.abspath,
|
||||
help="Kickstart file defining the install." )
|
||||
parser.add_argument( "--image-name", default=None,
|
||||
help="Name of disk image to create. Default is a random name." )
|
||||
parser.add_argument( "--image-only", action="store_true",
|
||||
help="Exit after creating disk image." )
|
||||
parser.add_argument( "--keep-image", action="store_true",
|
||||
@ -525,22 +566,34 @@ if __name__ == '__main__':
|
||||
parser.add_argument( "--lorax-templates", default="/usr/share/lorax/",
|
||||
type=os.path.abspath,
|
||||
help="Path to mako templates for lorax" )
|
||||
parser.add_argument( "--tmp", default="/tmp", type=os.path.abspath,
|
||||
parser.add_argument( "--tmp", default="/var/tmp", type=os.path.abspath,
|
||||
help="Top level temporary directory" )
|
||||
parser.add_argument( "--resultdir", default=None, dest="result_dir",
|
||||
type=os.path.abspath,
|
||||
help="Directory to copy the resulting images and iso into. "
|
||||
"Defaults to the temporary working directory")
|
||||
|
||||
# Group of arguments for appliance creation
|
||||
app_group = parser.add_argument_group("appliance arguments")
|
||||
app_group.add_argument( "--app-name", default=None,
|
||||
help="Name of appliance to pass to template")
|
||||
app_group.add_argument( "--app-template", default=None,
|
||||
help="Path to template to use for appliance data.")
|
||||
app_group.add_argument( "--app-file", default="appliance.xml",
|
||||
help="Appliance template results file.")
|
||||
|
||||
# Group of arguments to pass to virt-install
|
||||
virt_group = parser.add_argument_group("virt-install arguments")
|
||||
if not libvirt:
|
||||
virt_group = parser.add_argument_group("virt-install arguments (DISABLED -- no libvirt)")
|
||||
else:
|
||||
virt_group = parser.add_argument_group("virt-install arguments")
|
||||
virt_group.add_argument("--ram", metavar="MEMORY", default=1024,
|
||||
help="Memory to allocate for installer in megabytes." )
|
||||
virt_group.add_argument("--vcpus", default=1,
|
||||
help="Passed to --vcpus command" )
|
||||
virt_group.add_argument("--vnc",
|
||||
help="Passed to --graphics command" )
|
||||
virt_group.add_argument("--arch",
|
||||
virt_group.add_argument("--arch", default=None,
|
||||
help="Passed to --arch command" )
|
||||
virt_group.add_argument( "--kernel-args",
|
||||
help="Additional argument to pass to the installation kernel" )
|
||||
@ -559,6 +612,7 @@ if __name__ == '__main__':
|
||||
help="substituted for @PROJECT@ in bootloader config files" )
|
||||
parser.add_argument( "--releasever", type=int, default=16,
|
||||
help="substituted for @VERSION@ in bootloader config files" )
|
||||
parser.add_argument( "--volid", default=None, help="volume id")
|
||||
parser.add_argument( "--squashfs_args",
|
||||
help="additional squashfs args" )
|
||||
|
||||
@ -592,7 +646,7 @@ if __name__ == '__main__':
|
||||
log.error("You need to run this as root")
|
||||
sys.exit( 1 )
|
||||
|
||||
if not os.path.exists( opts.lorax_templates ):
|
||||
if opts.make_iso and not os.path.exists( opts.lorax_templates ):
|
||||
log.error( "The lorax templates directory ({0}) doesn't"
|
||||
" exist.".format( opts.lorax_templates ) )
|
||||
sys.exit( 1 )
|
||||
@ -610,24 +664,57 @@ if __name__ == '__main__':
|
||||
log.error( "The disk image {0} is missing.".format( opts.disk_image ) )
|
||||
sys.exit( 1 )
|
||||
|
||||
if opts.make_appliance:
|
||||
log.error( "--make-appliance is not yet implemented." )
|
||||
sys.exit( 1 )
|
||||
|
||||
if opts.make_ami:
|
||||
log.error( "--make-ami is not yet implemented." )
|
||||
sys.exit( 1 )
|
||||
|
||||
if not opts.no_virt and not opts.iso and not opts.disk_image:
|
||||
log.error( "virt-install needs an install iso." )
|
||||
sys.exit( 1 )
|
||||
|
||||
# Make the disk image
|
||||
if not opts.disk_image:
|
||||
# Parse the kickstart to get the partition sizes
|
||||
if opts.volid and len(opts.volid) > 32:
|
||||
logger.fatal("the volume id cannot be longer than 32 characters")
|
||||
sys.exit(1)
|
||||
|
||||
if not opts.no_virt and not libvirt:
|
||||
log.error("virt-install requires libvirt-python to be installed.")
|
||||
sys.exit(1)
|
||||
|
||||
if not opts.no_virt and not os.path.exists("/usr/bin/virt-install"):
|
||||
log.error("virt-install requires python-virtinst to be installed.")
|
||||
sys.exit(1)
|
||||
|
||||
if opts.no_virt and not os.path.exists("/usr/sbin/anaconda"):
|
||||
log.error("no-virt requires anaconda to be installed.")
|
||||
sys.exit(1)
|
||||
|
||||
if opts.make_appliance and not opts.app_template:
|
||||
opts.app_template = joinpaths(opts.lorax_templates,
|
||||
"appliance/libvirt.tmpl")
|
||||
|
||||
if opts.make_appliance and not os.path.exists(opts.app_template):
|
||||
log.error("The appliance template ({0}) doesn't "
|
||||
"exist".format(opts.app_template))
|
||||
sys.exit(1)
|
||||
|
||||
if opts.image_name and os.path.exists(joinpaths(opts.tmp,opts.image_name)):
|
||||
log.error("The disk image to be created should not exist.")
|
||||
sys.exit(1)
|
||||
|
||||
if opts.app_file:
|
||||
opts.app_file = joinpaths(opts.tmp, opts.app_file)
|
||||
|
||||
tempfile.tempdir = opts.tmp
|
||||
disk_img = None
|
||||
|
||||
# Parse the kickstart
|
||||
if opts.ks:
|
||||
ks_version = makeVersion()
|
||||
ks = KickstartParser( ks_version, errorsAreFatal=False, missingIncludeIsFatal=False )
|
||||
ks.readKickstart( opts.ks[0] )
|
||||
|
||||
# Make the disk image
|
||||
if not opts.disk_image:
|
||||
if not opts.ks:
|
||||
log.error("Image creation requires a kickstart file")
|
||||
sys.exit(1)
|
||||
|
||||
disk_size = 1 + (sum( [p.size for p in ks.handler.partition.partitions] ) / 1024)
|
||||
log.info( "disk_size = {0}GB".format(disk_size) )
|
||||
|
||||
@ -636,8 +723,15 @@ if __name__ == '__main__':
|
||||
"fix your kickstart file." )
|
||||
sys.exit( 1 )
|
||||
repo_url = ks.handler.method.url
|
||||
if ks.handler.displaymode.displayMode is not None:
|
||||
log.error("The kickstart must not set a display mode (text, cmdline, "
|
||||
"graphical), this will interfere with livemedia-creator.")
|
||||
sys.exit(1)
|
||||
|
||||
disk_img = tempfile.mktemp( prefix="disk", suffix=".img", dir=opts.tmp )
|
||||
if opts.image_name:
|
||||
disk_img = joinpaths(opts.tmp, opts.image_name)
|
||||
else:
|
||||
disk_img = tempfile.mktemp( prefix="disk", suffix=".img", dir=opts.tmp )
|
||||
install_log = os.path.abspath(os.path.dirname(opts.logfile))+"/virt-install.log"
|
||||
|
||||
log.info( "disk_img = {0}".format(disk_img) )
|
||||
@ -665,6 +759,14 @@ if __name__ == '__main__':
|
||||
if os.path.exists( "/tmp/"+l ):
|
||||
shutil.copy2( "/tmp/"+l, log_anaconda )
|
||||
os.unlink( "/tmp/"+l )
|
||||
|
||||
# If anaconda failed the disk image may still be in use by dm
|
||||
dm_name = os.path.splitext(os.path.basename(disk_img))[0]
|
||||
dm_path = "/dev/mapper/"+dm_name
|
||||
if os.path.exists(dm_path):
|
||||
dm_detach(dm_path)
|
||||
loop_detach(get_loop_name(disk_img))
|
||||
|
||||
else:
|
||||
iso_mount = IsoMountpoint( opts.iso )
|
||||
log_monitor = LogMonitor( install_log )
|
||||
@ -676,7 +778,7 @@ if __name__ == '__main__':
|
||||
kernel_args += " proxy="+opts.proxy
|
||||
|
||||
virt = VirtualInstall( iso_mount, opts.ks, disk_img, disk_size,
|
||||
kernel_args, opts.ram, opts.vnc,
|
||||
kernel_args, opts.ram, opts.vnc, opts.arch,
|
||||
log_check = log_monitor.server.log_check,
|
||||
virtio_host = log_monitor.host,
|
||||
virtio_port = log_monitor.port )
|
||||
@ -700,22 +802,35 @@ if __name__ == '__main__':
|
||||
if opts.make_iso and not opts.image_only:
|
||||
result_dir = make_livecd( opts.disk_image or disk_img, opts.squashfs_args,
|
||||
opts.lorax_templates,
|
||||
opts.title, opts.project, opts.releasever )
|
||||
|
||||
if not opts.keep_image and not opts.disk_image:
|
||||
opts.title, opts.project, opts.releasever,
|
||||
opts.volid )
|
||||
# cleanup the mess
|
||||
if disk_img and not opts.keep_image and not opts.disk_image:
|
||||
os.unlink( disk_img )
|
||||
log.info("Disk image erased")
|
||||
disk_img = None
|
||||
elif opts.make_ami and not opts.image_only:
|
||||
result_dir = make_ami(opts.disk_image or disk_img)
|
||||
elif opts.make_appliance and not opts.image_only:
|
||||
if not opts.ks:
|
||||
networks = []
|
||||
else:
|
||||
networks = ks.handler.network.network
|
||||
make_appliance(opts.disk_image or disk_img, opts.app_name,
|
||||
opts.app_template, opts.app_file, networks, opts.ram,
|
||||
opts.vcpus, opts.arch, opts.title, opts.project, opts.releasever)
|
||||
|
||||
if opts.result_dir:
|
||||
shutil.copytree( result_dir, opts.result_dir )
|
||||
shutil.rmtree( result_dir )
|
||||
if opts.result_dir and result_dir:
|
||||
shutil.copytree( result_dir, opts.result_dir )
|
||||
shutil.rmtree( result_dir )
|
||||
|
||||
log.info("SUMMARY")
|
||||
log.info("-------")
|
||||
log.info("Logs are in {0}".format(os.path.abspath(os.path.dirname(opts.logfile))))
|
||||
if opts.keep_image or opts.make_disk:
|
||||
if disk_img:
|
||||
log.info("Disk image is at {0}".format(disk_img))
|
||||
else:
|
||||
log.info("Disk image erased")
|
||||
if opts.make_appliance:
|
||||
log.info("Appliance description is in {0}".format(opts.app_file))
|
||||
if result_dir:
|
||||
log.info("Results are in {0}".format(opts.result_dir or result_dir))
|
||||
|
||||
|
@ -48,7 +48,7 @@ def main(args):
|
||||
required.add_option("-r", "--release", help="release information",
|
||||
metavar="STRING")
|
||||
required.add_option("-s", "--source",
|
||||
help="source repository (may be listed multibple times)",
|
||||
help="source repository (may be listed multiple times)",
|
||||
metavar="REPOSITORY", action="append", default=[])
|
||||
|
||||
# optional arguments
|
||||
@ -72,6 +72,10 @@ def main(args):
|
||||
help="package glob to exclude (may be listed multiple times)")
|
||||
optional.add_option("--buildarch", default=None,
|
||||
help="build architecture", metavar="STRING")
|
||||
optional.add_option("--volid", default=None,
|
||||
help="volume id", metavar="STRING")
|
||||
optional.add_option("--nomacboot", help="",
|
||||
action="store_false", default=True, dest="domacboot")
|
||||
|
||||
# add the option groups to the parser
|
||||
parser.add_option_group(required)
|
||||
@ -123,7 +127,8 @@ def main(args):
|
||||
lorax.configure(conf_file=opts.config)
|
||||
lorax.run(yb, opts.product, opts.version, opts.release,
|
||||
opts.variant, opts.bugurl, opts.isfinal,
|
||||
workdir=tempdir, outputdir=outputdir, buildarch=opts.buildarch)
|
||||
workdir=tempdir, outputdir=outputdir, buildarch=opts.buildarch,
|
||||
volid=opts.volid, domacboot=opts.domacboot, remove_temp=True)
|
||||
|
||||
|
||||
def get_yum_base_object(installroot, repositories, mirrorlists=[],
|
||||
@ -146,17 +151,17 @@ def get_yum_base_object(installroot, repositories, mirrorlists=[],
|
||||
repositories = filter(bool, repositories)
|
||||
mirrorlists = filter(bool, mirrorlists)
|
||||
|
||||
#cachedir = os.path.join(tempdir, "yum.cache")
|
||||
#if not os.path.isdir(cachedir):
|
||||
# os.mkdir(cachedir)
|
||||
cachedir = os.path.join(tempdir, "yum.cache")
|
||||
if not os.path.isdir(cachedir):
|
||||
os.mkdir(cachedir)
|
||||
|
||||
yumconf = os.path.join(tempdir, "yum.conf")
|
||||
c = ConfigParser.ConfigParser()
|
||||
|
||||
# add the main section
|
||||
section = "main"
|
||||
data = {#"cachedir": cachedir,
|
||||
#"keepcache": 0,
|
||||
data = {"cachedir": cachedir,
|
||||
"keepcache": 0,
|
||||
"gpgcheck": 0,
|
||||
"plugins": 0,
|
||||
"reposdir": "",
|
||||
|
@ -27,27 +27,54 @@ def mkefiboot(bootdir, outfile, label):
|
||||
'''Make an EFI boot image with the contents of bootdir in EFI/BOOT'''
|
||||
mkdosimg(None, outfile, label=label, graft={'EFI/BOOT':bootdir})
|
||||
|
||||
def mkmacboot(bootdir, outfile, label, icon=None):
|
||||
def mkmacboot(bootdir, outfile, label, icon=None, product='Generic',
|
||||
diskname=None):
|
||||
'''Make an EFI boot image for Apple's EFI implementation'''
|
||||
graft = {'EFI/BOOT':bootdir}
|
||||
if icon:
|
||||
if icon and os.path.exists(icon):
|
||||
graft['.VolumeIcon.icns'] = icon
|
||||
if diskname and os.path.exists(diskname):
|
||||
graft['EFI/BOOT/.disk_label'] = diskname
|
||||
mkhfsimg(None, outfile, label=label, graft=graft)
|
||||
macbless(outfile)
|
||||
macmunge(outfile, product)
|
||||
|
||||
# To make an HFS+ image bootable, we need to fill in parts of the
|
||||
# HFSPlusVolumeHeader structure - specifically, finderInfo[0,1,5].
|
||||
# For details, see Technical Note TN1150: HFS Plus Volume Format
|
||||
# http://developer.apple.com/library/mac/#technotes/tn/tn1150.html
|
||||
def macbless(imgfile):
|
||||
#
|
||||
# Additionally, we want to do some fixups to make it play nicely with
|
||||
# the startup disk preferences panel.
|
||||
def macmunge(imgfile, product):
|
||||
'''"bless" the EFI bootloader inside the given Mac EFI boot image, by
|
||||
writing its inode info into the HFS+ volume header.'''
|
||||
# Get the inode number for the boot image and its parent directory
|
||||
with LoopDev(imgfile) as loopdev:
|
||||
with Mount(loopdev) as mnt:
|
||||
loader = glob.glob(os.path.join(mnt,'EFI/BOOT/BOOT*.efi'))[0]
|
||||
config = glob.glob(os.path.join(mnt,'EFI/BOOT/BOOT*.conf'))[0]
|
||||
blessnode = os.stat(loader).st_ino
|
||||
dirnode = os.stat(os.path.dirname(loader)).st_ino
|
||||
with open(os.path.join(mnt,'mach_kernel'), 'w') as kernel:
|
||||
kernel.write('Dummy kernel for booting')
|
||||
sysdir = os.path.join(mnt,'System/Library/CoreServices/')
|
||||
os.makedirs(sysdir)
|
||||
with open(os.path.join(sysdir,'SystemVersion.plist'), 'w') as plist:
|
||||
plist.write('''<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>ProductBuildVersion</key>
|
||||
<string></string>
|
||||
<key>ProductName</key>
|
||||
<string>Linux</string>
|
||||
<key>ProductVersion</key>
|
||||
<string>%s</string>
|
||||
</dict>
|
||||
</plist>
|
||||
''' % (product,))
|
||||
shutil.copy(loader, os.path.join(sysdir,'boot.efi'))
|
||||
shutil.copy(config, os.path.join(sysdir,'boot.conf'))
|
||||
# format data properly (big-endian UInt32)
|
||||
nodedata = struct.pack(">i", blessnode)
|
||||
dirdata = struct.pack(">i", dirnode)
|
||||
@ -88,6 +115,10 @@ if __name__ == '__main__':
|
||||
help="filesystem label to use (default: %(default)s)")
|
||||
parser.add_argument("-i", "--icon", metavar="ICONFILE",
|
||||
help="icon file to include (for Apple EFI image)")
|
||||
parser.add_argument("-n", "--diskname", metavar="DISKNAME",
|
||||
help="disk name image to include (for Apple EFI image)")
|
||||
parser.add_argument("-p", "--product", metavar="PRODUCT",
|
||||
help="product name to use (for Apple EFI image)")
|
||||
parser.add_argument("bootdir", metavar="EFIBOOTDIR",
|
||||
help="input directory (will become /EFI/BOOT in the image)")
|
||||
parser.add_argument("outfile", metavar="OUTPUTFILE",
|
||||
@ -100,9 +131,12 @@ if __name__ == '__main__':
|
||||
parser.error("need root permissions")
|
||||
if opt.icon and not opt.imgtype == "apple":
|
||||
print "Warning: --icon is only useful for Apple EFI images"
|
||||
if opt.diskname and not opt.imgtype == "apple":
|
||||
print "Warning: --diskname is only useful for Apple EFI images"
|
||||
# do the thing!
|
||||
if opt.imgtype == "apple":
|
||||
mkmacboot(opt.bootdir, opt.outfile, opt.label, opt.icon)
|
||||
mkmacboot(opt.bootdir, opt.outfile, opt.label, opt.icon, opt.product,
|
||||
opt.diskname)
|
||||
else:
|
||||
mkefiboot(opt.bootdir, opt.outfile, opt.label)
|
||||
if opt.disk:
|
||||
|
Loading…
Reference in New Issue
Block a user