Skip to content

Commit

Permalink
Add bcm2711-kernel-bis-bin-4.19.108.20200324.ebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
sakaki- committed Mar 24, 2020
1 parent ea39f7e commit d6f3696
Show file tree
Hide file tree
Showing 2 changed files with 109 additions and 0 deletions.
1 change: 1 addition & 0 deletions sys-kernel/bcm2711-kernel-bis-bin/Manifest
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ DIST bcm2711-kernel-bis-bin-4.19.102.20200218.tar.xz 18505840 BLAKE2B 24bede0bd7
DIST bcm2711-kernel-bis-bin-4.19.106.20200225.tar.xz 18523156 BLAKE2B 71c183d471d1057d5bc583ad8561ad9325761314c25eadae12c92310432064df74669786988d0b75e337b5e36abd414412a1c6051bf4c7be791e79bda6da567c SHA512 a5e01f77f47064255bf59b8efcbb55453ef5f15904223e95da55ca6de1959bd41cb1ccd108a4ad69c90cc7dd38798c1d3d48db0bb3faa3ba9352fb8fd376b3fe
DIST bcm2711-kernel-bis-bin-4.19.106.20200304.tar.xz 18530100 BLAKE2B c409674e0f409c6e89d0421762983e4ee672f16236cb7738ab882bec000a01600d661279a0fea1f2bee0a9871e51ba9c5df6a46c7132f2898e1757bb8b39a81d SHA512 b774fb27b2678e0e7fd531ac6447436d11cc58bf6ee4fd47d609409702b756bf34e694ccea5bc3878bac718a0cef43c1ae62e7f6cf9eb9e36c202e18b23991ee
DIST bcm2711-kernel-bis-bin-4.19.108.20200310.tar.xz 18540740 BLAKE2B eabc951d3c1912d2a1a208cf15d9a3df89c41866da2e196da28394d945fe0d7ff359f74f9363f8d903726efc1ce82307c55dfbb11ee4b98dd1be2c7db485b101 SHA512 72a642db60fdc2ca08fa0a3261e4e75a3203c6e3e55441ae41ed38183b1e86c2ece179be22ca790f497a16ff8af10e0e2a302d821b6e8b296de617d37c624907
DIST bcm2711-kernel-bis-bin-4.19.108.20200324.tar.xz 18528052 BLAKE2B 6583975bd42a8b4169694aca8a473cabcf07e7cc22fcceac45c039e496350ecd179d7ddb5a0bf017bef8a57ac26ce9310ee2aedc72388f33359e2c9a87fd4294 SHA512 80e7b28fc85444cdf5f4b9411679aed83d9704bd6d0be6202db902acb3d6030491c6ffdfb39abc989138c55d07ae9078798f23bb721046fb703eec7b90ce0f79
DIST bcm2711-kernel-bis-bin-4.19.59.20190724.tar.xz 17192312 BLAKE2B 3d771862009b06931bf6e26c25f8b85a2ffd011d585106ae8723b6460f004dbe54a0bc3f041b2e68de5fdecc1136583051a092bb23bfedde70cd00b200014dd8 SHA512 ff585e7992b28ae88001dbd241437bdb8538499bc91a8a3d7cc73603a48ac2844f4c4d4b473cd1c3be2cf9d6317a7498c36bf3c845eb008ab1b5a1170c936804
DIST bcm2711-kernel-bis-bin-4.19.60.20190730.tar.xz 17193832 BLAKE2B b23ebff3bbc9a0ad7d2a86a4e8147f241068b12e145ae200bc2b4d71af7f6d762bd66f162f6365ad08c26e2392fd3cdbb4cbd0eef8aa270cdd628844aee2e04f SHA512 460bfef82e1b2c5db21e822633b14cc173faa05879fb2458a14124315c2c90c7d6ee342794da627cb033d6b58af706bdae49cd9577eeb73b92a0ac20521e45b9
DIST bcm2711-kernel-bis-bin-4.19.64.20190806.tar.xz 17228648 BLAKE2B 4f0be5f4d331f911ea25eccf1f570f1aeace82566ccb194558e7c14f76f8204c554df700d0357506922e02be0de37953a7a740410e02413d2269bad634aa64cf SHA512 8c5b5882f35429ad50f69967654be43f1c58ffafc83eb07099b1696cc5d949579604b63bff717b4c0e652c48a844623d566f108de8eb5a63e9e426820e6b5d47
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# Copyright (c) 2019 sakaki <[email protected]>
# Distributed under the terms of the GNU General Public License v2

EAPI="6"

inherit eutils autotools

DESCRIPTION="Binary RPi4 64-bit kernel package (bcm2711_defconfig + tweaks)"
HOMEPAGE="https://github.com/sakaki-/bcm2711-kernel-bis"

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

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

RESTRICT="mirror"

DEPEND="
!sys-kernel/bcm2711-kernel-bin"
# if pi3multiboot is specified, depend upon corresponding-date rpi3-specific
# kernel package too
RDEPEND="
with-matching-boot-fw? ( ~sys-boot/rpi3-64bit-firmware-1.20200212[pitop(-)?,-dtbo(+)] )
pi3multiboot? ( ~sys-kernel/bcmrpi3-kernel-bis-bin-${PV}[checkboot=,with-matching-boot-fw=,pitop=] )
!pi3multiboot? (
!sys-kernel/bcmrpi3-kernel-bin
!sys-kernel/bcmrpi3-kernel-bis-bin
)
${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"/*
# only copy overlays/ directory if not multibooting with a pi3 kernel
# (it owns them if this flag is set)
# also, don't duplicate COPYING.linux in this case
if use pi3multiboot; then
rm -rf "${D%/}/boot/overlays"
rm -f "${D%/}/boot/COPYING.linux"
fi
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 d6f3696

Please sign in to comment.