# Generated by pykickstart v3.48
#version=F36
# Keyboard layouts
keyboard 'us'
# System language
lang en_US.UTF-8
# Network information
network  --bootproto=dhcp --device=link --activate
# Shutdown after installation
shutdown
repo --name="koji" --baseurl=https://build.opencloudos.tech/kojifiles/repos/dist-oc9-webui-build/latest/$basearch/
# Root password
rootpw --iscrypted --lock locked
# SELinux configuration
# close selinux 
#selinux --enforcing
selinux --disabled
# System services
services --disabled="sshd" --enabled="NetworkManager"
# System timezone
timezone Asia/Shanghai --utc
# Use network installation
url --url=https://build.opencloudos.tech/kojifiles/repos/dist-oc9-webui-build/latest/$basearch/
# System bootloader configuration
bootloader --location=none --append=selinux=0
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all
# Disk partitioning information
part / --fstype="ext4" --size=7168
#part /boot/efi --fstype="efi" --size=500

xconfig --startxonboot
firstboot --enable


%post
# set livesys session type
sed -i 's/^livesys_session=.*/livesys_session="gnome"/' /etc/sysconfig/livesys

# set gnome init
rm -rf /home/liveuser/.config

# set live background, TODO
#sudo -u liveuser gsettings org.gnome.desktop.background picture-uri 'file:///usr/share/backgrounds/gnome/adwaita-l.webp'
sed -i "s/jpg/webp/g" /usr/share/glib-2.0/schemas/org.gnome.desktop.background.gschema.xml
glib-compile-schemas /usr/share/glib-2.0/schemas

# Enable livesys services
systemctl enable livesys.service
systemctl enable livesys-late.service
# enable tmpfs for /tmp
systemctl enable tmp.mount

# make it so that we don't do writing to the overlay for things which
# are just tmpdirs/caches
# note https://bugzilla.redhat.com/show_bug.cgi?id=1135475
cat >> /etc/fstab << EOF
vartmp   /var/tmp    tmpfs   defaults   0  0
EOF

# work around for poor key import UI in PackageKit
rm -f /var/lib/rpm/__db*
echo "Packages within this LiveCD"
rpm -qa --qf '%{size}\t%{name}-%{version}-%{release}.%{arch}\n' |sort -rn
# Note that running rpm recreates the rpm db files which aren't needed or wanted
rm -f /var/lib/rpm/__db*

# go ahead and pre-make the man -k cache (#455968)
/usr/bin/mandb

# Remove machine-id on pre generated images
rm -f /etc/machine-id
touch /etc/machine-id

%end


%packages
@Server with GUI
anaconda
anaconda-install-env-deps
anaconda-live
anaconda-webui
opencloudos-logos
gnome-backgrounds
dnf
dracut-config-generic
dracut-live
glibc-all-langpacks
grub2-efi
grub2-efi-aa64-cdboot
#grub2-pc-modules
#grub2-efi-x64-cdboot
#syslinux
kernel
kernel-modules
kernel-modules-extra
livesys-scripts
shim
-dracut-config-rescue

# Exclude unwanted packages from @anaconda-tools group
-gfs2-utils
-reiserfs-utils

# zz
efibootmgr

%end