Compare commits

...

28 Commits

Author SHA1 Message Date
Brian C. Lane
8268069a9c Automatic commit of package [lorax] release [23.21-1]. 2016-04-18 10:57:46 -07:00
Brian C. Lane
5bbef06725 livemedia-creator: Make sure make-iso kickstart includes dracut-live
iso creation requires the dracut-live package, otherwise rebuilding the
initrd will crash. Since it takes a long time to discover let's fail
early.

(cherry picked from commit 607d7c1eeb)
2016-04-06 17:11:37 -07:00
Brian C. Lane
541109ff69 livemedia_creator: dirinstall_path is ROOT_PATH 2016-04-06 17:09:43 -07:00
Brian C. Lane
d14f19ae31 livemedia-creator: Simplify cleanup for no-virt
If an anaconda no-virt run crashes it can leave things mounted under
/mnt/sysimage. Previously anaconda-cleanup was used to handle this, but
it will also try to cleanup host mountpoints which isn't desired.

(cherry picked from commit bae111d5a3)
2016-04-06 17:06:20 -07:00
Brian C. Lane
926a7f6b16 image-minimizer: Fix argument parsing
Can't pass metavar to args that are just switches.

(cherry picked from commit f616d37f59)
2016-04-05 10:26:55 -07:00
Brian C. Lane
f1fd83da7a livemedia-creator: Update ks examples to point to F23 release repo 2016-04-05 08:56:33 -07:00
Brian C. Lane
4679887cc9 Automatic commit of package [lorax] release [23.20-1]. 2016-03-29 17:40:09 -07:00
Colin Walters
dcd029f50b templates: Reinstate gpgme-pthread.so for ostree
See https://github.com/GNOME/ostree/pull/190

Without this the installer ISO generation fails.

(cherry picked from commit 6fcdac5c88)
2016-03-29 15:54:03 -07:00
Brian C. Lane
eb59bc4fab templates: On 32 bit systems limit the amount of memory xz uses
This uses --memlimit-compress=3700MiB on i386 and arm when building the
product and updates images.

(cherry picked from commit ce895bbeb1)
2016-03-29 15:31:58 -07:00
Brian C. Lane
07dca74c06 ltmpl: Add compressor selection and argument passing to installimg
Allow the template to select a different compression type or arguments
for the installimg command.

On 32bit builds running inside a mock xz sees the full amount of system
memory which can result in xz failing with a memory error. This allows
the template to limit the amount of memory it tries to use.

(cherry picked from commit 0400b8c393)
2016-03-29 15:31:55 -07:00
Brian C. Lane
4bec6f9b61 Automatic commit of package [lorax] release [23.19-1]. 2016-03-11 10:47:01 -08:00
Brian C. Lane
476deb0e42 pylorax: proc.returncode can be None
So use %s to keep it from generating a Traceback. If a callback is used
and it exits before the process does the returncode can be None.

