diff --git a/mkosi.conf.d/70-packages-build.conf b/mkosi.conf.d/70-packages-build.conf index 52d2a66..c8ffc58 100644 --- a/mkosi.conf.d/70-packages-build.conf +++ b/mkosi.conf.d/70-packages-build.conf @@ -11,4 +11,5 @@ Packages=boost pacman python-setproctitle # For kde-builder python-yaml # For kde-builder + rust diff --git a/mkosi.extra/live/usr/lib/live-setup b/mkosi.extra/live/usr/lib/live-setup index 168a03f..e6eeb26 100755 --- a/mkosi.extra/live/usr/lib/live-setup +++ b/mkosi.extra/live/usr/lib/live-setup @@ -74,3 +74,6 @@ chown -R live:live /home/live/ # Start the basic-test (if it wants to be started) systemctl daemon-reload systemctl start --no-block kde-linux-basic-test.service + +# Disable hibernation since dynamic-hibernate won't work in a live environment +systemctl mask hibernate.target diff --git a/mkosi.extra/usr/lib/systemd/system-preset/50-kde-linux.preset b/mkosi.extra/usr/lib/systemd/system-preset/50-kde-linux.preset index ce8a426..13ab1c4 100644 --- a/mkosi.extra/usr/lib/systemd/system-preset/50-kde-linux.preset +++ b/mkosi.extra/usr/lib/systemd/system-preset/50-kde-linux.preset @@ -33,8 +33,10 @@ enable kde-linux-live-setup.service enable kde-linux-volatile-var-lib-flatpak.service enable plasma-setup-live-system.service enable var-lib-snapd-snap.mount -# also one of ours but not prefixed with kde-linux- so others can use it too +# also ours but not prefixed with kde-linux- so others can use it too enable etc-factory.service +enable dynamic-hibernate-prepare.service +enable dynamic-hibernate-cleanup.service # networkd - we use networkmanager disable systemd-networkd-wait-online.service diff --git a/mkosi.extra/usr/lib/systemd/user-preset/50-kde-linux.preset b/mkosi.extra/usr/lib/systemd/user-preset/50-kde-linux.preset index 53eb62d..6dba936 100644 --- a/mkosi.extra/usr/lib/systemd/user-preset/50-kde-linux.preset +++ b/mkosi.extra/usr/lib/systemd/user-preset/50-kde-linux.preset @@ -3,3 +3,7 @@ # Screen reading is opt-in disable orca.service + +# Sends an error notification if dynamic hibernation fails +# also ours but not prefixed with kde-linux- so others can use it too +enable dynamic-hibernate-notifier.service diff --git a/mkosi.postinst.chroot b/mkosi.postinst.chroot index ce4bb83..b2858f3 100755 --- a/mkosi.postinst.chroot +++ b/mkosi.postinst.chroot @@ -16,6 +16,13 @@ bootctl install echo 'timeout 5' >> "$SYSTEMD_ESP_PATH/loader/loader.conf" cp /usr/share/edk2-shell/x64/Shell.efi "$SYSTEMD_ESP_PATH/shellx64.efi" +# dynamic-hibernate +cd /tmp +git clone --depth 1 https://invent.kde.org/tduck/dynamic-hibernate # TODO: move to kde-linux org and integrate into i18n infra +cmake -S dynamic-hibernate -B dynamic-hibernate/build -DCMAKE_INSTALL_PREFIX=/usr +cmake --build dynamic-hibernate/build -v +cmake --install dynamic-hibernate/build + # Meanwhile cleanup a bit ## Unnecessary for us pacman --remove --noconfirm qt6-doc qt6-examples || true