Compare commits
28 Commits
master
...
f23-branch
Author | SHA1 | Date | |
---|---|---|---|
|
8268069a9c | ||
|
5bbef06725 | ||
|
541109ff69 | ||
|
d14f19ae31 | ||
|
926a7f6b16 | ||
|
f1fd83da7a | ||
|
4679887cc9 | ||
|
dcd029f50b | ||
|
eb59bc4fab | ||
|
07dca74c06 | ||
|
4bec6f9b61 | ||
|
476deb0e42 | ||
|
d12fc22673 | ||
|
4056a5cc84 | ||
|
8ac8939b3a | ||
|
48498d9a2e | ||
|
ba11077394 | ||
|
704a01919b | ||
|
d9c23d1bce | ||
|
7c0c5c53ca | ||
|
2a19315dcd | ||
|
8efdfd26f2 | ||
|
fd16dc1d1b | ||
|
27e95a3b8b | ||
|
0c2905d2a3 | ||
|
4ffcd47874 | ||
|
b74986b2ba | ||
|
955afa8699 |
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
49
lorax.spec
49
lorax.spec
@ -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)
|
||||
|
@ -1 +1 @@
|
||||
23.14-1 ./
|
||||
23.21-1 ./
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
|
||||
|
2
share/config_files/common/vconsole.conf
Normal file
2
share/config_files/common/vconsole.conf
Normal file
@ -0,0 +1,2 @@
|
||||
KEYMAP=us
|
||||
FONT=eurlatgr
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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} \
|
||||
|
@ -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
|
||||
|
||||
|
@ -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/*
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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()
|
||||
|
@ -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()
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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):
|
||||
'''
|
||||
|
@ -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 = []
|
||||
|
Loading…
Reference in New Issue
Block a user