(cherry picked from commit 4fea0ba7f1)
2016-03-11 10:46:42 -08:00
Brian C. Lane
d12fc22673 Change location of basearch to dnf.rpm.basearch (#1312087)
The dnf fix for the busted API change is also busted, so just change it
everywhere.

(cherry picked from commit 8085395678)
2016-03-11 10:46:02 -08:00
Dan Horák
4056a5cc84 rsa1 keys are not supported any more by our openssh
(cherry picked from commit 15d44ce562)
2015-10-02 09:04:15 -07:00
Brian C. Lane
8ac8939b3a Automatic commit of package [lorax] release [23.18-1]. 2015-09-11 18:02:19 -07:00
Brian C. Lane
48498d9a2e Add a font that supports Urdu characters (#1004717)
(cherry picked from commit dc663cd9bf)
2015-09-09 08:08:55 -07:00
Brian C. Lane
ba11077394 livemedia-creator: Remove random-seed from images (#1258986)
systemd uses /var/lib/systemd/random-seed to add entropy to /dev/urandom
at boot time. During image creation this file is created, and if not
removed everything using the image will be adding the same seed.

This is only additional entropy, NOT a seed in the sense of a starting
point for a PRNG, so it will be mixed with other entropy as the system
runs. It isn't a good idea to use the same value everywhere so make sure
it is removed in %post

Resolves: rhbz#1258986
(cherry picked from commit 6f6af862c6)
2015-09-02 10:33:21 -07:00
Will Woods
704a01919b drop fedup-dracut and friends
This package will not exist soon. Don't bother trying to install it.

(cherry picked from commit 52171ecf23)
2015-08-31 16:39:30 -07:00
Will Woods
d9c23d1bce don't build upgrade.img anymore
fedup is deprecated and abandoned. Let's save time and disk by not
building `upgrade.img` when nothing is going to use it anymore.

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

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

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

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

For backwards compatibility, the API retains the `doupgrade` keyword
argument, and the `--noupgrade` flag is still accepted.

(cherry picked from commit a3e1a275ff)
2015-08-31 16:39:30 -07:00
Brian C. Lane
7c0c5c53ca Automatic commit of package [lorax] release [23.17-1]. 2015-08-27 15:44:39 -07:00
David Shea
2a19315dcd Add enough of shadow-utils to create new user accounts.
Yes user accounts, some account management

(cherry picked from commit 88869fff66)
2015-08-27 10:22:38 -04:00
Brian C. Lane
8efdfd26f2 Automatic commit of package [lorax] release [23.16-1]. 2015-08-07 17:12:50 -07:00
Peter Robinson
fd16dc1d1b some of the PowerPC utilities (powerpc-utils and fbset) need perl too
(cherry picked from commit dc9bae9b68)
2015-08-07 16:57:21 -07:00
Brian C. Lane
27e95a3b8b Add a default vconsole.conf to the boot.iso (#1250260)
This is needed so that the initial console will use the correct font
(eurlatgr). See
https://fedoraproject.org//wiki/Changes/NewDefaultConsoleFont for more
detail.

(cherry picked from commit 57b7516857)
2015-08-07 16:57:08 -07:00
Brian C. Lane
0c2905d2a3 Return the output from failed commands in CalledProcessError
Some callers expect CalledProcessError.output to have the output, so
pass up the stdout + stderr output.

This means failed runcmd template commands will log to program.log and
lorax.log

(cherry picked from commit 522ec34360)
2015-08-05 11:39:23 -07:00
Brian C. Lane
4ffcd47874 Add dracut-live for livemedia kickstart example
(cherry picked from commit b23bef069a)
2015-07-30 15:08:40 -07:00
Brian C. Lane
b74986b2ba Automatic commit of package [lorax] release [23.15-1]. 2015-07-30 14:56:53 -07:00
Brian C. Lane
955afa8699 livemedia-creator: Bump default releasevere to 23
Also point the example kickstarts to the F23 development repository.
2015-07-30 14:40:15 -07:00
26 changed files with 174 additions and 139 deletions

View File

@ -1,7 +1,7 @@
# Minimal Disk Image
# Use network installation
url --url="http://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/x86_64/os/"
url --url="https://dl.fedoraproject.org/pub/fedora/linux/releases/23/Everything/x86_64/os/"
# Root password
rootpw --plaintext replace-this-pw
@ -28,6 +28,10 @@ clearpart --all --initlabel
# Disk partitioning information
part / --fstype="ext4" --size=3000
%post
# Remove random-seed
rm /var/lib/systemd/random-seed
%end
%packages --nocore --instLangs en
httpd

View File

@ -22,7 +22,7 @@ part swap --size=512
#
# Repositories
url --url="http://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/x86_64/os/"
url --url="https://dl.fedoraproject.org/pub/fedora/linux/releases/23/Everything/x86_64/os/"
#
#
@ -115,3 +115,7 @@ passwd -d root > /dev/null
%end
%post
# Remove random-seed
rm /var/lib/systemd/random-seed
%end

View File

@ -10,7 +10,7 @@ timezone US/Eastern
lang en_US.UTF-8
# Firewall configuration
firewall --enabled --service=mdns
url --url="http://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/x86_64/os/"
url --url="https://dl.fedoraproject.org/pub/fedora/linux/releases/23/Everything/x86_64/os/"
# System authorization information
auth --useshadow --enablemd5
@ -289,6 +289,8 @@ fi
echo 'File created by kickstart. See systemd-update-done.service(8).' \
| tee /etc/.updated >/var/.updated
# Remove random-seed
rm /var/lib/systemd/random-seed
%end
%post --nochroot
@ -397,6 +399,7 @@ memtest86+
-gfs2-utils
-reiserfs-utils
dracut-live
dracut-config-generic
grub2-efi
-dracut-config-rescue

View File

@ -4,7 +4,7 @@ sshpw --username=root --plaintext randOmStrinGhERE
# Firewall configuration
firewall --enabled
# Use network installation
url --url="http://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/x86_64/os/"
url --url="https://dl.fedoraproject.org/pub/fedora/linux/releases/23/Everything/x86_64/os/"
# Root password
rootpw --plaintext removethispw
@ -33,6 +33,9 @@ part swap --size=1000
%post
# Remove root password
passwd -d root > /dev/null
# Remove random-seed
rm /var/lib/systemd/random-seed
%end
%packages

View File

@ -4,7 +4,7 @@ sshpw --username=root --plaintext randOmStrinGhERE
# Firewall configuration
firewall --enabled
# Use network installation
url --url="http://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/x86_64/os/"
url --url="https://dl.fedoraproject.org/pub/fedora/linux/releases/23/Everything/x86_64/os/"
# Root password
rootpw --plaintext removethispw
@ -33,6 +33,9 @@ part swap --size=1000
%post
# Remove root password
passwd -d root > /dev/null
# Remove random-seed
rm /var/lib/systemd/random-seed
%end
%packages

View File

@ -3,7 +3,7 @@
# Firewall configuration
firewall --enabled
# Use network installation
url --url="http://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/x86_64/os/"
url --url="https://dl.fedoraproject.org/pub/fedora/linux/releases/23/Everything/x86_64/os/"
# Root password
rootpw --plaintext replace-this-pw
@ -32,6 +32,11 @@ clearpart --all
# Disk partitioning information
part / --fstype="ext4" --size=3000
%post
# Remove random-seed
rm /var/lib/systemd/random-seed
%end
%packages
@core
kernel

View File

@ -78,9 +78,6 @@ volume id
.TP
\fB\-\-nomacboot\fR
.TP
\fB\-\-noupgrade\fR
.TP
\fB\-\-logfile=LOGFILE\fR
Path to logfile
@ -95,4 +92,3 @@ Martin Gracik
Will Woods
Brian C. Lane
.fi

View File

@ -1,7 +1,7 @@
%define debug_package %{nil}
Name: lorax
Version: 23.14
Version: 23.21
Release: 1%{?dist}
Summary: Tool for creating the anaconda install images
@ -42,13 +42,11 @@ Requires: dracut >= 030
Requires: libselinux-python3
Requires: python3-mako
Requires: python3-kickstart
Requires: python3-dnf
Requires: python3-dnf >= 1.1.7
%if 0%{?fedora}
# Fedora specific deps
Requires: fedup-dracut
Requires: fedup-dracut-plymouth
%ifarch x86_64
Requires: hfsplus-tools
%endif
@ -134,6 +132,49 @@ make DESTDIR=$RPM_BUILD_ROOT mandir=%{_mandir} install
%files lmc-novirt
%changelog
* Mon Apr 18 2016 Brian C. Lane <bcl@redhat.com> 23.21-1
- livemedia-creator: Make sure make-iso kickstart includes dracut-live
(bcl@redhat.com)
- livemedia_creator: dirinstall_path is ROOT_PATH (bcl@redhat.com)
- livemedia-creator: Simplify cleanup for no-virt (bcl@redhat.com)
- image-minimizer: Fix argument parsing (bcl@redhat.com)
- livemedia-creator: Update ks examples to point to F23 release repo
(bcl@redhat.com)
* Tue Mar 29 2016 Brian C. Lane <bcl@redhat.com> 23.20-1
- templates: Reinstate gpgme-pthread.so for ostree (walters@verbum.org)
- templates: On 32 bit systems limit the amount of memory xz uses
(bcl@redhat.com)
- ltmpl: Add compressor selection and argument passing to installimg
(bcl@redhat.com)
* Fri Mar 11 2016 Brian C. Lane <bcl@redhat.com> 23.19-1
- pylorax: proc.returncode can be None (bcl@redhat.com)
- Change location of basearch to dnf.rpm.basearch (#1312087) (bcl@redhat.com)
- rsa1 keys are not supported any more by our openssh (dan@danny.cz)
* Fri Sep 11 2015 Brian C. Lane <bcl@redhat.com> 23.18-1
- Add a font that supports Urdu characters (#1004717) (bcl@redhat.com)
- livemedia-creator: Remove random-seed from images (#1258986) (bcl@redhat.com)
- drop fedup-dracut and friends (wwoods@redhat.com)
- don't build upgrade.img anymore (wwoods@redhat.com)
* Thu Aug 27 2015 Brian C. Lane <bcl@redhat.com> 23.17-1
- Add enough of shadow-utils to create new user accounts. (dshea@redhat.com)
* Fri Aug 07 2015 Brian C. Lane <bcl@redhat.com> 23.16-1
- some of the PowerPC utilities (powerpc-utils and fbset) need perl too
(pbrobinson@gmail.com)
- Add a default vconsole.conf to the boot.iso (#1250260) (bcl@redhat.com)
- Return the output from failed commands in CalledProcessError (bcl@redhat.com)
- Add dracut-live for livemedia kickstart example (bcl@redhat.com)
* Thu Jul 30 2015 Brian C. Lane <bcl@redhat.com> 23.15-1
- livemedia-creator: Bump default releasevere to 23 (bcl@redhat.com)
- Use execReadlines in livemedia-creator (bcl@redhat.com)
- Add execReadlines to executils. (bcl@redhat.com)
- Add reset_lang argument to everything in executils. (bcl@redhat.com)
* Tue Jul 21 2015 Brian C. Lane <bcl@redhat.com> 23.14-1
- Add a new makefile target that does everything needed for jenkins.
(clumens@redhat.com)

View File

@ -1 +1 @@
23.14-1 ./
23.21-1 ./

View File

@ -17,9 +17,6 @@ mkdir ${KERNELDIR}
## normal aarch64
installkernel images-${basearch} ${kernel.path} ${KERNELDIR}/vmlinuz
installinitrd images-${basearch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img
%if doupgrade:
installupgradeinitrd images-${basearch} ${kernel.upgrade.path} ${KERNELDIR}/upgrade.img
%endif
%endfor
#FIXME: this will need adjusted when we have a real bootloader.

View File

@ -36,22 +36,6 @@ mkdir ${KERNELDIR}
platforms = platforms + delimiter + kernel.flavor
delimiter = ','
%>
%if doupgrade:
## install upgrade image
installupgradeinitrd images-${kernel.flavor}-${basearch} ${kernel.upgrade.path} ${KERNELDIR}/upgrade-${kernel.flavor}.img
runcmd mkimage \
-A arm -O linux -T ramdisk -C none \
-a 0 -e 0 \
-n "${product.name} ${product.version} ${kernel.flavor} ${kernel.arch}" \
-d ${outroot}/${KERNELDIR}/upgrade-${kernel.flavor}.img \
${outroot}/${KERNELDIR}/uUpgrade-${kernel.flavor}
treeinfo images-${kernel.flavor}-${basearch} uupgrade ${KERNELDIR}/uUpgrade-${kernel.flavor}
%endif
## create U-Boot wrapped images
runcmd mkimage \
@ -75,21 +59,6 @@ mkdir ${KERNELDIR}
installkernel images-${basearch} ${kernel.path} ${KERNELDIR}/vmlinuz
installinitrd images-${basearch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img
%if doupgrade:
## install upgrade image
installupgradeinitrd images-${basearch} ${kernel.upgrade.path} ${KERNELDIR}/upgrade.img
runcmd mkimage \
-A arm -O linux -T ramdisk -C none \
-a 0 -e 0 \
-n "${product.name} ${product.version} ${kernel.flavor} ${kernel.arch}" \
-d ${outroot}/${KERNELDIR}/upgrade.img \
${outroot}/${KERNELDIR}/uUpgrade
treeinfo images-${basearch} uupgrade ${KERNELDIR}/uUpgrade
%endif
## create U-Boot wrapped images
runcmd mkimage \
@ -119,7 +88,7 @@ treeinfo ${basearch} platforms ${platforms}
<% images=["product", "updates"] %>
%for img in images:
%if exists("%s/%s/" % (LORAXDIR, img)):
installimg ${LORAXDIR}/${img}/ images/${img}.img
installimg --xz -9 --memlimit-compress=3700MiB ${LORAXDIR}/${img}/ images/${img}.img
%endif
%endfor
@ -131,4 +100,3 @@ treeinfo ${basearch} platforms ${platforms}
%>
## FIXME: ARM may need some extra boot config

View File

@ -0,0 +1,2 @@
KEYMAP=us
FONT=eurlatgr

View File

@ -74,7 +74,7 @@ mkdir ${KERNELDIR}
<% images=["product", "updates"] %>
%for img in images:
%if exists("%s/%s/" % (LORAXDIR, img)):
installimg ${LORAXDIR}/${img}/ images/${img}.img
installimg --xz -9 --memlimit-compress=3700MiB ${LORAXDIR}/${img}/ images/${img}.img
%endif
%endfor

View File

@ -75,10 +75,14 @@ hardlink ${KERNELDIR}/initrd.img ${BOOTDIR}
%endif
# Create optional product.img and updates.img
<% imggraft=""; images=["product", "updates"] %>
<% imggraft=""; images=["product", "updates"]; compressargs=None; %>
%if basearch == 'i386':
# Limit the amount of memory xz uses on i386
<% compressargs="--xz -9 --memlimit-compress=3700MiB" %>
%endif
%for img in images:
%if exists("%s/%s/" % (LORAXDIR, img)):
installimg ${LORAXDIR}/${img}/ images/${img}.img
installimg ${compressargs} ${LORAXDIR}/${img}/ images/${img}.img
<% imggraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %>
%endif
%endfor

View File

@ -68,11 +68,6 @@ install ${configdir}/mapping ${BOOTDIR}
installkernel images-${kernel.arch} ${kernel.path} ${KERNELDIR}/vmlinuz
installinitrd images-${kernel.arch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img
%if doupgrade:
## upgrade image
installupgradeinitrd images-${kernel.arch} ${kernel.upgrade.path} ${KERNELDIR}/upgrade.img
%endif
## kernel-wrapper magic that makes the netboot combined ppc{32,64}.img
runcmd ${inroot}/${WRAPPER} -p of \
-D ${inroot}/${WRAPPER_DATA} \

View File

@ -54,11 +54,6 @@ install ${configdir}/mapping ${BOOTDIR}
installkernel images-${kernel.arch} ${kernel.path} ${KERNELDIR}/vmlinuz
installinitrd images-${kernel.arch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img
%if doupgrade:
## upgrade image
installupgradeinitrd images-${kernel.arch} ${kernel.upgrade.path} ${KERNELDIR}/upgrade.img
%endif
treeinfo images-${kernel.arch} zimage
%endfor

View File

@ -6,7 +6,8 @@ remove usr/share/i18n
## not required packages installed as dependencies
## no perl besides s390x
%if basearch != "s390x":
## perl needed for powerpc-utils and fbset on PPC
%if basearch not in ("ppc", "ppc64", "ppc64le", "s390x"):
removepkg perl*
%endif
## no sound support, thanks
@ -36,8 +37,13 @@ append etc/selinux/config ""
removefrom fedora-release --allbut /etc/os-release /usr/lib/os-release \
/usr/lib/os.release.d/*
removepkg fedora-release-rawhide
## no user accounts = no account management
removepkg usermode usermode-gtk passwd shadow-utils
## keep enough of shadow-utils to create accounts
removefrom shadow-utils --allbut /usr/bin/chage /usr/sbin/chpasswd \
/usr/sbin/groupadd /usr/sbin/useradd
## remove other account management tools
removepkg usermode usermode-gtk passwd
## no services to turn on/off (keep the /etc/init.d link though)
removefrom chkconfig --allbut /etc/init.d
## Miscellanous unnecessary gpg program
@ -202,7 +208,6 @@ removefrom gmp /usr/${libdir}/libgmpxx.* /usr/${libdir}/libmp.*
removefrom gnome-bluetooth-libs /usr/${libdir}/libgnome-bluetooth*
removefrom gnome-bluetooth-libs /usr/share/*
removefrom gnutls /usr/share/locale/*
removefrom gpgme /usr/${libdir}/libgpgme-*
removefrom grep /etc/* /usr/share/locale/*
removefrom gstreamer /usr/bin/* /usr/${libdir}/gstreamer-0.10/*
removefrom gstreamer /usr/${libdir}/libgst* /usr/libexec/* /usr/share/locale/*

View File

@ -52,12 +52,7 @@ installpkg plymouth
## extra dracut modules
installpkg anaconda-dracut dracut-network dracut-config-generic
## fedup-dracut handles upgrades
installpkg fedup-dracut fedup-dracut-plymouth
## install other fedup scripts, if there are any. It's OK if there aren't.
log "Looking for extra fedup-dracut packages..."
-installpkg *-fedup-dracut
## fedup and rescue need this
## rescue needs this
installpkg cryptsetup
## rpcbind or portmap needed by dracut nfs module
@ -139,6 +134,7 @@ installpkg xorg-x11-fonts-misc
installpkg gnome-icon-theme-legacy
installpkg aajohan-comfortaa-fonts
installpkg abattis-cantarell-fonts
installpkg sil-scheherazade-fonts
## debugging/bug reporting tools
installpkg gdb-gdbserver

View File

@ -62,6 +62,7 @@ install ${configdir}/sysctl.conf etc/sysctl.d/anaconda.conf
install ${configdir}/spice-vdagentd etc/sysconfig
mkdir etc/NetworkManager/conf.d
install ${configdir}/91-anaconda-autoconnect-slaves.conf etc/NetworkManager/conf.d
install ${configdir}/vconsole.conf etc
## set up sshd
install ${configdir}/sshd_config.anaconda etc/ssh
@ -78,7 +79,6 @@ replace "root:\*:" "root::" etc/shadow
## s390-specific setup
%if basearch in ("s390", "s390x"):
## 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
runcmd ssh-keygen -q -C "" -N "" -t dsa -f ${root}/etc/ssh/ssh_host_dsa_key
chmod etc/ssh/ssh_host*_key 600

View File

@ -26,11 +26,6 @@ replace @INITRD_LOAD_ADDRESS@ ${INITRD_ADDRESS} generic.ins
installkernel images-${basearch} ${kernel.path} ${KERNELDIR}/kernel.img
installinitrd images-${basearch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img
%if doupgrade:
## upgrader image
installupgradeinitrd images-${basearch} ${kernel.upgrade.path} ${KERNELDIR}/upgrade.img
%endif
## s390 needs some extra boot config
createaddrsize ${INITRD_ADDRESS} ${outroot}/${BOOTDIR}/initrd.img ${outroot}/${BOOTDIR}/initrd.addrsize

View File

@ -44,30 +44,18 @@ mkdir ${KERNELDIR}
## i386 PAE
installkernel images-xen ${kernel.path} ${KERNELDIR}/vmlinuz-${kernel.flavor}
installinitrd images-xen ${kernel.initrd.path} ${KERNELDIR}/initrd-${kernel.flavor}.img
%if doupgrade:
installupgradeinitrd images-xen ${kernel.upgrade.path} ${KERNELDIR}/upgrade-${kernel.flavor}.img
%endif
%else:
## normal i386, x86_64
installkernel images-${basearch} ${kernel.path} ${KERNELDIR}/vmlinuz
installinitrd images-${basearch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img
%if doupgrade:
installupgradeinitrd images-${basearch} ${kernel.upgrade.path} ${KERNELDIR}/upgrade.img
%endif
%endif
%endfor
hardlink ${KERNELDIR}/vmlinuz ${BOOTDIR}
hardlink ${KERNELDIR}/initrd.img ${BOOTDIR}
%if doupgrade:
hardlink ${KERNELDIR}/upgrade.img ${BOOTDIR}
%endif
%if basearch == 'x86_64':
treeinfo images-xen kernel ${KERNELDIR}/vmlinuz
treeinfo images-xen initrd ${KERNELDIR}/initrd.img
%if doupgrade:
treeinfo images-xen upgrade ${KERNELDIR}/upgrade.img
%endif
%endif
## WHeeeeeeee, EFI.
@ -89,10 +77,14 @@ hardlink ${KERNELDIR}/initrd.img ${BOOTDIR}
%endif
# Create optional product.img and updates.img
<% imggraft=""; images=["product", "updates"] %>
<% imggraft=""; images=["product", "updates"]; compressargs=None; %>
%if basearch == 'i386':
# Limit the amount of memory xz uses on i386
<% compressargs="--xz -9 --memlimit-compress=3700MiB" %>
%endif
%for img in images:
%if exists("%s/%s/" % (LORAXDIR, img)):
installimg ${LORAXDIR}/${img}/ images/${img}.img
installimg ${compressargs} ${LORAXDIR}/${img}/ images/${img}.img
<% imggraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %>
%endif
%endfor

View File

@ -2,7 +2,7 @@
#
# image-minimizer: removes files and packages on the filesystem
#
# Copyright 2007-2015 Red Hat, Inc.
# Copyright 2007-2016 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -70,7 +70,7 @@ class ImageMinimizer:
not_found = True
for hdr in mi:
not_found = False
rpms.add(hdr['name'])
rpms.add(hdr['name'].decode("utf8"))
if self.verbose and not_found:
print("%s package not found" % pattern)
@ -115,36 +115,30 @@ class ImageMinimizer:
if os.path.isdir(tag):
self.visited.add(tag)
else:
if self.dryrun:
print('rm ' + tag)
else:
if self.verbose:
print('rm ' + tag)
if self.dryrun or self.verbose:
print("rm %s" % tag)
if not self.dryrun:
os.remove(tag)
#remove all empty directory. Every 8k counts!
for d in sorted(self.visited, reverse=True):
if len(os.listdir(d)) == 0:
if self.dryrun:
print('rm -rf ' + d)
else:
if self.verbose:
print('rm -rf ' + d)
if self.dryrun or self.verbose:
print("rm -rf %s" % d)
if not self.dryrun:
os.rmdir(d)
def remove_rpm(self):
def runCallback(reason, amount, total, key, client_data):
if self.verbose and reason == rpm.RPMCALLBACK_UNINST_STOP:
print(key, "erased")
print("%s erased" % key)
if len(self.drops_rpm) == 0:
return
for pkg in self.drops_rpm:
if self.dryrun:
print("erasing ", pkg)
else:
if self.verbose:
print("erasing: %s " % pkg)
self.ts.addErase(pkg)
if not self.dryrun:
# skip ts.check(), equivalent to --nodeps
@ -166,10 +160,10 @@ def parse_options():
help="Root path to prepend to all file patterns and installation root for RPM "
"operations. Defaults to INSTALL_ROOT or /mnt/sysimage/")
parser.add_argument("--dryrun", metavar="BOOL", action="store_true", dest="dryrun",
parser.add_argument("--dryrun", action="store_true", dest="dryrun",
help="If set, no filesystem changes are made.")
parser.add_argument("-v", "--verbose", metavar="BOOL", action="store_true", dest="verbose",
parser.add_argument("-v", "--verbose", action="store_true", dest="verbose",
help="Display every action as it is performed.")
parser.add_argument("filename", metavar="STRING", help="Filename to process")
@ -186,7 +180,7 @@ def main():
except SystemExit as e:
sys.exit(e.code)
except KeyboardInterrupt as e:
print("Aborted at user request", file=sys.stderr)
print("Aborted at user request")
if __name__ == "__main__":
main()

View File

@ -61,7 +61,7 @@ class ArchData(DataHolder):
def __init__(self, buildarch):
super(ArchData, self).__init__()
self.buildarch = buildarch
self.basearch = dnf.arch.basearch(buildarch)
self.basearch = dnf.rpm.basearch(buildarch)
self.libdir = "lib64" if self.basearch in self.lib64_arches else "lib"
self.bcj = self.bcj_arch.get(self.basearch)
@ -338,21 +338,6 @@ class Lorax(BaseLoraxClass):
treebuilder.rebuild_initrds(add_args=anaconda_args)
if doupgrade:
# Build upgrade.img. It'd be nice if these could coexist in the same
# image, but that would increase the size of the anaconda initramfs,
# which worries some people (esp. PPC tftpboot). So they're separate.
try:
# If possible, use the 'fedup' plymouth theme
themes = runcmd_output(['plymouth-set-default-theme', '--list'],
root=installroot)
if 'fedup' in themes.splitlines():
os.environ['PLYMOUTH_THEME_NAME'] = 'fedup'
except RuntimeError:
pass
upgrade_args = dracut_args + ["--add", "system-upgrade"]
treebuilder.rebuild_initrds(add_args=upgrade_args, prefix="upgrade")
logger.info("populating output tree and building boot images")
treebuilder.build()

View File

@ -192,10 +192,11 @@ def _run_program(argv, root='/', stdin=None, stdout=None, env_prune=None, log_ou
raise
with program_log_lock:
program_log.debug("Return code: %d", proc.returncode)
program_log.debug("Return code: %s", proc.returncode)
if proc.returncode and raise_err:
raise subprocess.CalledProcessError(proc.returncode, argv)
output = output_string or "" + err_string or ""
raise subprocess.CalledProcessError(proc.returncode, argv, output)
return (proc.returncode, output_string)

View File

@ -243,9 +243,9 @@ class LoraxTemplateRunner(object):
for src in rglob(self._in(srcglob), fatal=True):
cpfile(src, self._out(dest))
def installimg(self, srcdir, destfile):
def installimg(self, *args):
'''
installimg SRCDIR DESTFILE
installimg [--xz|--gzip|--bzip2|--lzma] [-ARG|--ARG=OPTION] SRCDIR DESTFILE
Create a compressed cpio archive of the contents of SRCDIR and place
it in DESTFILE.
@ -254,11 +254,35 @@ class LoraxTemplateRunner(object):
Examples:
installimg ${LORAXDIR}/product/ images/product.img
installimg ${LORAXDIR}/updates/ images/updates.img
installimg --xz -6 ${LORAXDIR}/updates/ images/updates.img
installimg --xz -9 --memlimit-compress=3700MiB ${LORAXDIR}/updates/ images/updates.img
Optionally use a different compression type and override the default args
passed to it. The default is xz -9
'''
COMPRESSORS = ("--xz", "--gzip", "--bzip2", "--lzma")
if len(args) < 2:
raise ValueError("Not enough args for installimg.")
srcdir = args[-2]
destfile = args[-1]
if not os.path.isdir(self._in(srcdir)) or not os.listdir(self._in(srcdir)):
return
compression = "xz"
compressargs = []
if args[0] in COMPRESSORS:
compression = args[0][2:]
for arg in args[1:-2]:
if arg.startswith('-'):
compressargs.append(arg)
else:
raise ValueError("Argument is missing -")
logger.info("Creating image file %s from contents of %s", self._out(destfile), self._in(srcdir))
mkcpio(self._in(srcdir), self._out(destfile))
logger.debug("Using %s %s compression", compression, compressargs or "")
mkcpio(self._in(srcdir), self._out(destfile), compression=compression, compressargs=compressargs)
def mkdir(self, *dirs):
'''

View File

@ -548,6 +548,23 @@ def novirt_log_check(log_check, proc):
return False
def anaconda_cleanup(dirinstall_path):
"""
Cleanup any leftover mounts from anaconda
:param str dirinstall_path: Path where anaconda mounts things
If anaconda crashes it may leave things mounted under this path. It will
typically be set to /mnt/sysimage/
"""
dirinstall_path = os.path.abspath(dirinstall_path)
# unmount filesystems
for mounted in reversed(open("/proc/mounts").readlines()):
(_device, mountpoint, _rest) = mounted.split(" ", 2)
if mountpoint.startswith(dirinstall_path):
umount(mountpoint)
def novirt_install(opts, disk_img, disk_size, repo_url):
"""
Use Anaconda to install to a disk image
@ -633,8 +650,8 @@ def novirt_install(opts, disk_img, disk_size, repo_url):
finally:
log_monitor.shutdown()
# If anaconda failed there may be things needing cleanup
execWithRedirect("anaconda-cleanup", [])
# Make sure any leftover anaconda mounts have been cleaned up
anaconda_cleanup(ROOT_PATH)
# Move the anaconda logs over to a log directory
log_dir = os.path.abspath(os.path.dirname(opts.logfile))
@ -1006,7 +1023,7 @@ def main():
help="Substituted for @TITLE@ in bootloader config files")
parser.add_argument("--project", default="Linux",
help="substituted for @PROJECT@ in bootloader config files")
parser.add_argument("--releasever", default="22",
parser.add_argument("--releasever", default="23",
help="substituted for @VERSION@ in bootloader config files")
parser.add_argument("--volid", default=None, help="volume id")
parser.add_argument("--squashfs_args",
@ -1130,6 +1147,12 @@ def main():
ks = KickstartParser(ks_version, errorsAreFatal=False, missingIncludeIsFatal=False)
ks.readKickstart(opts.ks[0])
# live iso usually needs dracut-live so warn the user if it is missing
if opts.ks and opts.make_iso:
if "dracut-live" not in ks.handler.packages.packageList:
log.error("dracut-live package is missing from the kickstart.")
sys.exit(1)
# Make the disk or filesystem image
if not opts.disk_image and not opts.fs_image:
errors = []