Skip to content

Commit

Permalink
fix: use rpm-ostree to install kernel
Browse files Browse the repository at this point in the history
  • Loading branch information
drf-jpg committed Dec 22, 2024
1 parent 14580ae commit ece0c59
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,26 @@ function swap_kernel() {
rpm --erase "$pkg" --nodeps
done

printf "info: installing new kernel\n"
dnf5 -y install \
--repo="${kernel_repo_id}" \
--allowerasing \
printf "info: installing new kernel using rpm-ostree\n"
dnf -y install \
kernel \
kernel-core \
kernel-modules \
kernel-modules-core \
kernel-modules-extra

# shellcheck disable=SC2016 # Not trying to execute an expression
printf 'info: `dnf5 --showduplicates --installed kernel*`\n'
dnf5 list --showduplicates --installed 'kernel*'

# see: <https://github.com/ublue-os/bluefin/blob/main/build_files/base/19-initramfs.sh>
# and: <https://discussion.fedoraproject.org/t/kernel-6-12-will-not-boot-cannot-mount-root/140061/2>
printf 'info: running dracut manually\n'
kver="$(rpm -q --qf "%{REQUIREVERSION}" kernel)"
/usr/libexec/rpm-ostree/wrapped/dracut --no-hostonly --kver "$kver" --reproducible -v --add ostree -f "/lib/modules/$kver/initramfs.img"
chmod 0600 "/lib/modules/$kver/initramfs.img"
if [[ ! -f "/lib/modules/$kver/initramfs.img" ]]; then
printf 'info: running dracut manually\n'
/usr/libexec/rpm-ostree/wrapped/dracut --no-hostonly --kver "$kver" --reproducible -v --add ostree -f "/lib/modules/$kver/initramfs.img"
chmod 0600 "/lib/modules/$kver/initramfs.img"
fi
}

### Install packages
Expand Down

0 comments on commit ece0c59

Please sign in to comment.