Skip to content

Commit

Permalink
feat: add bootc to Bluefin (#1285)
Browse files Browse the repository at this point in the history
Co-authored-by: m2Giles <[email protected]>
Co-authored-by: Jorge O. Castro <[email protected]>
  • Loading branch information
3 people authored Jun 23, 2024
1 parent 3607d49 commit 05a262a
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/reusable-build-iso.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ jobs:
docker rmi ${image}
- name: Build ISOs
uses: jasonn3/[email protected].0
uses: jasonn3/[email protected].1
id: build
with:
arch: x86_64
Expand Down
15 changes: 7 additions & 8 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export git_branch := ` git branch --show-current`
export gts := "39"
export latest := "40"

alias run := run-booted-guest
alias run := run-container

_default:
@just help
Expand Down Expand Up @@ -46,13 +46,12 @@ build image="" target="" version="":
run-container image="" target="" version="":
@{{ project_root }}/scripts/run-image.sh {{ image }} {{ target }} {{ version }}

# Run Booted Image Session w/ Guest
run-booted-guest image="" target="" version="":
@{{ project_root }}/scripts/run-booted-guest.sh {{ image }} {{ target }} {{ version }}

# Run Booted Image Session w/ mounted in $USER and $HOME
run-booted-home image="" target="" version="":
@{{ project_root }}/scripts/run-booted-home.sh {{ image }} {{ target }} {{ version }}
# # Run Booted Image Session w/ Guest
# run-booted-guest image="" target="" version="":
# @{{ project_root }}/scripts/run-booted-guest.sh {{ image }} {{ target }} {{ version }}
# # Run Booted Image Session w/ mounted in $USER and $HOME
# run-booted-home image="" target="" version="":
# @{{ project_root }}/scripts/run-booted-home.sh {{ image }} {{ target }} {{ version }}

# Create ISO from local dev build image
build-iso image="" target="" version="":
Expand Down
1 change: 1 addition & 0 deletions build_files/base/build-base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ set -ouex pipefail
. /tmp/build/aurora-changes.sh
. /tmp/build/branding.sh
. /tmp/build/initramfs.sh
. /tmp/build/bootc.sh
. /tmp/build/cleanup.sh
6 changes: 0 additions & 6 deletions build_files/base/copr-repos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,12 @@ if [ "${FEDORA_MAJOR_VERSION}" -eq "39" ]; then
--from repo=copr:copr.fedorainfracloud.org:ublue-os:staging \
gtk4 \
vte291 \
vte-profile \
libadwaita
rpm-ostree install ptyxis
fi

# 40 Ptyxis
if [ "${FEDORA_MAJOR_VERSION}" -eq "40" ]; then
rpm-ostree override replace \
--experimental \
--from repo=copr:copr.fedorainfracloud.org:ublue-os:staging \
vte291 \
vte-profile
rpm-ostree install ptyxis
fi

Expand Down
5 changes: 5 additions & 0 deletions build_files/shared/bootc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/bash

if [ "$FEDORA_MAJOR_VERSION" -ge "40" ]; then
/usr/bin/bootupctl backend generate-update-metadata
fi
8 changes: 4 additions & 4 deletions build_files/shared/initramfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ set -oue pipefail

# Remove nvidia specific files
if [[ "${IMAGE_FLAVOR}" =~ "nvidia" ]]; then
rm /usr/lib/modprobe.d/nvk.conf
rm /usr/lib/modprobe.d/amd-legacy.conf
rm -f /usr/lib/modprobe.d/nvk.conf
rm -f /usr/lib/modprobe.d/amd-legacy.conf
else
rm /usr/lib/dracut/dracut.conf.d/95-nvidia.conf
rm /usr/lib/modprobe.d/nvidia.conf
rm -f /usr/lib/dracut/dracut.conf.d/95-nvidia.conf
rm -f /usr/lib/modprobe.d/nvidia.conf
fi

if [[ "${AKMODS_FLAVOR}" == "surface" ]]; then
Expand Down
1 change: 1 addition & 0 deletions packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"all": [
"bash-color-prompt",
"bcache-tools",
"bootc",
"evtest",
"epson-inkjet-printer-escpr",
"epson-inkjet-printer-escpr2",
Expand Down
28 changes: 17 additions & 11 deletions scripts/build-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,21 @@ container_mgr=$(just _container_mgr)
base_image=$(just _base_image "${image}")
tag=$(just _tag "${image}" "${target}")

# Build Command
command=( build -f Containerfile )
if [[ ${container_mgr} == "docker" && ${TERM} == "dumb" ]]; then
command+=(--progress=plain)
fi
command+=( --build-arg="AKMODS_FLAVOR=main" )
command+=( --build-arg="BASE_IMAGE_NAME=${base_image}" )
command+=( --build-arg="SOURCE_IMAGE=${base_image}-main" )
command+=( --build-arg="FEDORA_MAJOR_VERSION=${version}" )
command+=( --build-arg="IMAGE_NAME=${tag}" )
command+=( --build-arg="IMAGE_FLAVOR=main" )
command+=( --build-arg="IMAGE_VENDOR=localhost" )
command+=( --tag localhost/"${tag}:${version}-${git_branch}" )
command+=( --target "${target}" )
command+=( "${project_root}" )

# Build Image
$container_mgr build -f Containerfile \
--build-arg="AKMODS_FLAVOR=main" \
--build-arg="BASE_IMAGE_NAME=${base_image}" \
--build-arg="SOURCE_IMAGE=${base_image}-main" \
--build-arg="FEDORA_MAJOR_VERSION=${version}" \
--build-arg="IMAGE_NAME=${tag}" \
--build-arg="IMAGE_FLAVOR=main" \
--build-arg="IMAGE_VENDOR=localhost" \
--tag localhost/"${tag}:${version}-${git_branch}" \
--target "${target}" \
"${project_root}"
$container_mgr ${command[@]}
Empty file modified scripts/build-iso-installer-main.sh
100644 → 100755
Empty file.
10 changes: 6 additions & 4 deletions scripts/sudoif.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
#!/usr/bin/bash
function sudoif(){
if [[ "${TERM_PROGRAM}" == "vscode" && \
if [[ "${TERM_PROGRAM:-}" == "vscode" && \
! -f /run/.containerenv && \
! -f /.dockerenv ]]; then
[[ $(command -v systemd-run) ]] && \
/usr/bin/systemd-run --uid=0 --gid=0 -d -E TERM="$TERM" -t -q -P -G "$@" \
|| exit 1
elif [[ $(command -v sudo) && -n ${SSH_ASKPASS:-} && ${DISPLAY:-} ]]; then
/usr/bin/sudo --askpass "$@" || exit 1
elif [[ $(command -v sudo) ]]; then
/usr/bin/sudo "$@" || exit 1
else
[[ $(command -v sudo) ]] && \
/usr/bin/sudo "$@" \
|| exit 1
exit 1
fi
}

0 comments on commit 05a262a

Please sign in to comment.