kickstarts/Rocky-8-Container-UBI.ks

114 lines
2.2 KiB
Plaintext
Raw Normal View History

2022-07-07 19:05:25 +00:00
# This is a minimal Rocky kickstart designed for docker.
# It will not produce a bootable system
# To use this kickstart, run make
# Basic setup information
2022-11-12 21:31:34 +00:00
url --url https://download.rockylinux.org/stg/rocky/8/BaseOS/$basearch/os/
2022-07-07 19:05:25 +00:00
text
bootloader --disable
firewall --disabled
network --bootproto=dhcp --device=link --activate --onboot=on
rootpw --lock --iscrypted locked
selinux --disabled
shutdown
keyboard us
lang en_US.UTF-8
2023-04-02 13:45:56 +00:00
timezone --isUtc --nontp Etc/UTC
2022-07-07 19:05:25 +00:00
# Disk setup
zerombr
clearpart --all --initlabel
autopart --noboot --nohome --noswap --nolvm --fstype=ext4
2022-12-17 17:49:49 +00:00
%pre
dbus-broker-launch --scope=none
%end
2022-12-17 17:54:43 +00:00
%addon com_redhat_kdump --disable
%end
2022-12-17 17:49:49 +00:00
2022-07-07 19:05:25 +00:00
# Package setup
%packages --ignoremissing --excludedocs --instLangs=en --nocore --excludeWeakdeps
bash
coreutils-single
crypto-policies-scripts
2023-04-02 13:45:56 +00:00
curl-minimal
2022-07-07 19:05:25 +00:00
findutils
2023-04-02 13:45:56 +00:00
gdb-gdbserver
2022-07-07 19:05:25 +00:00
glibc-minimal-langpack
2023-04-02 13:45:56 +00:00
gzip
libcurl-minimal
systemd
2022-07-07 19:05:25 +00:00
rocky-release
rootfiles
tar
vim-minimal
which
yum
-dosfstools
-e2fsprogs
-firewalld
-fuse-libs
-gettext*
-gnupg2-smime
-grub\*
-iptables
-kernel
-kexec-tools
-libss
-os-prober*
-pinentry
-qemu-guest-agent
-shared-mime-info
-trousers
-xfsprogs
-xkeyboard-config
%end
%post --erroronfail --log=/root/anaconda-post.log
2023-04-02 13:45:56 +00:00
set -eux
2022-07-07 19:05:25 +00:00
# container customizations inside the chroot
# Stay compatible
echo 'container' > /etc/dnf/vars/infra
#Generate installtime file record
/bin/date +%Y%m%d_%H%M > /etc/BUILDTIME
# Limit languages to help reduce size.
LANG="en_US"
echo "%_install_langs $LANG" > /etc/rpm/macros.image-language-conf
# https://bugzilla.redhat.com/show_bug.cgi?id=1727489
echo 'LANG="C.UTF-8"' > /etc/locale.conf
# systemd fixes
:> /etc/machine-id
umount /run
systemd-tmpfiles --create --boot
# mask mounts and login bits
systemctl mask \
console-getty.service \
dev-hugepages.mount \
getty.target \
sys-fs-fuse-connections.mount \
systemd-logind.service \
systemd-remount-fs.service
2023-04-02 13:45:56 +00:00
# Remove network configuration files leftover from anaconda installation
# https://bugzilla.redhat.com/show_bug.cgi?id=1713089
rm -f /etc/sysconfig/network-scripts/ifcfg-*
2022-07-07 19:05:25 +00:00
# Cleanup the image
rm -f /etc/udev/hwdb.bin
rm -rf /usr/lib/udev/hwdb.d/ \
/boot /var/lib/dnf/history.* \
2023-04-02 13:45:56 +00:00
/var/cache/* /var/log/* \
2022-07-07 19:05:25 +00:00
/tmp/* /tmp/.* || true
%end