diff --git a/CHANGELOG.md b/CHANGELOG.md index ba7f0ab..5ff0d63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 9.0.0 - 2024-06-09 +### Changed +- Adopt kiwi-ng for builing images +### Removed +- Kickstart scripts + ## CentOS 9 - 2024-01-05 ### Changed - Minimize apps in favour of Flatpak diff --git a/Containerfile b/Containerfile index e6324fa..e3f0ee0 100644 --- a/Containerfile +++ b/Containerfile @@ -1,7 +1,6 @@ FROM quay.io/centos/centos:stream9 -ADD tools/ks-package-list.py /usr/local/bin/ks-package-list -RUN chmod ugo+x /usr/local/bin/ks-package-list && \ +RUN dnf --assumeyes install epel-release glibc-gconv-extra && \ dnf --assumeyes --setopt='tsflags=nodocs' --setopt='install_weak_deps=False' \ -install bash-completion pykickstart lorax-lmc-novirt && \ +install bash-completion distribution-gpg-keys kiwi-cli kiwi-systemdeps && \ dnf --assumeyes clean all && \ rm /etc/rpm/* -rf \ No newline at end of file diff --git a/README.md b/README.md index 43fdf9a..d3c7b8a 100644 --- a/README.md +++ b/README.md @@ -10,24 +10,24 @@ Other goals of this remix are: * Flatpak apps usage ## How to build the LiveCD -[See a detailed description][03] of how to build the live media. +[See a detailed description][03] about how to build the live media. -**NOTE** - -If `selinux` is on, disable it during the build process: +> [!NOTE] +> +> If `selinux` is on, disable it during the build process: ```shell $ sudo setenforce 0 ``` ### Prepare the working directories -Clone the project to get sources: +Clone the project into your `` to get sources: ```shell $ git clone https://github.com/mbugni/centos-remix.git / ``` -Choose or create a `/` where to put results. +Choose or create a `` folder where to put results. ### Prepare the build container Install Podman: @@ -45,10 +45,9 @@ $ sudo podman build --file=//Containerfile --tag=livebuild:el9 Initialize the container by running an interactive shell: ```shell -$ sudo podman run --privileged --network=host -it \ - --volume=/dev:/dev:ro --volume=/lib/modules:/lib/modules:ro \ - --volume=/:/live/source:ro --volume=/:/live/target \ - --name=livebuild-el9 --hostname=livebuild-el9 livebuild:el9 /usr/bin/bash +$ sudo podman run --privileged --network=host -it --volume=/dev:/dev:ro \ +--volume=/:/live/source:ro --volume=/:/live/target \ +--name=livebuild-el9 --hostname=livebuild-el9 livebuild:el9 /usr/bin/bash ``` The container can be reused and upgraded multiple times. See [Podman docs][06] for more details. @@ -60,39 +59,27 @@ $ sudo podman start -ia livebuild-el9 ``` ### Build the image - -Run build commands inside the container. - -#### Prepare the kickstart file - -Choose a version (eg: KDE workstation with italian support) and then create a single Kickstart file from the source code: +First, start the build container if not running: ```shell -[] ksflatten --config /live/source/kickstarts/l10n/kde-workstation-it_IT.ks \ - --output /live/target/el9-kde-workstation.ks +$ sudo podman start livebuild-el9 ``` -#### Check dependencies (optional) -Run the `ks-package-list` command if you need to check Kickstart dependencies: +Choose a variant (eg: KDE workstation with italian support) that corresponds to a profile (eg: `Workstation-it_IT`). -```shell -[] ks-package-list --stream 9 --format "{name}" --verbose \ - /live/target/el9-kde-workstation.ks > /live/target/el9-kde-packages.txt -``` +Available profiles/variants are: +* `Minimal` (console only, mainly for testing) +* `Desktop` (minimal KDE environment with basic tools) +* `Workstation` (KDE environment with more features like printing and scanning support) -Use the `--help` option to get more info about the tool: +For each variant you can append `-it_IT` to get italian localization (eg: `Desktop-it_IT`). -```shell -[] ks-package-list --help -``` - -#### Create the live image -Build the .iso image by running the `livemedia-creator` command: +Build the .iso image by running the `kiwi-ng` command: ```shell -[] livemedia-creator --no-virt --nomacboot --make-iso --project='CentOS Stream' \ - --releasever=9 --tmp=/live/target --logfile=/live/target/lmc-logs/livemedia.log \ - --ks=/live/target/el9-kde-workstation.ks +$ sudo podman exec livebuild-el9 kiwi-ng --profile=Workstation-it_IT --type=iso \ +--shared-cache-dir=/live/target/cache system build \ +--description=/live/source/kiwi-descriptions --target-dir=/live/target ``` The build can take a while (30 minutes or more), it depends on your machine performances. @@ -105,30 +92,24 @@ $ sudo podman image rm livebuild:el9 ``` ## Transferring the image to a bootable media -Install live media tools: - -```shell -$ sudo dnf install livecd-iso-to-mediums -``` - -Create a bootable USB/SD device using the .iso image: +You can use a tool like [Ventoy][07] to build multiboot USB devices, or simply transfer the image to a single +USB stick using the `dd` command: ```shell -$ sudo livecd-iso-to-disk --format --reset-mbr \ - //lmc-work-/images/boot.iso /dev/sd +$ dd if=//CentOS-Remix.x86_64-.iso of=/dev/ ``` ## Post-install tasks After installation, you can remove live system resources to save space by running: ```shell -$ source /usr/local/post-install/livesys-cleanup.sh +$ source /usr/local/libexec/remix/livesys-cleanup ``` A Flatpak quick setup script is provided: ```shell -$ source /usr/local/post-install/flatpak-setup.sh +$ source /usr/local/libexec/remix/flatpak-setup ``` ## ![Bandiera italiana][04] Per gli utenti italiani @@ -146,7 +127,8 @@ The format is based on [Keep a Changelog][05]. [01]: https://fedoraproject.org/wiki/Remix [02]: https://github.com/mbugni/centos-remix/releases -[03]: https://weldr.io/lorax/lorax.html +[03]: https://osinside.github.io/kiwi [04]: http://flagpedia.net/data/flags/mini/it.png [05]: https://keepachangelog.com/ -[06]: https://docs.podman.io/ \ No newline at end of file +[06]: https://docs.podman.io/ +[07]: https://www.ventoy.net/ \ No newline at end of file diff --git a/kickstarts/base-centos.ks b/kickstarts/base-centos.ks deleted file mode 100644 index ea5e2e3..0000000 --- a/kickstarts/base-centos.ks +++ /dev/null @@ -1,30 +0,0 @@ -# base-centos.ks -# -# Defines the basics for a CentOS live system. - -services --disabled=kdump - -%addon com_redhat_kdump --disable -%end - -%packages --excludeWeakdeps - -# Repositories -centos-stream-release -centos-stream-repos - -%end - -%post - -echo "" -echo "POST BASE CENTOS *************************************" -echo "" - -# Enable CRB (previously named PowerTools) repo -dnf config-manager --set-enabled crb - -# Fix missing installer icon (see https://issues.redhat.com/browse/RHEL-13713) -desktop-file-edit --set-icon=anaconda /usr/share/applications/liveinst.desktop - -%end diff --git a/kickstarts/base-desktop.ks b/kickstarts/base-desktop.ks deleted file mode 100644 index ae19028..0000000 --- a/kickstarts/base-desktop.ks +++ /dev/null @@ -1,205 +0,0 @@ -# base-desktop.ks -# -# Defines the basics for a basic desktop environment. - -%include base.ks - -repo --name=epel-cisco-openh264 --metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-cisco-openh264-$releasever&arch=$basearch - -firewall --enabled --service=mdns - -%packages --excludeWeakdeps - -# Common modules (see fedora-workstation-common.ks) -# Xorg modules (see @base-x) -xorg-x11-server-Xorg -xorg-x11-xauth -xorg-x11-xinit - -# Xorg drivers (see @base-x) -#libva-vdpau-driver -#libvdpau-va-gl -mesa-dri-drivers -#mesa-omx-drivers -mesa-vulkan-drivers -xorg-x11-drivers -#xorg-x11-drv-amdgpu - -# Xorg utils (see @base-x) -egl-utils -glx-utils -vulkan-tools -xorg-x11-server-utils -xorg-x11-utils - -# Core modules (see @core) -dnf -dnf-plugins-core -fwupd -grubby -sudo -# systemd-oomd-defaults -systemd-resolved -util-linux -# zram-generator-defaults - -# Common utilities -bash-completion -bind-utils -# btrfs-progs -less -net-tools -psmisc - -# Fonts -google-noto-sans-fonts -google-noto-sans-mono-fonts -google-noto-serif-fonts -google-noto-emoji-fonts - -# Hardware support -@hardware-support -linux-firmware -microcode_ctl - -# Multimedia -PackageKit-gstreamer-plugin -alsa-utils -gstreamer1-plugin-openh264 -gstreamer1-plugins-bad-free -gstreamer1-plugins-good -gstreamer1-plugins-ugly-free -libjxl # Library files for JPEG-XL -pipewire-alsa -pipewire-gstreamer -pipewire-jack-audio-connection-kit -pipewire-pulseaudio -pipewire-utils - -# Networking -NetworkManager-wifi -firewalld -firewall-config - -# System -plymouth-scripts -plymouth-theme-spinner -rpm-plugin-systemd-inhibit - -# Tools -clinfo -exfatprogs -htop -nano -neofetch -rsync -unar - -%end - - -%post - -echo "" -echo "POST BASE DESKTOP ************************************" -echo "" - -# Antialiasing by default. -# Set Noto fonts as preferred family. -cat > /etc/fonts/local.conf << EOF_FONTS - - - - - - - rgb - true - hintfull - true - lcddefault - - - - - - serif - - Noto Serif - DejaVu Serif - Liberation Serif - - - - - sans-serif - - Noto Sans - DejaVu Sans - Liberation Sans - - - - - monospace - - Noto Sans Mono - DejaVu Sans Mono - Liberation Mono - - - -EOF_FONTS - -# Set a colored prompt -cat > /etc/profile.d/color-prompt.sh << EOF_PROMPT -## Colored prompt -if [ -n "\$PS1" ]; then - if [[ "\$TERM" == *256color ]]; then - if [ \${UID} -eq 0 ]; then - PS1='\[\e[91m\]\u@\h \[\e[93m\]\W\[\e[0m\]\\$ ' - else - PS1='\[\e[94m\]\u@\h \[\e[93m\]\W\[\e[0m\]\\$ ' - fi - else - if [ \${UID} -eq 0 ]; then - PS1='\[\e[31m\]\u@\h \[\e[33m\]\W\[\e[0m\]\\$ ' - else - PS1='\[\e[34m\]\u@\h \[\e[33m\]\W\[\e[0m\]\\$ ' - fi - fi -fi -EOF_PROMPT - -# Sets a default grub config if not present (rhb #886502) -# Provides some reasonable defaults when the bootloader is not installed -if [ ! -f "/etc/default/grub" ]; then -cat > /etc/default/grub << EOF_DEFAULT_GRUB -GRUB_TIMEOUT=3 -GRUB_DISTRIBUTOR="\$(sed 's, release .*\$,,g' /etc/system-release)" -GRUB_DEFAULT=saved -GRUB_CMDLINE_LINUX="rd.md=0 rd.dm=0 rd.luks=0 rhgb quiet" -GRUB_DISABLE_RECOVERY=false -# GRUB_DISABLE_OS_PROBER=true -EOF_DEFAULT_GRUB -fi - -# Disable weak dependencies to avoid unwanted stuff -echo "install_weak_deps=False" >> /etc/dnf/dnf.conf - -# Set default boot theme -/usr/sbin/plymouth-set-default-theme spinner - -# Crete post-install cleanup script -mkdir -p /usr/local/post-install - -cat > /usr/local/post-install/livesys-cleanup.sh << CLEANUP_EOF -# livesys cleanup commands - -echo "Cleaning up livesys resources..." -sudo sh -c 'systemctl disable livesys.service; systemctl disable livesys-late.service; -dnf --assumeyes remove anaconda\* livesys-scripts; -rm /etc/sysconfig/livesys* -rf; rm /var/lib/livesys -rf' -CLEANUP_EOF - -%end diff --git a/kickstarts/base-extras.ks b/kickstarts/base-extras.ks deleted file mode 100644 index 852baa7..0000000 --- a/kickstarts/base-extras.ks +++ /dev/null @@ -1,39 +0,0 @@ -# base-extras.ks -# -# Adds extra components that the Fedora Project doesn't want to ship. - -# Extra repositories -repo --name=epel --metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-$releasever&arch=$basearch&infra=$infra&content=$contentdir -repo --name=epel-next --metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-next-$releasever&arch=$basearch&infra=$infra&content=$contentdir -repo --name=rpmfusion-free-el-tainted --metalink=https://mirrors.rpmfusion.org/metalink?repo=free-el-tainted-$releasever&arch=$basearch -repo --name=rpmfusion-free-el-updates-released --metalink=http://mirrors.rpmfusion.org/metalink?repo=free-el-updates-released-$releasever&arch=$basearch -repo --name=rpmfusion-nonfree-el-tainted --metalink=https://mirrors.rpmfusion.org/metalink?repo=nonfree-el-tainted-$releasever&arch=$basearch -repo --name=rpmfusion-nonfree-el-updates --metalink=http://mirrors.rpmfusion.org/metalink?repo=nonfree-el-updates-released-$releasever&arch=$basearch - -%packages --excludeWeakdeps - -# Extra repositories -epel-next-release - -# RPM Fusion repositories -rpmfusion-free-release -rpmfusion-free-release-tainted -rpmfusion-nonfree-release -rpmfusion-nonfree-release-tainted - -# Appstream data -# rpmfusion-*-appstream-data - -# Multimedia -ffmpeg -gstreamer1-libav -gstreamer1-vaapi -gstreamer1-plugins-bad-freeworld -gstreamer1-plugins-ugly -intel-media-driver -libva-intel-driver - -# Tools -unrar - -%end diff --git a/kickstarts/base-flatpak.ks b/kickstarts/base-flatpak.ks deleted file mode 100644 index 09e057c..0000000 --- a/kickstarts/base-flatpak.ks +++ /dev/null @@ -1,41 +0,0 @@ -# base-flatpak.ks -# -# Defines the basics for a basic flatpak environment. - -%packages --excludeWeakdeps - -# Fonts -libreoffice-opensymbol-fonts - -# Software -flatpak - -%end - -%post - -echo "" -echo "POST BASE FLATPAK ************************************" -echo "" - -# Manage flatpak setup -mkdir -p /usr/local/post-install - -cat > /usr/local/post-install/flatpak-setup.sh << EOF_FLATPAK -# Flatpak setup commands - -echo "Setting up flathub repo..." -flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo - -echo "Sharing user Gtk settings with apps..." -flatpak override --user --filesystem=xdg-config/gtkrc:ro -flatpak override --user --filesystem=xdg-config/gtkrc-2.0:ro -flatpak override --user --filesystem=xdg-config/gtk-3.0:ro -flatpak override --user --filesystem=xdg-config/gtk-4.0:ro - -echo "Installing Firefox..." -flatpak install --noninteractive --assumeyes flathub org.mozilla.firefox - -EOF_FLATPAK - -%end diff --git a/kickstarts/base-repo.ks b/kickstarts/base-repo.ks deleted file mode 100644 index df0a414..0000000 --- a/kickstarts/base-repo.ks +++ /dev/null @@ -1,4 +0,0 @@ -repo --name=baseos --metalink=https://mirrors.centos.org/metalink?repo=centos-baseos-$stream&arch=$basearch&protocol=https,http -repo --name=appstream --metalink=https://mirrors.centos.org/metalink?repo=centos-appstream-$stream&arch=$basearch&protocol=https,http -repo --name=crb --metalink=https://mirrors.centos.org/metalink?repo=centos-crb-$stream&arch=$basearch&protocol=https,http -url --mirrorlist=https://mirrors.centos.org/metalink?repo=centos-baseos-$stream&arch=$basearch&protocol=https,http diff --git a/kickstarts/base.ks b/kickstarts/base.ks deleted file mode 100644 index aec54ad..0000000 --- a/kickstarts/base.ks +++ /dev/null @@ -1,113 +0,0 @@ -# base.ks -# -# Defines the basics for all kickstarts -# Does not include package selection (other then mandatory) -# Does not include localization packages or configuration -# -# Does includes "default" language configuration (kickstarts including -# this template can override these settings) - -lang en_US.UTF-8 -keyboard us -timezone --utc Etc/UTC -selinux --permissive -firewall --enabled --service=mdns -xconfig --startxonboot -zerombr -clearpart --all -part / --size 8192 --fstype ext4 -services --disabled=sshd,NetworkManager-wait-online -network --bootproto=dhcp --device=link --activate -rootpw --lock --iscrypted locked -shutdown - -%include base-repo.ks -%include base-centos.ks - -%packages --excludeWeakdeps -# Explicitly specified here: -# walters: because otherwise dependency loops cause yum issues. -kernel -kernel-modules -kernel-modules-extra - -# This was added a while ago, I think it falls into the category of -# "Diagnosis/recovery tool useful from a Live OS image". Leaving this untouched -# for now. -memtest86+ # Keep this for CentOS, otherwise lorax x86.tmpl will fail - -# The point of a live image is to install -anaconda -anaconda-install-env-deps -anaconda-liveinst -# @anaconda-tools -efibootmgr -grub2-efi-x64* -grub2-pc* -grub2-tools* -shim-* -syslinux-extlinux -# zram - -# Without this, initramfs generation during live image creation fails: #1242586 -dracut-live - -# anaconda needs the locales available to run for different locales -# but the live image includes only desired ones to save space -glibc-langpack-en -langpacks-en - -# provide the livesys scripts -livesys-scripts -%end - -%post -# 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 - -# make sure there aren't core files lying around -rm -f /core* - -# remove random seed, the newly installed instance should make it's own -rm -f /var/lib/systemd/random-seed - -# convince readahead not to collect -# FIXME: for systemd - -echo 'File created by kickstart. See systemd-update-done.service(8).' \ - | tee /etc/.updated >/var/.updated - -# Drop the rescue kernel and initramfs, we don't need them on the live media itself. -# See bug 1317709 -rm -f /boot/*-rescue* - -# Disable network service here, as doing it in the services line -# fails due to RHBZ #1369794 -systemctl disable network - -# Remove machine-id on pre generated images -rm -f /etc/machine-id -touch /etc/machine-id - -%end diff --git a/kickstarts/kde-base.ks b/kickstarts/kde-base.ks deleted file mode 100644 index ef2557c..0000000 --- a/kickstarts/kde-base.ks +++ /dev/null @@ -1,35 +0,0 @@ -# kde-base.ks -# -# Defines the basics for the KDE desktop. - -%post - -# set default GTK+ theme for root (see #683855, #689070, #808062) -cat > /root/.gtkrc-2.0 << EOF -include "/usr/share/themes/Adwaita/gtk-2.0/gtkrc" -include "/etc/gtk-2.0/gtkrc" -gtk-theme-name="Adwaita" -EOF -mkdir -p /root/.config/gtk-3.0 -cat > /root/.config/gtk-3.0/settings.ini << EOF -[Settings] -gtk-theme-name = Adwaita -EOF - -# set livesys session type -sed -i 's/^livesys_session=.*/livesys_session="kde"/' /etc/sysconfig/livesys - -# add extra livesys script -mkdir -p /var/lib/livesys -cat >> /var/lib/livesys/livesys-session-extra << EOF_LIVESYS -# Use KDE X11 for auto-login session -sed -i "s/^Session=.*/Session=plasmax11.desktop/" /etc/sddm.conf -EOF_LIVESYS - -cat >> /etc/sddm.conf.d/local.conf << EOF_SDDM -[General] -# Control x11/wayland startup -DisplayServer=x11 -EOF_SDDM - -%end diff --git a/kickstarts/kde-desktop.ks b/kickstarts/kde-desktop.ks deleted file mode 100644 index 11e7e16..0000000 --- a/kickstarts/kde-desktop.ks +++ /dev/null @@ -1,125 +0,0 @@ -# kde-desktop.ks -# -# Provides a basic Linux box based on KDE desktop. - -%include base-desktop.ks -%include base-extras.ks -%include base-flatpak.ks -%include kde-base.ks - -%packages --excludeWeakdeps - -# Multimedia -ffmpegthumbs - -# Software -flatpak-kcm - -# KDE desktop -aha # Convert terminal output to HTML for KDE tools -ark -breeze-gtk -dolphin -featherpad -#fedora-release-kde -gwenview -ibus -kcalc -kcharselect -kcm_systemd -kde-gtk-config -#kde-style-breeze -kdeplasma-addons -kinfocenter -#kgamma -konsole5 -kscreen -kwalletmanager5 -kwin -okular -pam-kwallet -plasma-breeze -plasma-desktop -plasma-milou -plasma-nm # Network Manager -plasma-pa # Pulse Audio -plasma-systemmonitor -plasma-thunderbolt -plasma-workspace -plasma-workspace-x11 -polkit-kde -sddm-x11 -sddm-breeze -sddm-kcm -spectacle -svgpart -sweeper -upower -xdg-desktop-portal-kde - -%end - -%post - -echo "" -echo "POST KDE DESKTOP *************************************" -echo "" - -# Defaults for user configuration -mkdir -p /etc/skel/.config - -# Disable baloo -cat > /etc/xdg/baloofilerc << BALOO_EOF -[Basic Settings] -Indexing-Enabled=false -BALOO_EOF - -# User global settings -cat > /etc/xdg/kdeglobals << GLOBALS_EOF -[General] -fixed=Noto Sans Mono,11 -font=Noto Sans,11 -menuFont=Noto Sans,11 -smallestReadableFont=Noto Sans,10 -toolBarFont=Noto Sans,11 - -[KDE] -SingleClick=false -GLOBALS_EOF - -# Sudo settings -cat > /etc/xdg/kdesurc << KDESU_EOF -[super-user-command] -super-user-command=sudo -KDESU_EOF - -# Launcher settings -cat > /etc/xdg/klaunchrc << KLAUNCHRC_EOF -[BusyCursorSettings] -Timeout=6 - -[TaskbarButtonSettings] -Timeout=6 -KLAUNCHRC_EOF - -# Set Thunderbird as default email client -cat > /etc/xdg/emaildefaults << EMAILDEFAULTS_EOF -[Defaults] -Profile=Default - -[PROFILE_Default] -EmailClient[\$e]=thunderbird -TerminalClient=false -EMAILDEFAULTS_EOF - -# Set default text editor -cat > /etc/xdg/mimeapps.list << MIMEAPPS_EOF -[Default Applications] -text/plain=featherpad.desktop; -MIMEAPPS_EOF - -# Remove Discover and browser icons from taskmanager -sed -i -e 's/,applications:org.kde.discover.desktop//' -e 's/,preferred:\/\/browser//' \ -/usr/share/plasma/plasmoids/org.kde.plasma.taskmanager/contents/config/main.xml - -%end diff --git a/kickstarts/kde-workstation.ks b/kickstarts/kde-workstation.ks deleted file mode 100644 index bae8421..0000000 --- a/kickstarts/kde-workstation.ks +++ /dev/null @@ -1,28 +0,0 @@ -# kde-workstation.ks -# -# Provides a complete KDE workstation. Includes office, print and scan support. - -%include kde-desktop.ks -%include base-workstation.ks - -%packages --excludeWeakdeps - -# Bluetooth -bluedevil -#bluez-hid2hci -bluez-obexd -#bluez-tools - -# Connectivity -kde-connect -kio-extras - -# Networking -plasma-nm-l2tp -plasma-nm-openvpn -plasma-nm-pptp - -# Printing -kde-print-manager - -%end diff --git a/kickstarts/l10n/base-it_IT.ks b/kickstarts/l10n/base-it_IT.ks deleted file mode 100644 index d08f286..0000000 --- a/kickstarts/l10n/base-it_IT.ks +++ /dev/null @@ -1,34 +0,0 @@ -# base-it_IT.ks -# -# Defines the basics for italian localization support. - -lang --addsupport=it_IT.UTF-8 it_IT.UTF-8 -keyboard --xlayouts=it --vckeymap=it -timezone Europe/Rome - -%packages --excludeWeakdeps - -glibc-langpack-it -hunspell-it -langpacks-it - -%end - -%post - -echo "" -echo "POST BASE it_IT **************************************" -echo "" - -# Use italian locale in live image -cat >> /var/lib/livesys/livesys-session-extra << EOF_LIVESYS -# Force italian keyboard layout (rhb #982394) -localectl set-locale it_IT.UTF-8 -localectl set-x11-keymap it -localectl set-keymap it - -# Environment variable for Wayland -export XKB_DEFAULT_LAYOUT=it -EOF_LIVESYS - -%end diff --git a/kickstarts/l10n/kde-base-it_IT.ks b/kickstarts/l10n/kde-base-it_IT.ks deleted file mode 100644 index d4c2d61..0000000 --- a/kickstarts/l10n/kde-base-it_IT.ks +++ /dev/null @@ -1,38 +0,0 @@ -# kde-base-it_IT.ks -# -# Provides italian localization for the KDE desktop. - -%include base-it_IT.ks - -%packages --excludeWeakdeps - -kf5-ki18n - -%end - -%post - -echo "" -echo "POST KDE BASE it_IT **********************************" -echo "" - -# Defaults for user configuration -mkdir -p /etc/skel/.config/KDE - -# Plasma locale settings -cat > /etc/xdg/plasma-localerc << PLASMALOCALE_EOF -[Formats] -LANG=it_IT.UTF-8 - -[Translations] -LANGUAGE=it -PLASMALOCALE_EOF - -# KDE Sonnet locale settings -cat > /etc/skel/.config/KDE/Sonnet.conf << SONNET_EOF -[General] -autodetectLanguage=true -defaultLanguage=it_IT -SONNET_EOF - -%end diff --git a/kickstarts/l10n/kde-desktop-it_IT.ks b/kickstarts/l10n/kde-desktop-it_IT.ks deleted file mode 100644 index 0c669aa..0000000 --- a/kickstarts/l10n/kde-desktop-it_IT.ks +++ /dev/null @@ -1,6 +0,0 @@ -# kde-desktop-it_IT.ks -# -# Provides a basic KDE desktop with italian localization support. - -%include ../kde-desktop.ks -%include kde-base-it_IT.ks diff --git a/kickstarts/l10n/kde-workstation-it_IT.ks b/kickstarts/l10n/kde-workstation-it_IT.ks deleted file mode 100644 index 18d7a67..0000000 --- a/kickstarts/l10n/kde-workstation-it_IT.ks +++ /dev/null @@ -1,6 +0,0 @@ -# kde-workstation-it_IT.ks -# -# Provides a complete KDE workstation with italian localization support. - -%include ../kde-workstation.ks -%include kde-base-it_IT.ks diff --git a/kiwi-descriptions/components/boot.xml b/kiwi-descriptions/components/boot.xml new file mode 100644 index 0000000..0d01f4a --- /dev/null +++ b/kiwi-descriptions/components/boot.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kiwi-descriptions/components/common.xml b/kiwi-descriptions/components/common.xml new file mode 100644 index 0000000..343cb91 --- /dev/null +++ b/kiwi-descriptions/components/common.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kiwi-descriptions/components/livesystem.xml b/kiwi-descriptions/components/livesystem.xml new file mode 100644 index 0000000..8a24eb9 --- /dev/null +++ b/kiwi-descriptions/components/livesystem.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kiwi-descriptions/components/localization.xml b/kiwi-descriptions/components/localization.xml new file mode 100644 index 0000000..345b971 --- /dev/null +++ b/kiwi-descriptions/components/localization.xml @@ -0,0 +1,15 @@ + + + + + + it_IT + it + Europe/Rome + + + + + + + diff --git a/kiwi-descriptions/config.sh b/kiwi-descriptions/config.sh new file mode 100755 index 0000000..423448a --- /dev/null +++ b/kiwi-descriptions/config.sh @@ -0,0 +1,131 @@ +#!/bin/bash + +set -euxo pipefail + +#====================================== +# Functions... +#-------------------------------------- +test -f /.kconfig && . /.kconfig +test -f /.profile && . /.profile + +#====================================== +# Greeting... +#-------------------------------------- +echo "Configure image: [$kiwi_iname]-[$kiwi_iversion]..." +echo "Profiles: [$kiwi_profiles]" + +#====================================== +# Set SELinux booleans +#-------------------------------------- +## Fixes KDE Plasma, see rhbz#2058657 +setsebool -P selinuxuser_execmod 1 + +#====================================== +# Clear machine specific configuration +#-------------------------------------- +## Force generic hostname +echo "localhost" > /etc/hostname +## Clear machine-id on pre generated images +truncate -s 0 /etc/machine-id + +#====================================== +# Configure grub correctly +#-------------------------------------- +## Works around issues with grub-bls +## See: https://github.com/OSInside/kiwi/issues/2198 +echo "GRUB_DEFAULT=saved" >> /etc/default/grub +## Disable submenus to match Fedora +echo "GRUB_DISABLE_SUBMENU=true" >> /etc/default/grub +## Disable recovery entries to match Fedora +echo "GRUB_DISABLE_RECOVERY=true" >> /etc/default/grub + +#====================================== +# Setup default services +#-------------------------------------- +## Enable NetworkManager +systemctl enable NetworkManager.service +## Enable chrony +systemctl enable chronyd.service + +#====================================== +# Setup default target +#-------------------------------------- +if [[ "$kiwi_profiles" == *"Desktop"* ]]; then + systemctl set-default graphical.target +else + systemctl set-default multi-user.target +fi + +#====================================== +# Import GPG keys +#-------------------------------------- +rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-* +rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-* +# echo "Packages within this disk image" +# 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* + +#====================================== +# Remix minimal +#-------------------------------------- +if [[ "$kiwi_profiles" == *"Minimal"* ]]; then + # Delete and lock the root user password + passwd -d root + passwd -l root + # Delete the liveuser user password + passwd -d liveuser + usermod -c "Live System User" liveuser +fi + +#====================================== +# Remix graphical +#-------------------------------------- +if [[ "$kiwi_profiles" == *"LiveSystemGraphical"* ]]; then + echo "Set up desktop ${kiwi_displayname}" + # Set up default boot theme + /usr/sbin/plymouth-set-default-theme spinner + # Enable livesys services + systemctl enable livesys.service livesys-late.service + # Set up KDE live session + echo 'livesys_session="kde"' > /etc/sysconfig/livesys + echo "Setting up Flathub repo..." + flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo +fi + +#====================================== +# Remix localization +#-------------------------------------- +if [[ "$kiwi_profiles" == *"Localization"* ]]; then + livesys_locale="$(/bin/bash -c 'source /etc/locale.conf && echo $LANG')" + livesys_language="$(echo $livesys_locale | head -c 5)" + livesys_keymap="$(echo $livesys_locale | head -c 2)" + echo "Set up language ${livesys_locale}" + # Replace default locale settings + sed -i "s/^LANG=.*/LANG=${livesys_locale}/" /etc/xdg/plasma-localerc + sed -i "s/^LANGUAGE=.*/LANGUAGE="${livesys_language}"/" /etc/xdg/plasma-localerc + sed -i "s/^defaultLanguage=.*/defaultLanguage=${livesys_language}/" /etc/skel/.config/KDE/Sonnet.conf + # Store locale config for live scripts + echo 'livesys_keymap="'$livesys_keymap'"' >> /etc/sysconfig/livesys +fi + +#====================================== +# Remix settings +#-------------------------------------- +# Disable weak deps install +echo "install_weak_deps=False" >> /etc/dnf/dnf.conf +# Enable CRB (previously named PowerTools) repo +dnf config-manager --set-enabled crb +# Disable kdump crash recovery service +systemctl disable kdump.service + +#====================================== +# Remix fixes and tweaks +#-------------------------------------- +if [ -f /usr/share/applications/liveinst.desktop ]; then + # Fix missing installer icon (see https://issues.redhat.com/browse/RHEL-13713) + desktop-file-edit --set-icon=anaconda /usr/share/applications/liveinst.desktop +fi + +exit 0 diff --git a/kiwi-descriptions/config.xml b/kiwi-descriptions/config.xml new file mode 100644 index 0000000..ef9777c --- /dev/null +++ b/kiwi-descriptions/config.xml @@ -0,0 +1,32 @@ + + + + + Massimiliano Bugni + massi.ergosum@gmail.com + CentOS Remix + + + 9 + 9.0.0 + dnf + true + en_US + us + UTC + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kiwi-descriptions/platforms/desktop.xml b/kiwi-descriptions/platforms/desktop.xml new file mode 100644 index 0000000..51d0307 --- /dev/null +++ b/kiwi-descriptions/platforms/desktop.xml @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kiwi-descriptions/platforms/minimal.xml b/kiwi-descriptions/platforms/minimal.xml new file mode 100644 index 0000000..50b5b48 --- /dev/null +++ b/kiwi-descriptions/platforms/minimal.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/kiwi-descriptions/platforms/workstation.xml b/kiwi-descriptions/platforms/workstation.xml new file mode 100644 index 0000000..187cae1 --- /dev/null +++ b/kiwi-descriptions/platforms/workstation.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kiwi-descriptions/repositories/centos.xml b/kiwi-descriptions/repositories/centos.xml new file mode 100644 index 0000000..86cb243 --- /dev/null +++ b/kiwi-descriptions/repositories/centos.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kiwi-descriptions/repositories/epel.xml b/kiwi-descriptions/repositories/epel.xml new file mode 100644 index 0000000..a5ff2f0 --- /dev/null +++ b/kiwi-descriptions/repositories/epel.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kiwi-descriptions/repositories/rpmfusion.xml b/kiwi-descriptions/repositories/rpmfusion.xml new file mode 100644 index 0000000..4b6d91e --- /dev/null +++ b/kiwi-descriptions/repositories/rpmfusion.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kiwi-descriptions/root/etc/fonts/local.conf b/kiwi-descriptions/root/etc/fonts/local.conf new file mode 100644 index 0000000..b8a27af --- /dev/null +++ b/kiwi-descriptions/root/etc/fonts/local.conf @@ -0,0 +1,42 @@ + + + + + + + rgb + true + hintfull + true + lcddefault + + + + + + serif + + Noto Serif + DejaVu Serif + Liberation Serif + + + + + sans-serif + + Noto Sans + DejaVu Sans + Liberation Sans + + + + + monospace + + Noto Sans Mono + DejaVu Sans Mono + Liberation Mono + + + diff --git a/kiwi-descriptions/root/etc/profile.d/color-prompt.sh b/kiwi-descriptions/root/etc/profile.d/color-prompt.sh new file mode 100644 index 0000000..d2ecea2 --- /dev/null +++ b/kiwi-descriptions/root/etc/profile.d/color-prompt.sh @@ -0,0 +1,16 @@ +## Colored prompt +if [ -n "$PS1" ]; then + if [[ "$TERM" == *256color ]]; then + if [ $(id -u) -eq 0 ]; then + PS1='\[\e[91m\]\u@\h \[\e[93m\]\W\[\e[0m\]\$ ' + else + PS1='\[\e[94m\]\u@\h \[\e[93m\]\W\[\e[0m\]\$ ' + fi + else + if [ $(id -u) -eq 0 ]; then + PS1='\[\e[31m\]\u@\h \[\e[33m\]\W\[\e[0m\]\$ ' + else + PS1='\[\e[34m\]\u@\h \[\e[33m\]\W\[\e[0m\]\$ ' + fi + fi +fi diff --git a/kiwi-descriptions/root/etc/sddm.conf.d/local.conf b/kiwi-descriptions/root/etc/sddm.conf.d/local.conf new file mode 100644 index 0000000..6d42ab6 --- /dev/null +++ b/kiwi-descriptions/root/etc/sddm.conf.d/local.conf @@ -0,0 +1,3 @@ +[General] +# Control x11/wayland startup +DisplayServer=x11 \ No newline at end of file diff --git a/kiwi-descriptions/root/etc/skel/.config/KDE/Sonnet.conf b/kiwi-descriptions/root/etc/skel/.config/KDE/Sonnet.conf new file mode 100644 index 0000000..1468300 --- /dev/null +++ b/kiwi-descriptions/root/etc/skel/.config/KDE/Sonnet.conf @@ -0,0 +1,3 @@ +[General] +autodetectLanguage=true +defaultLanguage=en_US \ No newline at end of file diff --git a/kiwi-descriptions/root/etc/xdg/baloofilerc b/kiwi-descriptions/root/etc/xdg/baloofilerc new file mode 100644 index 0000000..120f0ce --- /dev/null +++ b/kiwi-descriptions/root/etc/xdg/baloofilerc @@ -0,0 +1,2 @@ +[Basic Settings] +Indexing-Enabled=false \ No newline at end of file diff --git a/kiwi-descriptions/root/etc/xdg/emaildefaults b/kiwi-descriptions/root/etc/xdg/emaildefaults new file mode 100644 index 0000000..0e084a4 --- /dev/null +++ b/kiwi-descriptions/root/etc/xdg/emaildefaults @@ -0,0 +1,6 @@ +[Defaults] +Profile=Default + +[PROFILE_Default] +EmailClient[$e]=thunderbird +TerminalClient=false \ No newline at end of file diff --git a/kiwi-descriptions/root/etc/xdg/kdeglobals b/kiwi-descriptions/root/etc/xdg/kdeglobals new file mode 100644 index 0000000..690cb92 --- /dev/null +++ b/kiwi-descriptions/root/etc/xdg/kdeglobals @@ -0,0 +1,9 @@ +[General] +fixed=Noto Sans Mono,11 +font=Noto Sans,11 +menuFont=Noto Sans,11 +smallestReadableFont=Noto Sans,10 +toolBarFont=Noto Sans,11 + +[KDE] +SingleClick=false \ No newline at end of file diff --git a/kiwi-descriptions/root/etc/xdg/klaunchrc b/kiwi-descriptions/root/etc/xdg/klaunchrc new file mode 100644 index 0000000..6c77a71 --- /dev/null +++ b/kiwi-descriptions/root/etc/xdg/klaunchrc @@ -0,0 +1,5 @@ +[BusyCursorSettings] +Timeout=6 + +[TaskbarButtonSettings] +Timeout=6 \ No newline at end of file diff --git a/kiwi-descriptions/root/etc/xdg/mimeapps.list b/kiwi-descriptions/root/etc/xdg/mimeapps.list new file mode 100644 index 0000000..7033565 --- /dev/null +++ b/kiwi-descriptions/root/etc/xdg/mimeapps.list @@ -0,0 +1,2 @@ +[Default Applications] +text/plain=featherpad.desktop; \ No newline at end of file diff --git a/kiwi-descriptions/root/etc/xdg/plasma-localerc b/kiwi-descriptions/root/etc/xdg/plasma-localerc new file mode 100644 index 0000000..a23bcaa --- /dev/null +++ b/kiwi-descriptions/root/etc/xdg/plasma-localerc @@ -0,0 +1,5 @@ +[Formats] +LANG=en_US.UTF-8 + +[Translations] +LANGUAGE=en \ No newline at end of file diff --git a/kickstarts/base-workstation.ks b/kiwi-descriptions/root/etc/yum.repos.d/openprinting-drivers.repo similarity index 59% rename from kickstarts/base-workstation.ks rename to kiwi-descriptions/root/etc/yum.repos.d/openprinting-drivers.repo index 011b06f..5116e12 100644 --- a/kickstarts/base-workstation.ks +++ b/kiwi-descriptions/root/etc/yum.repos.d/openprinting-drivers.repo @@ -1,35 +1,3 @@ -# base-workstation.ks -# -# Provides support for office automation. Adds extra repos for print drivers. - -firewall --enabled --service=mdns,kdeconnect - -%packages --excludeWeakdeps - -# Graphics -sane-backends-drivers-cameras -sane-backends-drivers-scanners - -# Networking -@networkmanager-submodules - -# Printing -@print-client -hplip -cups-ipptool -cups-lpd - -%end - - -%post - -echo "" -echo "POST BASE WORKSTATION ********************************" -echo "" - -# OpenPrinting/Database/DriverPackages based on the LSB 3.2 -cat > /etc/yum.repos.d/openprinting-drivers.repo << OPENPRINTING_REPO_EOF [openprinting-drivers-main] name=OpenPrinting LSB-based driver - main baseurl=http://www.openprinting.org/download/printdriver/components/lsb3.2/main/RPMS @@ -61,6 +29,3 @@ enabled=1 gpgcheck=0 timeout=5 skip_if_unavailable=True -OPENPRINTING_REPO_EOF - -%end diff --git a/kiwi-descriptions/root/usr/local/libexec/remix/flatpak-setup b/kiwi-descriptions/root/usr/local/libexec/remix/flatpak-setup new file mode 100755 index 0000000..075b461 --- /dev/null +++ b/kiwi-descriptions/root/usr/local/libexec/remix/flatpak-setup @@ -0,0 +1,6 @@ +# Flatpak setup commands +echo "Sharing user Gtk settings with apps..." +flatpak override --user --filesystem=xdg-config/gtkrc:ro +flatpak override --user --filesystem=xdg-config/gtkrc-2.0:ro +flatpak override --user --filesystem=xdg-config/gtk-3.0:ro +flatpak override --user --filesystem=xdg-config/gtk-4.0:ro diff --git a/kiwi-descriptions/root/usr/local/libexec/remix/livesys-cleanup b/kiwi-descriptions/root/usr/local/libexec/remix/livesys-cleanup new file mode 100755 index 0000000..8e1a916 --- /dev/null +++ b/kiwi-descriptions/root/usr/local/libexec/remix/livesys-cleanup @@ -0,0 +1,6 @@ +# livesys cleanup commands + +echo "Cleaning up livesys resources..." +sudo sh -c 'systemctl disable livesys.service; systemctl disable livesys-late.service; +dnf --assumeyes remove anaconda\* livesys-scripts; +rm /etc/sysconfig/livesys* -rf; rm /var/lib/livesys -rf' \ No newline at end of file diff --git a/kiwi-descriptions/root/var/lib/livesys/livesys-session-extra b/kiwi-descriptions/root/var/lib/livesys/livesys-session-extra new file mode 100755 index 0000000..3fe9a86 --- /dev/null +++ b/kiwi-descriptions/root/var/lib/livesys/livesys-session-extra @@ -0,0 +1,7 @@ +if [ -v livesys_keymap ]; then + # Force locale X11 keyboard layout (RHBG #982394) + localectl set-x11-keymap $livesys_keymap +fi + +# Use KDE X11 for auto-login session +sed -i "s/^Session=.*/Session=plasmax11.desktop/" /etc/sddm.conf diff --git a/tools/ks-package-list.py b/tools/ks-package-list.py deleted file mode 100755 index 0f2ec7b..0000000 --- a/tools/ks-package-list.py +++ /dev/null @@ -1,169 +0,0 @@ -#!/usr/bin/python3 -import copy -import sys -import argparse - -import pykickstart -import pykickstart.parser -import pykickstart.version - -import dnf -import dnf.conf -import dnf.transaction - -PKG_FORMAT = "{name}-{version}-{release}.{arch}" - -# Command line parsing -argparser = argparse.ArgumentParser(description='List kickstart package dependencies.') -argparser.add_argument('kickstart_file', metavar='KICKSTART', help='The kickstart file to parse') -version_opt = argparser.add_mutually_exclusive_group() -version_opt.add_argument('--releasever', metavar='RELEASEVER', help='release version', type=int, required=False) -version_opt.add_argument('--stream', metavar='STREAM', help='stream version', type=int, required=False) -argparser.add_argument('--format', metavar='FORMAT', help='package format (default is '+ PKG_FORMAT +')', required=False) -argparser.add_argument('--verbose', help='print additional info to stderr', action='store_true') -args = argparser.parse_args() - -# Kickstart parsing -ksparser = pykickstart.parser.KickstartParser(pykickstart.version.makeVersion()) -ksparser.readKickstart(args.kickstart_file) - -# Base object for dnf operations: https://dnf.readthedocs.io/en/latest/api.html -dnf_base = dnf.Base() - -# Load variables substitutions from base.conf.varsdir, default value for varsdir is ("/etc/yum/vars/", "/etc/dnf/vars/") -# the varsdir is searched under the installroot location. So if the varsdir is located on the host (outside the installroot) -# then you have to use "/" as installroot in this call: -# dnf_base.conf.substitutions.update_from_etc(installroot=dnf_base.conf.installroot, varsdir=dnf_base.conf.varsdir) - -# Set release version, if any -if args.releasever: - if args.verbose: - print(f'# Setting release version to {args.releasever}', file=sys.stderr) - dnf_base.conf.releasever = args.releasever -# Set stream version, if any -elif args.stream: - if args.verbose: - print(f'# Setting stream version to {args.stream}', file=sys.stderr) - dnf_base.conf.releasever = args.stream - # Example of setting substitutions programmatically: the CentOS Stream version - dnf_base.conf.substitutions['stream'] = f"{args.stream}-stream" - -if args.verbose: - print(f'# Exclude weak dependencies: {ksparser.handler.packages.excludeWeakdeps}', file=sys.stderr) -dnf_base.conf.install_weak_deps = not ksparser.handler.packages.excludeWeakdeps - -# Create parser for kickstart 'repo' command -repoparser = argparse.ArgumentParser(prog='repo', description='Kickstart repo command') -repoparser.add_argument('--name', required=True) -repoparser.add_argument('--excludepkgs', required=False) -repourl_opt = repoparser.add_mutually_exclusive_group() -repourl_opt.add_argument('--baseurl', required=False) -repourl_opt.add_argument('--metalink', required=False) -repourl_opt.add_argument('--mirrorlist', required=False) - -# Parse repo list from kickstart file -repolist = ksparser.handler.commands['repo'].dataList() -if repolist: - if args.verbose: - print(f'# Processing {len(repolist)} repositories using substitutions {dnf_base.conf.substitutions}:', file=sys.stderr) - for repocmd in repolist: - repo_conf = copy.copy(dnf_base.conf) - if args.verbose: - print(f"# {repocmd}".strip(), file=sys.stderr) - repoargs = repoparser.parse_args(args=f"{repocmd}".split()[1:]) - repourls = {} - if repoargs.baseurl: - repourls['baseurl'] = repoargs.baseurl - if repoargs.metalink: - repourls['metalink'] = repoargs.metalink - if repoargs.mirrorlist: - repourls['mirrorlist'] = repoargs.mirrorlist - if repoargs.excludepkgs: - repo_conf.exclude_pkgs(repoargs.excludepkgs) - # Add repo to current configuration - dnf_base.repos.add_new_repo(repoid=repoargs.name.strip('"'), conf=repo_conf, **repourls) -elif args.verbose: - print('# No repository command in kickstart file', file=sys.stderr) - -# Dump config -# print(f"# Config: {dnf_base.conf.dump()}", file=sys.stderr) - -# Retrieve metadata information about all known packages -dnf_base.fill_sack(load_system_repo=False) - -# Retrieve metadata information about all known groups -dnf_base.read_comps() - -# Parse modules (currently disabled) -# modulelist = ksparser.handler.commands['module'].dataList() -# if modulelist: -# if args.verbose: -# print(f'# Processing {len(modulelist)} modules:', file=sys.stderr) -# moduleparser = argparse.ArgumentParser(prog='module', description='Kickstart module command') -# moduleparser.add_argument('--name', required=True) -# moduleparser.add_argument('--stream', required=True) -# module_base = dnf.module.module_base.ModuleBase(dnf_base) -# enabled_modules = [] -# for module in modulelist: -# moduleargs = moduleparser.parse_args(args=f"{module}".split()[1:]) -# modulever = f"{moduleargs.name}:{moduleargs.stream}" -# print(f"# Enabling module: {modulever}", file=sys.stderr) -# module_packages, nsvcap = module_base.get_modules(modulever) - -# print("Parsed NSVCAP:") -# print("name:", nsvcap.name) -# print("stream:", nsvcap.stream) -# print("version:", nsvcap.version) -# print("context:", nsvcap.context) -# print("arch:", nsvcap.arch) -# print("profile:", nsvcap.profile) - -# print("Matching modules:") -# for mpkg in module_packages: -# print(mpkg.getFullIdentifier()) - -# enabled_modules.append(moduleargs.name) -# module_base.enable(enabled_modules) - -# Resolves package list from name -def resolvePackage(pkg_name): - return dnf_base.sack.query().filter(name__glob=pkg_name, latest_per_arch=True) - -# Process kickstart required groups -for group in ksparser.handler.packages.groupList: - resolved_group = dnf_base.comps.group_by_pattern(group.name) - if resolved_group: - # Add group to install transaction - found = dnf_base.group_install(resolved_group.id, dnf_base.conf.group_package_types) - if args.verbose: - print(f"# Including {found} packages from group {group}", file=sys.stderr) - else: - print(f"# Warning: cannot find required group {group.name}", file=sys.stderr) - -# Process kickstart excluded packages -excluded_list = ksparser.handler.packages.excludedList -if excluded_list: - if args.verbose: - print(f"# Processing {len(excluded_list)} explicitly excluded packages: {excluded_list}", file=sys.stderr) - for pkg in excluded_list: - resolved = resolvePackage(pkg) - if not resolved and args.verbose: - print(f"# Warning: cannot find excluded package {pkg}", file=sys.stderr) - -# Process kickstart required packages -included_list = ksparser.handler.packages.packageList -for pkg in included_list: - resolved = resolvePackage(pkg) - if not resolved: - print(f"# Warning: cannot find required package {pkg}", file=sys.stderr) - -# Resolve install dependencies -dnf_base.install_specs(included_list, exclude=excluded_list) -dnf_base.resolve() - -# Print formatted results -pkg_format = PKG_FORMAT -if args.format: - pkg_format = args.format -for pkg in sorted(dnf_base.transaction.install_set): - print(pkg_format.format(name=pkg.name,epoch=pkg.epoch,version=pkg.version,release=pkg.release,arch=pkg.arch))