From 6fba02610e9ed91716a4511b050504d1aa456ac9 Mon Sep 17 00:00:00 2001 From: Kyle Gospodnetich Date: Wed, 20 Sep 2023 00:18:14 -0700 Subject: [PATCH 01/14] fix: Split justfiles into multiple numbered files to fix issue with default command on other releases. --- build/ublue-os-just/00-default.just | 15 ++++++++ build/ublue-os-just/10-update.just | 5 +++ build/ublue-os-just/20-clean.just | 10 ++++++ .../{main.just => 30-distrobox.just} | 34 +------------------ .../{nvidia.just => 40-nvidia.just} | 4 ++- build/ublue-os-just/50-custom.just | 3 ++ build/ublue-os-just/build.sh | 2 +- build/ublue-os-just/custom.just | 0 build/ublue-os-just/ublue-os-just.sh | 9 +++-- build/ublue-os-just/ublue-os-just.spec | 16 ++++----- 10 files changed, 52 insertions(+), 46 deletions(-) create mode 100644 build/ublue-os-just/00-default.just create mode 100644 build/ublue-os-just/10-update.just create mode 100644 build/ublue-os-just/20-clean.just rename build/ublue-os-just/{main.just => 30-distrobox.just} (67%) rename build/ublue-os-just/{nvidia.just => 40-nvidia.just} (87%) create mode 100644 build/ublue-os-just/50-custom.just delete mode 100644 build/ublue-os-just/custom.just diff --git a/build/ublue-os-just/00-default.just b/build/ublue-os-just/00-default.just new file mode 100644 index 00000000..a2ff5595 --- /dev/null +++ b/build/ublue-os-just/00-default.just @@ -0,0 +1,15 @@ +_default: + @just --unstable --list --list-heading $'Available commands:\n' --list-prefix $' - ' + +# Boot into this device's BIOS/UEFI screen +bios: + systemctl reboot --firmware-setup + +# Show the changelog +changelogs: + rpm-ostree db diff --changelogs + +# Enroll Nvidia driver & KMOD signing key for secure boot - Enter password "ublue-os" if prompted +enroll-secure-boot-key: + sudo mokutil --import /etc/pki/akmods/certs/akmods-ublue.der + echo 'Enter password "ublue-os" if prompted' diff --git a/build/ublue-os-just/10-update.just b/build/ublue-os-just/10-update.just new file mode 100644 index 00000000..197a1d0f --- /dev/null +++ b/build/ublue-os-just/10-update.just @@ -0,0 +1,5 @@ +# Update system, flatpaks, and containers all at once +update: + rpm-ostree update + flatpak update -y + distrobox upgrade -a diff --git a/build/ublue-os-just/20-clean.just b/build/ublue-os-just/20-clean.just new file mode 100644 index 00000000..8c5001ca --- /dev/null +++ b/build/ublue-os-just/20-clean.just @@ -0,0 +1,10 @@ +# Clean up old containers and flatpaks +clean-system: + #!/usr/bin/env bash + podman system prune -a + flatpak uninstall --unused + rpm-ostree cleanup -bm + if [ -x "$(command -v nix-store)" ]; then + nix-store --gc + nix-store --optimise + fi diff --git a/build/ublue-os-just/main.just b/build/ublue-os-just/30-distrobox.just similarity index 67% rename from build/ublue-os-just/main.just rename to build/ublue-os-just/30-distrobox.just index ba4d8407..c301edd7 100644 --- a/build/ublue-os-just/main.just +++ b/build/ublue-os-just/30-distrobox.just @@ -1,26 +1,9 @@ -default: - @just --unstable --list - -# Boot into this device's BIOS/UEFI screen -bios: - systemctl reboot --firmware-setup - -# Clean up old containers and flatpaks -clean: - podman system prune -a - flatpak uninstall --unused - rpm-ostree cleanup -bm - -# Show the changelog -changelogs: - rpm-ostree db diff --changelogs - # Create an Arch container distrobox-arch: echo 'Creating Arch distrobox ...' distrobox create --nvidia --image quay.io/toolbx-images/archlinux-toolbox:latest -n arch -Y -# Create a Bazzite container +# Create a Bazzite-Arch container distrobox-bazzite: #!/usr/bin/env bash echo 'Creating Bazzite distrobox ...' @@ -55,18 +38,3 @@ distrobox-opensuse: distrobox-ubuntu: echo 'Creating Ubuntu distrobox ...' distrobox create --nvidia --image quay.io/toolbx-images/ubuntu-toolbox:22.04 -n ubuntu -Y - -# Enroll secure boot key -enroll-secure-boot-key: - sudo mokutil --import /etc/pki/akmods/certs/akmods-ublue.der - -# Update system, flatpaks, and containers all at once -update: - rpm-ostree update - flatpak update -y - distrobox upgrade -a - -# Enable xwaylandvideobridge -fixscreenshare: - cp /usr/share/applications/org.kde.xwaylandvideobridge.desktop $HOME/.config/autostart/ - diff --git a/build/ublue-os-just/nvidia.just b/build/ublue-os-just/40-nvidia.just similarity index 87% rename from build/ublue-os-just/nvidia.just rename to build/ublue-os-just/40-nvidia.just index 2e39e942..4b16a258 100644 --- a/build/ublue-os-just/nvidia.just +++ b/build/ublue-os-just/40-nvidia.just @@ -1,4 +1,4 @@ - +# Set needed kernel arguments for Nvidia GPUs set-kargs-nvidia: rpm-ostree kargs \ --append-if-missing=rd.driver.blacklist=nouveau \ @@ -6,6 +6,7 @@ set-kargs-nvidia: --append-if-missing=nvidia-drm.modeset=1 \ --delete-if-present=nomodeset +# Test CUDA support for Nvidia GPUs test-cuda: podman run \ --user 1000:1000 \ @@ -14,6 +15,7 @@ test-cuda: --security-opt label=type:nvidia_container_t \ docker.io/mirrorgooglecontainers/cuda-vector-add:v0.1 +# Enable VAAPI in Firefox for Nvidia GPUs setup-firefox-flatpak-vaapi-nvidia: flatpak override \ --user \ diff --git a/build/ublue-os-just/50-custom.just b/build/ublue-os-just/50-custom.just new file mode 100644 index 00000000..573f4d1d --- /dev/null +++ b/build/ublue-os-just/50-custom.just @@ -0,0 +1,3 @@ +# Enable xwaylandvideobridge +fixscreenshare: + cp /usr/share/applications/org.kde.xwaylandvideobridge.desktop $HOME/.config/autostart/ diff --git a/build/ublue-os-just/build.sh b/build/ublue-os-just/build.sh index 9e8d8e0f..674db077 100755 --- a/build/ublue-os-just/build.sh +++ b/build/ublue-os-just/build.sh @@ -6,7 +6,7 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) mkdir -p /tmp/ublue-os/rpmbuild/SOURCES -cp ${SCRIPT_DIR}/{custom,main,nvidia}.just /tmp/ublue-os/rpmbuild/SOURCES +cp ${SCRIPT_DIR}/*.just /tmp/ublue-os/rpmbuild/SOURCES cp ${SCRIPT_DIR}/ublue-os-just.sh /tmp/ublue-os/rpmbuild/SOURCES rpmbuild -ba \ diff --git a/build/ublue-os-just/custom.just b/build/ublue-os-just/custom.just deleted file mode 100644 index e69de29b..00000000 diff --git a/build/ublue-os-just/ublue-os-just.sh b/build/ublue-os-just/ublue-os-just.sh index 9aaddb0a..0bc442a8 100755 --- a/build/ublue-os-just/ublue-os-just.sh +++ b/build/ublue-os-just/ublue-os-just.sh @@ -4,8 +4,11 @@ alias just="just --unstable" if [ ! -z "$HOME" ] && [ -d "$HOME" ] && [ ! -f "${HOME}/.justfile" ]; then cat > "${HOME}/.justfile" << EOF -!include /usr/share/ublue-os/just/main.just -!include /usr/share/ublue-os/just/nvidia.just -!include /usr/share/ublue-os/just/custom.just +!include /usr/share/ublue-os/just/00-default.just +!include /usr/share/ublue-os/just/10-update.just +!include /usr/share/ublue-os/just/20-clean.just +!include /usr/share/ublue-os/just/30-distrobox.just +!include /usr/share/ublue-os/just/40-nvidia.just +!include /usr/share/ublue-os/just/50-custom.just EOF fi diff --git a/build/ublue-os-just/ublue-os-just.spec b/build/ublue-os-just/ublue-os-just.spec index 1d4be9d5..220d5e93 100644 --- a/build/ublue-os-just/ublue-os-just.spec +++ b/build/ublue-os-just/ublue-os-just.spec @@ -11,9 +11,12 @@ BuildArch: noarch Supplements: just Source0: ublue-os-just.sh -Source1: custom.just -Source2: main.just -Source3: nvidia.just +Source1: 00-default.just +Source2: 10-update.just +Source3: 20-clean.just +Source4: 30-distrobox.just +Source5: 40-nvidia.just +Source6: 50-custom.just %global sub_name %{lua:t=string.gsub(rpm.expand("%{NAME}"), "^ublue%-os%-", ""); print(t)} @@ -26,15 +29,12 @@ Adds ublue-os just integration for easier setup %build mkdir -p -m0755 %{buildroot}%{_datadir}/%{VENDOR}/%{sub_name} -cp %{SOURCE0} %{SOURCE1} %{SOURCE2} %{SOURCE3} %{buildroot}%{_datadir}/%{VENDOR}/%{sub_name} +cp %{SOURCE0} %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} %{buildroot}%{_datadir}/%{VENDOR}/%{sub_name} install -Dm755 %{SOURCE0} %{buildroot}%{_sysconfdir}/profile.d/ublue-os-just.sh %files %dir %attr(0755,root,root) %{_datadir}/%{VENDOR}/%{sub_name} -%attr(0644,root,root) %{_datadir}/%{VENDOR}/%{sub_name}/custom.just -%attr(0644,root,root) %{_datadir}/%{VENDOR}/%{sub_name}/main.just -%attr(0644,root,root) %{_datadir}/%{VENDOR}/%{sub_name}/nvidia.just -%attr(0755,root,root) %{_datadir}/%{VENDOR}/%{sub_name}/ublue-os-just.sh +%attr(0644,root,root) %{_datadir}/%{VENDOR}/%{sub_name}/*.just %attr(0755,root,root) %{_sysconfdir}/profile.d/ublue-os-just.sh %changelog From 6a5293af61745e337e5f8c88fde1663b6fc3875d Mon Sep 17 00:00:00 2001 From: Kyle Gospodnetich Date: Wed, 20 Sep 2023 14:30:16 -0700 Subject: [PATCH 02/14] chore: Set vim syntax highlighting on just files --- build/ublue-os-just/00-default.just | 2 ++ build/ublue-os-just/10-update.just | 2 ++ build/ublue-os-just/20-clean.just | 2 ++ build/ublue-os-just/30-distrobox.just | 2 ++ build/ublue-os-just/40-nvidia.just | 2 ++ build/ublue-os-just/50-custom.just | 2 ++ 6 files changed, 12 insertions(+) diff --git a/build/ublue-os-just/00-default.just b/build/ublue-os-just/00-default.just index a2ff5595..fbab95c1 100644 --- a/build/ublue-os-just/00-default.just +++ b/build/ublue-os-just/00-default.just @@ -1,3 +1,5 @@ +# vim: set ft=make : + _default: @just --unstable --list --list-heading $'Available commands:\n' --list-prefix $' - ' diff --git a/build/ublue-os-just/10-update.just b/build/ublue-os-just/10-update.just index 197a1d0f..706b31db 100644 --- a/build/ublue-os-just/10-update.just +++ b/build/ublue-os-just/10-update.just @@ -1,3 +1,5 @@ +# vim: set ft=make : + # Update system, flatpaks, and containers all at once update: rpm-ostree update diff --git a/build/ublue-os-just/20-clean.just b/build/ublue-os-just/20-clean.just index 8c5001ca..ccb4d07d 100644 --- a/build/ublue-os-just/20-clean.just +++ b/build/ublue-os-just/20-clean.just @@ -1,3 +1,5 @@ +# vim: set ft=make : + # Clean up old containers and flatpaks clean-system: #!/usr/bin/env bash diff --git a/build/ublue-os-just/30-distrobox.just b/build/ublue-os-just/30-distrobox.just index c301edd7..23a97d27 100644 --- a/build/ublue-os-just/30-distrobox.just +++ b/build/ublue-os-just/30-distrobox.just @@ -1,3 +1,5 @@ +# vim: set ft=make : + # Create an Arch container distrobox-arch: echo 'Creating Arch distrobox ...' diff --git a/build/ublue-os-just/40-nvidia.just b/build/ublue-os-just/40-nvidia.just index 4b16a258..beb50c0b 100644 --- a/build/ublue-os-just/40-nvidia.just +++ b/build/ublue-os-just/40-nvidia.just @@ -1,3 +1,5 @@ +# vim: set ft=make : + # Set needed kernel arguments for Nvidia GPUs set-kargs-nvidia: rpm-ostree kargs \ diff --git a/build/ublue-os-just/50-custom.just b/build/ublue-os-just/50-custom.just index 573f4d1d..dc92af59 100644 --- a/build/ublue-os-just/50-custom.just +++ b/build/ublue-os-just/50-custom.just @@ -1,3 +1,5 @@ +# vim: set ft=make : + # Enable xwaylandvideobridge fixscreenshare: cp /usr/share/applications/org.kde.xwaylandvideobridge.desktop $HOME/.config/autostart/ From 87add12e1bd2f3c2e83ea20bf14cc4986ef707e1 Mon Sep 17 00:00:00 2001 From: Kyle Gospodnetich Date: Wed, 20 Sep 2023 14:36:05 -0700 Subject: [PATCH 03/14] fix: Allow duplicate recipes to prevent any errors being thrown, ignore comments in just commands. --- build/ublue-os-just/00-default.just | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/build/ublue-os-just/00-default.just b/build/ublue-os-just/00-default.just index fbab95c1..48db3828 100644 --- a/build/ublue-os-just/00-default.just +++ b/build/ublue-os-just/00-default.just @@ -1,5 +1,8 @@ # vim: set ft=make : +set allow-duplicate-recipes +set ignore-comments + _default: @just --unstable --list --list-heading $'Available commands:\n' --list-prefix $' - ' @@ -13,5 +16,5 @@ changelogs: # Enroll Nvidia driver & KMOD signing key for secure boot - Enter password "ublue-os" if prompted enroll-secure-boot-key: - sudo mokutil --import /etc/pki/akmods/certs/akmods-ublue.der - echo 'Enter password "ublue-os" if prompted' + sudo mokutil --import /etc/pki/akmods/certs/akmods-ublue.der + echo 'Enter password "ublue-os" if prompted' From b10c19ef196bed9a5bbe99c0b4a615f3802efd2b Mon Sep 17 00:00:00 2001 From: Kyle Gospodnetich Date: Thu, 21 Sep 2023 14:05:31 -0700 Subject: [PATCH 04/14] feat(just): Use new fedora-distrobox image --- build/ublue-os-just/30-distrobox.just | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/ublue-os-just/30-distrobox.just b/build/ublue-os-just/30-distrobox.just index 23a97d27..bdb096b7 100644 --- a/build/ublue-os-just/30-distrobox.just +++ b/build/ublue-os-just/30-distrobox.just @@ -29,7 +29,7 @@ distrobox-debian: # Create a Fedora container distrobox-fedora: echo 'Creating Fedora distrobox ...' - distrobox create --nvidia --image registry.fedoraproject.org/fedora-toolbox:38 -n fedora -Y + distrobox create --nvidia --image ghcr.io/ublue-os/fedora-distrobox:latest -n fedora -Y # Create an openSUSE container distrobox-opensuse: From 9497cbb4770e4a6bb5bf1e9d5adcf407bf3f7da2 Mon Sep 17 00:00:00 2001 From: Kyle Gospodnetich Date: Thu, 21 Sep 2023 14:22:45 -0700 Subject: [PATCH 05/14] chore: Clean up 40-nvidia.just --- build/ublue-os-just/40-nvidia.just | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build/ublue-os-just/40-nvidia.just b/build/ublue-os-just/40-nvidia.just index beb50c0b..9d411ae5 100644 --- a/build/ublue-os-just/40-nvidia.just +++ b/build/ublue-os-just/40-nvidia.just @@ -1,7 +1,7 @@ # vim: set ft=make : # Set needed kernel arguments for Nvidia GPUs -set-kargs-nvidia: +nvidia-set-kargs: rpm-ostree kargs \ --append-if-missing=rd.driver.blacklist=nouveau \ --append-if-missing=modprobe.blacklist=nouveau \ @@ -9,7 +9,7 @@ set-kargs-nvidia: --delete-if-present=nomodeset # Test CUDA support for Nvidia GPUs -test-cuda: +nvidia-test-cuda: podman run \ --user 1000:1000 \ --security-opt=no-new-privileges \ @@ -17,8 +17,8 @@ test-cuda: --security-opt label=type:nvidia_container_t \ docker.io/mirrorgooglecontainers/cuda-vector-add:v0.1 -# Enable VAAPI in Firefox for Nvidia GPUs -setup-firefox-flatpak-vaapi-nvidia: +# Enable VAAPI in Firefox Flatpak for Nvidia GPUs +nvidia-setup-firefox-vaapi: flatpak override \ --user \ --filesystem=host-os \ From fe9dee729ff2ddc62dcc8dd39516b12070d460f3 Mon Sep 17 00:00:00 2001 From: Kyle Gospodnetich Date: Thu, 21 Sep 2023 15:43:51 -0700 Subject: [PATCH 06/14] feat: Create /usr/share/ublue-os/justfile which points to every file in /usr/share/ublue-os/just/*.just --- build/ublue-os-just/ublue-os-just.spec | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build/ublue-os-just/ublue-os-just.spec b/build/ublue-os-just/ublue-os-just.spec index 220d5e93..c2fd2a4b 100644 --- a/build/ublue-os-just/ublue-os-just.spec +++ b/build/ublue-os-just/ublue-os-just.spec @@ -32,9 +32,15 @@ mkdir -p -m0755 %{buildroot}%{_datadir}/%{VENDOR}/%{sub_name} cp %{SOURCE0} %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} %{buildroot}%{_datadir}/%{VENDOR}/%{sub_name} install -Dm755 %{SOURCE0} %{buildroot}%{_sysconfdir}/profile.d/ublue-os-just.sh +# Create justfile which always contains all .just files included in this package +for justfile in %{buildroot}%{_datadir}/%{VENDOR}/%{sub_name}/*.just; do + echo "!include %{_datadir}/%{VENDOR}/%{sub_name}/${justfile}" >> "%{buildroot}%{_datadir}/%{VENDOR}/justfile" +done + %files %dir %attr(0755,root,root) %{_datadir}/%{VENDOR}/%{sub_name} %attr(0644,root,root) %{_datadir}/%{VENDOR}/%{sub_name}/*.just +%attr(0644,root,root) %{_datadir}/%{VENDOR}/justfile %attr(0755,root,root) %{_sysconfdir}/profile.d/ublue-os-just.sh %changelog From 43f009e258ea12eee58deb5e3d864e509f88c275 Mon Sep 17 00:00:00 2001 From: Kyle Gospodnetich Date: Thu, 21 Sep 2023 15:48:35 -0700 Subject: [PATCH 07/14] chore: Modify ublue-os-just.sh to create .justfile in home pointing to new /usr/share/ublue-os/justfile fixme: Modify existing .justfiles to have this same change in a non-destructive way. --- build/ublue-os-just/ublue-os-just.sh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/build/ublue-os-just/ublue-os-just.sh b/build/ublue-os-just/ublue-os-just.sh index 0bc442a8..c17063b7 100755 --- a/build/ublue-os-just/ublue-os-just.sh +++ b/build/ublue-os-just/ublue-os-just.sh @@ -4,11 +4,6 @@ alias just="just --unstable" if [ ! -z "$HOME" ] && [ -d "$HOME" ] && [ ! -f "${HOME}/.justfile" ]; then cat > "${HOME}/.justfile" << EOF -!include /usr/share/ublue-os/just/00-default.just -!include /usr/share/ublue-os/just/10-update.just -!include /usr/share/ublue-os/just/20-clean.just -!include /usr/share/ublue-os/just/30-distrobox.just -!include /usr/share/ublue-os/just/40-nvidia.just -!include /usr/share/ublue-os/just/50-custom.just +!include /usr/share/ublue-os/justfile EOF fi From d82953ed70608e29a256bb74d7314a4e65824698 Mon Sep 17 00:00:00 2001 From: Kyle Gospodnetich Date: Thu, 21 Sep 2023 17:03:16 -0700 Subject: [PATCH 08/14] chore: Adjust versions --- build/ublue-os-just/ublue-os-just.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/build/ublue-os-just/ublue-os-just.spec b/build/ublue-os-just/ublue-os-just.spec index c2fd2a4b..405b73b7 100644 --- a/build/ublue-os-just/ublue-os-just.spec +++ b/build/ublue-os-just/ublue-os-just.spec @@ -1,7 +1,7 @@ Name: ublue-os-just Packager: ublue-os Vendor: ublue-os -Version: 0.2 +Version: 0.3 Release: 1%{?dist} Summary: ublue-os just integration License: MIT @@ -44,6 +44,11 @@ done %attr(0755,root,root) %{_sysconfdir}/profile.d/ublue-os-just.sh %changelog +* Thu Sep 21 2023 Kyle Gospodnetich - 0.3 +- Modify just files to be numbered for ordered loading +- Move to using a single master justfile +- Clean up previous installs to point to new file + * Sat May 13 2023 Benjamin Sherman - 0.2 - Refactor directory structure - Rename justfile to main.just From 75480098da298f980ef0e29478cdfe4144076cf7 Mon Sep 17 00:00:00 2001 From: Kyle Gospodnetich Date: Thu, 21 Sep 2023 17:40:36 -0700 Subject: [PATCH 09/14] fix: Reset previously added .just files for existing users and preserve user-added lines. chore: Minor spec cleanup --- build/ublue-os-just/ublue-os-just.sh | 10 ++++++++++ build/ublue-os-just/ublue-os-just.spec | 6 +++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/build/ublue-os-just/ublue-os-just.sh b/build/ublue-os-just/ublue-os-just.sh index c17063b7..426e6a1b 100755 --- a/build/ublue-os-just/ublue-os-just.sh +++ b/build/ublue-os-just/ublue-os-just.sh @@ -7,3 +7,13 @@ if [ ! -z "$HOME" ] && [ -d "$HOME" ] && [ ! -f "${HOME}/.justfile" ]; then !include /usr/share/ublue-os/justfile EOF fi + +if [ -f "${HOME}/.justfile" ]; then + if ! grep -Fxq '!include /usr/share/ublue-os/justfile' "${HOME}/.justfile"; then + # Remove any lines we may have added previously. + sed -i '/!include \/usr\/share\/ublue-os\/just\/.*.just/d' "${HOME}/.justfile" + + # Point to the new main justfile, place it as the first line + sed -i '1s/^/!include \/usr\/share\/ublue-os\/justfile\n/' "${HOME}/.justfile" + fi +fi \ No newline at end of file diff --git a/build/ublue-os-just/ublue-os-just.spec b/build/ublue-os-just/ublue-os-just.spec index 405b73b7..476ef8d5 100644 --- a/build/ublue-os-just/ublue-os-just.spec +++ b/build/ublue-os-just/ublue-os-just.spec @@ -29,19 +29,19 @@ Adds ublue-os just integration for easier setup %build mkdir -p -m0755 %{buildroot}%{_datadir}/%{VENDOR}/%{sub_name} -cp %{SOURCE0} %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} %{buildroot}%{_datadir}/%{VENDOR}/%{sub_name} install -Dm755 %{SOURCE0} %{buildroot}%{_sysconfdir}/profile.d/ublue-os-just.sh +cp %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} %{buildroot}%{_datadir}/%{VENDOR}/%{sub_name} -# Create justfile which always contains all .just files included in this package +# Create justfile which contains all .just files included in this package for justfile in %{buildroot}%{_datadir}/%{VENDOR}/%{sub_name}/*.just; do echo "!include %{_datadir}/%{VENDOR}/%{sub_name}/${justfile}" >> "%{buildroot}%{_datadir}/%{VENDOR}/justfile" done %files %dir %attr(0755,root,root) %{_datadir}/%{VENDOR}/%{sub_name} +%attr(0755,root,root) %{_sysconfdir}/profile.d/ublue-os-just.sh %attr(0644,root,root) %{_datadir}/%{VENDOR}/%{sub_name}/*.just %attr(0644,root,root) %{_datadir}/%{VENDOR}/justfile -%attr(0755,root,root) %{_sysconfdir}/profile.d/ublue-os-just.sh %changelog * Thu Sep 21 2023 Kyle Gospodnetich - 0.3 From 131e0de6b9853064104f1426b390fed36492a8cb Mon Sep 17 00:00:00 2001 From: Kyle Gospodnetich Date: Thu, 21 Sep 2023 17:41:53 -0700 Subject: [PATCH 10/14] feat: Add support for fish shell --- build/ublue-os-just/ublue-os-just.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build/ublue-os-just/ublue-os-just.spec b/build/ublue-os-just/ublue-os-just.spec index 476ef8d5..3c157951 100644 --- a/build/ublue-os-just/ublue-os-just.spec +++ b/build/ublue-os-just/ublue-os-just.spec @@ -30,6 +30,7 @@ Adds ublue-os just integration for easier setup mkdir -p -m0755 %{buildroot}%{_datadir}/%{VENDOR}/%{sub_name} install -Dm755 %{SOURCE0} %{buildroot}%{_sysconfdir}/profile.d/ublue-os-just.sh +install -Dm755 %{SOURCE0} %{buildroot}%{_datarootdir}/fish/vendor_conf.d/ublue-os-just.fish cp %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} %{buildroot}%{_datadir}/%{VENDOR}/%{sub_name} # Create justfile which contains all .just files included in this package @@ -40,6 +41,7 @@ done %files %dir %attr(0755,root,root) %{_datadir}/%{VENDOR}/%{sub_name} %attr(0755,root,root) %{_sysconfdir}/profile.d/ublue-os-just.sh +%attr(0755,root,root) %{_datarootdir}/fish/vendor_conf.d/ublue-os-just.fish %attr(0644,root,root) %{_datadir}/%{VENDOR}/%{sub_name}/*.just %attr(0644,root,root) %{_datadir}/%{VENDOR}/justfile @@ -48,6 +50,7 @@ done - Modify just files to be numbered for ordered loading - Move to using a single master justfile - Clean up previous installs to point to new file +- Add support for fish shell * Sat May 13 2023 Benjamin Sherman - 0.2 - Refactor directory structure From 826645e8f09d088ab50c21833dd137966b609451 Mon Sep 17 00:00:00 2001 From: Kyle Gospodnetich Date: Thu, 21 Sep 2023 18:22:54 -0700 Subject: [PATCH 11/14] feat: Add 50-akmods just file with wl and xbox driver toggling. feat: Add installer for obs-studio-portable --- build/ublue-os-just/30-distrobox.just | 6 ++++ build/ublue-os-just/50-akmods.just | 29 +++++++++++++++++++ .../{50-custom.just => 60-custom.just} | 0 build/ublue-os-just/ublue-os-just.spec | 5 ++-- 4 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 build/ublue-os-just/50-akmods.just rename build/ublue-os-just/{50-custom.just => 60-custom.just} (100%) diff --git a/build/ublue-os-just/30-distrobox.just b/build/ublue-os-just/30-distrobox.just index bdb096b7..471eb9fe 100644 --- a/build/ublue-os-just/30-distrobox.just +++ b/build/ublue-os-just/30-distrobox.just @@ -40,3 +40,9 @@ distrobox-opensuse: distrobox-ubuntu: echo 'Creating Ubuntu distrobox ...' distrobox create --nvidia --image quay.io/toolbx-images/ubuntu-toolbox:22.04 -n ubuntu -Y + +# Install obs-studio-portable from wimpysworld, which bundles an extensive collection of 3rd party plugins +install-obs-studio-portable: + echo 'Installing obs-studio-portable...' && \ + distrobox create --nvidia --no-entry --image ghcr.io/ublue-os/obs-studio-portable -n obs-studio-portable -Y && \ + distrobox-enter -n obs-studio-portable -- 'bash -c "distrobox-export --app obs"' \ No newline at end of file diff --git a/build/ublue-os-just/50-akmods.just b/build/ublue-os-just/50-akmods.just new file mode 100644 index 00000000..0dbb5f4a --- /dev/null +++ b/build/ublue-os-just/50-akmods.just @@ -0,0 +1,29 @@ +# vim: set ft=make : + +# Use stock gamepad drivers +use-stock-gamepads: + #!/usr/bin/env bash + sudo bash -c '> /etc/modprobe.d/xone.conf' + sudo bash -c '> /etc/modprobe.d/xpadneo.conf' + sudo bash -c '> /etc/modprobe.d/xpad-noone-blacklist.conf' + sudo bash -c '> /etc/modules-load.d/xpad-noone.conf' + +# Use uBlue gamepad drivers (Default) +use-ublue-gamepads: + #!/usr/bin/env bash + sudo rm -f /etc/modprobe.d/xone.conf + sudo rm -f /etc/modprobe.d/xpadneo.conf + sudo rm -f /etc/modprobe.d/xpad-noone-blacklist.conf + sudo rm -f /etc/modules-load.d/xpad-noone.conf + +# Disable Broadcom WL driver (Default - WL breaks numerous other Wi-Fi adapters) +disable-broadcom-wl: + #!/usr/bin/env bash + sudo bash -c '> /etc/modules-load.d/broadcom-wl-blacklist.conf' + sudo bash -c 'echo "wl" > /etc/modules-load.d/default-disable-broadcom-wl.conf' + +# Use Broadcom WL driver +use-broadcom-wl: + #!/usr/bin/env bash + sudo rm -f /etc/modprobe.d/broadcom-wl-blacklist.conf + sudo rm -f /etc/modprobe.d/default-disable-broadcom-wl.conf \ No newline at end of file diff --git a/build/ublue-os-just/50-custom.just b/build/ublue-os-just/60-custom.just similarity index 100% rename from build/ublue-os-just/50-custom.just rename to build/ublue-os-just/60-custom.just diff --git a/build/ublue-os-just/ublue-os-just.spec b/build/ublue-os-just/ublue-os-just.spec index 3c157951..cbf35f0e 100644 --- a/build/ublue-os-just/ublue-os-just.spec +++ b/build/ublue-os-just/ublue-os-just.spec @@ -16,7 +16,8 @@ Source2: 10-update.just Source3: 20-clean.just Source4: 30-distrobox.just Source5: 40-nvidia.just -Source6: 50-custom.just +Source6: 50-akmods.just +Source7: 60-custom.just %global sub_name %{lua:t=string.gsub(rpm.expand("%{NAME}"), "^ublue%-os%-", ""); print(t)} @@ -31,7 +32,7 @@ Adds ublue-os just integration for easier setup mkdir -p -m0755 %{buildroot}%{_datadir}/%{VENDOR}/%{sub_name} install -Dm755 %{SOURCE0} %{buildroot}%{_sysconfdir}/profile.d/ublue-os-just.sh install -Dm755 %{SOURCE0} %{buildroot}%{_datarootdir}/fish/vendor_conf.d/ublue-os-just.fish -cp %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} %{buildroot}%{_datadir}/%{VENDOR}/%{sub_name} +cp %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} %{SOURCE7} %{buildroot}%{_datadir}/%{VENDOR}/%{sub_name} # Create justfile which contains all .just files included in this package for justfile in %{buildroot}%{_datadir}/%{VENDOR}/%{sub_name}/*.just; do From 262dd8692df582e45888c8516c05229c8e2bf34e Mon Sep 17 00:00:00 2001 From: Kyle Gospodnetich Date: Thu, 21 Sep 2023 21:58:13 -0700 Subject: [PATCH 12/14] feat: Add a check when running certain nvidia commands for the nvidia module, print a helpful message if it's not found. --- build/ublue-os-just/40-nvidia.just | 48 ++++++++++++++++++------------ 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/build/ublue-os-just/40-nvidia.just b/build/ublue-os-just/40-nvidia.just index 9d411ae5..fb60d867 100644 --- a/build/ublue-os-just/40-nvidia.just +++ b/build/ublue-os-just/40-nvidia.just @@ -2,30 +2,40 @@ # Set needed kernel arguments for Nvidia GPUs nvidia-set-kargs: - rpm-ostree kargs \ - --append-if-missing=rd.driver.blacklist=nouveau \ - --append-if-missing=modprobe.blacklist=nouveau \ - --append-if-missing=nvidia-drm.modeset=1 \ - --delete-if-present=nomodeset + rpm-ostree kargs \ + --append-if-missing=rd.driver.blacklist=nouveau \ + --append-if-missing=modprobe.blacklist=nouveau \ + --append-if-missing=nvidia-drm.modeset=1 \ + --delete-if-present=nomodeset # Test CUDA support for Nvidia GPUs nvidia-test-cuda: + #!/usr/bin/env bash + if lsmod | grep -wq "nvidia"; then podman run \ - --user 1000:1000 \ - --security-opt=no-new-privileges \ - --cap-drop=ALL \ - --security-opt label=type:nvidia_container_t \ - docker.io/mirrorgooglecontainers/cuda-vector-add:v0.1 + --user 1000:1000 \ + --security-opt=no-new-privileges \ + --cap-drop=ALL \ + --security-opt label=type:nvidia_container_t \ + docker.io/mirrorgooglecontainers/cuda-vector-add:v0.1 + else + echo 'The Nvidia kernel module is not loaded. You may be using secure boot without the needed signing key, lacking the needed kargs, or may not be on a Nvidia image. See "just enroll-secure-boot-key" and "just nvidia-set-kargs".' + fi # Enable VAAPI in Firefox Flatpak for Nvidia GPUs nvidia-setup-firefox-vaapi: + #!/usr/bin/env bash + if lsmod | grep -wq "nvidia"; then flatpak override \ - --user \ - --filesystem=host-os \ - --env=LIBVA_DRIVER_NAME=nvidia \ - --env=LIBVA_DRIVERS_PATH=/run/host/usr/lib64/dri \ - --env=LIBVA_MESSAGING_LEVEL=1 \ - --env=MOZ_DISABLE_RDD_SANDBOX=1 \ - --env=NVD_BACKEND=direct \ - --env=MOZ_ENABLE_WAYLAND=1 \ - org.mozilla.firefox + --user \ + --filesystem=host-os \ + --env=LIBVA_DRIVER_NAME=nvidia \ + --env=LIBVA_DRIVERS_PATH=/run/host/usr/lib64/dri \ + --env=LIBVA_MESSAGING_LEVEL=1 \ + --env=MOZ_DISABLE_RDD_SANDBOX=1 \ + --env=NVD_BACKEND=direct \ + --env=MOZ_ENABLE_WAYLAND=1 \ + org.mozilla.firefox + else + echo 'The Nvidia kernel module is not loaded. You may be using secure boot without the needed signing key, lacking the needed kargs, or may not be on a Nvidia image. See "just enroll-secure-boot-key" and "just nvidia-set-kargs".' + fi From ebea73220b5f146d0cc9bf10a8fc84773b61cddd Mon Sep 17 00:00:00 2001 From: Kyle Gospodnetich Date: Fri, 22 Sep 2023 11:07:57 -0700 Subject: [PATCH 13/14] fix(just): Correctly disable WL --- build/ublue-os-just/50-akmods.just | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/ublue-os-just/50-akmods.just b/build/ublue-os-just/50-akmods.just index 0dbb5f4a..bb7ac769 100644 --- a/build/ublue-os-just/50-akmods.just +++ b/build/ublue-os-just/50-akmods.just @@ -20,7 +20,7 @@ use-ublue-gamepads: disable-broadcom-wl: #!/usr/bin/env bash sudo bash -c '> /etc/modules-load.d/broadcom-wl-blacklist.conf' - sudo bash -c 'echo "wl" > /etc/modules-load.d/default-disable-broadcom-wl.conf' + sudo bash -c 'echo "blacklist wl" > /etc/modules-load.d/default-disable-broadcom-wl.conf' # Use Broadcom WL driver use-broadcom-wl: From 8c62c42084f2a60b761da9d737135250caae85d2 Mon Sep 17 00:00:00 2001 From: Kyle Gospodnetich Date: Fri, 22 Sep 2023 16:21:25 -0700 Subject: [PATCH 14/14] feat(just): Show a helpful error if nvidia-smi isn't present --- build/ublue-os-just/40-nvidia.just | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/build/ublue-os-just/40-nvidia.just b/build/ublue-os-just/40-nvidia.just index fb60d867..1091bd15 100644 --- a/build/ublue-os-just/40-nvidia.just +++ b/build/ublue-os-just/40-nvidia.just @@ -2,11 +2,16 @@ # Set needed kernel arguments for Nvidia GPUs nvidia-set-kargs: - rpm-ostree kargs \ - --append-if-missing=rd.driver.blacklist=nouveau \ - --append-if-missing=modprobe.blacklist=nouveau \ - --append-if-missing=nvidia-drm.modeset=1 \ - --delete-if-present=nomodeset + #!/usr/bin/env bash + if command -v nvidia-smi; then + rpm-ostree kargs \ + --append-if-missing=rd.driver.blacklist=nouveau \ + --append-if-missing=modprobe.blacklist=nouveau \ + --append-if-missing=nvidia-drm.modeset=1 \ + --delete-if-present=nomodeset + else + echo 'You do not appear to be on a Nvidia image, please refer to the README for your uBlue-OS image.' + fi # Test CUDA support for Nvidia GPUs nvidia-test-cuda: