From 8936ae0d600c1a222daff98f7f7386e040674db1 Mon Sep 17 00:00:00 2001 From: Heus-Sueh Date: Thu, 26 Dec 2024 18:29:47 -0300 Subject: [PATCH] trying to fix the image dbus/freedesktop error --- .github/workflows/build.yml | 19 +---- .../user => misc}/hyprland-session.service | 0 files/scripts/hwe-additions.sh | 76 +++++++++++++++++++ files/scripts/hwe-firmware.sh | 11 +++ files/scripts/installproprietarypackages.sh | 25 ------ files/scripts/installrpmfusion.sh | 3 - files/scripts/installsignedkernel.sh | 31 -------- files/systemd/system/dconf-update.service | 10 --- recipes/modules/akmods.yml | 2 +- recipes/modules/common-modules.yml | 2 +- recipes/modules/developer.yml | 23 +++--- .../{experimental => }/experimental.yml | 0 recipes/modules/experimental/remove-pkgs.yml | 38 ---------- recipes/modules/experimental/ublue-bling.yml | 18 ----- .../modules/{copr-pkgs.yml => extra-pkgs.yml} | 0 recipes/modules/hwe.yml | 10 +++ recipes/modules/nvidia.yml | 4 + recipes/modules/pkgs.yml | 1 - recipes/recipe-testing-nvidia.yml | 16 ++++ 19 files changed, 133 insertions(+), 156 deletions(-) rename files/{systemd/user => misc}/hyprland-session.service (100%) create mode 100644 files/scripts/hwe-additions.sh create mode 100644 files/scripts/hwe-firmware.sh delete mode 100644 files/scripts/installproprietarypackages.sh delete mode 100644 files/scripts/installrpmfusion.sh delete mode 100644 files/scripts/installsignedkernel.sh delete mode 100644 files/systemd/system/dconf-update.service rename recipes/modules/{experimental => }/experimental.yml (100%) delete mode 100644 recipes/modules/experimental/remove-pkgs.yml delete mode 100644 recipes/modules/experimental/ublue-bling.yml rename recipes/modules/{copr-pkgs.yml => extra-pkgs.yml} (100%) create mode 100644 recipes/modules/hwe.yml create mode 100644 recipes/recipe-testing-nvidia.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bbf313a..83e4063 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,25 +28,8 @@ jobs: - recipe-nvidia.yml - recipe-dx-nvidia.yml - recipe-vm.yml + - recipe-testing-nvidia.yml steps: - - name: Gather image data from recipe - run: | - echo "IMAGE_NAME=$(grep '^name:' ./recipes/${{ matrix.recipe }} | sed 's/^name: //')" >> $GITHUB_ENV - echo "IMAGE_MAJOR_VERSION=$(grep '^image-version:' ./recipes/${{ matrix.recipe }} | sed 's/^image-version: //')" >> $GITHUB_ENV - BASE_IMAGE=$(grep '^base-image:' ./recipes/${{ matrix.recipe }} | sed 's/^base-image: //') - echo "BASE_IMAGE_NAME=$(echo $BASE_IMAGE | sed 's/.*\/.*\///')" >> $GITHUB_ENV - - - name: Validate kernel and kmod versions - run: | - set -eo pipefail - linux=$(skopeo inspect docker://ghcr.io/ublue-os/main-kernel:41 | jq -r '.Labels["ostree.linux"]') - AKMODS_KERNEL_VERSION=$(skopeo inspect docker://ghcr.io/ublue-os/akmods:main-41 | jq -r '.Labels["ostree.linux"]') - if [[ "${linux}" != "${AKMODS_KERNEL_VERSION}" ]]; then - echo "Kernel Versions do not match between AKMODS and Cached-Kernel." - exit 1 - fi - echo "KERNEL_VERSION=$linux" >> $GITHUB_ENV - # the build is fully handled by the reusable github action - name: Build Custom Image uses: blue-build/github-action@v1.8 diff --git a/files/systemd/user/hyprland-session.service b/files/misc/hyprland-session.service similarity index 100% rename from files/systemd/user/hyprland-session.service rename to files/misc/hyprland-session.service diff --git a/files/scripts/hwe-additions.sh b/files/scripts/hwe-additions.sh new file mode 100644 index 0000000..fe5ea44 --- /dev/null +++ b/files/scripts/hwe-additions.sh @@ -0,0 +1,76 @@ +#!/usr/bin/bash + +set -eoux pipefail + +if [[ "${IMAGE_NAME}" =~ hwe ]]; then + echo "HWE image detected, installing HWE packages" +else + echo "Standard image detected, skipping HWE packages" + exit 0 +fi + +# Asus/Surface for HWE +curl --retry 3 -Lo /etc/yum.repos.d/_copr_lukenukem-asus-linux.repo \ + https://copr.fedorainfracloud.org/coprs/lukenukem/asus-linux/repo/fedora-$(rpm -E %fedora)/lukenukem-asus-linux-fedora-$(rpm -E %fedora).repo + +curl --retry 3 -Lo /etc/yum.repos.d/linux-surface.repo \ + https://pkg.surfacelinux.com/fedora/linux-surface.repo + +# Asus Firmware +git clone https://gitlab.com/asus-linux/firmware.git --depth 1 /tmp/asus-firmware +cp -rf /tmp/asus-firmware/* /usr/lib/firmware/ +rm -rf /tmp/asus-firmware + +ASUS_PACKAGES=( + asusctl + asusctl-rog-gui +) + +SURFACE_PACKAGES=( + iptsd + libcamera + libcamera-tools + libcamera-gstreamer + libcamera-ipa + pipewire-plugin-libcamera +) + +rpm-ostree install \ + "${ASUS_PACKAGES[@]}" \ + "${SURFACE_PACKAGES[@]}" + +tee /usr/lib/modules-load.d/ublue-surface.conf << EOF +# Add modules necessary for Disk Encryption via keyboard +surface_aggregator +surface_aggregator_registry +surface_aggregator_hub +surface_hid_core +8250_dw + +# Surface Laptop 3/Surface Book 3 and later +surface_hid +surface_kbd + +# Only on AMD models +pinctrl_amd + +# Only on Intel models +intel_lpss +intel_lpss_pci + +# Surface Book 2 +pinctrl_sunrisepoint + +# For Surface Laptop 3/Surface Book 3 +pinctrl_icelake + +# For Surface Laptop 4/Surface Laptop Studio +pinctrl_tigerlake + +# For Surface Pro 9/Surface Laptop 5 +pinctrl_alderlake + +# For Surface Pro 10/Surface Laptop 6 +pinctrl_meteorlake +EOF + diff --git a/files/scripts/hwe-firmware.sh b/files/scripts/hwe-firmware.sh new file mode 100644 index 0000000..0bf5f77 --- /dev/null +++ b/files/scripts/hwe-firmware.sh @@ -0,0 +1,11 @@ +#!/usr/bin/bash + +set -eoux pipefail + +mkdir -p /tmp/mediatek-firmware +curl --retry 3 -Lo /tmp/mediatek-firmware/WIFI_MT7922_patch_mcu_1_1_hdr.bin https://gitlab.com/kernel-firmware/linux-firmware/-/raw/8f08053b2a7474e210b03dbc2b4ba59afbe98802/mediatek/WIFI_MT7922_patch_mcu_1_1_hdr.bin?inline=false +curl --retry 3 -Lo /tmp/mediatek-firmware/WIFI_RAM_CODE_MT7922_1.bin https://gitlab.com/kernel-firmware/linux-firmware/-/raw/8f08053b2a7474e210b03dbc2b4ba59afbe98802/mediatek/WIFI_RAM_CODE_MT7922_1.bin?inline=false +xz --check=crc32 /tmp/mediatek-firmware/WIFI_MT7922_patch_mcu_1_1_hdr.bin +xz --check=crc32 /tmp/mediatek-firmware/WIFI_RAM_CODE_MT7922_1.bin +mv -vf /tmp/mediatek-firmware/* /usr/lib/firmware/mediatek/ +rm -rf /tmp/mediatek-firmware diff --git a/files/scripts/installproprietarypackages.sh b/files/scripts/installproprietarypackages.sh deleted file mode 100644 index 075cbd4..0000000 --- a/files/scripts/installproprietarypackages.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash - -# Tell build process to exit if there are any errors. -set -oue pipefail - -curl -Lo /etc/yum.repos.d/negativo17-fedora-multimedia.repo https://negativo17.org/repos/fedora-multimedia.repo -sed -i '0,/enabled=1/{s/enabled=1/enabled=1\npriority=90/}' /etc/yum.repos.d/negativo17-fedora-multimedia.repo - -rpm-ostree override replace \ - --experimental \ - --from repo='fedora-multimedia' \ - libheif \ - libva \ - libva-intel-media-driver \ - mesa-dri-drivers \ - mesa-filesystem \ - mesa-libEGL \ - mesa-libGL \ - mesa-libgbm \ - mesa-libglapi \ - mesa-libxatracker \ - mesa-va-drivers \ - mesa-vulkan-drivers \ - gstreamer1-plugin-libav \ - gstreamer1-plugin-vaapi \ No newline at end of file diff --git a/files/scripts/installrpmfusion.sh b/files/scripts/installrpmfusion.sh deleted file mode 100644 index 08a3411..0000000 --- a/files/scripts/installrpmfusion.sh +++ /dev/null @@ -1,3 +0,0 @@ - rpm-ostree install \ - https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-${OS_VERSION}.noarch.rpm \ - https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-${OS_VERSION}.noarch.rpm \ No newline at end of file diff --git a/files/scripts/installsignedkernel.sh b/files/scripts/installsignedkernel.sh deleted file mode 100644 index e6e5b8e..0000000 --- a/files/scripts/installsignedkernel.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash - -# Tell build process to exit if there are any errors. -set -oue pipefail - -find /tmp/rpms - -rpm-ostree cliwrap install-to-root / - -QUALIFIED_KERNEL="$(rpm -qa | grep -P 'kernel-(\d+\.\d+\.\d+)' | sed -E 's/kernel-//')" -INCOMING_KERNEL_VERSION="$(basename -s .rpm $(ls /tmp/rpms/kernel/kernel-[0-9]*.rpm 2>/dev/null | grep -P 'kernel-(\d+\.\d+\.\d+)' | sed -E 's/kernel-//'))" - -echo "Qualified kernel: $QUALIFIED_KERNEL" -echo "Incoming kernel version: $INCOMING_KERNEL_VERSION" - - -if [[ "$INCOMING_KERNEL_VERSION" != "$QUALIFIED_KERNEL" ]]; then - echo "Installing kernel rpm from kernel-cache." - rpm-ostree override replace \ - --experimental \ - --install=zstd \ - /tmp/rpms/kernel/kernel-[0-9]*.rpm \ - /tmp/rpms/kernel/kernel-core-*.rpm \ - /tmp/rpms/kernel/kernel-modules-*.rpm -else - echo "Installing kernel files from kernel-cache." - cd /tmp - rpm2cpio /tmp/rpms/kernel/kernel-core-*.rpm | cpio -idmv - cp ./lib/modules/*/vmlinuz /usr/lib/modules/*/vmlinuz - cd / -fi \ No newline at end of file diff --git a/files/systemd/system/dconf-update.service b/files/systemd/system/dconf-update.service deleted file mode 100644 index 8311c6f..0000000 --- a/files/systemd/system/dconf-update.service +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=Update the dconf database onboot -Documentation=https://github.com/coreos/rpm-ostree/issues/1944 - -[Service] -Type=oneshot -ExecStart=/usr/bin/dconf update - -[Install] -WantedBy=multi-user.target diff --git a/recipes/modules/akmods.yml b/recipes/modules/akmods.yml index 7936183..b817f98 100644 --- a/recipes/modules/akmods.yml +++ b/recipes/modules/akmods.yml @@ -1,4 +1,4 @@ type: akmods base: main # if not specified, classic "main" base is used by default install: - - v4l2loopback + - nvidia diff --git a/recipes/modules/common-modules.yml b/recipes/modules/common-modules.yml index a092c8a..ecf3c81 100644 --- a/recipes/modules/common-modules.yml +++ b/recipes/modules/common-modules.yml @@ -6,7 +6,7 @@ modules: # - from-file: modules/akmods.yml - from-file: modules/scripts.yml - from-file: modules/pkgs.yml - - from-file: modules/copr-pkgs.yml + - from-file: modules/extra-pkgs.yml - from-file: modules/default-flatpaks.yml - from-file: modules/files.yml - from-file: modules/fonts.yml diff --git a/recipes/modules/developer.yml b/recipes/modules/developer.yml index e4681a4..b6c7ac6 100644 --- a/recipes/modules/developer.yml +++ b/recipes/modules/developer.yml @@ -7,27 +7,21 @@ modules: - docker-ce.repo - mise.repo install: + - dbus-x11 + # cli + - git-credential-libsecret - gh - mise - neovim - - code - gcc - - clang - genisoimage - ddcutil - flatpak-builder - pipx - # Libs - # GTK Stuff - # - gtk4 - # - gtk4-layer-shell - # - gobject-introspection-devel - # - cairo-gobject-devel - # Terminal Tools + - evtest - fastfetch - tealdeer - bat - - ugrep - ripgrep - zoxide - zsh @@ -36,6 +30,15 @@ modules: - eza - direnv - android-tools + - rclone + # Apps + - code + # Libs + # GTK Stuff + # - gtk4 + # - gtk4-layer-shell + # - gobject-introspection-devel + # - cairo-gobject-devel # Net and VPN - tailscale # Virtual Machine diff --git a/recipes/modules/experimental/experimental.yml b/recipes/modules/experimental.yml similarity index 100% rename from recipes/modules/experimental/experimental.yml rename to recipes/modules/experimental.yml diff --git a/recipes/modules/experimental/remove-pkgs.yml b/recipes/modules/experimental/remove-pkgs.yml deleted file mode 100644 index ce1930f..0000000 --- a/recipes/modules/experimental/remove-pkgs.yml +++ /dev/null @@ -1,38 +0,0 @@ ---- -# yaml-language-server: $schema=https://schema.blue-build.org/module-v1.json -modules: - - type: script - scripts: - # install negativo17 drivers and codecs - - installproprietarypackages.sh - - type: rpm-ostree - install: - # proprietary codecs - - heif-pixbuf-loader - - ffmpeg - - ffmpeg-libs - - ffmpegthumbnailer - - pipewire-libs-extra - - libfdk-aac - - gstreamer1-plugins-bad - - gstreamer1-plugins-ugly - remove: - # free software - - gstreamer1-plugins-bad-free - - gstreamer1-plugins-bad-free-libs - - gstreamer1-plugins-ugly-free - - fdk-aac-free - - ffmpeg-free - - libavcodec-free - - libavdevice-free - - libavfilter-free - - libavformat-free - - libavutil-free - - libpostproc-free - - libswresample-free - - libswscale-free - - - type: script - scripts: - # remove negativo17 repo and others - - removeunusedrepos.sh diff --git a/recipes/modules/experimental/ublue-bling.yml b/recipes/modules/experimental/ublue-bling.yml deleted file mode 100644 index edb3597..0000000 --- a/recipes/modules/experimental/ublue-bling.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -# yaml-language-server: $schema=https://schema.blue-build.org/module-v1.json -# to remove this file!!! -modules: - - type: containerfile - # configs files and enhancements - snippets: - - RUN rpm-ostree install just powerstat - - COPY --from=ghcr.io/ublue-os/config:latest /rpms/ublue-os-udev-rules.noarch.rpm / - - COPY --from=ghcr.io/ublue-os/config:latest /rpms/ublue-os-update-services.noarch.rpm / - - COPY --from=ghcr.io/ublue-os/config:latest /rpms/ublue-os-signing.noarch.rpm / - - COPY --from=ghcr.io/ublue-os/config:latest /rpms/ublue-os-luks.noarch.rpm / - - COPY --from=ghcr.io/ublue-os/config:latest /rpms/ublue-os-just.noarch.rpm / - - RUN rpm -ivh /ublue-os-udev-rules.noarch.rpm - - RUN rpm -ivh /ublue-os-update-services.noarch.rpm - - RUN rpm -ivh /ublue-os-signing.noarch.rpm - - RUN rpm -ivh /ublue-os-luks.noarch.rpm - - RUN rpm -ivh /ublue-os-just.noarch.rpm diff --git a/recipes/modules/copr-pkgs.yml b/recipes/modules/extra-pkgs.yml similarity index 100% rename from recipes/modules/copr-pkgs.yml rename to recipes/modules/extra-pkgs.yml diff --git a/recipes/modules/hwe.yml b/recipes/modules/hwe.yml new file mode 100644 index 0000000..7115ab1 --- /dev/null +++ b/recipes/modules/hwe.yml @@ -0,0 +1,10 @@ +--- +# yaml-language-server: $schema=https://schema.blue-build.org/module-v1.json +modules: + - type: script + snippets: [] + # - "curl https://example.com/examplebinary > /usr/bin/examplebinary" # example: download binary + scripts: + - hwe-firmware.sh + - hwe-additions.sh + # - example.sh # example: run files/scripts/example.sh diff --git a/recipes/modules/nvidia.yml b/recipes/modules/nvidia.yml index d166170..e105c2a 100644 --- a/recipes/modules/nvidia.yml +++ b/recipes/modules/nvidia.yml @@ -1,6 +1,10 @@ --- # yaml-language-server: $schema=https://schema.blue-build.org/module-v1.json modules: + # - type: akmods + # base: main # if not specified, classic "main" base is used by default + # install: + # - nvidia - type: script scripts: - nvidia.sh diff --git a/recipes/modules/pkgs.yml b/recipes/modules/pkgs.yml index d653429..09396c5 100644 --- a/recipes/modules/pkgs.yml +++ b/recipes/modules/pkgs.yml @@ -85,7 +85,6 @@ install: - qt6ct - kvantum # Themes packages - # - adwaita-qt5 # it looks obsolete - adw-gtk3-theme - gnome-themes-extra - gnome-icon-theme diff --git a/recipes/recipe-testing-nvidia.yml b/recipes/recipe-testing-nvidia.yml new file mode 100644 index 0000000..c2e4714 --- /dev/null +++ b/recipes/recipe-testing-nvidia.yml @@ -0,0 +1,16 @@ +--- +# yaml-language-server: $schema=https://schema.blue-build.org/module-v1.json +name: hyprland-testing-nvidia +description: This is my personal OS image. +base-image: quay.io/fedora-ostree-desktops/base-atomic +image-version: 41 # latest is also supported if you want new updates ASAP +modules: + # --------------------------------------------------------------------------------------------------------------------------- + - from-file: modules/akmods.yml + - from-file: modules/common-modules.yml + - from-file: modules/nvidia.yml + # - from-file: modules/final-scripts.yml + # --------------------------------------------------------------------------------------------------------------------------- + # Signing + - type: signing # this sets up the proper policy & signing files for signed images to work fully + # ----------------------------------------------------------------------------------------------------------------------------