2014-03-31 18:13:03 +00:00
|
|
|
# Minimal Disk Image -- Example of image-minimizer usage in %post
|
|
|
|
#
|
|
|
|
# Firewall configuration
|
|
|
|
firewall --enabled
|
|
|
|
# Use network installation
|
2018-11-27 01:04:25 +00:00
|
|
|
url --url="http://URL-TO-BASEOS/"
|
|
|
|
repo --name=appstream --baseurl="http://URL-TO-APPSTREAM/"
|
2016-03-22 19:05:13 +00:00
|
|
|
# Network information
|
|
|
|
network --bootproto=dhcp --device=link --activate
|
2014-03-31 18:13:03 +00:00
|
|
|
|
|
|
|
# Root password
|
|
|
|
rootpw --plaintext removethispw
|
|
|
|
# System authorization information
|
2016-03-22 19:05:13 +00:00
|
|
|
auth --useshadow --passalgo=sha512
|
2014-03-31 18:13:03 +00:00
|
|
|
# System keyboard
|
|
|
|
keyboard --xlayouts=us --vckeymap=us
|
|
|
|
# System language
|
|
|
|
lang en_US.UTF-8
|
|
|
|
# SELinux configuration
|
|
|
|
selinux --enforcing
|
|
|
|
# Installation logging level
|
|
|
|
logging --level=info
|
|
|
|
# Shutdown after installation
|
|
|
|
shutdown
|
|
|
|
# System timezone
|
|
|
|
timezone US/Eastern
|
|
|
|
# System bootloader configuration
|
|
|
|
bootloader --location=mbr
|
|
|
|
# Partition clearing information
|
2015-05-12 00:09:04 +00:00
|
|
|
clearpart --all --initlabel
|
2014-03-31 18:13:03 +00:00
|
|
|
# Disk partitioning information
|
|
|
|
part / --fstype="ext4" --size=4000
|
|
|
|
part swap --size=1000
|
|
|
|
|
|
|
|
%post
|
|
|
|
# Remove root password
|
|
|
|
passwd -d root > /dev/null
|
2015-09-02 17:32:30 +00:00
|
|
|
|
|
|
|
# Remove random-seed
|
|
|
|
rm /var/lib/systemd/random-seed
|
2018-11-27 01:04:25 +00:00
|
|
|
|
|
|
|
# Clear /etc/machine-id
|
|
|
|
rm /etc/machine-id
|
|
|
|
touch /etc/machine-id
|
2014-03-31 18:13:03 +00:00
|
|
|
%end
|
|
|
|
|
|
|
|
%packages
|
|
|
|
@core
|
|
|
|
kernel
|
2016-01-13 22:31:40 +00:00
|
|
|
# Make sure that DNF doesn't pull in debug kernel to satisfy kmod() requires
|
|
|
|
kernel-modules
|
|
|
|
kernel-modules-extra
|
|
|
|
|
2014-03-31 18:13:03 +00:00
|
|
|
memtest86+
|
|
|
|
grub2-efi
|
|
|
|
grub2
|
|
|
|
shim
|
|
|
|
syslinux
|
|
|
|
-dracut-config-rescue
|
2015-01-15 01:14:49 +00:00
|
|
|
|
|
|
|
# dracut needs these included
|
|
|
|
dracut-network
|
|
|
|
tar
|
2016-03-22 19:05:13 +00:00
|
|
|
|
|
|
|
# lorax for image-minimizer
|
|
|
|
lorax
|
2014-03-31 18:13:03 +00:00
|
|
|
%end
|
|
|
|
|
|
|
|
#
|
|
|
|
# Use the image-minimizer to remove some packages and dirs
|
|
|
|
#
|
|
|
|
%post --interpreter=image-minimizer --nochroot
|
|
|
|
|
|
|
|
|
|
|
|
# Kernel modules minimization
|
|
|
|
# Drop many filesystems
|
|
|
|
drop /lib/modules/*/kernel/fs
|
|
|
|
keep /lib/modules/*/kernel/fs/ext*
|
|
|
|
keep /lib/modules/*/kernel/fs/mbcache*
|
|
|
|
keep /lib/modules/*/kernel/fs/squashfs
|
|
|
|
keep /lib/modules/*/kernel/fs/jbd*
|
|
|
|
keep /lib/modules/*/kernel/fs/btrfs
|
|
|
|
keep /lib/modules/*/kernel/fs/cifs*
|
|
|
|
keep /lib/modules/*/kernel/fs/fat
|
|
|
|
keep /lib/modules/*/kernel/fs/nfs
|
|
|
|
keep /lib/modules/*/kernel/fs/nfs_common
|
|
|
|
keep /lib/modules/*/kernel/fs/fscache
|
|
|
|
keep /lib/modules/*/kernel/fs/lockd
|
|
|
|
keep /lib/modules/*/kernel/fs/nls/nls_utf8.ko
|
|
|
|
keep /lib/modules/*/kernel/fs/configfs/configfs.ko
|
|
|
|
keep /lib/modules/*/kernel/fs/fuse
|
|
|
|
keep /lib/modules/*/kernel/fs/isofs
|
|
|
|
# No sound
|
|
|
|
drop /lib/modules/*/kernel/sound
|
|
|
|
|
|
|
|
|
|
|
|
# Drop some unused rpms, without dropping dependencies
|
|
|
|
droprpm checkpolicy
|
|
|
|
droprpm dmraid-events
|
|
|
|
droprpm gamin
|
|
|
|
droprpm gnupg2
|
|
|
|
droprpm linux-atm-libs
|
|
|
|
droprpm make
|
|
|
|
droprpm mtools
|
|
|
|
droprpm mysql-libs
|
|
|
|
droprpm perl
|
|
|
|
droprpm perl-Module-Pluggable
|
|
|
|
droprpm perl-Net-Telnet
|
|
|
|
droprpm perl-PathTools
|
|
|
|
droprpm perl-Pod-Escapes
|
|
|
|
droprpm perl-Pod-Simple
|
|
|
|
droprpm perl-Scalar-List-Utils
|
|
|
|
droprpm perl-hivex
|
|
|
|
droprpm perl-macros
|
|
|
|
droprpm sgpio
|
|
|
|
droprpm syslinux
|
|
|
|
droprpm system-config-firewall-base
|
|
|
|
droprpm usermode
|
2016-03-22 19:05:13 +00:00
|
|
|
# Not needed after image-minimizer is done
|
|
|
|
droprpm lorax
|
2014-03-31 18:13:03 +00:00
|
|
|
%end
|