Skip to content

Commit

Permalink
Merge branch 'ublue-os:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
hisergiorojas authored Nov 29, 2023
2 parents 5f74b9f + 72b73e8 commit 996e222
Show file tree
Hide file tree
Showing 7 changed files with 140 additions and 128 deletions.
63 changes: 39 additions & 24 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,31 @@ ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-39}"

FROM ${BASE_IMAGE}:${FEDORA_MAJOR_VERSION} AS bazzite

ARG IMAGE_NAME="${IMAGE_NAME}"
ARG IMAGE_VENDOR="${IMAGE_VENDOR}"
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 IMAGE_NAME="${IMAGE_NAME:-bazzite}"
ARG IMAGE_VENDOR="${IMAGE_VENDOR:-ublue-os}"
ARG IMAGE_FLAVOR="${IMAGE_FLAVOR:-main}"
ARG AKMODS_FLAVOR="${AKMODS_FLAVOR:-main}"
ARG BASE_IMAGE_NAME="${BASE_IMAGE_NAME:-kinoite}"
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-39}"

COPY system_files/desktop/shared system_files/desktop/${BASE_IMAGE_NAME} /

# Add ublue packages, add needed negativo17 repo and then immediately disable due to incompatibility with RPMFusion
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 && \
rpm-ostree install \
/tmp/akmods-rpms/kmods/*xpadneo*.rpm \
/tmp/akmods-rpms/kmods/*xpad-noone*.rpm \
/tmp/akmods-rpms/kmods/*xone*.rpm \
/tmp/akmods-rpms/kmods/*openrazer*.rpm \
/tmp/akmods-rpms/kmods/*v4l2loopback*.rpm \
/tmp/akmods-rpms/kmods/*wl*.rpm && \
sed -i "0,/enabled/ s@enabled=0@enabled=1@g" /etc/yum.repos.d/negativo17-fedora-multimedia.repo && \
rpm-ostree install \
/tmp/akmods-rpms/kmods/*gcadapter_oc*.rpm \
/tmp/akmods-rpms/kmods/*nct6687*.rpm \
/tmp/akmods-rpms/kmods/*openrazer*.rpm \
/tmp/akmods-rpms/kmods/*openrgb*.rpm \
/tmp/akmods-rpms/kmods/*ryzen-smu*.rpm \
/tmp/akmods-rpms/kmods/*winesync*.rpm && \
/tmp/akmods-rpms/kmods/*v4l2loopback*.rpm \
/tmp/akmods-rpms/kmods/*winesync*.rpm \
/tmp/akmods-rpms/kmods/*wl*.rpm \
/tmp/akmods-rpms/kmods/*xone*.rpm \
/tmp/akmods-rpms/kmods/*xpad-noone*.rpm \
/tmp/akmods-rpms/kmods/*xpadneo*.rpm && \
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/
Expand Down Expand Up @@ -62,7 +61,11 @@ RUN rpm-ostree override remove \
htop

# Install new packages
RUN rpm-ostree install \
RUN if [[ "${IMAGE_FLAVOR}" =~ "nvidia" ]]; then \
rpm-ostree override remove \
glibc32 \
; fi && \
rpm-ostree install \
ublue-update \
discover-overlay \
python3-pip \
Expand Down Expand Up @@ -92,6 +95,7 @@ RUN rpm-ostree install \
libxcrypt-compat \
mesa-libGLU \
vulkan-tools \
glibc.i686 \
extest.i686 \
twitter-twemoji-fonts \
google-noto-sans-cjk-fonts \
Expand All @@ -108,7 +112,19 @@ RUN rpm-ostree install \
wget https://gitlab.com/popsulfr/steamos-btrfs/-/raw/main/files/usr/lib/systemd/system/[email protected] -O /usr/lib/systemd/system/[email protected]

# Install Steam & Lutris, plus supporting packages
RUN rpm-ostree install \
RUN rpm-ostree override replace \
--experimental \
--from repo=updates \
pipewire \
pipewire-alsa \
pipewire-gstreamer \
pipewire-jack-audio-connection-kit \
pipewire-jack-audio-connection-kit-libs \
pipewire-libs \
pipewire-pulseaudio \
pipewire-utils \
|| true && \
rpm-ostree install \
vulkan-loader.i686 \
alsa-lib.i686 \
fontconfig.i686 \
Expand Down Expand Up @@ -208,7 +224,6 @@ RUN if grep -q "kinoite" <<< "${BASE_IMAGE_NAME}"; then \
gnome-control-center-filesystem && \
rpm-ostree install \
gnome-shell-extension-tailscale-gnome-qs \
xwaylandvideobridge \
steamdeck-backgrounds \
gnome-randr-rust \
gnome-shell-extension-user-theme \
Expand Down Expand Up @@ -254,7 +269,7 @@ RUN rpm-ostree override replace \
RUN if grep -qv "nvidia" <<< "${IMAGE_NAME}"; then \
rpm-ostree install \
gamescope.x86_64 \
gamescope.i686 \
gamescope-libs.i686 \
rocm-hip \
rocm-opencl \
rocm-clinfo \
Expand Down Expand Up @@ -341,11 +356,11 @@ RUN /tmp/image-info.sh && \

FROM bazzite as bazzite-deck

ARG IMAGE_NAME="${IMAGE_NAME}"
ARG IMAGE_VENDOR="${IMAGE_VENDOR}"
ARG IMAGE_FLAVOR="${IMAGE_FLAVOR}"
ARG BASE_IMAGE_NAME="${BASE_IMAGE_NAME}"
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION}"
ARG IMAGE_NAME="${IMAGE_NAME:-bazzite-deck}"
ARG IMAGE_VENDOR="${IMAGE_VENDOR:-ublue-os}"
ARG IMAGE_FLAVOR="${IMAGE_FLAVOR:-main}"
ARG BASE_IMAGE_NAME="${BASE_IMAGE_NAME:-kinoite}"
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-39}"

COPY system_files/deck/shared system_files/deck/${BASE_IMAGE_NAME} /

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ screens:
description: Nix is a powerful package manager for Linux and other Unix systems that makes package management reliable and reproducible
default: false
packages:
- Install Nix Package Support: sudo -A ujust install-nix
- Install Fleek (Requires Nix): ujust install-fleek
- Install Nix Package Support: sudo -A ujust nix-install
- Install Fleek (Requires Nix): ujust fleek-install
Oversteer:
description: Application to control supported steering wheels
default: false
Expand Down
57 changes: 15 additions & 42 deletions system_files/deck/shared/usr/share/ublue-os/just/60-custom.just
Original file line number Diff line number Diff line change
Expand Up @@ -68,43 +68,6 @@ install-openrazer:
sudo usermod -a -G plugdev $USER && \
echo "Please reboot to apply needed changes."

# Install Nix with the Determinate Nix Installer
install-nix:
#!/usr/bin/env bash
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sudo bash -s -- install --no-confirm
# Uninstall Nix
remove-nix:
sudo /nix/nix-installer uninstall

# Install Fleek (https://getfleek.dev/)
install-fleek:
#!/usr/bin/env bash
if [[ -d "/nix" ]]; then
mkdir -p $HOME/.config/nix
echo "experimental-features = nix-command flakes" >> $HOME/.config/nix/nix.conf
curl -fsSL https://getfleek.dev/installer | env FORCE=1 bash
else
echo "Install nix with ujust install-nix before running ujust install-fleek."
fi
# Integrate Nix/Fleek applications with system theme
install-fleek-themes:
#!/usr/bin/env bash
if [[ -x "/var/usrlocal/bin/fleek" ]]; then
IMAGE_INFO="/usr/share/ublue-os/image-info.json"
BASE_IMAGE_NAME=$(jq -r '."base-image-name"' < $IMAGE_INFO)
if [[ ${BASE_IMAGE_NAME} == 'silverblue' ]]; then
fleek add adw-gtk3 --apply
else
fleek add breeze-icons
fleek add libsForQt5.breeze-qt5
fleek apply
fi
else
echo "Install fleek with ujust install-fleek before running ujust install-fleek-themes."
fi
# Install Greenlight xCloud and xHome streaming AppImage
get-greenlight:
#!/usr/bin/env bash
Expand Down Expand Up @@ -373,21 +336,31 @@ unhide-grub:
# Install Deck HD BIOS
install-deckhd-bios:
#!/usr/bin/env bash
RESOLUTION=$(sudo lshw -json -c display | jq -r .[]."configuration"."resolution")
if [[ "${RESOLUTION}" = "1200,1920" ]]; then
SYS_ID="$(cat /sys/devices/virtual/dmi/id/product_name)"
if [[ ":Jupiter:" =~ ":$SYS_ID:" ]]; then
RESOLUTION=$(sudo lshw -json -c display | jq -r .[]."configuration"."resolution")
if [[ "${RESOLUTION}" = "1200,1920" ]]; then
sudo systemctl mask --now jupiter-biosupdate.service
wget -q https://deckhd.com/downloads/install.sh -O /tmp/deckhd-install.sh
chmod +x /tmp/deckhd-install.sh
sudo ./tmp/deckhd-install.sh
else
else
echo "Unable to detect DeckHD. Aborting..."
fi
else
echo "This is only applicable to LCD Steam Decks with the DeckHD screen. Aborting..."
fi
# Enable BIOS & Firmware update services for the Steam Deck
enable-deck-bios-firmware-updates:
#!/usr/bin/env bash
sudo systemctl enable jupiter-biosupdate.service
sudo systemctl enable jupiter-controller-update.service
SYS_ID="$(cat /sys/devices/virtual/dmi/id/product_name)"
if [[ ":Jupiter:" =~ ":$SYS_ID:" || ":Galileo:" =~ ":$SYS_ID:" ]]; then
sudo systemctl enable jupiter-biosupdate.service
sudo systemctl enable jupiter-controller-update.service
else
echo "This is only applicable to Valve's Steam Deck. Aborting..."
fi
# Disable Steam Deck BIOS updates
disable-bios-updates:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Anything commented out with # on a new line will be ignored
# These files follow the "rpm-ostree initramfs" syntax, please consult
# "rpm-ostree initramfs --help" for more information
#
# You can do 1 initramfs argument per line or do them all in 1 line.
# If you need to just add drivers to dracut, you should instead just add
# config files for dracut into /etc/dracut.conf.d/ and trigger an initramfs
# rebuild using "sudo touch /etc/bazzite/initramfs/rebuild" which
# will rebuild the initramfs on next boot using bazzite-hardware-setup.
#
# Multiline Example:
#--arg="--add-drivers"
#--arg="vfio vfio_iommu_type1 vfio-pci"
#
# Single Line Example:
#--arg="--add-drivers" --arg="vfio vfio_iommu_type1 vfio-pci
61 changes: 51 additions & 10 deletions system_files/desktop/shared/usr/bin/bazzite-hardware-setup
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ BASE_IMAGE_NAME=$(jq -r '."base-image-name"' < $IMAGE_INFO)
FEDORA_VERSION=$(jq -r '."fedora-version"' < $IMAGE_INFO)

# SCRIPT VERSION
HWS_VER=15
HWS_VER=17
HWS_VER_FILE="/etc/bazzite/hws_version"
HWS_VER_RAN=$(cat $HWS_VER_FILE)

Expand All @@ -19,17 +19,42 @@ KNOWN_IMAGE_FLAVOR=$(cat $KNOWN_IMAGE_FLAVOR_FILE)
KNOWN_FEDORA_VERSION_FILE="/etc/bazzite/fedora_version"
KNOWN_FEDORA_VERSION=$(cat $KNOWN_FEDORA_VERSION_FILE)

# RUN REMAINDER OF SCRIPT ONLY IF UPDATED
if [[ -f $HWS_VER_FILE && $HWS_VER = $HWS_VER_RAN ]]; then
if [[ -f $KNOWN_IMAGE_NAME_FILE && -f $KNOWN_IMAGE_FLAVOR_FILE ]]; then
if [[ -f $KNOWN_FEDORA_VERSION_FILE && -f $KNOWN_FEDORA_VERSION_FILE ]]; then
# Run script if image has been rebased
if [[ $IMAGE_NAME = $KNOWN_IMAGE_NAME && $IMAGE_FLAVOR = $KNOWN_IMAGE_FLAVOR && $FEDORA_VERSION = $KNOWN_FEDORA_VERSION ]]; then
echo "Hardware setup has already run. Exiting..."
exit 0
# INITRAMFS CONFIG
INITRAMFS_DIR="/etc/bazzite/initramfs"
INITRAMFS_REBUILD_TRIGGER="$INITRAMFS_DIR/rebuild"
INITRAMFS_BAZZITE_ARG_FILE="$INITRAMFS_DIR/hardware-setup.args"
INITRAMFS_BAZZITE_ARGS=$(cat $INITRAMFS_BAZZITE_ARG_FILE)
INITRAMFS_CUSTOM_ARGS_DIR="$INITRAMFS_DIR/args.d"
INITRAMFS_CUSTOM_ARGS=""

# If the /etc/bazzite/initramfs/args.d dir exists
if [[ -d "$INITRAMFS_CUSTOM_ARGS_DIR" ]]; then
# Grab all the content of the files (minus comments) and join them together with spaces
INITRAMFS_CUSTOM_ARGS=$(grep -RvP "^(#|$)" $INITRAMFS_CUSTOM_ARGS_DIR/ | sort | perl -pe 's/(^$INITRAMFS_CUSTOM_ARGS_DIR\/.+:|\\\n$)//g' | tr '\n' ' ')
fi

# If no rebuild is requested
if [[ ! -f $INITRAMFS_REBUILD_TRIGGER ]]; then
# RUN REMAINDER OF SCRIPT ONLY IF UPDATED
if [[ -f $HWS_VER_FILE && $HWS_VER = $HWS_VER_RAN ]]; then
if [[ -f $KNOWN_IMAGE_NAME_FILE && -f $KNOWN_IMAGE_FLAVOR_FILE ]]; then
if [[ -f $KNOWN_FEDORA_VERSION_FILE && -f $KNOWN_FEDORA_VERSION_FILE ]]; then
# Run script if image has been rebased
if [[ $IMAGE_NAME = $KNOWN_IMAGE_NAME && $IMAGE_FLAVOR = $KNOWN_IMAGE_FLAVOR && $FEDORA_VERSION = $KNOWN_FEDORA_VERSION ]]; then
echo "Hardware setup has already run. Exiting..."
exit 0
fi
fi
fi
fi
else
# REMOVE REBUILD TRIGGER TO AVOID INFINITE BOOT LOOP!
rm $INITRAMFS_REBUILD_TRIGGER
# Rebuild current initramfs (this will add any new configs added to /etc/dracut.conf.d/) then reboot
echo "Initramfs rebuild triggered, using: $INITRAMFS_BAZZITE_ARGS $INITRAMFS_CUSTOM_ARGS"
plymouth display-message --text="Updating initramfs - Please wait, this may take a while" || true
rpm-ostree initramfs --enable "$INITRAMFS_BAZZITE_ARGS" "$INITRAMFS_CUSTOM_ARGS" --reboot
exit 0
fi

# GLOBAL
Expand Down Expand Up @@ -62,10 +87,21 @@ for INITRAMFS_ARG in ${NEEDED_INITRAMFS[@]}; do
fi
done

# If there is nothing in INITRAMFS_BAZZITE_ARGS
if [[ ! $INITRAMFS_BAZZITE_ARGS ]]; then
# Make sure we will have /etc/bazzite/initramfs/bazzite.args for the future
mkdir -p /etc/bazzite/initramfs/args.d
echo "--arg=\"-I ${NEEDED_INITRAMFS[*]}\"" > $INITRAMFS_BAZZITE_ARG_FILE
INITRAMFS_BAZZITE_ARGS=$(cat $INITRAMFS_BAZZITE_ARG_FILE)
fi

if $NEEDS_INITRAMFS_APPLICATION; then
echo "Found needed initramfs changes, applying the following: ${NEEDED_INITRAMFS[*]}"
echo "--arg=\"-I ${NEEDED_INITRAMFS[*]}\"" > $INITRAMFS_BAZZITE_ARG_FILE
INITRAMFS_BAZZITE_ARGS=$(cat $INITRAMFS_BAZZITE_ARG_FILE)
echo "Building initramfs with following custom args: $INITRAMFS_CUSTOM_ARGS"
plymouth display-message --text="Updating initramfs - Please wait, this may take a while" || true
rpm-ostree initramfs --enable --arg="-I ${NEEDED_INITRAMFS[*]}"
rpm-ostree initramfs --enable "$INITRAMFS_BAZZITE_ARGS" "$INITRAMFS_CUSTOM_ARGS"
else
echo "No initramfs changes needed"
fi
Expand Down Expand Up @@ -149,6 +185,11 @@ if [[ $IMAGE_NAME =~ "deck" || $IMAGE_NAME =~ "ally" || $IMAGE_NAME =~ "framegam
systemctl disable --now ryzenadj.service
systemctl disable --now batterylimit.service
systemctl --global disable --now sdgyrodsu.service

if [[ ":83E1:" =~ ":$SYS_ID:" ]]; then
echo "Lenovo Legion detected. Swapping to X11 by default."
sed -i 's/DESKTOP_WAYLAND=true/DESKTOP_WAYLAND=false/g' /etc/desktop-wayland
fi
fi
fi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ screens:
description: Nix is a powerful package manager for Linux and other Unix systems that makes package management reliable and reproducible
default: false
packages:
- Install Nix Package Support: sudo -A ujust install-nix
- Install Fleek (Requires Nix): ujust install-fleek
- Install Nix Package Support: sudo -A ujust nix-install
- Install Fleek (Requires Nix): ujust fleek-install
OpenRazer:
description: Enables additional capabilities for Razer Hardware
default: false
Expand Down Expand Up @@ -77,7 +77,7 @@ screens:
show_terminal: true
package_manager: yafti.plugin.run
packages:
- CoreCtrl (GPU Overclocking): ujust install-corectrl
- LACT (GPU Overclocking): ujust install-lact
nvidia-additions:
source: yafti.screen.package
values:
Expand Down
Loading

0 comments on commit 996e222

Please sign in to comment.