Skip to content

Commit

Permalink
Merge branch 'main' into bluefin-schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
tulilirockz authored Jan 12, 2025
2 parents a6a4056 + ce84b9d commit 66e9913
Show file tree
Hide file tree
Showing 77 changed files with 90 additions and 33,522 deletions.
37 changes: 37 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// For format details, see https://aka.ms/devcontainer.json.
{
"name": "Bluefin-devcontainer",
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"workspaceFolder": "${localWorkspaceFolder}",
"workspaceMount": "source=${localWorkspaceFolder},target=${localWorkspaceFolder},type=bind",
"mounts": [{ "source": "/tmp", "target": "/tmp", "type": "bind" }],
"otherPortsAttributes": { "onAutoForward" : "ignore" },
"customizations": {
"vscode": {
"extensions": [
"eamodio.gitlens",
"hangxingliu.vscode-systemd-support",
"mads-hartmann.bash-ide-vscode",
"ms-azuretools.vscode-docker",
"sclu1034.justfile",
"timonwong.shellcheck"
]
}
},
// Likely need to add "--userns=keep-id, --group-add=keep-groups" for podman support
"runArgs": ["--init"],
"securityOpt": [
"label=disable"
],
"features": {
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {},
"ghcr.io/guiyomh/features/just:0": {},
"ghcr.io/lukewiwa/features/shellcheck:0": {},
"ghcr.io/jsburckhardt/devcontainer-features/skopeo:1": {}
},
"onCreateCommand": {
"bash-completions": "sudo apt-get install -y bash-completion; echo 'source /etc/profile.d/bash_completion.sh' | sudo tee -a /etc/bash.bashrc > /dev/null",
"just-completions": "just --completions bash | sudo tee -a /etc/bash_completion.d/just > /dev/null",
"docker-completions": "docker completion bash | sudo tee -a /etc/bash_completion.d/docker.sh > /dev/null"
}
}
11 changes: 6 additions & 5 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ tags := '(
export SUDO_DISPLAY := if `if [ -n "${DISPLAY:-}" ] || [ -n "${WAYLAND_DISPLAY:-}" ]; then echo true; fi` == "true" { "true" } else { "false" }
export SUDOIF := if `id -u` == "0" { "" } else { if SUDO_DISPLAY == "true" { "sudo --askpass" } else { "sudo" } }
export PODMAN := if path_exists("/usr/bin/podman") == "true" { env("PODMAN", "/usr/bin/podman") } else { if path_exists("/usr/bin/docker") == "true" { env("PODMAN", "docker") } else { env("PODMAN", "exit 1 ; ") } }
export PULL_POLICY := if PODMAN =~ "docker" { "missing" } else { "newer" }

[private]
default:
Expand Down Expand Up @@ -226,7 +227,7 @@ build $image="bluefin" $tag="latest" $flavor="main" rechunk="0" ghcr="0" pipelin
"${BUILD_ARGS[@]}" \
"${LABELS[@]}" \
--target "${target}" \
--tag "${image_name}:${tag}" \
--tag localhost/"${image_name}:${tag}" \
--file Containerfile \
.
echo "::endgroup::"
Expand Down Expand Up @@ -346,7 +347,7 @@ rechunk $image="bluefin" $tag="latest" $flavor="main" ghcr="0" pipeline="0":

# Run Rechunker's Prune
${SUDOIF} ${PODMAN} run --rm \
--pull=newer \
--pull=${PULL_POLICY} \
--security-opt label=disable \
--volume "$MOUNT":/var/tree \
--env TREE=/var/tree \
Expand Down Expand Up @@ -379,7 +380,7 @@ rechunk $image="bluefin" $tag="latest" $flavor="main" ghcr="0" pipeline="0":

# Run Rechunker
${SUDOIF} ${PODMAN} run --rm \
--pull=newer \
--pull=${PULL_POLICY} \
--security-opt label=disable \
--volume "$PWD:/workspace" \
--volume "$PWD:/var/git" \
Expand Down Expand Up @@ -559,7 +560,7 @@ build-iso $image="bluefin" $tag="latest" $flavor="main" ghcr="0" pipeline="0":

# Build ISO
iso_build_args=()
iso_build_args+=("--rm" "--privileged" "--pull=newer")
iso_build_args+=("--rm" "--privileged" "--pull=${PULL_POLICY}")
if [[ "{{ ghcr }}" == "0" ]]; then
iso_build_args+=(--volume "/var/lib/containers/storage:/var/lib/containers/storage")
fi
Expand Down Expand Up @@ -620,7 +621,7 @@ run-iso $image="bluefin" $tag="latest" $flavor="main":
echo "Connect to http://localhost:${port}"
run_args=()
run_args+=(--rm --privileged)
run_args+=(--pull=newer)
run_args+=(--pull=${PULL_POLICY})
run_args+=(--publish "127.0.0.1:${port}:8006")
run_args+=(--env "CPU_CORES=4")
run_args+=(--env "RAM_SIZE=8G")
Expand Down
7 changes: 7 additions & 0 deletions build_files/base/05-override-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ pip install --prefix=/usr topgrade
# Install ublue-update -- breaks with packages.json due to missing topgrade
rpm-ostree install ublue-update

