Skip to content

Commit

Permalink
Add bcmrpi3-kernel-bin-4.19.56.20190702.ebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
sakaki- committed Jul 2, 2019
1 parent 5365268 commit 1901368
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 0 deletions.
1 change: 1 addition & 0 deletions sys-kernel/bcmrpi3-kernel-bin/Manifest
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ DIST bcmrpi3-kernel-bin-4.19.44.20190528.tar.xz 15892816 BLAKE2B 4de325c57edc09d
DIST bcmrpi3-kernel-bin-4.19.46.20190604.tar.xz 15911384 BLAKE2B 78a8672d8bd70d8125a7d77e2d88b7a352e51012b6e6b9d171d398894d946702f60ede0cbe7d62e4f276466723c803e8139341a20d750e20488d8d55b74eb0ba SHA512 076d878d728ee6c2a27f0827a8034c09c18b71bcb2f871bb98410426c4edef2b191e6b7813f20796eccd89a0639e37880292bc66d706ab495d80cad2e146b483
DIST bcmrpi3-kernel-bin-4.19.49.20190611.tar.xz 15897176 BLAKE2B fa7caef0455b590e04bff5b911298180660a1460dd34f406e4b8efb70a6b37c38bddfc771128a058914a349e19d28f19397b42147333054d275fadec68ceaeb2 SHA512 570a5986a7c75ea8d7d290f82a7eb959b944d5b534b0767e6b17366f7951e9e3ef475da050a26047a413cad67865571fddefffec4b7b5e1a86d0470e60211cce
DIST bcmrpi3-kernel-bin-4.19.50.20190618.tar.xz 15904792 BLAKE2B 1d45209584e9f93a1a6ac35f0c63eb456b91771029167a5397c7d82496d52c8f3664768b45f0f8bdd47933c16869f66240fa13516461749fb41933d26be99fda SHA512 d09ca42c11207fb63dcbd6ebc63e61623872a996d9603f44ce365e8520b81114b2b3db6d6918e12cf7f1a13b308c3eca871e3e961f0f17351f7a7744b3c8d7e6
DIST bcmrpi3-kernel-bin-4.19.56.20190702.tar.xz 16285968 BLAKE2B d19009740a5b689473181901645be74ce9b773cfd1d925cff73f399296166340e7d4d1ef51d71a0b3cf1e3b9cf1a98220fef0af59de2fd735abdfde10874f08d SHA512 2728b04dfe2f7713e3f318c8e956fbdd2f7056f4ac6f76201e15b715533a1dfd7a23a6ba247f2baf96f4f5d6320f2ee4157cdfe865f76ccc441892c1f55ef0c0
DIST bcmrpi3-kernel-bin-4.9.30.20170601.tar.xz 15134912 BLAKE2B 325346d81d062b232c4382db844b03dd224e47cd622441332166bf7425da29f4414db147bc1f1ce60e24a9c4fe884f8a3d4ccdc580e397a01391fdaefdc3d738 SHA512 10d5a1ee0bd0c01c6cec5f5ff10153ff5682b8d7120e8a7a9142c7ef4a3c5588bd2fe82be6401b4f4d21c7f9b6f5e1f87957be472a34e0ce251744524200e114
DIST bcmrpi3-kernel-bin-4.9.30.20170602.tar.xz 15119212 BLAKE2B f60f045ec8930e5ef1d1f72435cf474fff5b5982e7182b32d413811f7804ffbf0739ae330492f1deae268505cae70cf5e13cbc8009acda450aa021007ca32ad0 SHA512 25d39820cbf3eafe638273549324060cb310176ec9b69577d80443be711fdbad52231f1f5de2a9090b82551b44e10febb4b35c441d915356cab7b35b99032f22
DIST bcmrpi3-kernel-bin-4.9.31.20170612.tar.xz 15121096 BLAKE2B 5f3e9f2afa9e2c9287cbb71363106482e46bfee9552c67908de1835a7c6e3684b7201811358edcbda71c33daa2d3af1fe7d6ad8b00300f5979de04cc4bad94c9 SHA512 c2bed0f581dcce51785997919e939427ef625c16d0477f0b2e326cefb3f146a15a5657be7e037e04ed1723b015a9a84b8eff9702c9931778f34a43923b89b046
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Copyright (c) 2018 sakaki <[email protected]>
# Distributed under the terms of the GNU General Public License v2

