From 1e68ee35224f6a1579154d4afd02fb8ce57170d9 Mon Sep 17 00:00:00 2001 From: bobslept <38557801+bobslept@users.noreply.github.com> Date: Fri, 13 Oct 2023 14:46:50 +0200 Subject: [PATCH 1/4] fix: flatpak-manager exit and retry on failure (#583) --- usr/bin/ublue-system-flatpak-manager | 16 ++++++++++------ usr/bin/ublue-user-flatpak-manager | 17 ++++++++++------- .../system/ublue-system-flatpak-manager.service | 2 ++ .../user/ublue-user-flatpak-manager.service | 2 ++ 4 files changed, 24 insertions(+), 13 deletions(-) diff --git a/usr/bin/ublue-system-flatpak-manager b/usr/bin/ublue-system-flatpak-manager index a503caaa8ee..0f4e1e09dd2 100755 --- a/usr/bin/ublue-system-flatpak-manager +++ b/usr/bin/ublue-system-flatpak-manager @@ -11,8 +11,6 @@ if [[ -f $VER_FILE && $VER = $VER_RAN ]]; then exit 0 fi -notify-send "Flatpak installer" "Currently installing system flatpaks" --app-name="Flatpak installer" -u NORMAL - # Remove fedora flatpak repo if grep -qz 'fedora' <<< $(flatpak remotes); then flatpak remote-delete --user fedora --force @@ -27,13 +25,14 @@ REMOVE_LIST=$(cat /etc/flatpak/system/remove) if [[ -n $INSTALL_LIST ]]; then for flatpak in $INSTALL_LIST; do if grep -qvz $flatpak <<< $FLATPAK_LIST; then - flatpak install --system --noninteractive flathub $flatpak + if ! flatpak install --system --noninteractive flathub $flatpak; then + # exit on error + exit 1 + fi fi done fi -notify-send "Flatpak installer" "Finished installing system flatpaks" --app-name="Flatpak installer" -u NORMAL - # Remove flatpaks in list if [[ -n $REMOVE_LIST ]]; then for flatpak in $REMOVE_LIST; do @@ -51,12 +50,17 @@ if grep -qz 'fedora' <<< $(flatpak remotes); then FEDORA_FLATPAKS=$(flatpak list --columns=application,origin | grep -w 'fedora' | awk '{print $1}') for flatpak in $FEDORA_FLATPAKS; do - flatpak remove --system --noninteractive $flatpak + if ! flatpak remove --system --noninteractive $flatpak; then + # exit on error + exit 1 + fi done fi # Disable the system variant of the flathub repo flatpak remote-modify flathub --disable --system +notify-send "Flatpak installer" "Finished installing system flatpaks" --app-name="Flatpak installer" -u NORMAL + mkdir -p /etc/ublue echo $VER > $VER_FILE diff --git a/usr/bin/ublue-user-flatpak-manager b/usr/bin/ublue-user-flatpak-manager index 95d9b5eacd8..f8f4530d93c 100755 --- a/usr/bin/ublue-user-flatpak-manager +++ b/usr/bin/ublue-user-flatpak-manager @@ -19,27 +19,30 @@ FLATPAK_LIST=$(flatpak list --columns=application) INSTALL_LIST=$(cat /etc/flatpak/user/install) REMOVE_LIST=$(cat /etc/flatpak/user/remove) -notify-send "Flatpak installer" "Currently installing user flatpaks" --app-name="Flatpak installer" -u NORMAL - # Install flatpaks in list if [[ -n $INSTALL_LIST ]]; then for flatpak in $INSTALL_LIST; do if grep -qvz $flatpak <<< $FLATPAK_LIST; then - flatpak install --user --noninteractive flathub $flatpak + if ! flatpak install --user --noninteractive flathub $flatpak; then + # exit on error + exit 1 + fi fi done fi -notify-send "Flatpak installer" "Finished installing user flatpaks" --app-name="Flatpak installer" -u NORMAL - - # Remove flatpaks in list if [[ -n $REMOVE_LIST ]]; then for flatpak in $REMOVE_LIST; do if grep -qz $flatpak <<< $FLATPAK_LIST; then - flatpak remove --user --noninteractive $flatpak + if ! flatpak remove --user --noninteractive $flatpak; then + # exit on error + exit 1 + fi fi done fi +notify-send "Flatpak installer" "Finished installing user flatpaks" --app-name="Flatpak installer" -u NORMAL + echo $VER > $VER_FILE diff --git a/usr/lib/systemd/system/ublue-system-flatpak-manager.service b/usr/lib/systemd/system/ublue-system-flatpak-manager.service index 41fe8ebd3bb..d3e1fe08ff5 100644 --- a/usr/lib/systemd/system/ublue-system-flatpak-manager.service +++ b/usr/lib/systemd/system/ublue-system-flatpak-manager.service @@ -8,6 +8,8 @@ After=network-online.target ublue-system-setup.service Type=oneshot ExecStart=/usr/bin/ublue-system-flatpak-manager Restart=on-failure +RestartSec=30 +StartLimitInterval=0 [Install] WantedBy=multi-user.target diff --git a/usr/lib/systemd/user/ublue-user-flatpak-manager.service b/usr/lib/systemd/user/ublue-user-flatpak-manager.service index 1398e805ca0..f900fbca9e6 100644 --- a/usr/lib/systemd/user/ublue-user-flatpak-manager.service +++ b/usr/lib/systemd/user/ublue-user-flatpak-manager.service @@ -8,6 +8,8 @@ After=network-online.target Type=oneshot ExecStart=/usr/bin/ublue-user-flatpak-manager Restart=on-failure +RestartSec=30 +StartLimitInterval=0 [Install] WantedBy=default.target From 9b23bd19ca1500d7c4faaeb3d624c1375d25b2eb Mon Sep 17 00:00:00 2001 From: bobslept <38557801+bobslept@users.noreply.github.com> Date: Fri, 13 Oct 2023 16:12:34 +0200 Subject: [PATCH 2/4] fix: flatpak-manager may fail on removal (#586) --- usr/bin/ublue-system-flatpak-manager | 5 +---- usr/bin/ublue-user-flatpak-manager | 5 +---- usr/etc/flatpak/system/remove | 2 ++ usr/etc/flatpak/user/remove | 2 -- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/usr/bin/ublue-system-flatpak-manager b/usr/bin/ublue-system-flatpak-manager index 0f4e1e09dd2..d4c3fca76cb 100755 --- a/usr/bin/ublue-system-flatpak-manager +++ b/usr/bin/ublue-system-flatpak-manager @@ -50,10 +50,7 @@ if grep -qz 'fedora' <<< $(flatpak remotes); then FEDORA_FLATPAKS=$(flatpak list --columns=application,origin | grep -w 'fedora' | awk '{print $1}') for flatpak in $FEDORA_FLATPAKS; do - if ! flatpak remove --system --noninteractive $flatpak; then - # exit on error - exit 1 - fi + flatpak remove --system --noninteractive $flatpak done fi diff --git a/usr/bin/ublue-user-flatpak-manager b/usr/bin/ublue-user-flatpak-manager index f8f4530d93c..21abfafa427 100755 --- a/usr/bin/ublue-user-flatpak-manager +++ b/usr/bin/ublue-user-flatpak-manager @@ -35,10 +35,7 @@ fi if [[ -n $REMOVE_LIST ]]; then for flatpak in $REMOVE_LIST; do if grep -qz $flatpak <<< $FLATPAK_LIST; then - if ! flatpak remove --user --noninteractive $flatpak; then - # exit on error - exit 1 - fi + flatpak remove --user --noninteractive $flatpak fi done fi diff --git a/usr/etc/flatpak/system/remove b/usr/etc/flatpak/system/remove index e69de29bb2d..2dc7caf66af 100644 --- a/usr/etc/flatpak/system/remove +++ b/usr/etc/flatpak/system/remove @@ -0,0 +1,2 @@ +org.gnome.Cheese +org.gnome.eog diff --git a/usr/etc/flatpak/user/remove b/usr/etc/flatpak/user/remove index 2dc7caf66af..e69de29bb2d 100644 --- a/usr/etc/flatpak/user/remove +++ b/usr/etc/flatpak/user/remove @@ -1,2 +0,0 @@ -org.gnome.Cheese -org.gnome.eog From 9a8909ca884b25b750669a0a37c38fb51598f008 Mon Sep 17 00:00:00 2001 From: bri <284789+b-@users.noreply.github.com> Date: Fri, 13 Oct 2023 10:13:14 -0400 Subject: [PATCH 3/4] Use `usermod` instead of `lchsh` in custom.just (#585) --- just/custom.just | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/just/custom.just b/just/custom.just index d8fd1f8e347..05eceece4a0 100644 --- a/just/custom.just +++ b/just/custom.just @@ -107,7 +107,8 @@ distrobox-universal: # Switch to the fish shell fish: - sudo lchsh $USER /usr/bin/fish + sudo usermod $USER --shell /usr/bin/fish + printf "${USER}'s shell is now %s." "$(cat /etc/passwd | grep ":$UID:" | cut '-d:' '-f7')" # Install recommended GNOME extensions gnome-extensions: @@ -155,7 +156,8 @@ nix-devbox-global: podmansh: sudo mkdir -p /etc/containers/systemd/users/${UID} sudo cp /usr/share/ublue-os/quadlets/podmansh.container /etc/containers/systemd/users/${UID}/podmansh.container - sudo lchsh $USER /usr/bin/podmansh + sudo usermod $USER --shell /usr/bin/podmansh + printf "${USER}'s shell is now %s." "$(cat /etc/passwd | grep ":$UID:" | cut '-d:' '-f7')" podman pull ghcr.io/ublue-os/ubuntu-toolbox:latest systemctl --user daemon-reload @@ -215,7 +217,8 @@ yafti: # Switch to the zsh shell zsh: - sudo lchsh $USER /usr/bin/zsh + sudo usermod $USER --shell /usr/bin/zsh + printf "${USER}'s shell is now %s." "$(cat /etc/passwd | grep ":$UID:" | cut '-d:' '-f7')" docker: sudo systemctl enable --now docker From 4e9fbaef3626632b1bfc6ff13b840d53e462c64e Mon Sep 17 00:00:00 2001 From: RJ Trujillo Date: Fri, 13 Oct 2023 10:19:51 -0600 Subject: [PATCH 4/4] fix(f39): Install kernel specific kmods (#584) --- .github/workflows/build.yml | 8 ++++++++ Containerfile | 12 ++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9f552fd2583..49a37bb00d3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,6 +49,13 @@ jobs: else echo "IMAGE_NAME=${{ format('{0}-{1}', matrix.base_name, matrix.image_flavor) }}" >> $GITHUB_ENV fi + if [[ "${{ matrix.image_flavor }}" =~ "asus" ]]; then + echo "AKMODS_FLAVOR=asus" >> $GITHUB_ENV + elif [[ "${{ matrix.image_flavor }}" =~ "surface" ]]; then + echo "AKMODS_FLAVOR=surface" >> $GITHUB_ENV + else + echo "AKMODS_FLAVOR=main" >> $GITHUB_ENV + fi - name: Generate tags id: generate-tags @@ -126,6 +133,7 @@ jobs: IMAGE_FLAVOR=${{ matrix.image_flavor }} FEDORA_MAJOR_VERSION=${{ matrix.major_version }} TARGET_BASE=${{ matrix.target_base }} + AKMODS_FLAVOR=${{ env.AKMODS_FLAVOR }} labels: ${{ steps.meta.outputs.labels }} oci: false # TODO(GH-280) diff --git a/Containerfile b/Containerfile index 5b4c9a16493..61709fc2333 100644 --- a/Containerfile +++ b/Containerfile @@ -1,5 +1,6 @@ ARG BASE_IMAGE_NAME="${BASE_IMAGE_NAME:-silverblue}" ARG IMAGE_FLAVOR="${IMAGE_FLAVOR:-main}" +ARG AKMODS_FLAVOR="${AKMODS_FLAVOR:-main}" ARG SOURCE_IMAGE="${SOURCE_IMAGE:-$BASE_IMAGE_NAME-$IMAGE_FLAVOR}" ARG BASE_IMAGE="ghcr.io/ublue-os/${SOURCE_IMAGE}" ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-38}" @@ -10,8 +11,9 @@ FROM ${BASE_IMAGE}:${FEDORA_MAJOR_VERSION} AS bluefin ARG IMAGE_NAME="${IMAGE_NAME}" ARG IMAGE_VENDOR="ublue-os" -ARG BASE_IMAGE_NAME="${BASE_IMAGE_NAME}" ARG IMAGE_FLAVOR="${IMAGE_FLAVOR}" +ARG AKMODS_FLAVOR="${AKMODS_FLAVOR}" +ARG BASE_IMAGE_NAME="${BASE_IMAGE_NAME}" ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION}" ARG PACKAGE_LIST="bluefin" @@ -25,9 +27,8 @@ COPY image-info.sh /tmp/image-info.sh COPY usr/etc/ublue-update/ublue-update.toml /tmp/ublue-update.toml # Add ublue kmods, add needed negativo17 repo and then immediately disable due to incompatibility with RPMFusion -COPY --from=ghcr.io/ublue-os/akmods:main-${FEDORA_MAJOR_VERSION} /rpms /tmp/akmods-rpms -RUN if [[ "${IMAGE_FLAVOR}" = "main" || "${IMAGE_NAME}" = "nvidia" ]]; then \ - sed -i 's@enabled=0@enabled=1@g' /etc/yum.repos.d/_copr_ublue-os-akmods.repo && \ +COPY --from=ghcr.io/ublue-os/akmods:${AKMODS_FLAVOR}-${FEDORA_MAJOR_VERSION} /rpms /tmp/akmods-rpms +RUN sed -i 's@enabled=0@enabled=1@g' /etc/yum.repos.d/_copr_ublue-os-akmods.repo && \ wget https://negativo17.org/repos/fedora-multimedia.repo -O /etc/yum.repos.d/negativo17-fedora-multimedia.repo && \ if [[ "${FEDORA_MAJOR_VERSION}" -ge "39" ]]; then \ rpm-ostree install \ @@ -43,8 +44,7 @@ RUN if [[ "${IMAGE_FLAVOR}" = "main" || "${IMAGE_NAME}" = "nvidia" ]]; then \ ; fi && \ sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/negativo17-fedora-multimedia.repo && \ mkdir -p /etc/akmods-rpms/ && \ - mv /tmp/akmods-rpms/kmods/*steamdeck*.rpm /etc/akmods-rpms/steamdeck.rpm \ -; fi + mv /tmp/akmods-rpms/kmods/*steamdeck*.rpm /etc/akmods-rpms/steamdeck.rpm # GNOME VRR RUN wget https://copr.fedorainfracloud.org/coprs/kylegospo/gnome-vrr/repo/fedora-"${FEDORA_MAJOR_VERSION}"/kylegospo-gnome-vrr-fedora-"${FEDORA_MAJOR_VERSION}".repo -O /etc/yum.repos.d/_copr_kylegospo-gnome-vrr.repo && \