# Required for bluefin faces to work without conflicting with a ton of packages
rm -f /usr/share/pixmaps/faces/* || echo "Expected directory deletion to fail"
mv /usr/share/pixmaps/faces/bluefin/* /usr/share/pixmaps/faces
rm -rf /usr/share/pixmaps/faces/bluefin

rpm-ostree override remove fedora-logos --install=bluefin-logos

# Consolidate Just Files
find /tmp/just -iname '*.just' -exec printf "\n\n" \; -exec cat {} \; >> /usr/share/ublue-os/just/60-custom.just

Expand Down
4 changes: 4 additions & 0 deletions build_files/base/18-workarounds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@ fi
# rpm-ostree override replace https://bodhi.fedoraproject.org/updates/FEDORA-2024-dd2e9fb225
#fi

# Current bluefin systems have the bling.sh and bling.fish in their default locations
mkdir -p /usr/share/ublue-os/bluefin-cli
cp /usr/share/ublue-os/bling/* /usr/share/ublue-os/bluefin-cli

echo "::endgroup::"
51 changes: 25 additions & 26 deletions just/bluefin-system.just
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ benchmark:
# Configure Bluefin-CLI Terminal Experience with Brew
[group('System')]
bluefin-cli:
@/usr/libexec/ublue-bling.sh
@/usr/libexec/ublue-bling

# alias for toggle-devmode
devmode:
Expand Down Expand Up @@ -146,8 +146,8 @@ configure-vfio ACTION="":
This is only used for GPU passthrough of a secondary dGPU.
It will enable vfio and configure kvmfr for use with $(Urllink "https://looking-glass.io" "Looking Glass")
If you do not plan to use any of this then press ESC.
EOF
${bold}NOTE:${normal} Since this is a niche use case, support will be ${b}very limited${n}
EOF
OPTION=$(Choose \
"Enable VFIO drivers" \
"Disable VFIO drivers" \
Expand All @@ -156,32 +156,31 @@ configure-vfio ACTION="":
fi
if [[ "${OPTION,,}" =~ (^enable[[:space:]]vfio|vfio-on) ]]; then
echo "Enabling VFIO..."
VIRT_TEST=$(rpm-ostree kargs)
CPU_VENDOR=$(grep "vendor_id" "/proc/cpuinfo" | uniq | awk -F": " '{ print $2 }')
VENDOR_KARG="unset"
if [[ ${VIRT_TEST} == *kvm.report_ignored_msrs* ]]; then
echo 'add_drivers+=" vfio vfio_iommu_type1 vfio-pci "' | sudo tee /etc/dracut.conf.d/vfio.conf
rpm-ostree initramfs --enable
if [[ ${CPU_VENDOR} == "AuthenticAMD" ]]; then
VENDOR_KARG="amd_iommu=on"
elif [[ ${CPU_VENDOR} == "GenuineIntel" ]]; then
VENDOR_KARG="intel_iommu=on"
fi
if [[ ${VENDOR_KARG} == "unset" ]]; then
echo "Failed to get CPU vendor, exiting..."
exit 1
else
rpm-ostree kargs \
--append-if-missing="${VENDOR_KARG}" \
--append-if-missing="iommu=pt" \
--append-if-missing="rd.driver.pre=vfio_pci" \
--append-if-missing="vfio_pci.disable_vga=1"
echo "VFIO will be enabled on next boot, make sure you enable IOMMU, VT-d or AMD-v in your BIOS!"
echo "Please understand that since this is such a niche use case, support will be very limited!"
echo "To add your unused/second GPU device ids to the vfio driver by running"
echo 'rpm-ostree kargs --append-if-missing="vfio-pci.ids=xxxx:yyyy,xxxx:yyzz"'
echo "NOTE: Your second GPU will not be usable by the host after you do this!"
fi
echo 'add_drivers+=" vfio vfio_iommu_type1 vfio-pci "' | sudo tee /etc/dracut.conf.d/vfio.conf
rpm-ostree initramfs --enable
if [[ ${CPU_VENDOR} == "AuthenticAMD" ]]; then
VENDOR_KARG="amd_iommu=on"
elif [[ ${CPU_VENDOR} == "GenuineIntel" ]]; then
VENDOR_KARG="intel_iommu=on"
fi
if [[ ${VENDOR_KARG} == "unset" ]]; then
echo "Failed to get CPU vendor, exiting..."
exit 1
else
rpm-ostree kargs \
--append-if-missing="${VENDOR_KARG}" \
--append-if-missing="iommu=pt" \
--append-if-missing="rd.driver.pre=vfio_pci" \
--append-if-missing="vfio_pci.disable_vga=1" \
--append-if-missing="kvm.ignore_msrs=1" \
--append-if-missing="kvm.report_ignored_msrs=0"
echo "VFIO will be enabled on next boot, make sure you enable IOMMU, VT-d or AMD-v in your BIOS!"
echo "Please understand that since this is such a niche use case, support will be very limited!"
echo "To add your unused/second GPU device ids to the vfio driver by running"
echo 'rpm-ostree kargs --append-if-missing="vfio-pci.ids=xxxx:yyyy,xxxx:yyzz"'
echo "NOTE: Your second GPU will not be usable by the host after you do this!"
fi
elif [[ "${OPTION,,}" =~ (^disable[[:space:]]vfio|vfio-off) ]]; then
echo ""
Expand Down
4 changes: 4 additions & 0 deletions packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
"adw-gtk3-theme",
"bash-color-prompt",
"bcache-tools",
"bluefin-backgrounds",
"bluefin-schemas",
"borgbackup",
"bootc",
"bluefin-faces",
"ddcutil",
"evtest",
"epson-inkjet-printer-escpr",
Expand Down Expand Up @@ -56,7 +58,9 @@
"stress-ng",
"tailscale",
"tmux",
"ublue-motd",
"usbmuxd",
"ublue-bling",
"wireguard-tools",
"xprop",
"wl-clipboard",
Expand Down
3 changes: 3 additions & 0 deletions system_files/shared/etc/ublue-os/bling.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"bling-cli-name": "bluefin-cli"
}
169 changes: 0 additions & 169 deletions system_files/shared/usr/libexec/ublue-bling.sh

This file was deleted.

Loading

0 comments on commit 66e9913

Please sign in to comment.