EAPI="6"

inherit eutils autotools

DESCRIPTION="Binary RPi3 64-bit kernel package (bcmrpi3_defconfig)"
HOMEPAGE="https://github.com/sakaki-/bcmrpi3-kernel"

SRC_URI="${HOMEPAGE}/releases/download/${PV}/bcmrpi3-kernel-${PV}.tar.xz -> ${P}.tar.xz"

LICENSE="GPL-2 freedist"
SLOT="0"
KEYWORDS="~arm64"
IUSE="+checkboot +with-matching-boot-fw pitop"

RESTRICT="mirror"

DEPEND="
!sys-kernel/bcmrpi3-kernel-bis-bin"
RDEPEND="
with-matching-boot-fw? ( ~sys-boot/rpi3-64bit-firmware-1.20190620_p1[pitop(-)?,-dtbo(+)] )
${DEPEND}"

QA_PREBUILT="*"

S="${WORKDIR}"

# ebuild function overrides

pkg_pretend() {
# check /boot directory is mounted, provided $ROOT is /
if use checkboot && [[ "${ROOT%/}" == "" ]]; then
if ! grep -q "^/boot$" <(cut -d " " -f 2 "/proc/mounts") &>/dev/null; then
die "Your /boot directory does not appear to be mounted"
fi
else
ewarn 'Installing into non-default $ROOT'
ewarn "Not checking whether /boot is mounted"
fi
}

src_install() {
local RELEASE_NAME

# just copy tarball contents into temporary install root
insinto /boot
doins -r "${S%/}/boot"/*
insinto /lib/modules
doins -r "${S%/}/lib/modules"/*

# note that we installed the libraries, for future cleanup
RELEASE_NAME=$(head -n1 <(ls -t1d "${S}/lib/modules"/*))
RELEASE_NAME="${RELEASE_NAME##*/}"
echo "${PF}" > "${D%/}/lib/modules/${RELEASE_NAME}/owning_binpkg"
}

pkg_postinst() {
elog "Your new kernel has been installed."
elog "Reboot your system to start using it."
}

pkg_postrm() {
# it is possible that if the kernel originally installed by this ebuild
# is currently running, then its /lib/modules/<release_name> directory
# will still be present, due to some of the module files therein having
# been marked as "in use", leading Portage deline to delete them during
# the default uninstall phase
# detect if this has happened and, if so, forcibly (and recursively)
# delete /lib/modules/<release_name>, and print a warning
local MDIR OWNING_BINPKG

shopt -s nullglob
for MDIR in "${ROOT%/}/lib/modules"/*; do
# was this kernel installed by a binary package?
if [[ -s "${MDIR}/owning_binpkg" ]]; then
OWNING_BINPKG="$(<"${MDIR}/owning_binpkg")"
# was it us? (also check this is not a pure re-install)
if [[ "${PF}" == "${OWNING_BINPKG}" && "${PVR}" != "${REPLACED_BY_VERSION}" ]]; then
# yes, we installed it, we need to remove it
ewarn "Forcibly deleting kernel module directory ${MDIR}"
rm -rf "${MDIR}"
# warn user if this is a 'pure' uninstall,
# rather than an upgrade
if [[ -z "${REPLACED_BY_VERSION}" ]]; then
ewarn "Please ensure you have a valid kernel and module set"
ewarn "in place, before rebooting."
fi
fi
fi
done
shopt -u nullglob
}

0 comments on commit 1901368

Please sign in to comment.