From 40aaaa64e86ba6710bbeb31c4615a6ce80e75e11 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Wed, 28 Apr 2021 20:21:43 +0100 Subject: gentoo resync : 28.04.2021 --- sys-kernel/mips-sources/Manifest | 12 +- .../mips-sources/mips-sources-4.14.221.ebuild | 346 --------------------- .../mips-sources/mips-sources-4.14.227.ebuild | 346 +++++++++++++++++++++ .../mips-sources/mips-sources-4.19.176.ebuild | 344 -------------------- .../mips-sources/mips-sources-4.19.183.ebuild | 344 ++++++++++++++++++++ .../mips-sources/mips-sources-5.4.108.ebuild | 344 ++++++++++++++++++++ sys-kernel/mips-sources/mips-sources-5.4.99.ebuild | 344 -------------------- 7 files changed, 1040 insertions(+), 1040 deletions(-) delete mode 100644 sys-kernel/mips-sources/mips-sources-4.14.221.ebuild create mode 100644 sys-kernel/mips-sources/mips-sources-4.14.227.ebuild delete mode 100644 sys-kernel/mips-sources/mips-sources-4.19.176.ebuild create mode 100644 sys-kernel/mips-sources/mips-sources-4.19.183.ebuild create mode 100644 sys-kernel/mips-sources/mips-sources-5.4.108.ebuild delete mode 100644 sys-kernel/mips-sources/mips-sources-5.4.99.ebuild (limited to 'sys-kernel/mips-sources') diff --git a/sys-kernel/mips-sources/Manifest b/sys-kernel/mips-sources/Manifest index 335a9e5b9d42..93ed87632143 100644 --- a/sys-kernel/mips-sources/Manifest +++ b/sys-kernel/mips-sources/Manifest @@ -5,10 +5,10 @@ DIST mips-sources-4.14.0-patches-v2.tar.xz 287560 BLAKE2B 9fb6b07dcb0336be95c863 DIST mips-sources-4.19.0-patches-v2.tar.xz 289940 BLAKE2B ffca5540cbd663ed3eab3f748dec7727ca6f1abe11ce107fe1780b8191175b77d8c59f70d5e9254f01c43d507f805f081f15bd150f66da1d11e2a91715dcb038 SHA512 c67ac8c6f041a96348a5a6023919fc5586b70b6c3aa52777945d5f1a831e6bd24d867c0318034cf304a3c8f4c6ff0d2af3611b3ad2bc476f3bf3762d39a215f8 DIST mips-sources-5.4-patches-v3.tar.xz 195616 BLAKE2B 389d5d86265d14961d739f13623ed5a1efa0b4e6a649816eccb41f947186316560473a1ec0222d1db84ce8cc1e0c8dadb4dd499b941e37de201571cc37359e74 SHA512 4181b776ec17526c246516d0d2fb2737f12a214a18c2526085a71174a12e30735d7b497d9cba658a2579c05055a74191ebbdd658003c7b28265d49915bc94b58 DIST mipsgit-4.14.0-20180128.diff.xz 1008 BLAKE2B 2a317ff97aab096883680c6b653e993aee31994e6caec52c52dfbbb61f1dc1f25d03ebd3182fa122923a67aeee0aa598b36e603692333e4c9ccdc741fd456d96 SHA512 378deb1bc1d10a6b4912e5e4a0d6fcab28952e2e59c35fc879601841cf8160081b318a2598ef74db225e95f0f26483f6b9a56a348811b1ee7b8934391dd271ae -DIST patch-4.14.221.xz 4125144 BLAKE2B 474f8791e2b59f1524681e70300d5a9543a4b56fb7affbd02a22d67d4df2632c7aa37a73d032697b3b10291671efd96f5eaf13c4632c05801a4a7cac99a4c219 SHA512 fd332b076ac0231ea4b3806bd6cb58f0b66bd9317ae352fb6f90856e92df5cc96d2c89bc8c44001f2f34ea98b43fbbe8b8eae0abe2249fe561b8dd4a2c76bcb5 -DIST patch-4.19.176.xz 3779956 BLAKE2B 136d927a3254a8214b7c0766971b4585e7a08d13ac4b5e7160f24a1a0d687dfe234632b873aac3cff9fd596b9191acee202e88b7f5d7e139a3284aa544983f0a SHA512 9bb51df1822242aee8340b8d54b5d1eb9bab8c0fff37a5b671f2ab7d10e5b3f1bd9f6a7e13af600434cc406a42b6638a5659cc056917c44a158bf243b5383146 -DIST patch-5.4.99.xz 2620252 BLAKE2B e6b965a159fd019e95207eab66f0cee6ed35334d634594c4d8a433cfdb4be6b8274bc3794754c27ab9dc52223b6760c303ba5a9a2624b7799fb4d831ba49c8df SHA512 00b9128b450c86742ecdfd9656d2527625cd257e95dd18bf032d0c9325e5eb67dc65e30b30b95e1dd00f590eb6ea85710d9c43b2d92fe03e93d761b34b7cc498 -EBUILD mips-sources-4.14.221.ebuild 13186 BLAKE2B cec1cc92e456d22154cfb9d9cabbd34eeba1d3993ccc43c47ebe8fe08137e31c7153189276aeedf015d6a81227895145065eea6009efa0f449444a3be2d20e24 SHA512 8a7f90c75cc87c9194777cc606f60f089a8dcf6929890b6ee7e035a2c0a69a02d9554f932b6f5ceba6fa66c371df63487f195e4eba3d93e674802f7750b58b07 -EBUILD mips-sources-4.19.176.ebuild 12784 BLAKE2B 93e2dad1f50b2c62321c8d89e559c8e921ccc9b5f0ac423abc3feb088812c25a62e8286d202855b530f7a92361640f47e8502c27fb6236b8b639a4cdbb2efe25 SHA512 0064a4470494317b1d01f2534e2955dc6ff5447971f9c8177881ae4f0150bfb40606dc75e537f8823d09904d2781a8948263f641fa6ee7d83eefc4689ddf1897 -EBUILD mips-sources-5.4.99.ebuild 12784 BLAKE2B 9b41bd6ca6be6fd1d22123b8d749d9053cef9f33a464a038f7b934d54b13d2d27281c2b7c8eedebedbf4629b63724ab1a03b8a11c68abf90bb529b8c5733c7ee SHA512 0ca57656a3cb8a5435c7f12b81bb5591bfda6caa10b9b15a1d2ca9123be2777c6e4de3043f376a28bba88647d0a9f512be8ae2966f097a939415acf83bff255e +DIST patch-4.14.227.xz 4193400 BLAKE2B 126c48a104ef2836aeea86965c9c5c5f09dfea0cdd8598e0a9c6d7aad9bdec21319a9557c41906f67d95e161584ab143b6f895e7b4012ba771eca804f40439e1 SHA512 26d5ee9fff8a9e03fee571780759196282dc46d385b5e8ba3f7fa0ebf42443c9e2d038472bca61190a8fda194f5f229b92af410a339401b6f0256564fc5aaea1 +DIST patch-4.19.183.xz 3876724 BLAKE2B 8a64e3aae05b3abbecff097f6bd2501665f3c3d7a918e7752404d976077377d33e754807e1007515fe624465ed6075449e392c9f124c462a69b85c01b8461658 SHA512 f0c93463ee1727d074018d140848099f87cc242868a48400c68adbdf068af15b25b007ff95ffc8a27ab17b36391448426b6b56471b9c6df0dfdaaa166fd967c4 +DIST patch-5.4.108.xz 2763084 BLAKE2B d19897ed03298867180bc967c00499eb5df26d9126bf027fb6ab9e074cb6bbb9729166da2318986f932c3b5e557cf50fa10a08c04cb002b11a892c242a59edce SHA512 6856033ad3af0306911c97a5c213054ff3bcb390c763d60a0a29767e80d22281e43ea6c32ecee95c6f0f2d8d5c3b4eeab78eea111087f47249a4034269ddde44 +EBUILD mips-sources-4.14.227.ebuild 13186 BLAKE2B f053edebd8d69e66e1383af2d157b7c5fdaaf32c069ffb5dcf7c42bcbb66927d26cdf1eab34a0cb3f48ef075aec5e1cbd859975955b4c0ff559943771a8647a9 SHA512 6125ef8fe21239b9b08389d59cead224aeb369329e5b762393da33ae4cdd474512f451655252eef6765ba5afe5d29b7f92c1e444237a040ec2174fc46a37d996 +EBUILD mips-sources-4.19.183.ebuild 12784 BLAKE2B 1d50baf06efdc58916b492d108e1618ebfff02aba7b6d984f952876a26cc35c22a583f6236237218dd1ab473ede8a35ea8725669f53b044eadff05592a074ae5 SHA512 98a159d59ffa0ea4c9e1d097368c6f517e5df94bcd204043095a52d72f60858f69ae8422b13a33e142c667a0593ac8018aa46ac2969439cf1724573974d8170b +EBUILD mips-sources-5.4.108.ebuild 12784 BLAKE2B 1e0d64a34dc183dc4858159cb7399470e3585018354cf700f5f653d026f974f94624116a39f03fb925afd9e42f919c1b6d2e927da58c6a8cbd42bac06380785a SHA512 f2cf0b3af9f449f060520f04558a81bd722dd6d25fc97216856ccbbc1945e4ee473d8bee4e29f5fee606049e29718d4f41946e8bb1723404a3bc12ef921de0de MISC metadata.xml 659 BLAKE2B 0a4de62c5b7f4b11765e722d0cb95491d8502bacb0ac3265192c87398482fda7425fdc6d74db3c30d28782bd739b4f10b12a20b90722be96a41d350c9a211d7f SHA512 16b3055ff4e57c8cd0c5f393450095bd30f6f8da580bd82fce200715c023add333a8055a1c67303a6f7f7fed2bfea287f695c825a7d328ecab147b44ff6845e1 diff --git a/sys-kernel/mips-sources/mips-sources-4.14.221.ebuild b/sys-kernel/mips-sources/mips-sources-4.14.221.ebuild deleted file mode 100644 index 64bd5b08b301..000000000000 --- a/sys-kernel/mips-sources/mips-sources-4.14.221.ebuild +++ /dev/null @@ -1,346 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -# EAPI Version -EAPI="6" - -#//------------------------------------------------------------------------------ - -# Version Data -GITDATE="20180128" # Date of diff between kernel.org and lmo GIT -GENPATCHREV="2" # Tarball revision for patches - -# Directories -S="${WORKDIR}/linux-${OKV}-${GITDATE}" -MIPS_PATCHES="${WORKDIR}/mips-patches" - -# Kernel-2 Vars -K_SECURITY_UNSUPPORTED="yes" -K_NOUSENAME="yes" -K_NOSETEXTRAVERSION="yes" -K_NOUSEPR="yes" -K_BASE_VER="4.13" -K_FROM_GIT="yes" -ETYPE="sources" - -# Inherit Eclasses -inherit kernel-2 eutils eapi7-ver -detect_version - -# Version Data -F_KV="${PVR}" -BASE_KV="$(ver_cut 1-2).0" -[[ "${EXTRAVERSION}" = -rc* ]] && KVE="${EXTRAVERSION}" - -# Portage Vars -HOMEPAGE="https://wiki.gentoo.org/wiki/Project:MIPS" -KEYWORDS="-* ~mips" -IUSE="experimental ip27 ip28 ip30" -RDEPEND="" -DEPEND="${RDEPEND} - >=sys-devel/gcc-4.7.0 - >=sys-devel/patch-2.7.4" - -# Specify any patches or patch familes to NOT apply here. -# Use only the 4-digit number followed by a '*'. -P_EXCLUDE="" - -# Machine Support Control Variables -DO_IP22="test" # If "yes", enable IP22 support (SGI Indy, Indigo2 R4x00) -DO_IP27="yes" # IP27 support (SGI Origin) -DO_IP28="test" # IP28 support (SGI Indigo2 Impact R10000) -DO_IP30="yes" # IP30 support (SGI Octane) -DO_IP32="yes" # IP32 support (SGI O2, R5000/RM5200 Only) - -# Machine Stable Version Variables -SV_IP22="" # If set && DO_IP22 == "no", indicates last "good" IP22 version -SV_IP27="" # DO_IP27 == "no", IP27 -SV_IP28="" # DO_IP28 == "no", IP28 -SV_IP30="" # DO_IP30 == "no", IP30 -SV_IP32="" # DO_IP32 == "no", IP32 - -DESCRIPTION="Linux-Mips GIT sources for MIPS-based machines, dated ${GITDATE}" -SRC_URI="${KERNEL_URI} - https://dev.gentoo.org/~kumba/distfiles/mipsgit-${BASE_KV}${KVE}-${GITDATE}.diff.xz - https://dev.gentoo.org/~kumba/distfiles/${PN}-${BASE_KV}-patches-v${GENPATCHREV}.tar.xz" - -UNIPATCH_STRICTORDER="yes" -UNIPATCH_LIST="${DISTDIR}/mipsgit-${BASE_KV}${KVE}-${GITDATE}.diff.xz" - -#//------------------------------------------------------------------------------ - -err_disabled_mach() { - # Get args - local m_name="${1}" - local m_abbr="${2}" - local m_use="${3}" - local is_test="${4}" - - # Get stable version, if exists - local stable_ver="SV_${m_abbr}" - stable_ver="${!stable_ver}" - - # See if this machine needs a USE passed or skip dying - local has_use - [ ! -z "${m_use}" -a "${m_use}" != "skip" ] && has_use="USE=\"${m_use}\" " - - # Print error && (maybe) die - echo -e "" - if [ "${is_test}" != "test" ]; then - eerror "${m_name} Support has been disabled in this ebuild" - eerror "revision. If you wish to merge ${m_name} sources, then" - eerror "run ${has_use}emerge =mips-sources-${stable_ver}" - [ "${m_use}" != "skip" ] && die "${m_name} Support disabled." - else - ewarn "${m_name} Support has been marked as needing testing in this" - ewarn "ebuild revision. This usually means that any patches to support" - ewarn "${m_name} have been forward ported and maybe even compile-tested," - ewarn "but not yet booted on real hardware, possibly due to a lack of access" - ewarn "to such hardware. If you happen to boot this kernel and have no" - ewarn "problems at all, then please inform the maintainer. Otherwise, if" - ewarn "experience a bug, an oops/panic, or some other oddity, then please" - ewarn "file a bug at bugs.gentoo.org, and assign it to the mips team." - fi - - return 0 -} - -err_only_one_mach_allowed() { - echo -e "" - eerror "A patchset for a specific machine-type has already been selected." - eerror "No other patches for machines-types are permitted. You will need a" - eerror "separate copy of the kernel sources for each different machine-type" - eerror "you want to build a kernel for." - die "Only one machine-type patchset allowed" -} - -pkg_postinst() { - # Symlink /usr/src/linux as appropriate - local my_ksrc="${S##*/}" - for x in {ip27,ip28,ip30}; do - use ${x} && my_ksrc="${my_ksrc}.${x}" - done - - if [ ! -e "${ROOT}usr/src/linux" ]; then - rm -f "${ROOT}usr/src/linux" - ln -sf "${my_ksrc}" "${ROOT}/usr/src/linux" - fi -} - -pkg_setup() { - local arch_is_selected="no" - local m_ip m_enable m_name - - # Exclusive machine patchsets - # These are not allowed to be mixed together, thus only one of them may be applied - # to a tree per merge. - for x in \ - "ip27 SGI Origin 200/2000" \ - "ip28 SGI Indigo2 Impact R10000" \ - "ip30 SGI Octane" - do - set -- ${x} # Set positional params - m_ip="${1}" # Grab the first param (HW IP for SGI) - shift # Shift the positions - m_name="${*}" # Get the rest (Name) - - if use ${m_ip}; then - # Fetch the value indiciating if the machine is enabled or not - m_enable="DO_${m_ip/ip/IP}" - m_enable="${!m_enable}" - - # Make sure only one of these exclusive machine patches is selected - [ "${arch_is_selected}" = "no" ] \ - && arch_is_selected="yes" \ - || err_only_one_mach_allowed - - # Is the machine support disabled or marked as needing testing? - [ "${m_enable}" = "test" ] \ - && err_disabled_mach "${m_name}" "${m_ip/ip/IP}" "${m_ip}" "test" - [ "${m_enable}" = "no" ] \ - && err_disabled_mach "${m_name}" "${m_ip/ip/IP}" "${m_ip}" - - # Show relevant information about the machine - show_${m_ip}_info - fi - done - - # All other systems that don't have a USE flag go here - # These systems have base-line support included in linux-mips git, so - # instead of failing, if disabled, we simply warn the user - if [ "${arch_is_selected}" = "no" ]; then - [ "${DO_IP22}" = "no" ] \ - && err_disabled_mach "SGI Indy/Indigo2 R4x00" "IP22" "skip" \ - || show_ip22_info - [ "${DO_IP32}" = "no" ] \ - && err_disabled_mach "SGI O2" "IP32" "skip" \ - || show_ip32_info - - fi -} - -show_ip22_info() { - echo -e "" - einfo "IP22 systems with an R5000 processor should work with this release." - einfo "The R4x00 series of processors tend to be rather flaky, especially the" - einfo "R4600. If you have to run an R4x00 processor, then try to use an R4400." - einfo "" - einfo "Some Notes:" - einfo "\t- Supported graphics card right now is Newport (XL)." - einfo "\t- A driver for Extreme (XZ) does not exist at present." - echo -e "" -} - -show_ip27_info() { - echo -e "" - ewarn "Heavy disk I/O on recent kernels may randomly trigger a VM_BUG_ON_PAGE()" - ewarn "in move_freepages() in mm/page_alloc.c. The exact trigger cause is" - ewarn "unknown at this time. Please report any oops messages from this" - ewarn "bug to bugs.gentoo.org (assign to mips@gentoo.org)" - echo -e "" -} - -show_ip28_info() { - echo -e "" - einfo "Support for the Indigo2 Impact R10000 is now in the mainline kernel. However," - einfo "due to the R10000 Speculative Execution issue that exists with this machine," - einfo "nothing is guaranteed to work correctly. Consider enabling ${HILITE}CONFIG_KALLSYMS${NORMAL}" - einfo "in your kernel so that if the machine Oopes, you'll be able to provide valuable" - einfo "feedback that can be used to trace down the crash." - echo -e "" -} - -show_ip30_info() { - echo -e "" - eerror "Things that DON'T work:" - eerror "\t- Do not use CONFIG_SLUB, otherwise, you'll get errors when booting" - eerror "\t\040\040regarding duplicate /sys/kernel/slab/* entries in sysfs." - eerror "\t- Impact (MGRAS) Xorg driver no longer functions due to severe bitrot." - eerror "\t- Octane is limited to a maximum of 2GB of memory right now due to a" - eerror "\t\040\040hardware quirk in the BRIDGE PCI chip that limits BRIDGE DMA" - eerror "\t\040\040addresses to 31-bits when converted into physical addresses." - eerror "\t\040\040Patches that attempt to fix the issue are highly welcome." - echo -e "" - ewarn "Things that might work, but have problems, or are unknown:" - ewarn "\t- CONFIG_TRANSPARENT_HUGEPAGE should work now, but there may still be" - ewarn "\t\040\040intermittent issues. Additionally, CONFIG_HUGETLBFS must also be" - ewarn "\t\040\040selected for hugepages to work. If use of this feature continues" - ewarn "\t\040\040to trigger random Instruction Bus Errors (IBEs), then it is best to" - ewarn "\t\040\040disable the functionality and perform a cold reset of the machine" - ewarn "\t\040\040after powering it down for at least 30 seconds." - ewarn "\t- Serial support on the Octane uses a very basic UART driver that drives" - ewarn "\t\040\040the 16550A chip on the IOC3 directly. It does not use interrupts," - ewarn "\t\040\040only a polling routine on a timer, which makes it slow and CPU-" - ewarn "\t\040\040intensive. The baud rate is limited to no more than 38.4kbps on" - ewarn "\t\040\040this driver. Patches for getting the Altix IOC3 serial driver to" - ewarn "\t\040\040work (which uses DMA and supports faster baud rates) are welcome." - ewarn "\t- UHCI Cards are known to have issues, but should still function." - ewarn "\t\040\040This issue primarily manifests itself when using pl2303 USB->Serial" - ewarn "\t\040\040adapters." - ewarn "\t- MENET boards appear to have the four ethernet ports detected, however" - ewarn "\t\040\040the six serial ports don't appear to get picked up by the IOC3" - ewarn "\t\040\040UART driver. The NIC part number is also not read correctly" - ewarn "\t\040\040from the four Number-In-a-Cans. Additional testing would be" - ewarn "\t\040\040appreciated and patches welcome." - ewarn "\t- Other XIO-based devices, like various Impact addons, remain untested" - ewarn "\t\040\040and are not guaranteed to work. This applies to various digital" - ewarn "\t\040\040video conversion boards as well." - echo -e "" - einfo "Things that DO work:" - einfo "\t- SMP works again, celebrate!" - einfo "\t- Impact (MGRAS) console only." - einfo "\t- VPro (Odyssey) console only (no X driver exists yet)." - einfo "\t- PCI Card Cages should work for many devices, except certain types like" - einfo "\t\040\040PCI-to-PCI bridges (USB hubs, USB flash card readers for example)." - einfo "\t- SCSI, RTC, basic PCI, IOC3 Ethernet, keyboard, and mouse. Please" - einfo "\t\040\040report any problems with these devices." - echo -e "" -} - -show_ip32_info() { - echo -e "" - einfo "IP32 systems function well, however there are some notes:" - einfo "\t- A sound driver now exists for IP32. Celebrate!" - einfo "\t- Framebuffer console is limited to 4MB. Anything greater" - einfo "\t\040\040specified when building the kernel will likely oops" - einfo "\t\040\040or panic the kernel." - einfo "\t- X support is limited to the generic fbdev driver. No X" - einfo "\t\040\040gbefb driver exists for O2 yet. Feel free to submit" - einfo "\t\040\040patches!" - echo -e "" - - einfo "To Build 64bit kernels for SGI O2 (IP32) or SGI Indy/Indigo2 R4x00 (IP22)" - einfo "systems, you need to use the ${GOOD}vmlinux.32${NORMAL} make target." - einfo "Once done, boot the ${GOOD}vmlinux.32${NORMAL} file (NOT vmlinux)." -} - -src_unpack() { - # Unpack the kernel sources, update to the latest rev (if needed), - # and apply the latest patch from linux-mips git. - kernel-2_src_unpack - - # Unpack the mips-sources patchset to ${WORKDIR}/mips-patches-${BASE_KV}. - echo -e "" - cd "${WORKDIR}" - unpack "${PN}-${BASE_KV}-patches-v${GENPATCHREV}.tar.xz" - - # Create a new folder called 'patch-symlinks' and create symlinks to - # all mips-patches in there. If we want to exclude a patch, we'll - # just delete the symlink instead of the actual patch. - local psym="patch-symlinks" - mkdir "${psym}" - cd "${psym}" - for x in ../mips-patches-${BASE_KV}/*.patch; do - ln -s "${x}" "${x##../mips-patches-*/}" - done - - # With symlinks created, setup the variables referencing external - # machine patches and if a machine USE flag is enabled, then unset - # its corresponding variable. - # See 0000_README for the patch numbers and their meanings. - local p_generic="51*" - local p_ip27="52*" p_ip28="53*" p_ip30="54*" - local p_xp="80*" - use ip27 && unset p_generic p_ip27 - use ip28 && unset p_ip28 - use ip30 && unset p_generic p_ip30 - use experimental && unset p_xp - - # Remove symlinks for any patches that we don't want applied. We - # do this by looping through all the above variables, and deleting - # matching symlinks that point to the corresponding patches. - # The remaining symlinks will be applied to the kernel source. - # - # $P_EXCLUDE is a new var that can be set in an ebuild to exclude - # specific patches by wildcarding the patch number. - local patchlist="${p_generic} ${p_ip27} ${p_ip28} ${p_ip30} ${p_xp} ${P_EXCLUDE}" - for x in $patchlist; - do rm -f "./${x}" - done - - # Rename the source tree to match the linux-mips git checkout date and - # machine type. - local fkv="${F_KV%-*}" - local v="${fkv}-${GITDATE}" - for x in {ip27,ip28,ip30}; do - use ${x} && v="${v}.${x}" && break - done - mv "${WORKDIR}/linux-${fkv/_/-}" "${WORKDIR}/linux-${v}" || die - S="${WORKDIR}/linux-${v}" - - # Set the EXTRAVERSION to linux-VERSION-mipsgit-GITDATE - EXTRAVERSION="${EXTRAVERSION}-mipsgit-${GITDATE}" - unpack_set_extraversion -} - -src_prepare() { - local psym="patch-symlinks" - - # Now go into the kernel source and patch it. - cd "${S}" - epatch -p1 "${WORKDIR}/${psym}"/*.patch - - eapply_user -} - -#//------------------------------------------------------------------------------ diff --git a/sys-kernel/mips-sources/mips-sources-4.14.227.ebuild b/sys-kernel/mips-sources/mips-sources-4.14.227.ebuild new file mode 100644 index 000000000000..c26d6b622c90 --- /dev/null +++ b/sys-kernel/mips-sources/mips-sources-4.14.227.ebuild @@ -0,0 +1,346 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# EAPI Version +EAPI="6" + +#//------------------------------------------------------------------------------ + +# Version Data +GITDATE="20180128" # Date of diff between kernel.org and lmo GIT +GENPATCHREV="2" # Tarball revision for patches + +# Directories +S="${WORKDIR}/linux-${OKV}-${GITDATE}" +MIPS_PATCHES="${WORKDIR}/mips-patches" + +# Kernel-2 Vars +K_SECURITY_UNSUPPORTED="yes" +K_NOUSENAME="yes" +K_NOSETEXTRAVERSION="yes" +K_NOUSEPR="yes" +K_BASE_VER="4.13" +K_FROM_GIT="yes" +ETYPE="sources" + +# Inherit Eclasses +inherit kernel-2 epatch eapi7-ver +detect_version + +# Version Data +F_KV="${PVR}" +BASE_KV="$(ver_cut 1-2).0" +[[ "${EXTRAVERSION}" = -rc* ]] && KVE="${EXTRAVERSION}" + +# Portage Vars +HOMEPAGE="https://wiki.gentoo.org/wiki/Project:MIPS" +KEYWORDS="-* ~mips" +IUSE="experimental ip27 ip28 ip30" +RDEPEND="" +DEPEND="${RDEPEND} + >=sys-devel/gcc-4.7.0 + >=sys-devel/patch-2.7.4" + +# Specify any patches or patch familes to NOT apply here. +# Use only the 4-digit number followed by a '*'. +P_EXCLUDE="" + +# Machine Support Control Variables +DO_IP22="test" # If "yes", enable IP22 support (SGI Indy, Indigo2 R4x00) +DO_IP27="yes" # IP27 support (SGI Origin) +DO_IP28="test" # IP28 support (SGI Indigo2 Impact R10000) +DO_IP30="yes" # IP30 support (SGI Octane) +DO_IP32="yes" # IP32 support (SGI O2, R5000/RM5200 Only) + +# Machine Stable Version Variables +SV_IP22="" # If set && DO_IP22 == "no", indicates last "good" IP22 version +SV_IP27="" # DO_IP27 == "no", IP27 +SV_IP28="" # DO_IP28 == "no", IP28 +SV_IP30="" # DO_IP30 == "no", IP30 +SV_IP32="" # DO_IP32 == "no", IP32 + +DESCRIPTION="Linux-Mips GIT sources for MIPS-based machines, dated ${GITDATE}" +SRC_URI="${KERNEL_URI} + https://dev.gentoo.org/~kumba/distfiles/mipsgit-${BASE_KV}${KVE}-${GITDATE}.diff.xz + https://dev.gentoo.org/~kumba/distfiles/${PN}-${BASE_KV}-patches-v${GENPATCHREV}.tar.xz" + +UNIPATCH_STRICTORDER="yes" +UNIPATCH_LIST="${DISTDIR}/mipsgit-${BASE_KV}${KVE}-${GITDATE}.diff.xz" + +#//------------------------------------------------------------------------------ + +err_disabled_mach() { + # Get args + local m_name="${1}" + local m_abbr="${2}" + local m_use="${3}" + local is_test="${4}" + + # Get stable version, if exists + local stable_ver="SV_${m_abbr}" + stable_ver="${!stable_ver}" + + # See if this machine needs a USE passed or skip dying + local has_use + [ ! -z "${m_use}" -a "${m_use}" != "skip" ] && has_use="USE=\"${m_use}\" " + + # Print error && (maybe) die + echo -e "" + if [ "${is_test}" != "test" ]; then + eerror "${m_name} Support has been disabled in this ebuild" + eerror "revision. If you wish to merge ${m_name} sources, then" + eerror "run ${has_use}emerge =mips-sources-${stable_ver}" + [ "${m_use}" != "skip" ] && die "${m_name} Support disabled." + else + ewarn "${m_name} Support has been marked as needing testing in this" + ewarn "ebuild revision. This usually means that any patches to support" + ewarn "${m_name} have been forward ported and maybe even compile-tested," + ewarn "but not yet booted on real hardware, possibly due to a lack of access" + ewarn "to such hardware. If you happen to boot this kernel and have no" + ewarn "problems at all, then please inform the maintainer. Otherwise, if" + ewarn "experience a bug, an oops/panic, or some other oddity, then please" + ewarn "file a bug at bugs.gentoo.org, and assign it to the mips team." + fi + + return 0 +} + +err_only_one_mach_allowed() { + echo -e "" + eerror "A patchset for a specific machine-type has already been selected." + eerror "No other patches for machines-types are permitted. You will need a" + eerror "separate copy of the kernel sources for each different machine-type" + eerror "you want to build a kernel for." + die "Only one machine-type patchset allowed" +} + +pkg_postinst() { + # Symlink /usr/src/linux as appropriate + local my_ksrc="${S##*/}" + for x in {ip27,ip28,ip30}; do + use ${x} && my_ksrc="${my_ksrc}.${x}" + done + + if [ ! -e "${ROOT}usr/src/linux" ]; then + rm -f "${ROOT}usr/src/linux" + ln -sf "${my_ksrc}" "${ROOT}/usr/src/linux" + fi +} + +pkg_setup() { + local arch_is_selected="no" + local m_ip m_enable m_name + + # Exclusive machine patchsets + # These are not allowed to be mixed together, thus only one of them may be applied + # to a tree per merge. + for x in \ + "ip27 SGI Origin 200/2000" \ + "ip28 SGI Indigo2 Impact R10000" \ + "ip30 SGI Octane" + do + set -- ${x} # Set positional params + m_ip="${1}" # Grab the first param (HW IP for SGI) + shift # Shift the positions + m_name="${*}" # Get the rest (Name) + + if use ${m_ip}; then + # Fetch the value indiciating if the machine is enabled or not + m_enable="DO_${m_ip/ip/IP}" + m_enable="${!m_enable}" + + # Make sure only one of these exclusive machine patches is selected + [ "${arch_is_selected}" = "no" ] \ + && arch_is_selected="yes" \ + || err_only_one_mach_allowed + + # Is the machine support disabled or marked as needing testing? + [ "${m_enable}" = "test" ] \ + && err_disabled_mach "${m_name}" "${m_ip/ip/IP}" "${m_ip}" "test" + [ "${m_enable}" = "no" ] \ + && err_disabled_mach "${m_name}" "${m_ip/ip/IP}" "${m_ip}" + + # Show relevant information about the machine + show_${m_ip}_info + fi + done + + # All other systems that don't have a USE flag go here + # These systems have base-line support included in linux-mips git, so + # instead of failing, if disabled, we simply warn the user + if [ "${arch_is_selected}" = "no" ]; then + [ "${DO_IP22}" = "no" ] \ + && err_disabled_mach "SGI Indy/Indigo2 R4x00" "IP22" "skip" \ + || show_ip22_info + [ "${DO_IP32}" = "no" ] \ + && err_disabled_mach "SGI O2" "IP32" "skip" \ + || show_ip32_info + + fi +} + +show_ip22_info() { + echo -e "" + einfo "IP22 systems with an R5000 processor should work with this release." + einfo "The R4x00 series of processors tend to be rather flaky, especially the" + einfo "R4600. If you have to run an R4x00 processor, then try to use an R4400." + einfo "" + einfo "Some Notes:" + einfo "\t- Supported graphics card right now is Newport (XL)." + einfo "\t- A driver for Extreme (XZ) does not exist at present." + echo -e "" +} + +show_ip27_info() { + echo -e "" + ewarn "Heavy disk I/O on recent kernels may randomly trigger a VM_BUG_ON_PAGE()" + ewarn "in move_freepages() in mm/page_alloc.c. The exact trigger cause is" + ewarn "unknown at this time. Please report any oops messages from this" + ewarn "bug to bugs.gentoo.org (assign to mips@gentoo.org)" + echo -e "" +} + +show_ip28_info() { + echo -e "" + einfo "Support for the Indigo2 Impact R10000 is now in the mainline kernel. However," + einfo "due to the R10000 Speculative Execution issue that exists with this machine," + einfo "nothing is guaranteed to work correctly. Consider enabling ${HILITE}CONFIG_KALLSYMS${NORMAL}" + einfo "in your kernel so that if the machine Oopes, you'll be able to provide valuable" + einfo "feedback that can be used to trace down the crash." + echo -e "" +} + +show_ip30_info() { + echo -e "" + eerror "Things that DON'T work:" + eerror "\t- Do not use CONFIG_SLUB, otherwise, you'll get errors when booting" + eerror "\t\040\040regarding duplicate /sys/kernel/slab/* entries in sysfs." + eerror "\t- Impact (MGRAS) Xorg driver no longer functions due to severe bitrot." + eerror "\t- Octane is limited to a maximum of 2GB of memory right now due to a" + eerror "\t\040\040hardware quirk in the BRIDGE PCI chip that limits BRIDGE DMA" + eerror "\t\040\040addresses to 31-bits when converted into physical addresses." + eerror "\t\040\040Patches that attempt to fix the issue are highly welcome." + echo -e "" + ewarn "Things that might work, but have problems, or are unknown:" + ewarn "\t- CONFIG_TRANSPARENT_HUGEPAGE should work now, but there may still be" + ewarn "\t\040\040intermittent issues. Additionally, CONFIG_HUGETLBFS must also be" + ewarn "\t\040\040selected for hugepages to work. If use of this feature continues" + ewarn "\t\040\040to trigger random Instruction Bus Errors (IBEs), then it is best to" + ewarn "\t\040\040disable the functionality and perform a cold reset of the machine" + ewarn "\t\040\040after powering it down for at least 30 seconds." + ewarn "\t- Serial support on the Octane uses a very basic UART driver that drives" + ewarn "\t\040\040the 16550A chip on the IOC3 directly. It does not use interrupts," + ewarn "\t\040\040only a polling routine on a timer, which makes it slow and CPU-" + ewarn "\t\040\040intensive. The baud rate is limited to no more than 38.4kbps on" + ewarn "\t\040\040this driver. Patches for getting the Altix IOC3 serial driver to" + ewarn "\t\040\040work (which uses DMA and supports faster baud rates) are welcome." + ewarn "\t- UHCI Cards are known to have issues, but should still function." + ewarn "\t\040\040This issue primarily manifests itself when using pl2303 USB->Serial" + ewarn "\t\040\040adapters." + ewarn "\t- MENET boards appear to have the four ethernet ports detected, however" + ewarn "\t\040\040the six serial ports don't appear to get picked up by the IOC3" + ewarn "\t\040\040UART driver. The NIC part number is also not read correctly" + ewarn "\t\040\040from the four Number-In-a-Cans. Additional testing would be" + ewarn "\t\040\040appreciated and patches welcome." + ewarn "\t- Other XIO-based devices, like various Impact addons, remain untested" + ewarn "\t\040\040and are not guaranteed to work. This applies to various digital" + ewarn "\t\040\040video conversion boards as well." + echo -e "" + einfo "Things that DO work:" + einfo "\t- SMP works again, celebrate!" + einfo "\t- Impact (MGRAS) console only." + einfo "\t- VPro (Odyssey) console only (no X driver exists yet)." + einfo "\t- PCI Card Cages should work for many devices, except certain types like" + einfo "\t\040\040PCI-to-PCI bridges (USB hubs, USB flash card readers for example)." + einfo "\t- SCSI, RTC, basic PCI, IOC3 Ethernet, keyboard, and mouse. Please" + einfo "\t\040\040report any problems with these devices." + echo -e "" +} + +show_ip32_info() { + echo -e "" + einfo "IP32 systems function well, however there are some notes:" + einfo "\t- A sound driver now exists for IP32. Celebrate!" + einfo "\t- Framebuffer console is limited to 4MB. Anything greater" + einfo "\t\040\040specified when building the kernel will likely oops" + einfo "\t\040\040or panic the kernel." + einfo "\t- X support is limited to the generic fbdev driver. No X" + einfo "\t\040\040gbefb driver exists for O2 yet. Feel free to submit" + einfo "\t\040\040patches!" + echo -e "" + + einfo "To Build 64bit kernels for SGI O2 (IP32) or SGI Indy/Indigo2 R4x00 (IP22)" + einfo "systems, you need to use the ${GOOD}vmlinux.32${NORMAL} make target." + einfo "Once done, boot the ${GOOD}vmlinux.32${NORMAL} file (NOT vmlinux)." +} + +src_unpack() { + # Unpack the kernel sources, update to the latest rev (if needed), + # and apply the latest patch from linux-mips git. + kernel-2_src_unpack + + # Unpack the mips-sources patchset to ${WORKDIR}/mips-patches-${BASE_KV}. + echo -e "" + cd "${WORKDIR}" + unpack "${PN}-${BASE_KV}-patches-v${GENPATCHREV}.tar.xz" + + # Create a new folder called 'patch-symlinks' and create symlinks to + # all mips-patches in there. If we want to exclude a patch, we'll + # just delete the symlink instead of the actual patch. + local psym="patch-symlinks" + mkdir "${psym}" + cd "${psym}" + for x in ../mips-patches-${BASE_KV}/*.patch; do + ln -s "${x}" "${x##../mips-patches-*/}" + done + + # With symlinks created, setup the variables referencing external + # machine patches and if a machine USE flag is enabled, then unset + # its corresponding variable. + # See 0000_README for the patch numbers and their meanings. + local p_generic="51*" + local p_ip27="52*" p_ip28="53*" p_ip30="54*" + local p_xp="80*" + use ip27 && unset p_generic p_ip27 + use ip28 && unset p_ip28 + use ip30 && unset p_generic p_ip30 + use experimental && unset p_xp + + # Remove symlinks for any patches that we don't want applied. We + # do this by looping through all the above variables, and deleting + # matching symlinks that point to the corresponding patches. + # The remaining symlinks will be applied to the kernel source. + # + # $P_EXCLUDE is a new var that can be set in an ebuild to exclude + # specific patches by wildcarding the patch number. + local patchlist="${p_generic} ${p_ip27} ${p_ip28} ${p_ip30} ${p_xp} ${P_EXCLUDE}" + for x in $patchlist; + do rm -f "./${x}" + done + + # Rename the source tree to match the linux-mips git checkout date and + # machine type. + local fkv="${F_KV%-*}" + local v="${fkv}-${GITDATE}" + for x in {ip27,ip28,ip30}; do + use ${x} && v="${v}.${x}" && break + done + mv "${WORKDIR}/linux-${fkv/_/-}" "${WORKDIR}/linux-${v}" || die + S="${WORKDIR}/linux-${v}" + + # Set the EXTRAVERSION to linux-VERSION-mipsgit-GITDATE + EXTRAVERSION="${EXTRAVERSION}-mipsgit-${GITDATE}" + unpack_set_extraversion +} + +src_prepare() { + local psym="patch-symlinks" + + # Now go into the kernel source and patch it. + cd "${S}" + epatch -p1 "${WORKDIR}/${psym}"/*.patch + + eapply_user +} + +#//------------------------------------------------------------------------------ diff --git a/sys-kernel/mips-sources/mips-sources-4.19.176.ebuild b/sys-kernel/mips-sources/mips-sources-4.19.176.ebuild deleted file mode 100644 index 4f2c0e512d0b..000000000000 --- a/sys-kernel/mips-sources/mips-sources-4.19.176.ebuild +++ /dev/null @@ -1,344 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -# EAPI Version -EAPI="6" - -#//------------------------------------------------------------------------------ - -# Version Data -GENPATCHREV="2" # Tarball revision for patches - -# Directories -S="${WORKDIR}/linux-${OKV}" -MIPS_PATCHES="${WORKDIR}/mips-patches" - -# Kernel-2 Vars -K_SECURITY_UNSUPPORTED="yes" -K_NOUSENAME="yes" -K_NOSETEXTRAVERSION="yes" -K_NOUSEPR="yes" -K_BASE_VER="4.18" -K_FROM_GIT="yes" -ETYPE="sources" - -# Inherit Eclasses -inherit kernel-2 eutils eapi7-ver -detect_version - -# Version Data -F_KV="${PVR}" -BASE_KV="$(ver_cut 1-2).0" -[[ "${EXTRAVERSION}" = -rc* ]] && KVE="${EXTRAVERSION}" - -# Portage Vars -HOMEPAGE="https://wiki.gentoo.org/wiki/Project:MIPS" -KEYWORDS="-* ~mips" -IUSE="experimental ip27 ip28 ip30" -RDEPEND="" -DEPEND="${RDEPEND} - >=sys-devel/gcc-4.7.0 - >=sys-devel/patch-2.7.4" - -# Specify any patches or patch familes to NOT apply here. -# Use only the 4-digit number followed by a '*'. -P_EXCLUDE="" - -# Machine Support Control Variables -DO_IP22="test" # If "yes", enable IP22 support (SGI Indy, Indigo2 R4x00) -DO_IP27="yes" # IP27 support (SGI Origin) -DO_IP28="test" # IP28 support (SGI Indigo2 Impact R10000) -DO_IP30="yes" # IP30 support (SGI Octane) -DO_IP32="yes" # IP32 support (SGI O2, R5000/RM5200 Only) - -# Machine Stable Version Variables -SV_IP22="" # If set && DO_IP22 == "no", indicates last "good" IP22 version -SV_IP27="" # DO_IP27 == "no", IP27 -SV_IP28="" # DO_IP28 == "no", IP28 -SV_IP30="" # DO_IP30 == "no", IP30 -SV_IP32="" # DO_IP32 == "no", IP32 - -DESCRIPTION="Kernel.org sources for MIPS-based machines" -SRC_URI="${KERNEL_URI} - https://dev.gentoo.org/~kumba/distfiles/${PN}-${BASE_KV}-patches-v${GENPATCHREV}.tar.xz" - -#//------------------------------------------------------------------------------ - -err_disabled_mach() { - # Get args - local m_name="${1}" - local m_abbr="${2}" - local m_use="${3}" - local is_test="${4}" - - # Get stable version, if exists - local stable_ver="SV_${m_abbr}" - stable_ver="${!stable_ver}" - - # See if this machine needs a USE passed or skip dying - local has_use - [ ! -z "${m_use}" -a "${m_use}" != "skip" ] && has_use="USE=\"${m_use}\" " - - # Print error && (maybe) die - echo -e "" - if [ "${is_test}" != "test" ]; then - eerror "${m_name} Support has been disabled in this ebuild" - eerror "revision. If you wish to merge ${m_name} sources, then" - eerror "run ${has_use}emerge =mips-sources-${stable_ver}" - [ "${m_use}" != "skip" ] && die "${m_name} Support disabled." - else - ewarn "${m_name} Support has been marked as needing testing in this" - ewarn "ebuild revision. This usually means that any patches to support" - ewarn "${m_name} have been forward ported and maybe even compile-tested," - ewarn "but not yet booted on real hardware, possibly due to a lack of access" - ewarn "to such hardware. If you happen to boot this kernel and have no" - ewarn "problems at all, then please inform the maintainer. Otherwise, if" - ewarn "experience a bug, an oops/panic, or some other oddity, then please" - ewarn "file a bug at bugs.gentoo.org, and assign it to the mips team." - fi - - return 0 -} - -err_only_one_mach_allowed() { - echo -e "" - eerror "A patchset for a specific machine-type has already been selected." - eerror "No other patches for machines-types are permitted. You will need a" - eerror "separate copy of the kernel sources for each different machine-type" - eerror "you want to build a kernel for." - die "Only one machine-type patchset allowed" -} - -pkg_postinst() { - # Symlink /usr/src/linux as appropriate - local my_ksrc="${S##*/}" - for x in {ip27,ip28,ip30}; do - use ${x} && my_ksrc="${my_ksrc}.${x}" - done - - if [ ! -e "${ROOT}usr/src/linux" ]; then - rm -f "${ROOT}usr/src/linux" - ln -sf "${my_ksrc}" "${ROOT}/usr/src/linux" - fi -} - -pkg_setup() { - local arch_is_selected="no" - local m_ip m_enable m_name - - # Exclusive machine patchsets - # These are not allowed to be mixed together, thus only one of them may be applied - # to a tree per merge. - for x in \ - "ip27 SGI Origin 200/2000" \ - "ip28 SGI Indigo2 Impact R10000" \ - "ip30 SGI Octane" - do - set -- ${x} # Set positional params - m_ip="${1}" # Grab the first param (HW IP for SGI) - shift # Shift the positions - m_name="${*}" # Get the rest (Name) - - if use ${m_ip}; then - # Fetch the value indiciating if the machine is enabled or not - m_enable="DO_${m_ip/ip/IP}" - m_enable="${!m_enable}" - - # Make sure only one of these exclusive machine patches is selected - [ "${arch_is_selected}" = "no" ] \ - && arch_is_selected="yes" \ - || err_only_one_mach_allowed - - # Is the machine support disabled or marked as needing testing? - [ "${m_enable}" = "test" ] \ - && err_disabled_mach "${m_name}" "${m_ip/ip/IP}" "${m_ip}" "test" - [ "${m_enable}" = "no" ] \ - && err_disabled_mach "${m_name}" "${m_ip/ip/IP}" "${m_ip}" - - # Show relevant information about the machine - show_${m_ip}_info - fi - done - - # All other systems that don't have a USE flag go here - # These systems have base-line support included in linux-mips git, so - # instead of failing, if disabled, we simply warn the user - if [ "${arch_is_selected}" = "no" ]; then - [ "${DO_IP22}" = "no" ] \ - && err_disabled_mach "SGI Indy/Indigo2 R4x00" "IP22" "skip" \ - || show_ip22_info - [ "${DO_IP32}" = "no" ] \ - && err_disabled_mach "SGI O2" "IP32" "skip" \ - || show_ip32_info - - fi -} - -show_ip22_info() { - echo -e "" - einfo "IP22 systems with an R5000 processor should work with this release." - einfo "The R4x00 series of processors tend to be rather flaky, especially the" - einfo "R4600. If you have to run an R4x00 processor, then try to use an R4400." - einfo "" - einfo "Some Notes:" - einfo "\t- Supported graphics card right now is Newport (XL)." - einfo "\t- A driver for Extreme (XZ) does not exist at present." - echo -e "" -} - -show_ip27_info() { - echo -e "" - ewarn "IP27 Origin 2k/Onyx2 systems may be prone to sudden hard lockups." - ewarn "The exact trigger is unknown at this time." - echo -e "" -} - -show_ip28_info() { - echo -e "" - einfo "Support for the Indigo2 Impact R10000 is now in the mainline kernel. However," - einfo "due to the R10000 Speculative Execution issue that exists with this machine," - einfo "nothing is guaranteed to work correctly. Consider enabling ${HILITE}CONFIG_KALLSYMS${NORMAL}" - einfo "in your kernel so that if the machine Oopes, you'll be able to provide valuable" - einfo "feedback that can be used to trace down the crash." - echo -e "" -} - -show_ip30_info() { - echo -e "" - eerror "Things that DON'T work:" - eerror "\t- Do not use CONFIG_SLUB, otherwise, you'll get errors when booting" - eerror "\t\040\040regarding duplicate /sys/kernel/slab/* entries in sysfs." - eerror "\t- Impact (MGRAS) Xorg driver no longer functions due to severe bitrot." - eerror "\t- Octane is limited to a maximum of 2GB of memory right now due to a" - eerror "\t\040\040hardware quirk in the BRIDGE PCI chip that limits BRIDGE DMA" - eerror "\t\040\040addresses to 31-bits when converted into physical addresses." - eerror "\t\040\040Patches that attempt to fix the issue are highly welcome." - echo -e "" - ewarn "Things that might work, but have problems, or are unknown:" - ewarn "\t- CONFIG_TRANSPARENT_HUGEPAGE should work now, but there may still be" - ewarn "\t\040\040intermittent issues. Additionally, CONFIG_HUGETLBFS must also be" - ewarn "\t\040\040selected for hugepages to work. If use of this feature continues" - ewarn "\t\040\040to trigger random Instruction Bus Errors (IBEs), then it is best to" - ewarn "\t\040\040disable the functionality and perform a cold reset of the machine" - ewarn "\t\040\040after powering it down for at least 30 seconds." - ewarn "\t- Serial support on the Octane uses a very basic UART driver that drives" - ewarn "\t\040\040the 16550A chip on the IOC3 directly. It does not use interrupts," - ewarn "\t\040\040only a polling routine on a timer, which makes it slow and CPU-" - ewarn "\t\040\040intensive. The baud rate is limited to no more than 38.4kbps on" - ewarn "\t\040\040this driver. Patches for getting the Altix IOC3 serial driver to" - ewarn "\t\040\040work (which uses DMA and supports faster baud rates) are welcome." - ewarn "\t- UHCI Cards are known to have issues, but should still function." - ewarn "\t\040\040This issue primarily manifests itself when using pl2303 USB->Serial" - ewarn "\t\040\040adapters." - ewarn "\t- MENET boards appear to have the four ethernet ports detected, however" - ewarn "\t\040\040the six serial ports don't appear to get picked up by the IOC3" - ewarn "\t\040\040UART driver. The NIC part number is also not read correctly" - ewarn "\t\040\040from the four Number-In-a-Cans. Additional testing would be" - ewarn "\t\040\040appreciated and patches welcome." - ewarn "\t- Other XIO-based devices, like various Impact addons, remain untested" - ewarn "\t\040\040and are not guaranteed to work. This applies to various digital" - ewarn "\t\040\040video conversion boards as well." - echo -e "" - einfo "Things that DO work:" - einfo "\t- SMP works again, celebrate!" - einfo "\t- Impact (MGRAS) console only." - einfo "\t- VPro (Odyssey) console only (no X driver exists yet)." - einfo "\t- PCI Card Cages should work for many devices, except certain types like" - einfo "\t\040\040PCI-to-PCI bridges (USB hubs, USB flash card readers for example)." - einfo "\t- SCSI, RTC, basic PCI, IOC3 Ethernet, keyboard, and mouse. Please" - einfo "\t\040\040report any problems with these devices." - echo -e "" -} - -show_ip32_info() { - echo -e "" - einfo "IP32 systems function well, however there are some notes:" - einfo "\t- A sound driver now exists for IP32. Celebrate!" - einfo "\t- Framebuffer console is limited to 4MB. Anything greater" - einfo "\t\040\040specified when building the kernel will likely oops" - einfo "\t\040\040or panic the kernel." - einfo "\t- X support is limited to the generic fbdev driver. No X" - einfo "\t\040\040gbefb driver exists for O2 yet. Feel free to submit" - einfo "\t\040\040patches!" - echo -e "" - - einfo "To Build 64bit kernels for SGI O2 (IP32) or SGI Indy/Indigo2 R4x00 (IP22)" - einfo "systems, you need to use the ${GOOD}vmlinux.32${NORMAL} make target." - einfo "Once done, boot the ${GOOD}vmlinux.32${NORMAL} file (NOT vmlinux)." -} - -src_unpack() { - # Unpack the kernel sources, update to the latest rev (if needed), - # and apply the latest patch from linux-mips git. - kernel-2_src_unpack - - # Unpack the mips-sources patchset to ${WORKDIR}/mips-patches-${BASE_KV}. - echo -e "" - cd "${WORKDIR}" - unpack "${PN}-${BASE_KV}-patches-v${GENPATCHREV}.tar.xz" - - # Create a new folder called 'patch-symlinks' and create symlinks to - # all mips-patches in there. If we want to exclude a patch, we'll - # just delete the symlink instead of the actual patch. - local psym="patch-symlinks" - mkdir "${psym}" - cd "${psym}" - for x in ../mips-patches-${BASE_KV}/*.patch; do - ln -s "${x}" "${x##../mips-patches-*/}" - done - - # With symlinks created, setup the variables referencing external - # machine patches and if a machine USE flag is enabled, then unset - # its corresponding variable. - # See 0000_README for the patch numbers and their meanings. - local p_generic="51*" - local p_ip27="52*" p_ip28="53*" p_ip30="54*" - local p_xp="80*" - use ip27 && unset p_generic p_ip27 - use ip28 && unset p_ip28 - use ip30 && unset p_generic p_ip30 - use experimental && unset p_xp - - # Remove symlinks for any patches that we don't want applied. We - # do this by looping through all the above variables, and deleting - # matching symlinks that point to the corresponding patches. - # The remaining symlinks will be applied to the kernel source. - # - # $P_EXCLUDE is a new var that can be set in an ebuild to exclude - # specific patches by wildcarding the patch number. - local patchlist="${p_generic} ${p_ip27} ${p_ip28} ${p_ip30} ${p_xp} ${P_EXCLUDE}" - for x in $patchlist; - do rm -f "./${x}" - done - - # Rename the source tree to match the linux-mips git checkout date and - # machine type. - local fkv="${F_KV%-*}" - local v="${fkv}" - for x in {ip27,ip28,ip30}; do - use ${x} && v="${v}.${x}" && break - done - - local old="${WORKDIR}/linux-${fkv/_/-}" - local new="${WORKDIR}/linux-${v}" - if [ "${old}" != "${new}" ]; then - mv "${old}" "${new}" || die - fi - S="${new}" - - # Set the EXTRAVERSION to linux-VERSION-mipsgit-GITDATE - EXTRAVERSION="${EXTRAVERSION}-gentoo-mips" - unpack_set_extraversion -} - -src_prepare() { - local psym="patch-symlinks" - - # Now go into the kernel source and patch it. - cd "${S}" - epatch -p1 "${WORKDIR}/${psym}"/*.patch - - eapply_user -} - -#//------------------------------------------------------------------------------ diff --git a/sys-kernel/mips-sources/mips-sources-4.19.183.ebuild b/sys-kernel/mips-sources/mips-sources-4.19.183.ebuild new file mode 100644 index 000000000000..0b3d0941bb86 --- /dev/null +++ b/sys-kernel/mips-sources/mips-sources-4.19.183.ebuild @@ -0,0 +1,344 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# EAPI Version +EAPI="6" + +#//------------------------------------------------------------------------------ + +# Version Data +GENPATCHREV="2" # Tarball revision for patches + +# Directories +S="${WORKDIR}/linux-${OKV}" +MIPS_PATCHES="${WORKDIR}/mips-patches" + +# Kernel-2 Vars +K_SECURITY_UNSUPPORTED="yes" +K_NOUSENAME="yes" +K_NOSETEXTRAVERSION="yes" +K_NOUSEPR="yes" +K_BASE_VER="4.18" +K_FROM_GIT="yes" +ETYPE="sources" + +# Inherit Eclasses +inherit kernel-2 epatch eapi7-ver +detect_version + +# Version Data +F_KV="${PVR}" +BASE_KV="$(ver_cut 1-2).0" +[[ "${EXTRAVERSION}" = -rc* ]] && KVE="${EXTRAVERSION}" + +# Portage Vars +HOMEPAGE="https://wiki.gentoo.org/wiki/Project:MIPS" +KEYWORDS="-* ~mips" +IUSE="experimental ip27 ip28 ip30" +RDEPEND="" +DEPEND="${RDEPEND} + >=sys-devel/gcc-4.7.0 + >=sys-devel/patch-2.7.4" + +# Specify any patches or patch familes to NOT apply here. +# Use only the 4-digit number followed by a '*'. +P_EXCLUDE="" + +# Machine Support Control Variables +DO_IP22="test" # If "yes", enable IP22 support (SGI Indy, Indigo2 R4x00) +DO_IP27="yes" # IP27 support (SGI Origin) +DO_IP28="test" # IP28 support (SGI Indigo2 Impact R10000) +DO_IP30="yes" # IP30 support (SGI Octane) +DO_IP32="yes" # IP32 support (SGI O2, R5000/RM5200 Only) + +# Machine Stable Version Variables +SV_IP22="" # If set && DO_IP22 == "no", indicates last "good" IP22 version +SV_IP27="" # DO_IP27 == "no", IP27 +SV_IP28="" # DO_IP28 == "no", IP28 +SV_IP30="" # DO_IP30 == "no", IP30 +SV_IP32="" # DO_IP32 == "no", IP32 + +DESCRIPTION="Kernel.org sources for MIPS-based machines" +SRC_URI="${KERNEL_URI} + https://dev.gentoo.org/~kumba/distfiles/${PN}-${BASE_KV}-patches-v${GENPATCHREV}.tar.xz" + +#//------------------------------------------------------------------------------ + +err_disabled_mach() { + # Get args + local m_name="${1}" + local m_abbr="${2}" + local m_use="${3}" + local is_test="${4}" + + # Get stable version, if exists + local stable_ver="SV_${m_abbr}" + stable_ver="${!stable_ver}" + + # See if this machine needs a USE passed or skip dying + local has_use + [ ! -z "${m_use}" -a "${m_use}" != "skip" ] && has_use="USE=\"${m_use}\" " + + # Print error && (maybe) die + echo -e "" + if [ "${is_test}" != "test" ]; then + eerror "${m_name} Support has been disabled in this ebuild" + eerror "revision. If you wish to merge ${m_name} sources, then" + eerror "run ${has_use}emerge =mips-sources-${stable_ver}" + [ "${m_use}" != "skip" ] && die "${m_name} Support disabled." + else + ewarn "${m_name} Support has been marked as needing testing in this" + ewarn "ebuild revision. This usually means that any patches to support" + ewarn "${m_name} have been forward ported and maybe even compile-tested," + ewarn "but not yet booted on real hardware, possibly due to a lack of access" + ewarn "to such hardware. If you happen to boot this kernel and have no" + ewarn "problems at all, then please inform the maintainer. Otherwise, if" + ewarn "experience a bug, an oops/panic, or some other oddity, then please" + ewarn "file a bug at bugs.gentoo.org, and assign it to the mips team." + fi + + return 0 +} + +err_only_one_mach_allowed() { + echo -e "" + eerror "A patchset for a specific machine-type has already been selected." + eerror "No other patches for machines-types are permitted. You will need a" + eerror "separate copy of the kernel sources for each different machine-type" + eerror "you want to build a kernel for." + die "Only one machine-type patchset allowed" +} + +pkg_postinst() { + # Symlink /usr/src/linux as appropriate + local my_ksrc="${S##*/}" + for x in {ip27,ip28,ip30}; do + use ${x} && my_ksrc="${my_ksrc}.${x}" + done + + if [ ! -e "${ROOT}usr/src/linux" ]; then + rm -f "${ROOT}usr/src/linux" + ln -sf "${my_ksrc}" "${ROOT}/usr/src/linux" + fi +} + +pkg_setup() { + local arch_is_selected="no" + local m_ip m_enable m_name + + # Exclusive machine patchsets + # These are not allowed to be mixed together, thus only one of them may be applied + # to a tree per merge. + for x in \ + "ip27 SGI Origin 200/2000" \ + "ip28 SGI Indigo2 Impact R10000" \ + "ip30 SGI Octane" + do + set -- ${x} # Set positional params + m_ip="${1}" # Grab the first param (HW IP for SGI) + shift # Shift the positions + m_name="${*}" # Get the rest (Name) + + if use ${m_ip}; then + # Fetch the value indiciating if the machine is enabled or not + m_enable="DO_${m_ip/ip/IP}" + m_enable="${!m_enable}" + + # Make sure only one of these exclusive machine patches is selected + [ "${arch_is_selected}" = "no" ] \ + && arch_is_selected="yes" \ + || err_only_one_mach_allowed + + # Is the machine support disabled or marked as needing testing? + [ "${m_enable}" = "test" ] \ + && err_disabled_mach "${m_name}" "${m_ip/ip/IP}" "${m_ip}" "test" + [ "${m_enable}" = "no" ] \ + && err_disabled_mach "${m_name}" "${m_ip/ip/IP}" "${m_ip}" + + # Show relevant information about the machine + show_${m_ip}_info + fi + done + + # All other systems that don't have a USE flag go here + # These systems have base-line support included in linux-mips git, so + # instead of failing, if disabled, we simply warn the user + if [ "${arch_is_selected}" = "no" ]; then + [ "${DO_IP22}" = "no" ] \ + && err_disabled_mach "SGI Indy/Indigo2 R4x00" "IP22" "skip" \ + || show_ip22_info + [ "${DO_IP32}" = "no" ] \ + && err_disabled_mach "SGI O2" "IP32" "skip" \ + || show_ip32_info + + fi +} + +show_ip22_info() { + echo -e "" + einfo "IP22 systems with an R5000 processor should work with this release." + einfo "The R4x00 series of processors tend to be rather flaky, especially the" + einfo "R4600. If you have to run an R4x00 processor, then try to use an R4400." + einfo "" + einfo "Some Notes:" + einfo "\t- Supported graphics card right now is Newport (XL)." + einfo "\t- A driver for Extreme (XZ) does not exist at present." + echo -e "" +} + +show_ip27_info() { + echo -e "" + ewarn "IP27 Origin 2k/Onyx2 systems may be prone to sudden hard lockups." + ewarn "The exact trigger is unknown at this time." + echo -e "" +} + +show_ip28_info() { + echo -e "" + einfo "Support for the Indigo2 Impact R10000 is now in the mainline kernel. However," + einfo "due to the R10000 Speculative Execution issue that exists with this machine," + einfo "nothing is guaranteed to work correctly. Consider enabling ${HILITE}CONFIG_KALLSYMS${NORMAL}" + einfo "in your kernel so that if the machine Oopes, you'll be able to provide valuable" + einfo "feedback that can be used to trace down the crash." + echo -e "" +} + +show_ip30_info() { + echo -e "" + eerror "Things that DON'T work:" + eerror "\t- Do not use CONFIG_SLUB, otherwise, you'll get errors when booting" + eerror "\t\040\040regarding duplicate /sys/kernel/slab/* entries in sysfs." + eerror "\t- Impact (MGRAS) Xorg driver no longer functions due to severe bitrot." + eerror "\t- Octane is limited to a maximum of 2GB of memory right now due to a" + eerror "\t\040\040hardware quirk in the BRIDGE PCI chip that limits BRIDGE DMA" + eerror "\t\040\040addresses to 31-bits when converted into physical addresses." + eerror "\t\040\040Patches that attempt to fix the issue are highly welcome." + echo -e "" + ewarn "Things that might work, but have problems, or are unknown:" + ewarn "\t- CONFIG_TRANSPARENT_HUGEPAGE should work now, but there may still be" + ewarn "\t\040\040intermittent issues. Additionally, CONFIG_HUGETLBFS must also be" + ewarn "\t\040\040selected for hugepages to work. If use of this feature continues" + ewarn "\t\040\040to trigger random Instruction Bus Errors (IBEs), then it is best to" + ewarn "\t\040\040disable the functionality and perform a cold reset of the machine" + ewarn "\t\040\040after powering it down for at least 30 seconds." + ewarn "\t- Serial support on the Octane uses a very basic UART driver that drives" + ewarn "\t\040\040the 16550A chip on the IOC3 directly. It does not use interrupts," + ewarn "\t\040\040only a polling routine on a timer, which makes it slow and CPU-" + ewarn "\t\040\040intensive. The baud rate is limited to no more than 38.4kbps on" + ewarn "\t\040\040this driver. Patches for getting the Altix IOC3 serial driver to" + ewarn "\t\040\040work (which uses DMA and supports faster baud rates) are welcome." + ewarn "\t- UHCI Cards are known to have issues, but should still function." + ewarn "\t\040\040This issue primarily manifests itself when using pl2303 USB->Serial" + ewarn "\t\040\040adapters." + ewarn "\t- MENET boards appear to have the four ethernet ports detected, however" + ewarn "\t\040\040the six serial ports don't appear to get picked up by the IOC3" + ewarn "\t\040\040UART driver. The NIC part number is also not read correctly" + ewarn "\t\040\040from the four Number-In-a-Cans. Additional testing would be" + ewarn "\t\040\040appreciated and patches welcome." + ewarn "\t- Other XIO-based devices, like various Impact addons, remain untested" + ewarn "\t\040\040and are not guaranteed to work. This applies to various digital" + ewarn "\t\040\040video conversion boards as well." + echo -e "" + einfo "Things that DO work:" + einfo "\t- SMP works again, celebrate!" + einfo "\t- Impact (MGRAS) console only." + einfo "\t- VPro (Odyssey) console only (no X driver exists yet)." + einfo "\t- PCI Card Cages should work for many devices, except certain types like" + einfo "\t\040\040PCI-to-PCI bridges (USB hubs, USB flash card readers for example)." + einfo "\t- SCSI, RTC, basic PCI, IOC3 Ethernet, keyboard, and mouse. Please" + einfo "\t\040\040report any problems with these devices." + echo -e "" +} + +show_ip32_info() { + echo -e "" + einfo "IP32 systems function well, however there are some notes:" + einfo "\t- A sound driver now exists for IP32. Celebrate!" + einfo "\t- Framebuffer console is limited to 4MB. Anything greater" + einfo "\t\040\040specified when building the kernel will likely oops" + einfo "\t\040\040or panic the kernel." + einfo "\t- X support is limited to the generic fbdev driver. No X" + einfo "\t\040\040gbefb driver exists for O2 yet. Feel free to submit" + einfo "\t\040\040patches!" + echo -e "" + + einfo "To Build 64bit kernels for SGI O2 (IP32) or SGI Indy/Indigo2 R4x00 (IP22)" + einfo "systems, you need to use the ${GOOD}vmlinux.32${NORMAL} make target." + einfo "Once done, boot the ${GOOD}vmlinux.32${NORMAL} file (NOT vmlinux)." +} + +src_unpack() { + # Unpack the kernel sources, update to the latest rev (if needed), + # and apply the latest patch from linux-mips git. + kernel-2_src_unpack + + # Unpack the mips-sources patchset to ${WORKDIR}/mips-patches-${BASE_KV}. + echo -e "" + cd "${WORKDIR}" + unpack "${PN}-${BASE_KV}-patches-v${GENPATCHREV}.tar.xz" + + # Create a new folder called 'patch-symlinks' and create symlinks to + # all mips-patches in there. If we want to exclude a patch, we'll + # just delete the symlink instead of the actual patch. + local psym="patch-symlinks" + mkdir "${psym}" + cd "${psym}" + for x in ../mips-patches-${BASE_KV}/*.patch; do + ln -s "${x}" "${x##../mips-patches-*/}" + done + + # With symlinks created, setup the variables referencing external + # machine patches and if a machine USE flag is enabled, then unset + # its corresponding variable. + # See 0000_README for the patch numbers and their meanings. + local p_generic="51*" + local p_ip27="52*" p_ip28="53*" p_ip30="54*" + local p_xp="80*" + use ip27 && unset p_generic p_ip27 + use ip28 && unset p_ip28 + use ip30 && unset p_generic p_ip30 + use experimental && unset p_xp + + # Remove symlinks for any patches that we don't want applied. We + # do this by looping through all the above variables, and deleting + # matching symlinks that point to the corresponding patches. + # The remaining symlinks will be applied to the kernel source. + # + # $P_EXCLUDE is a new var that can be set in an ebuild to exclude + # specific patches by wildcarding the patch number. + local patchlist="${p_generic} ${p_ip27} ${p_ip28} ${p_ip30} ${p_xp} ${P_EXCLUDE}" + for x in $patchlist; + do rm -f "./${x}" + done + + # Rename the source tree to match the linux-mips git checkout date and + # machine type. + local fkv="${F_KV%-*}" + local v="${fkv}" + for x in {ip27,ip28,ip30}; do + use ${x} && v="${v}.${x}" && break + done + + local old="${WORKDIR}/linux-${fkv/_/-}" + local new="${WORKDIR}/linux-${v}" + if [ "${old}" != "${new}" ]; then + mv "${old}" "${new}" || die + fi + S="${new}" + + # Set the EXTRAVERSION to linux-VERSION-mipsgit-GITDATE + EXTRAVERSION="${EXTRAVERSION}-gentoo-mips" + unpack_set_extraversion +} + +src_prepare() { + local psym="patch-symlinks" + + # Now go into the kernel source and patch it. + cd "${S}" + epatch -p1 "${WORKDIR}/${psym}"/*.patch + + eapply_user +} + +#//------------------------------------------------------------------------------ diff --git a/sys-kernel/mips-sources/mips-sources-5.4.108.ebuild b/sys-kernel/mips-sources/mips-sources-5.4.108.ebuild new file mode 100644 index 000000000000..f940004dfb69 --- /dev/null +++ b/sys-kernel/mips-sources/mips-sources-5.4.108.ebuild @@ -0,0 +1,344 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# EAPI Version +EAPI="6" + +#//------------------------------------------------------------------------------ + +# Version Data +GENPATCHREV="3" # Tarball revision for patches + +# Directories +S="${WORKDIR}/linux-${OKV}" +MIPS_PATCHES="${WORKDIR}/mips-patches" + +# Kernel-2 Vars +K_SECURITY_UNSUPPORTED="yes" +K_NOUSENAME="yes" +K_NOSETEXTRAVERSION="yes" +K_NOUSEPR="yes" +K_BASE_VER="5.3" +K_FROM_GIT="yes" +ETYPE="sources" + +# Inherit Eclasses +inherit kernel-2 epatch eapi7-ver +detect_version + +# Version Data +F_KV="${PVR}" +BASE_KV="$(ver_cut 1-2)" +[[ "${EXTRAVERSION}" = -rc* ]] && KVE="${EXTRAVERSION}" + +# Portage Vars +HOMEPAGE="https://wiki.gentoo.org/wiki/Project:MIPS" +KEYWORDS="-* ~mips" +IUSE="experimental ip27 ip28 ip30" +RDEPEND="" +DEPEND="${RDEPEND} + >=sys-devel/gcc-6.5.0 + >=sys-devel/patch-2.7.6" + +# Specify any patches or patch familes to NOT apply here. +# Use only the 4-digit number followed by a '*'. +P_EXCLUDE="" + +# Machine Support Control Variables +DO_IP22="test" # If "yes", enable IP22 support (SGI Indy, Indigo2 R4x00) +DO_IP27="yes" # IP27 support (SGI Origin) +DO_IP28="no" # IP28 support (SGI Indigo2 Impact R10000) +DO_IP30="yes" # IP30 support (SGI Octane) +DO_IP32="yes" # IP32 support (SGI O2, R5000/RM5200 Only) + +# Machine Stable Version Variables +SV_IP22="" # If set && DO_IP22 == "no", indicates last "good" IP22 version +SV_IP27="" # DO_IP27 == "no", IP27 +SV_IP28="4.19.x" # DO_IP28 == "no", IP28 +SV_IP30="" # DO_IP30 == "no", IP30 +SV_IP32="" # DO_IP32 == "no", IP32 + +DESCRIPTION="Kernel.org sources for MIPS-based machines" +SRC_URI="${KERNEL_URI} + https://dev.gentoo.org/~kumba/distfiles/${PN}-${BASE_KV}-patches-v${GENPATCHREV}.tar.xz" + +#//------------------------------------------------------------------------------ + +err_disabled_mach() { + # Get args + local m_name="${1}" + local m_abbr="${2}" + local m_use="${3}" + local is_test="${4}" + + # Get stable version, if exists + local stable_ver="SV_${m_abbr}" + stable_ver="${!stable_ver}" + + # See if this machine needs a USE passed or skip dying + local has_use + [ ! -z "${m_use}" -a "${m_use}" != "skip" ] && has_use="USE=\"${m_use}\" " + + # Print error && (maybe) die + echo -e "" + if [ "${is_test}" != "test" ]; then + eerror "${m_name} Support has been disabled in this ebuild" + eerror "revision. If you wish to merge ${m_name} sources, then" + eerror "run ${has_use}emerge =mips-sources-${stable_ver}" + [ "${m_use}" != "skip" ] && die "${m_name} Support disabled." + else + ewarn "${m_name} Support has been marked as needing testing in this" + ewarn "ebuild revision. This usually means that any patches to support" + ewarn "${m_name} have been forward ported and maybe even compile-tested," + ewarn "but not yet booted on real hardware, possibly due to a lack of access" + ewarn "to such hardware. If you happen to boot this kernel and have no" + ewarn "problems at all, then please inform the maintainer. Otherwise, if" + ewarn "experience a bug, an oops/panic, or some other oddity, then please" + ewarn "file a bug at bugs.gentoo.org, and assign it to the mips team." + fi + + return 0 +} + +err_only_one_mach_allowed() { + echo -e "" + eerror "A patchset for a specific machine-type has already been selected." + eerror "No other patches for machines-types are permitted. You will need a" + eerror "separate copy of the kernel sources for each different machine-type" + eerror "you want to build a kernel for." + die "Only one machine-type patchset allowed" +} + +pkg_postinst() { + # Symlink /usr/src/linux as appropriate + local my_ksrc="${S##*/}" + for x in {ip27,ip28,ip30}; do + use ${x} && my_ksrc="${my_ksrc}.${x}" + done + + if [ ! -e "${ROOT}usr/src/linux" ]; then + rm -f "${ROOT}usr/src/linux" + ln -sf "${my_ksrc}" "${ROOT}/usr/src/linux" + fi +} + +pkg_setup() { + local arch_is_selected="no" + local m_ip m_enable m_name + + # Exclusive machine patchsets + # These are not allowed to be mixed together, thus only one of them may be applied + # to a tree per merge. + for x in \ + "ip27 SGI Origin 200/2000" \ + "ip28 SGI Indigo2 Impact R10000" \ + "ip30 SGI Octane" + do + set -- ${x} # Set positional params + m_ip="${1}" # Grab the first param (HW IP for SGI) + shift # Shift the positions + m_name="${*}" # Get the rest (Name) + + if use ${m_ip}; then + # Fetch the value indiciating if the machine is enabled or not + m_enable="DO_${m_ip/ip/IP}" + m_enable="${!m_enable}" + + # Make sure only one of these exclusive machine patches is selected + [ "${arch_is_selected}" = "no" ] \ + && arch_is_selected="yes" \ + || err_only_one_mach_allowed + + # Is the machine support disabled or marked as needing testing? + [ "${m_enable}" = "test" ] \ + && err_disabled_mach "${m_name}" "${m_ip/ip/IP}" "${m_ip}" "test" + [ "${m_enable}" = "no" ] \ + && err_disabled_mach "${m_name}" "${m_ip/ip/IP}" "${m_ip}" + + # Show relevant information about the machine + show_${m_ip}_info + fi + done + + # All other systems that don't have a USE flag go here + # These systems have base-line support included in linux-mips git, so + # instead of failing, if disabled, we simply warn the user + if [ "${arch_is_selected}" = "no" ]; then + [ "${DO_IP22}" = "no" ] \ + && err_disabled_mach "SGI Indy/Indigo2 R4x00" "IP22" "skip" \ + || show_ip22_info + [ "${DO_IP32}" = "no" ] \ + && err_disabled_mach "SGI O2" "IP32" "skip" \ + || show_ip32_info + + fi +} + +show_ip22_info() { + echo -e "" + einfo "IP22 systems with an R5000 processor should work with this release." + einfo "The R4x00 series of processors tend to be rather flaky, especially the" + einfo "R4600. If you have to run an R4x00 processor, then try to use an R4400." + einfo "" + einfo "Some Notes:" + einfo "\t- Supported graphics card right now is Newport (XL)." + einfo "\t- A driver for Extreme (XZ) does not exist at present." + echo -e "" +} + +show_ip27_info() { + echo -e "" + ewarn "IP27 Origin 2k/Onyx2 systems may be prone to sudden hard lockups." + ewarn "The exact trigger is unknown at this time." + echo -e "" +} + +show_ip28_info() { + echo -e "" + einfo "Support for the Indigo2 Impact R10000 is now in the mainline kernel. However," + einfo "due to the R10000 Speculative Execution issue that exists with this machine," + einfo "nothing is guaranteed to work correctly. Consider enabling ${HILITE}CONFIG_KALLSYMS${NORMAL}" + einfo "in your kernel so that if the machine Oopes, you'll be able to provide valuable" + einfo "feedback that can be used to trace down the crash." + echo -e "" +} + +show_ip30_info() { + echo -e "" + eerror "Things that DON'T work:" + eerror "\t- Do not use CONFIG_SLUB, otherwise, you'll get errors when booting" + eerror "\t\040\040regarding duplicate /sys/kernel/slab/* entries in sysfs." + eerror "\t- Impact (MGRAS) Xorg driver no longer functions due to severe bitrot." + eerror "\t- Octane is limited to a maximum of 2GB of memory right now due to a" + eerror "\t\040\040hardware quirk in the BRIDGE PCI chip that limits BRIDGE DMA" + eerror "\t\040\040addresses to 31-bits when converted into physical addresses." + eerror "\t\040\040Patches that attempt to fix the issue are highly welcome." + echo -e "" + ewarn "Things that might work, but have problems, or are unknown:" + ewarn "\t- CONFIG_TRANSPARENT_HUGEPAGE should work now, but there may still be" + ewarn "\t\040\040intermittent issues. Additionally, CONFIG_HUGETLBFS must also be" + ewarn "\t\040\040selected for hugepages to work. If use of this feature continues" + ewarn "\t\040\040to trigger random Instruction Bus Errors (IBEs), then it is best to" + ewarn "\t\040\040disable the functionality and perform a cold reset of the machine" + ewarn "\t\040\040after powering it down for at least 30 seconds." + ewarn "\t- Serial support on the Octane uses a very basic UART driver that drives" + ewarn "\t\040\040the 16550A chip on the IOC3 directly. It does not use interrupts," + ewarn "\t\040\040only a polling routine on a timer, which makes it slow and CPU-" + ewarn "\t\040\040intensive. The baud rate is limited to no more than 38.4kbps on" + ewarn "\t\040\040this driver. Patches for getting the Altix IOC3 serial driver to" + ewarn "\t\040\040work (which uses DMA and supports faster baud rates) are welcome." + ewarn "\t- UHCI Cards are known to have issues, but should still function." + ewarn "\t\040\040This issue primarily manifests itself when using pl2303 USB->Serial" + ewarn "\t\040\040adapters." + ewarn "\t- MENET boards appear to have the four ethernet ports detected, however" + ewarn "\t\040\040the six serial ports don't appear to get picked up by the IOC3" + ewarn "\t\040\040UART driver. The NIC part number is also not read correctly" + ewarn "\t\040\040from the four Number-In-a-Cans. Additional testing would be" + ewarn "\t\040\040appreciated and patches welcome." + ewarn "\t- Other XIO-based devices, like various Impact addons, remain untested" + ewarn "\t\040\040and are not guaranteed to work. This applies to various digital" + ewarn "\t\040\040video conversion boards as well." + echo -e "" + einfo "Things that DO work:" + einfo "\t- SMP works again, celebrate!" + einfo "\t- Impact (MGRAS) console only." + einfo "\t- VPro (Odyssey) console only (no X driver exists yet)." + einfo "\t- PCI Card Cages should work for many devices, except certain types like" + einfo "\t\040\040PCI-to-PCI bridges (USB hubs, USB flash card readers for example)." + einfo "\t- SCSI, RTC, basic PCI, IOC3 Ethernet, keyboard, and mouse. Please" + einfo "\t\040\040report any problems with these devices." + echo -e "" +} + +show_ip32_info() { + echo -e "" + einfo "IP32 systems function well, however there are some notes:" + einfo "\t- A sound driver now exists for IP32. Celebrate!" + einfo "\t- Framebuffer console is limited to 4MB. Anything greater" + einfo "\t\040\040specified when building the kernel will likely oops" + einfo "\t\040\040or panic the kernel." + einfo "\t- X support is limited to the generic fbdev driver. No X" + einfo "\t\040\040gbefb driver exists for O2 yet. Feel free to submit" + einfo "\t\040\040patches!" + echo -e "" + + einfo "To Build 64bit kernels for SGI O2 (IP32) or SGI Indy/Indigo2 R4x00 (IP22)" + einfo "systems, you need to use the ${GOOD}vmlinux.32${NORMAL} make target." + einfo "Once done, boot the ${GOOD}vmlinux.32${NORMAL} file (NOT vmlinux)." +} + +src_unpack() { + # Unpack the kernel sources, update to the latest rev (if needed), + # and apply the latest patch from linux-mips git. + kernel-2_src_unpack + + # Unpack the mips-sources patchset to ${WORKDIR}/mips-patches-${BASE_KV}. + echo -e "" + cd "${WORKDIR}" + unpack "${PN}-${BASE_KV}-patches-v${GENPATCHREV}.tar.xz" + + # Create a new folder called 'patch-symlinks' and create symlinks to + # all mips-patches in there. If we want to exclude a patch, we'll + # just delete the symlink instead of the actual patch. + local psym="patch-symlinks" + mkdir "${psym}" + cd "${psym}" + for x in ../mips-patches-${BASE_KV}/*.patch; do + ln -s "${x}" "${x##../mips-patches-*/}" + done + + # With symlinks created, setup the variables referencing external + # machine patches and if a machine USE flag is enabled, then unset + # its corresponding variable. + # See 0000_README for the patch numbers and their meanings. + local p_generic="51*" + local p_ip27="52*" p_ip28="53*" p_ip30="54*" + local p_xp="80*" + use ip27 && unset p_generic p_ip27 + use ip28 && unset p_ip28 + use ip30 && unset p_generic p_ip30 + use experimental && unset p_xp + + # Remove symlinks for any patches that we don't want applied. We + # do this by looping through all the above variables, and deleting + # matching symlinks that point to the corresponding patches. + # The remaining symlinks will be applied to the kernel source. + # + # $P_EXCLUDE is a new var that can be set in an ebuild to exclude + # specific patches by wildcarding the patch number. + local patchlist="${p_generic} ${p_ip27} ${p_ip28} ${p_ip30} ${p_xp} ${P_EXCLUDE}" + for x in $patchlist; + do rm -f "./${x}" + done + + # Rename the source tree to match the linux-mips git checkout date and + # machine type. + local fkv="${F_KV%-*}" + local v="${fkv}" + for x in {ip27,ip28,ip30}; do + use ${x} && v="${v}.${x}" && break + done + + local old="${WORKDIR}/linux-${fkv/_/-}" + local new="${WORKDIR}/linux-${v}" + if [ "${old}" != "${new}" ]; then + mv "${old}" "${new}" || die + fi + S="${new}" + + # Set the EXTRAVERSION to linux-VERSION-mipsgit-GITDATE + EXTRAVERSION="${EXTRAVERSION}-gentoo-mips" + unpack_set_extraversion +} + +src_prepare() { + local psym="patch-symlinks" + + # Now go into the kernel source and patch it. + cd "${S}" + epatch -p1 "${WORKDIR}/${psym}"/*.patch + + eapply_user +} + +#//------------------------------------------------------------------------------ diff --git a/sys-kernel/mips-sources/mips-sources-5.4.99.ebuild b/sys-kernel/mips-sources/mips-sources-5.4.99.ebuild deleted file mode 100644 index 1a6b743ec994..000000000000 --- a/sys-kernel/mips-sources/mips-sources-5.4.99.ebuild +++ /dev/null @@ -1,344 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -# EAPI Version -EAPI="6" - -#//------------------------------------------------------------------------------ - -# Version Data -GENPATCHREV="3" # Tarball revision for patches - -# Directories -S="${WORKDIR}/linux-${OKV}" -MIPS_PATCHES="${WORKDIR}/mips-patches" - -# Kernel-2 Vars -K_SECURITY_UNSUPPORTED="yes" -K_NOUSENAME="yes" -K_NOSETEXTRAVERSION="yes" -K_NOUSEPR="yes" -K_BASE_VER="5.3" -K_FROM_GIT="yes" -ETYPE="sources" - -# Inherit Eclasses -inherit kernel-2 eutils eapi7-ver -detect_version - -# Version Data -F_KV="${PVR}" -BASE_KV="$(ver_cut 1-2)" -[[ "${EXTRAVERSION}" = -rc* ]] && KVE="${EXTRAVERSION}" - -# Portage Vars -HOMEPAGE="https://wiki.gentoo.org/wiki/Project:MIPS" -KEYWORDS="-* ~mips" -IUSE="experimental ip27 ip28 ip30" -RDEPEND="" -DEPEND="${RDEPEND} - >=sys-devel/gcc-6.5.0 - >=sys-devel/patch-2.7.6" - -# Specify any patches or patch familes to NOT apply here. -# Use only the 4-digit number followed by a '*'. -P_EXCLUDE="" - -# Machine Support Control Variables -DO_IP22="test" # If "yes", enable IP22 support (SGI Indy, Indigo2 R4x00) -DO_IP27="yes" # IP27 support (SGI Origin) -DO_IP28="no" # IP28 support (SGI Indigo2 Impact R10000) -DO_IP30="yes" # IP30 support (SGI Octane) -DO_IP32="yes" # IP32 support (SGI O2, R5000/RM5200 Only) - -# Machine Stable Version Variables -SV_IP22="" # If set && DO_IP22 == "no", indicates last "good" IP22 version -SV_IP27="" # DO_IP27 == "no", IP27 -SV_IP28="4.19.x" # DO_IP28 == "no", IP28 -SV_IP30="" # DO_IP30 == "no", IP30 -SV_IP32="" # DO_IP32 == "no", IP32 - -DESCRIPTION="Kernel.org sources for MIPS-based machines" -SRC_URI="${KERNEL_URI} - https://dev.gentoo.org/~kumba/distfiles/${PN}-${BASE_KV}-patches-v${GENPATCHREV}.tar.xz" - -#//------------------------------------------------------------------------------ - -err_disabled_mach() { - # Get args - local m_name="${1}" - local m_abbr="${2}" - local m_use="${3}" - local is_test="${4}" - - # Get stable version, if exists - local stable_ver="SV_${m_abbr}" - stable_ver="${!stable_ver}" - - # See if this machine needs a USE passed or skip dying - local has_use - [ ! -z "${m_use}" -a "${m_use}" != "skip" ] && has_use="USE=\"${m_use}\" " - - # Print error && (maybe) die - echo -e "" - if [ "${is_test}" != "test" ]; then - eerror "${m_name} Support has been disabled in this ebuild" - eerror "revision. If you wish to merge ${m_name} sources, then" - eerror "run ${has_use}emerge =mips-sources-${stable_ver}" - [ "${m_use}" != "skip" ] && die "${m_name} Support disabled." - else - ewarn "${m_name} Support has been marked as needing testing in this" - ewarn "ebuild revision. This usually means that any patches to support" - ewarn "${m_name} have been forward ported and maybe even compile-tested," - ewarn "but not yet booted on real hardware, possibly due to a lack of access" - ewarn "to such hardware. If you happen to boot this kernel and have no" - ewarn "problems at all, then please inform the maintainer. Otherwise, if" - ewarn "experience a bug, an oops/panic, or some other oddity, then please" - ewarn "file a bug at bugs.gentoo.org, and assign it to the mips team." - fi - - return 0 -} - -err_only_one_mach_allowed() { - echo -e "" - eerror "A patchset for a specific machine-type has already been selected." - eerror "No other patches for machines-types are permitted. You will need a" - eerror "separate copy of the kernel sources for each different machine-type" - eerror "you want to build a kernel for." - die "Only one machine-type patchset allowed" -} - -pkg_postinst() { - # Symlink /usr/src/linux as appropriate - local my_ksrc="${S##*/}" - for x in {ip27,ip28,ip30}; do - use ${x} && my_ksrc="${my_ksrc}.${x}" - done - - if [ ! -e "${ROOT}usr/src/linux" ]; then - rm -f "${ROOT}usr/src/linux" - ln -sf "${my_ksrc}" "${ROOT}/usr/src/linux" - fi -} - -pkg_setup() { - local arch_is_selected="no" - local m_ip m_enable m_name - - # Exclusive machine patchsets - # These are not allowed to be mixed together, thus only one of them may be applied - # to a tree per merge. - for x in \ - "ip27 SGI Origin 200/2000" \ - "ip28 SGI Indigo2 Impact R10000" \ - "ip30 SGI Octane" - do - set -- ${x} # Set positional params - m_ip="${1}" # Grab the first param (HW IP for SGI) - shift # Shift the positions - m_name="${*}" # Get the rest (Name) - - if use ${m_ip}; then - # Fetch the value indiciating if the machine is enabled or not - m_enable="DO_${m_ip/ip/IP}" - m_enable="${!m_enable}" - - # Make sure only one of these exclusive machine patches is selected - [ "${arch_is_selected}" = "no" ] \ - && arch_is_selected="yes" \ - || err_only_one_mach_allowed - - # Is the machine support disabled or marked as needing testing? - [ "${m_enable}" = "test" ] \ - && err_disabled_mach "${m_name}" "${m_ip/ip/IP}" "${m_ip}" "test" - [ "${m_enable}" = "no" ] \ - && err_disabled_mach "${m_name}" "${m_ip/ip/IP}" "${m_ip}" - - # Show relevant information about the machine - show_${m_ip}_info - fi - done - - # All other systems that don't have a USE flag go here - # These systems have base-line support included in linux-mips git, so - # instead of failing, if disabled, we simply warn the user - if [ "${arch_is_selected}" = "no" ]; then - [ "${DO_IP22}" = "no" ] \ - && err_disabled_mach "SGI Indy/Indigo2 R4x00" "IP22" "skip" \ - || show_ip22_info - [ "${DO_IP32}" = "no" ] \ - && err_disabled_mach "SGI O2" "IP32" "skip" \ - || show_ip32_info - - fi -} - -show_ip22_info() { - echo -e "" - einfo "IP22 systems with an R5000 processor should work with this release." - einfo "The R4x00 series of processors tend to be rather flaky, especially the" - einfo "R4600. If you have to run an R4x00 processor, then try to use an R4400." - einfo "" - einfo "Some Notes:" - einfo "\t- Supported graphics card right now is Newport (XL)." - einfo "\t- A driver for Extreme (XZ) does not exist at present." - echo -e "" -} - -show_ip27_info() { - echo -e "" - ewarn "IP27 Origin 2k/Onyx2 systems may be prone to sudden hard lockups." - ewarn "The exact trigger is unknown at this time." - echo -e "" -} - -show_ip28_info() { - echo -e "" - einfo "Support for the Indigo2 Impact R10000 is now in the mainline kernel. However," - einfo "due to the R10000 Speculative Execution issue that exists with this machine," - einfo "nothing is guaranteed to work correctly. Consider enabling ${HILITE}CONFIG_KALLSYMS${NORMAL}" - einfo "in your kernel so that if the machine Oopes, you'll be able to provide valuable" - einfo "feedback that can be used to trace down the crash." - echo -e "" -} - -show_ip30_info() { - echo -e "" - eerror "Things that DON'T work:" - eerror "\t- Do not use CONFIG_SLUB, otherwise, you'll get errors when booting" - eerror "\t\040\040regarding duplicate /sys/kernel/slab/* entries in sysfs." - eerror "\t- Impact (MGRAS) Xorg driver no longer functions due to severe bitrot." - eerror "\t- Octane is limited to a maximum of 2GB of memory right now due to a" - eerror "\t\040\040hardware quirk in the BRIDGE PCI chip that limits BRIDGE DMA" - eerror "\t\040\040addresses to 31-bits when converted into physical addresses." - eerror "\t\040\040Patches that attempt to fix the issue are highly welcome." - echo -e "" - ewarn "Things that might work, but have problems, or are unknown:" - ewarn "\t- CONFIG_TRANSPARENT_HUGEPAGE should work now, but there may still be" - ewarn "\t\040\040intermittent issues. Additionally, CONFIG_HUGETLBFS must also be" - ewarn "\t\040\040selected for hugepages to work. If use of this feature continues" - ewarn "\t\040\040to trigger random Instruction Bus Errors (IBEs), then it is best to" - ewarn "\t\040\040disable the functionality and perform a cold reset of the machine" - ewarn "\t\040\040after powering it down for at least 30 seconds." - ewarn "\t- Serial support on the Octane uses a very basic UART driver that drives" - ewarn "\t\040\040the 16550A chip on the IOC3 directly. It does not use interrupts," - ewarn "\t\040\040only a polling routine on a timer, which makes it slow and CPU-" - ewarn "\t\040\040intensive. The baud rate is limited to no more than 38.4kbps on" - ewarn "\t\040\040this driver. Patches for getting the Altix IOC3 serial driver to" - ewarn "\t\040\040work (which uses DMA and supports faster baud rates) are welcome." - ewarn "\t- UHCI Cards are known to have issues, but should still function." - ewarn "\t\040\040This issue primarily manifests itself when using pl2303 USB->Serial" - ewarn "\t\040\040adapters." - ewarn "\t- MENET boards appear to have the four ethernet ports detected, however" - ewarn "\t\040\040the six serial ports don't appear to get picked up by the IOC3" - ewarn "\t\040\040UART driver. The NIC part number is also not read correctly" - ewarn "\t\040\040from the four Number-In-a-Cans. Additional testing would be" - ewarn "\t\040\040appreciated and patches welcome." - ewarn "\t- Other XIO-based devices, like various Impact addons, remain untested" - ewarn "\t\040\040and are not guaranteed to work. This applies to various digital" - ewarn "\t\040\040video conversion boards as well." - echo -e "" - einfo "Things that DO work:" - einfo "\t- SMP works again, celebrate!" - einfo "\t- Impact (MGRAS) console only." - einfo "\t- VPro (Odyssey) console only (no X driver exists yet)." - einfo "\t- PCI Card Cages should work for many devices, except certain types like" - einfo "\t\040\040PCI-to-PCI bridges (USB hubs, USB flash card readers for example)." - einfo "\t- SCSI, RTC, basic PCI, IOC3 Ethernet, keyboard, and mouse. Please" - einfo "\t\040\040report any problems with these devices." - echo -e "" -} - -show_ip32_info() { - echo -e "" - einfo "IP32 systems function well, however there are some notes:" - einfo "\t- A sound driver now exists for IP32. Celebrate!" - einfo "\t- Framebuffer console is limited to 4MB. Anything greater" - einfo "\t\040\040specified when building the kernel will likely oops" - einfo "\t\040\040or panic the kernel." - einfo "\t- X support is limited to the generic fbdev driver. No X" - einfo "\t\040\040gbefb driver exists for O2 yet. Feel free to submit" - einfo "\t\040\040patches!" - echo -e "" - - einfo "To Build 64bit kernels for SGI O2 (IP32) or SGI Indy/Indigo2 R4x00 (IP22)" - einfo "systems, you need to use the ${GOOD}vmlinux.32${NORMAL} make target." - einfo "Once done, boot the ${GOOD}vmlinux.32${NORMAL} file (NOT vmlinux)." -} - -src_unpack() { - # Unpack the kernel sources, update to the latest rev (if needed), - # and apply the latest patch from linux-mips git. - kernel-2_src_unpack - - # Unpack the mips-sources patchset to ${WORKDIR}/mips-patches-${BASE_KV}. - echo -e "" - cd "${WORKDIR}" - unpack "${PN}-${BASE_KV}-patches-v${GENPATCHREV}.tar.xz" - - # Create a new folder called 'patch-symlinks' and create symlinks to - # all mips-patches in there. If we want to exclude a patch, we'll - # just delete the symlink instead of the actual patch. - local psym="patch-symlinks" - mkdir "${psym}" - cd "${psym}" - for x in ../mips-patches-${BASE_KV}/*.patch; do - ln -s "${x}" "${x##../mips-patches-*/}" - done - - # With symlinks created, setup the variables referencing external - # machine patches and if a machine USE flag is enabled, then unset - # its corresponding variable. - # See 0000_README for the patch numbers and their meanings. - local p_generic="51*" - local p_ip27="52*" p_ip28="53*" p_ip30="54*" - local p_xp="80*" - use ip27 && unset p_generic p_ip27 - use ip28 && unset p_ip28 - use ip30 && unset p_generic p_ip30 - use experimental && unset p_xp - - # Remove symlinks for any patches that we don't want applied. We - # do this by looping through all the above variables, and deleting - # matching symlinks that point to the corresponding patches. - # The remaining symlinks will be applied to the kernel source. - # - # $P_EXCLUDE is a new var that can be set in an ebuild to exclude - # specific patches by wildcarding the patch number. - local patchlist="${p_generic} ${p_ip27} ${p_ip28} ${p_ip30} ${p_xp} ${P_EXCLUDE}" - for x in $patchlist; - do rm -f "./${x}" - done - - # Rename the source tree to match the linux-mips git checkout date and - # machine type. - local fkv="${F_KV%-*}" - local v="${fkv}" - for x in {ip27,ip28,ip30}; do - use ${x} && v="${v}.${x}" && break - done - - local old="${WORKDIR}/linux-${fkv/_/-}" - local new="${WORKDIR}/linux-${v}" - if [ "${old}" != "${new}" ]; then - mv "${old}" "${new}" || die - fi - S="${new}" - - # Set the EXTRAVERSION to linux-VERSION-mipsgit-GITDATE - EXTRAVERSION="${EXTRAVERSION}-gentoo-mips" - unpack_set_extraversion -} - -src_prepare() { - local psym="patch-symlinks" - - # Now go into the kernel source and patch it. - cd "${S}" - epatch -p1 "${WORKDIR}/${psym}"/*.patch - - eapply_user -} - -#//------------------------------------------------------------------------------ -- cgit v1.2.3