From a90c3ada0c38ee89ac5e486f9e836b2a3a943ce0 Mon Sep 17 00:00:00 2001 From: mbugni Date: Mon, 14 Oct 2024 18:53:33 +0200 Subject: [PATCH] Improve scripts and minimize dependencies --- CHANGELOG.md | 9 +++++++++ Containerfile | 2 +- README.md | 20 +++++++------------ kiwi-descriptions/components/common.xml | 1 + kiwi-descriptions/config.sh | 4 ++++ kiwi-descriptions/config.xml | 6 +++--- kiwi-descriptions/platforms/desktop.xml | 10 ++++------ kiwi-descriptions/platforms/workstation.xml | 5 +++++ .../etc/systemd/system/machine-setup.service | 12 +++++++++++ .../etc/systemd/user/flatpak-setup.service | 12 +++++++++++ .../usr/local/libexec/remix/flatpak-setup | 11 ++++++++-- .../usr/local/libexec/remix/livesys-cleanup | 4 ++-- .../usr/local/libexec/remix/machine-setup | 12 +++++++++++ 13 files changed, 81 insertions(+), 27 deletions(-) create mode 100644 kiwi-descriptions/root/etc/systemd/system/machine-setup.service create mode 100644 kiwi-descriptions/root/etc/systemd/user/flatpak-setup.service create mode 100755 kiwi-descriptions/root/usr/local/libexec/remix/machine-setup diff --git a/CHANGELOG.md b/CHANGELOG.md index d08f411..93c069a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## 39.0.2 - 2024-10-14 +### Added +- Custom user Flatpak setup +- Custom machine setup +### Changed +- Improve scan and print support +- Better live system cleanup +- Minimize dependencies + ## 39.0.1 - 2024-08-10 ### Changed - Build container is based on fedora-minimal diff --git a/Containerfile b/Containerfile index 31c822d..120e716 100644 --- a/Containerfile +++ b/Containerfile @@ -1,6 +1,6 @@ FROM registry.fedoraproject.org/fedora-minimal:39 RUN microdnf --assumeyes --setopt='tsflags=nodocs' --setopt='install_weak_deps=False' \ install bash-completion distribution-gpg-keys python3-pip kiwi-systemdeps-iso-media && \ -pip3 install kiwi==v10.1.1 --break-system-packages && \ +pip3 install kiwi==v10.1.14 --break-system-packages && \ microdnf --assumeyes clean all && \ rm /etc/rpm/* -rf \ No newline at end of file diff --git a/README.md b/README.md index 33c1207..603b941 100644 --- a/README.md +++ b/README.md @@ -5,10 +5,10 @@ This project is a [Fedora Remix][01] and aims to offer a complete system for mul You can [download a live image][02] and try the software, and then install it in your PC if you want. You can also customize the image starting from available scripts. -Other goals of this remix are: -* adding common extra-repos -* supporting multimedia and office (printers and scanners) +Main goals of this remix are: * Flatpak apps usage +* adding common extra-repos +* supporting printers and scanners ## How to build the LiveCD [See a detailed description][03] about how to build the live media. @@ -101,25 +101,19 @@ $ sudo dd if=//Fedora-Remix.x86_64-.iso of=/dev/ + diff --git a/kiwi-descriptions/config.sh b/kiwi-descriptions/config.sh index 16e3089..f071840 100755 --- a/kiwi-descriptions/config.sh +++ b/kiwi-descriptions/config.sh @@ -93,6 +93,8 @@ if [[ "$kiwi_profiles" == *"LiveSystemGraphical"* ]]; then # Set up Flatpak echo "Setting up Flathub repo..." flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo + # Enable Flatpak user settings + systemctl --global enable flatpak-setup.service # Avoid additional Fedora's Flatpak repos systemctl disable flatpak-add-fedora-repos fi @@ -124,6 +126,8 @@ echo "install_weak_deps=False" >> /etc/dnf/dnf.conf #====================================== # Remix fixes and tweaks #-------------------------------------- +## Enable machine system settings +systemctl enable machine-setup ## Remove preferred browser icon in KDE taskmanager if [ -f /usr/share/plasma/plasmoids/org.kde.plasma.taskmanager/contents/config/main.xml ]; then sed -i -e 's/\,preferred:\/\/browser//' \ diff --git a/kiwi-descriptions/config.xml b/kiwi-descriptions/config.xml index 737282c..d6c8615 100644 --- a/kiwi-descriptions/config.xml +++ b/kiwi-descriptions/config.xml @@ -1,6 +1,6 @@ - + Massimiliano Bugni massi.ergosum@gmail.com @@ -8,8 +8,8 @@ 39 - 39.0.1 - dnf + 39.0.2 + dnf4 true en_US us diff --git a/kiwi-descriptions/platforms/desktop.xml b/kiwi-descriptions/platforms/desktop.xml index c71d103..2232f53 100644 --- a/kiwi-descriptions/platforms/desktop.xml +++ b/kiwi-descriptions/platforms/desktop.xml @@ -12,10 +12,6 @@ - - - - @@ -63,6 +59,8 @@ + + @@ -72,13 +70,13 @@ - + @@ -87,7 +85,6 @@ - @@ -102,6 +99,7 @@ + diff --git a/kiwi-descriptions/platforms/workstation.xml b/kiwi-descriptions/platforms/workstation.xml index 065fdbe..89eae4b 100644 --- a/kiwi-descriptions/platforms/workstation.xml +++ b/kiwi-descriptions/platforms/workstation.xml @@ -15,8 +15,12 @@ + + + + @@ -28,6 +32,7 @@ + diff --git a/kiwi-descriptions/root/etc/systemd/system/machine-setup.service b/kiwi-descriptions/root/etc/systemd/system/machine-setup.service new file mode 100644 index 0000000..d09a388 --- /dev/null +++ b/kiwi-descriptions/root/etc/systemd/system/machine-setup.service @@ -0,0 +1,12 @@ +[Unit] +Description=Machine system settings + +[Service] +Type=oneshot +Restart=no +RemainAfterExit=no +ExecStart=/usr/local/libexec/remix/machine-setup + +[Install] +WantedBy=multi-user.target +WantedBy=graphical.target diff --git a/kiwi-descriptions/root/etc/systemd/user/flatpak-setup.service b/kiwi-descriptions/root/etc/systemd/user/flatpak-setup.service new file mode 100644 index 0000000..938f41d --- /dev/null +++ b/kiwi-descriptions/root/etc/systemd/user/flatpak-setup.service @@ -0,0 +1,12 @@ +[Unit] +Description=Flatpak user settings +PartOf=graphical-session.target + +[Service] +Type=oneshot +Restart=no +RemainAfterExit=no +ExecStart=/usr/local/libexec/remix/flatpak-setup + +[Install] +WantedBy=graphical-session.target diff --git a/kiwi-descriptions/root/usr/local/libexec/remix/flatpak-setup b/kiwi-descriptions/root/usr/local/libexec/remix/flatpak-setup index 075b461..8241e66 100755 --- a/kiwi-descriptions/root/usr/local/libexec/remix/flatpak-setup +++ b/kiwi-descriptions/root/usr/local/libexec/remix/flatpak-setup @@ -1,6 +1,13 @@ -# Flatpak setup commands -echo "Sharing user Gtk settings with apps..." +#!/usr/bin/bash +# +# flatpak: user settings + +echo "Sharing KDE custom 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 + +# https://bugzilla.mozilla.org/show_bug.cgi?id=1882641 +echo "Inhibit idle when Firefox is playing full screen video" +flatpak override --user --talk-name=org.freedesktop.ScreenSaver org.mozilla.firefox \ No newline at end of file diff --git a/kiwi-descriptions/root/usr/local/libexec/remix/livesys-cleanup b/kiwi-descriptions/root/usr/local/libexec/remix/livesys-cleanup index 8e1a916..94fac3e 100755 --- a/kiwi-descriptions/root/usr/local/libexec/remix/livesys-cleanup +++ b/kiwi-descriptions/root/usr/local/libexec/remix/livesys-cleanup @@ -1,6 +1,6 @@ # livesys cleanup commands -echo "Cleaning up livesys resources..." +echo "Cleaning up livesys resources" sudo sh -c 'systemctl disable livesys.service; systemctl disable livesys-late.service; -dnf --assumeyes remove anaconda\* livesys-scripts; +dnf --assumeyes remove anaconda\* livesys-scripts dracut-live; rm /etc/sysconfig/livesys* -rf; rm /var/lib/livesys -rf' \ No newline at end of file diff --git a/kiwi-descriptions/root/usr/local/libexec/remix/machine-setup b/kiwi-descriptions/root/usr/local/libexec/remix/machine-setup new file mode 100755 index 0000000..ee0d773 --- /dev/null +++ b/kiwi-descriptions/root/usr/local/libexec/remix/machine-setup @@ -0,0 +1,12 @@ +#!/usr/bin/bash +# +# machine: system settings + +system_product_name="$(dmidecode --string system-product-name)" +if [ "$system_product_name" == "HP 250 G8 Notebook PC" ]; then + # When closing laptop lid airplane mode comes on and won't go off: + # https://bugzilla.redhat.com/show_bug.cgi?id=1628353 + # https://askubuntu.com/questions/965595/why-does-airplane-mode-keep-toggling-on-my-hp-laptop-in-ubuntu-18-04 + echo "HP 250 G8 - Fix airplane mode when closing laptop lid" + setkeycodes e057 240 e058 240 +fi