generated from ublue-os/base
-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: proposal refactor #670
Draft
p5
wants to merge
3
commits into
main
Choose a base branch
from
refactor-builds
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/bash | ||
|
||
set -ouex pipefail | ||
|
||
mkdir -p /var/lib/alternatives |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/bash | ||
|
||
set -ouex pipefail | ||
|
||
RELEASE="$(rpm -E %fedora)" | ||
KERNEL_SUFFIX="" | ||
QUALIFIED_KERNEL="$(rpm -qa | grep -P 'kernel-(|'"$KERNEL_SUFFIX"'-)(\d+\.\d+\.\d+)' | sed -E 's/kernel-(|'"$KERNEL_SUFFIX"'-)//')" | ||
|
||
curl -Lo /etc/yum.repos.d/_copr_ublue-os_staging.repo https://copr.fedorainfracloud.org/coprs/ublue-os/staging/repo/fedora-"${RELEASE}"/ublue-os-staging-fedora-"${RELEASE}".repo | ||
curl -Lo /etc/yum.repos.d/_copr_kylegospo_oversteer.repo https://copr.fedorainfracloud.org/coprs/kylegospo/oversteer/repo/fedora-"${RELEASE}"/kylegospo-oversteer-fedora-"${RELEASE}".repo | ||
|
||
rpm-ostree install \ | ||
/tmp/rpms/*.rpm \ | ||
/tmp/akmods-rpms/*.rpm \ | ||
fedora-repos-archive | ||
|
||
# Handle Kernel Skew with override replace | ||
rpm-ostree cliwrap install-to-root / | ||
if [[ "${KERNEL_VERSION}" == "${QUALIFIED_KERNEL}" ]]; then | ||
echo "Installing signed kernel from kernel-cache." | ||
cd /tmp | ||
rpm2cpio /tmp/kernel-rpms/kernel-core-*.rpm | cpio -idmv | ||
cp ./lib/modules/*/vmlinuz /usr/lib/modules/*/vmlinuz | ||
cd / | ||
else | ||
echo "Install kernel version ${KERNEL_VERSION} from kernel-cache." | ||
rpm-ostree override replace \ | ||
--experimental \ | ||
--install=zstd \ | ||
/tmp/kernel-rpms/kernel-[0-9]*.rpm \ | ||
/tmp/kernel-rpms/kernel-core-*.rpm \ | ||
/tmp/kernel-rpms/kernel-modules-*.rpm | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/bash | ||
|
||
set -eoux pipefail | ||
|
||
# use negativo17 for 3rd party packages with higher priority than default | ||
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 | ||
|
||
# use override to replace mesa and others with less crippled versions | ||
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 | ||
|
||
if [[ "$FEDORA_MAJOR_VERSION" -ne "41" ]]; then | ||
rpm-ostree override replace \ | ||
--experimental \ | ||
--from repo='fedora-multimedia' \ | ||
libvdpau | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/bin/sh | ||
|
||
set -ouex pipefail | ||
|
||
# Helper function to parse packages | ||
get_packages() { | ||
local type="$1" | ||
jq -r "[(.all.${type} | (.all, select(.\"$IMAGE_NAME\" != null).\"$IMAGE_NAME\")[]), \ | ||
(select(.\"$FEDORA_MAJOR_VERSION\" != null).\"$FEDORA_MAJOR_VERSION\".${type} | (.all, select(.\"$IMAGE_NAME\" != null).\"$IMAGE_NAME\")[])] \ | ||
| sort | unique[]" /ctx/packages.json | ||
} | ||
|
||
# Get package lists | ||
INCLUDED_PACKAGES=($(get_packages "include")) | ||
EXCLUDED_PACKAGES=($(get_packages "exclude")) | ||
|
||
# Filter out only installed packages from the exclusion list | ||
if [[ "${#EXCLUDED_PACKAGES[@]}" -gt 0 ]]; then | ||
EXCLUDED_PACKAGES=($(rpm -qa --queryformat='%{NAME} ' ${EXCLUDED_PACKAGES[@]})) | ||
fi | ||
|
||
# Run rpm-ostree with necessary installs and removals | ||
if [[ "${#INCLUDED_PACKAGES[@]}" -gt 0 || "${#EXCLUDED_PACKAGES[@]}" -gt 0 ]]; then | ||
rpm-ostree override remove \ | ||
${EXCLUDED_PACKAGES[@]} \ | ||
$(printf -- "--install=%s " ${INCLUDED_PACKAGES[@]}) | ||
else | ||
echo "No packages to install or remove." | ||
fi | ||
|
||
# Check if excluded packages are still present due to dependencies | ||
EXCLUDED_PACKAGES=($(get_packages "exclude")) | ||
if [[ "${#EXCLUDED_PACKAGES[@]}" -gt 0 ]]; then | ||
EXCLUDED_PACKAGES=($(rpm -qa --queryformat='%{NAME} ' ${EXCLUDED_PACKAGES[@]})) | ||
fi | ||
|
||
# Remove any remaining excluded packages | ||
if [[ "${#EXCLUDED_PACKAGES[@]}" -gt 0 ]]; then | ||
rpm-ostree override remove \ | ||
${EXCLUDED_PACKAGES[@]} | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/bash | ||
|
||
set -eoux pipefail | ||
|
||
KERNEL_SUFFIX="" | ||
QUALIFIED_KERNEL="$(rpm -qa | grep -P 'kernel-(|'"$KERNEL_SUFFIX"'-)(\d+\.\d+\.\d+)' | sed -E 's/kernel-(|'"$KERNEL_SUFFIX"'-)//')" | ||
|
||
if [[ "${KERNEL_VERSION}" == "${QUALIFIED_KERNEL}" ]]; then | ||
QUALIFIED_KERNEL="$(rpm -qa | grep -P 'kernel-(\d+\.\d+\.\d+)' | sed -E 's/kernel-//')" | ||
/usr/libexec/rpm-ostree/wrapped/dracut --no-hostonly --kver "$QUALIFIED_KERNEL" --reproducible -v --add ostree -f "/lib/modules/$QUALIFIED_KERNEL/initramfs.img" | ||
chmod 0600 "/lib/modules/$QUALIFIED_KERNEL/initramfs.img" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/bash | ||
|
||
set -eoux pipefail | ||
|
||
# use CoreOS' generator for emergency/rescue boot | ||
# see detail: https://github.com/ublue-os/main/issues/653 | ||
CSFG=/usr/lib/systemd/system-generators/coreos-sulogin-force-generator | ||
curl -sSLo ${CSFG} https://raw.githubusercontent.com/coreos/fedora-coreos-config/refs/heads/stable/overlay.d/05core/usr/lib/systemd/system-generators/coreos-sulogin-force-generator | ||
chmod +x ${CSFG} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/bash | ||
|
||
set -eoux pipefail | ||
|
||
rm -f /usr/bin/chsh | ||
rm -f /usr/bin/lchsh | ||
|
||
# prevent gnome software from warning about dkms secureboot as these warnings | ||
# would duplicate warnings provided by ublue already. we don't want confusion | ||
rm -f /usr/libexec/gnome-software-dkms-helper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why does is this bind mount changed to
rw=true
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was added because I got annoyed with permissions on the scripts directory. The Containerfile now
chmod +x
s all scripts in the directory, which required write access. It can be removed if we wish to proceed with this.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the bind being read-only, seems a bit odd to mutate the scripts on the fly.
Alternatives are:
bash /ctx/build_files/scriptname.sh
at runtime instead of/ctx/build_files/scriptname.sh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Option 2 seems solid, if all the scripts are standardized as bash scripts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find it unlikely for us to move off of bash any time soon so option 2 would be reasonable for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really understand why the permissions are problematic in the first place. They are stored in git repo.
Only potential problem is someone committing in windows (not WSL).