Skip to content

Commit

Permalink
main/base-kernel: do not brick systems with chimera-buildkernel
Browse files Browse the repository at this point in the history
This was always meant to be more like a packaging helper but it
can be useful for building/installing on actual systems too. When
doing that, do not remove /lib as that would render the system
unbootable afterwards.
  • Loading branch information
q66 committed Jul 11, 2024
1 parent 1586307 commit 743086d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions main/base-kernel/files/chimera-buildkernel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -358,10 +358,14 @@ do_install() {

mkdir -p "${DESTDIR}/usr/lib"
# needed for depmod
ln -sf usr/lib "${DESTDIR}/lib"
[ -e "${DESTDIR}/lib" -o -L "${DESTDIR}/lib" ] || \
ln -s usr/lib "${DESTDIR}/lib"

[ -d "$DESTDIR" ] || die "Could not create destination directory."

# resolve absolute
DESTDIR=$(realpath "$DESTDIR")

echo "=> Installing modules..."

strip_exe=/usr/bin/true
Expand Down Expand Up @@ -423,7 +427,8 @@ do_install() {
"${DESTDIR}/usr/lib/debug/boot/vmlinux-${kernver}"
fi

rm -f "${DESTDIR}/lib"
# do not remove when installing to system
[ "$DESTDIR" = "/" ] || rm -f "${DESTDIR}/lib"

cd "${DESTDIR}/usr/lib/modules/${kernver}" \
|| die "Could not change directory"
Expand Down
2 changes: 1 addition & 1 deletion main/base-kernel/template.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pkgname = "base-kernel"
pkgver = "0.1"
pkgrel = 12
pkgrel = 13
depends = [
"kmod",
"procps",
Expand Down

0 comments on commit 743086d

Please sign in to comment.