2023-08-30 16:12:09 +00:00
|
|
|
# Fixes and tweaks to make things easier for end-users
|
|
|
|
|
|
|
|
%post
|
2023-08-30 20:31:00 +00:00
|
|
|
# Need DNS available, so we'll hack it up real quick:
|
|
|
|
echo "nameserver 1.1.1.1" > /etc/resolv.conf
|
|
|
|
|
2023-09-01 19:26:20 +00:00
|
|
|
# switch default kernel package to the -lt variant:
|
2023-08-30 20:31:00 +00:00
|
|
|
echo -e "DEFAULTKERNEL=kernel-lt-core\nUPDATEDEFAULT=yes" > /etc/sysconfig/kernel
|
2023-09-01 19:26:20 +00:00
|
|
|
|
2023-08-30 16:12:09 +00:00
|
|
|
|
|
|
|
# Enable crb and extras by default
|
|
|
|
dnf config-manager --enable crb
|
|
|
|
dnf config-manager --enable extras
|
|
|
|
dnf config-manager --enable elrepo-kernel
|
|
|
|
|
|
|
|
|
2023-09-02 04:07:51 +00:00
|
|
|
# Filthy hack alert: Had DNS resolution issues when building in mock. This is the "solution", for now:
|
2023-09-01 19:26:20 +00:00
|
|
|
echo "nameserver 1.1.1.1" > /etc/resolv.conf
|
2023-08-30 16:12:09 +00:00
|
|
|
curl -o /etc/yum.repos.d/nvidia.repo https://developer.download.nvidia.com/compute/cuda/repos/rhel9/x86_64/cuda-rhel9.repo
|
|
|
|
|
|
|
|
cat > /etc/sysctl.d/80-i915-fix.conf <<EOF
|
|
|
|
# fix performance for newer integrated Intel i915 gfx:
|
|
|
|
dev.i915.perf_stream_paranoid = 0
|
|
|
|
EOF
|
|
|
|
|
|
|
|
# Add flathub so Gnome Software shows all kinds of great apps:
|
|
|
|
mkdir -p /etc/flatpak/remotes.d
|
|
|
|
curl -o /etc/flatpak/remotes.d/flathub.flatpakrepo https://dl.flathub.org/repo/flathub.flatpakrepo
|
|
|
|
|
|
|
|
# Install Google Chrome:
|
|
|
|
dnf -y install https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
|
|
|
|
|
2023-09-01 19:26:20 +00:00
|
|
|
# Initialize flathub + dnf metadata (attempt to make Software app faster first-boot):
|
|
|
|
flatpak remote-ls &> /dev/null
|
|
|
|
flatpak update
|
|
|
|
dnf -y makecache
|
|
|
|
|
|
|
|
|
|
|
|
# Enable dkms service:
|
|
|
|
systemctl enable dkms
|
|
|
|
|
|
|
|
# Visible char. marks for sudo:
|
|
|
|
echo "Defaults pwfeedback" > /etc/sudoers.d/50_feedback
|
|
|
|
|
2023-08-30 16:12:09 +00:00
|
|
|
|
2023-09-01 19:26:20 +00:00
|
|
|
# Make Anaconda install-to-disk icon visible in live environment:
|
|
|
|
sed -i 's/NoDisplay=true/#NoDisplay=true/' /usr/share/applications/anaconda.desktop
|
|
|
|
sed -i 's/NoDisplay=true/#NoDisplay=true/' /usr/share/applications/liveinst.desktop
|
2023-08-30 16:12:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Inside-the-ISO postinstall script
|
|
|
|
# Anything put in /usr/shar/anaconda/post-scripts/*.ks will be run as a %post
|
|
|
|
# after the user installs on their system from the booted live ISO. We need to do grub boot modification
|
|
|
|
# only after Anaconda has run and installed on their system, not when this ISO is built:
|
|
|
|
|
|
|
|
# Need to turn %post and %end into variables, or kickstart gets confused:
|
|
|
|
export post="%post"
|
|
|
|
export end="%end"
|
|
|
|
|
|
|
|
cat > /usr/share/anaconda/post-scripts/95-kernel-gfx-args.ks <<EOF
|
|
|
|
${post}
|
|
|
|
# Add Intel + Nvidia tweaks to permanent boot options automatically:
|
2024-08-04 20:54:33 +00:00
|
|
|
sed -i 's/quiet"/quiet i915.force_probe=* rd.driver.blacklist=nouveau nvidia_drm.modeset=0"/' /etc/default/grub
|
2023-08-30 16:12:09 +00:00
|
|
|
grub2-mkconfig -o /boot/grub2/grub.cfg
|
2024-08-04 20:54:33 +00:00
|
|
|
if [ -f /boot/efi/EFI/rocky/grub.cfg ]; then
|
|
|
|
grub2-mkconfig -o /boot/efi/EFI/rocky/grub.cfg
|
|
|
|
fi
|
2023-08-30 16:12:09 +00:00
|
|
|
${end}
|
|
|
|
EOF
|
|
|
|
|
2023-08-30 20:31:00 +00:00
|
|
|
# Clean up some space at the end:
|
|
|
|
dnf -y clean all
|
|
|
|
|
2023-08-30 16:12:09 +00:00
|
|
|
%end
|
|
|
|
|
|
|
|
|