From fcc5224904648a8e6eb528d7603154160a20022f Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Wed, 2 Feb 2022 01:39:05 +0000 Subject: gentoo resync : 02.02.2022 --- sys-kernel/mips-sources/Manifest | 14 +- .../mips-sources/mips-sources-4.14.256.ebuild | 352 --------------------- .../mips-sources/mips-sources-4.14.263.ebuild | 352 +++++++++++++++++++++ .../mips-sources/mips-sources-4.19.219.ebuild | 347 -------------------- .../mips-sources/mips-sources-4.19.226.ebuild | 347 ++++++++++++++++++++ .../mips-sources/mips-sources-5.4.163.ebuild | 344 -------------------- .../mips-sources/mips-sources-5.4.174.ebuild | 344 ++++++++++++++++++++ 7 files changed, 1050 insertions(+), 1050 deletions(-) delete mode 100644 sys-kernel/mips-sources/mips-sources-4.14.256.ebuild create mode 100644 sys-kernel/mips-sources/mips-sources-4.14.263.ebuild delete mode 100644 sys-kernel/mips-sources/mips-sources-4.19.219.ebuild create mode 100644 sys-kernel/mips-sources/mips-sources-4.19.226.ebuild delete mode 100644 sys-kernel/mips-sources/mips-sources-5.4.163.ebuild create mode 100644 sys-kernel/mips-sources/mips-sources-5.4.174.ebuild (limited to 'sys-kernel/mips-sources') diff --git a/sys-kernel/mips-sources/Manifest b/sys-kernel/mips-sources/Manifest index ced512e9c951..500c49afd432 100644 --- a/sys-kernel/mips-sources/Manifest +++ b/sys-kernel/mips-sources/Manifest @@ -3,12 +3,12 @@ DIST linux-4.19.tar.xz 103117552 BLAKE2B 1dbf16cf410867412d17568fe42bc1e90c03418 DIST linux-5.4.tar.xz 109441440 BLAKE2B 193bc4a3147e147d5529956164ec4912fad5d5c6fb07f909ff1056e57235834173194afc686993ccd785c1ff15804de0961b625f3008cca0e27493efc8f27b13 SHA512 9f60f77e8ab972b9438ac648bed17551c8491d6585a5e85f694b2eaa4c623fbc61eb18419b2656b6795eac5deec0edaa04547fc6723fbda52256bd7f3486898f DIST mips-sources-4.14.0-patches-v3.tar.xz 287468 BLAKE2B 24212e2d6ca784986d0e3ec22ed2e13a911cbc67699878f2e013c26bc4623d846d969dcfdda6e1bc8dc60d5ddff3cadb94decb7b5386c575f618b819296dc4aa SHA512 9a5e5bfec358edeb28ad067cb5fa8ec4acde7b0aa9ea80ba1e6696be90a58e11f9cc47aba195d78657e8d0e216ad63157e6327f58c16e2f0ed79e84f34e34d32 DIST mips-sources-4.19.0-patches-v3.tar.xz 289136 BLAKE2B 9c77c641d4c4603983c0bc11cba5d83337c7373f67bc5870b8b02d6d4a537c8c02f21fe47fd64f13c5e10d37100654857d0b598be6d8c429f5fe1d7332b6b6bd SHA512 7199a20f20f9d0a4eae38279335d8c9da20940fb37f0ba38cb6b68fdd5c9d4d2e2b65efff5383065e685c0fb5ad639c6d79d74989a5b4200b987f175de7da422 -DIST mips-sources-5.4-patches-v6.tar.xz 197884 BLAKE2B 08dad7c3d7ba3d04afe5a39dd0e0930894c124beebecfaa66aab6f42f3151f5271186e6735cd19344e05ea10faf11461290f62667d12379660734a63828c595a SHA512 472f44d1e212ca0bfae896dcf3ec45bbeb47fe1aa49b80060c2d0b7347b065ce8354e6b8ad009d7b5e2923d4072a9a93acf9ecbcc56575195ad5b60bef1af12e +DIST mips-sources-5.4-patches-v7.tar.xz 198300 BLAKE2B c3b6823abda9bc60b81cf12eefabf0a987993894f2bd8ef56244af863e9e0c26bb2ba759d3b9fe90d13ffe0f60972186905be0e709aec03e0f61bc3a3ae870a0 SHA512 07f5091b78d0a5de10898a6552f96ee131e0c41276a8de1e93bc6edee2fdbc1d64baf9b87772021c58fb3e3e9b67497b008361ed79918735062e1d9c13693409 DIST mipsgit-4.14.0-20180128.diff.xz 1008 BLAKE2B 2a317ff97aab096883680c6b653e993aee31994e6caec52c52dfbbb61f1dc1f25d03ebd3182fa122923a67aeee0aa598b36e603692333e4c9ccdc741fd456d96 SHA512 378deb1bc1d10a6b4912e5e4a0d6fcab28952e2e59c35fc879601841cf8160081b318a2598ef74db225e95f0f26483f6b9a56a348811b1ee7b8934391dd271ae -DIST patch-4.14.256.xz 4525004 BLAKE2B c35a6ebee7ea0feb96bf5750727cd41a0ff657faac4cd11594728e856403fc4d951493dbf5f49ab3d2f298d13034d81bf79bb165ba81266ad347aff4d2eb38ff SHA512 21c31f6e22e3e7ac384b98bddf27756788b86424739a94db9d1e1156a336e6ab29cc044a0b67759ff61cc138bc304adadc786c64f31fd25a33b981de04024a19 -DIST patch-4.19.219.xz 4376592 BLAKE2B 69a72e35c25354f9d44123d520a48344004376401a91cf1edee8b8c6943d46dcf9d0b619428751da0698a4d6d186b780cbec4b45f1e855916f34743474caa0b4 SHA512 bc6a2e532005cefb2334b0c2a0fe94a44dd5e7f15570004170126fd8d5bcc905402c0429a93e3d6ad03e24daf5f0e684a9db936b1169959b094f548bb9fd3f03 -DIST patch-5.4.163.xz 3555508 BLAKE2B 27003251a960888746e6d55449cd44eeaf7534b917ab1db293f2fb6e3d5a1a59167571d9024350db33606b5227b095b01c0233fd1f8f69db6ad2760e7c878111 SHA512 0796750b579616b194d2bdf1d2ed4953bd685d6ea7d9899ae39cfd705f006a473ae4f798c527e8e7dd79ef28c67f9df6317818c201d2cff25a177d211ff3e732 -EBUILD mips-sources-4.14.256.ebuild 13016 BLAKE2B a864230a2c9b4dfc94d22779ed54fddaa25362aec1d81e7dcc3dca53cc2ac20d925e50a8d9b63315751c5b92c09eb5fa341bad84306c9e92e170068f2cdd3aa2 SHA512 e5e4891f0cf247943173126a820536d4d71216f951e894861da2afc9af917a24ab6555ffce07f06df93c00ed2e1559ac34ca774ceafd86b400e6bef086d080be -EBUILD mips-sources-4.19.219.ebuild 12725 BLAKE2B 0f3ff9d4160d0da3d7aa4b9f62b66104fdae2fc32ed56963202cb9303449a44d6fa4e427b8310b34242f02e16c857b36ebd0a0aca501c28fc77f476216ee54e5 SHA512 da902e69cf09f57a51a2d79bfdf60293fe48fbfe1d7ae493c842ba1b347181bcb553517eb6302f943bd6be602cfd4d6407323a70f0ec59e99dd4652f879aef06 -EBUILD mips-sources-5.4.163.ebuild 12413 BLAKE2B 2280f669d0ea3a1a03af1ee13782d1b1991fe2f4f346177b754e588c25cca67cf57b066e191178dd2e3734767201bccee71aa536a339055bc4e05e4f6f3c6c43 SHA512 df7c462e36dd50ac286dda5c8ccfe57135334ce02ba570b9ea0e78779313c6f6a430aada383794047e847a83a33ead9e6895fb8cf5a1896472049f94fbc42726 +DIST patch-4.14.263.xz 4607712 BLAKE2B 254a70c96bed9e72a2cad76a1ca10b8353f4abeac28e81f9a17581fcd5818b827d050dc445f7dc4c3826280850edc3d09b8695160cf49e2f76e0ba1492bcd406 SHA512 ee3a30d8c30d402b3b6901fe817368223cb30cee17608ca810fff95e95ee56d86fbf1ca554c18a96386235a224810859b536a2ace8352f4924c9864ca56a6aac +DIST patch-4.19.226.xz 4467320 BLAKE2B d1461dd5ef6b30a49c7cf85fcbab5556bb15b4c35c1b0a4365263ab6aeb780b0db1d06024c17b23071872e73a0a245825072046f700da5e18cd344ab88bc9d73 SHA512 4ed3f9d90e69c880fc58300376236781eb2334045ca8e6c2f13bb37803f78ba756000fb528319cb1993ac4b0e0c9b0888a7818ad69ef8ffba18df0a78dad445b +DIST patch-5.4.174.xz 3683224 BLAKE2B 17b01c3e2c916c2b73cd67ee1c40c03a8f47e27a9a7ce8f00abcbd60d78b193b0cc02b819bef13d2f13632b1911da9496fcd842ee4114340a4fa26b6886e34f6 SHA512 f20d53b880e59064663f6bfb0694da3f99451127be0a56cb31af0a8b6eacb882dd60ce5c7ea84ac6ca3bc1c5ef07e858bd1cf8fc2999ecaad111bfeed0efcd4e +EBUILD mips-sources-4.14.263.ebuild 13016 BLAKE2B 01dbeb15603ee534cd4fab7b053a86fcb391f6639a1d268044dde8aa856fc5b5b618494af3db8fd7b5e4207c5f8836ebad6011fcfaf6f01c684e35e631366c5b SHA512 81cbf9a416bb29571c14a5c87ed8a9cc09d14e1d468eb4774f0589d890994a1984978fcf5a2ebdbdbf8868c55d0a8b98ccc2b34cae7c6bd3a9dee167649c3e26 +EBUILD mips-sources-4.19.226.ebuild 12725 BLAKE2B f9164b2989e2354135413d77a42488db5bdb859d5eea567760a3677a6e0245eb064e6675ae4ea67bfa83e34f7df0346bb9a4d650573b4e110cc591a1c942ed32 SHA512 5c8508412b085e052c782cd1665fa596b8e8ff41bedb5c90ddc9223779c53e99365c6721949e898e976f72cc301c148872cb17724ab3a4c7c002c1d2f4c025ce +EBUILD mips-sources-5.4.174.ebuild 12413 BLAKE2B dd0f30dbb26ab18c1e7e6d3d30fcedaca7fb9db7274ce554c8ac4129934fbc81ddd687a659ae012daebb0aacb527b6f9648946571d65c70c50eead159c8c1979 SHA512 50a5d1d16b4fe6e28c5bd16c92e959a46f385e6d6d21ef22a52a82d3c16825224d7f3ec5454b7e5a6d23ce1c459f1de7d402381e8cee665b77ea17c20d25d834 MISC metadata.xml 897 BLAKE2B 836b1277cc304353bdac34699a75ca60d197033e8b21e049ba1afc1e36da62e24fbe736a0ed2504018216ee4262e7cf03c4c111e663257c646c2072ebe5ed4a3 SHA512 d497f642033e08b212ed038ff294162f4a1f5032bf91d2f78f2f05fa1c5a3c7e33cd29db6195898485bfdbfa5095cb840692de7a9f2c00d2e2fb39741934e76d diff --git a/sys-kernel/mips-sources/mips-sources-4.14.256.ebuild b/sys-kernel/mips-sources/mips-sources-4.14.256.ebuild deleted file mode 100644 index 0db2aa7260a7..000000000000 --- a/sys-kernel/mips-sources/mips-sources-4.14.256.ebuild +++ /dev/null @@ -1,352 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -# EAPI Version -EAPI="8" - -#//------------------------------------------------------------------------------ - -# Version Data -GITDATE="20180128" # Date of diff between kernel.org and lmo GIT -GENPATCHREV="3" # 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 -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 symlink" - -# 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 - [[ "${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" -} - -fkv_to_machtype() { - # For any machines that use external patches, we rename the source - # tree to match the machine type. - local fkv="${F_KV%-*}" - local v="${fkv}" - for x in {ip27,ip28,ip30}; do - use ${x} && v="${v}.${x}" && break - done - - echo "${v}" -} - -pkg_postinst() { - if ! use symlink; then - return 0 - fi - - local kern_sym="/usr/src/linux" - - # Check that /usr/src/linux is safe to overwrite - if [[ -e "${kern_sym}" && ! -L "${kern_sym}" ]]; then - die "${kern_sym} already exists, but is not a symbolic link" - fi - - # Symlink /usr/src/linux as appropriate - local kern_ver=$(fkv_to_machtype) - ln -snf "linux-${kern_ver}" "${kern_sym}" -} - -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 - continue - fi - - # 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? - case "${m_enable}" in - "test") err_disabled_mach "${m_name}" "${m_ip/ip/IP}" "${m_ip}" "test" ;; - "no") err_disabled_mach "${m_name}" "${m_ip/ip/IP}" "${m_ip}" ;; - esac - - # Show relevant information about the machine - show_${m_ip}_info - 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. - mkdir patch-symlinks - cd patch-symlinks - 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, if needed. - local old="${WORKDIR}/linux-${F_KV%-*/_/-}" - local new="${WORKDIR}/linux-$(fkv_to_machtype)" - if [[ "${old}" != "${new}" ]]; then - mv "${old}" "${new}" || die - fi - S="${new}" - - # Set the EXTRAVERSION to linux-VERSION-mipsgit-GITDATE - EXTRAVERSION="${EXTRAVERSION}-mipsgit-${GITDATE}" - unpack_set_extraversion -} - -src_prepare() { - # Apply patches to the kernel tree. - eapply "${WORKDIR}/patch-symlinks"/ - - eapply_user -} diff --git a/sys-kernel/mips-sources/mips-sources-4.14.263.ebuild b/sys-kernel/mips-sources/mips-sources-4.14.263.ebuild new file mode 100644 index 000000000000..f6d735a1d856 --- /dev/null +++ b/sys-kernel/mips-sources/mips-sources-4.14.263.ebuild @@ -0,0 +1,352 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# EAPI Version +EAPI="8" + +#//------------------------------------------------------------------------------ + +# Version Data +GITDATE="20180128" # Date of diff between kernel.org and lmo GIT +GENPATCHREV="3" # 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 +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 symlink" + +# 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 + [[ "${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" +} + +fkv_to_machtype() { + # For any machines that use external patches, we rename the source + # tree to match the machine type. + local fkv="${F_KV%-*}" + local v="${fkv}" + for x in {ip27,ip28,ip30}; do + use ${x} && v="${v}.${x}" && break + done + + echo "${v}" +} + +pkg_postinst() { + if ! use symlink; then + return 0 + fi + + local kern_sym="/usr/src/linux" + + # Check that /usr/src/linux is safe to overwrite + if [[ -e "${kern_sym}" && ! -L "${kern_sym}" ]]; then + die "${kern_sym} already exists, but is not a symbolic link" + fi + + # Symlink /usr/src/linux as appropriate + local kern_ver=$(fkv_to_machtype) + ln -snf "linux-${kern_ver}" "${kern_sym}" +} + +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 + continue + fi + + # 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? + case "${m_enable}" in + "test") err_disabled_mach "${m_name}" "${m_ip/ip/IP}" "${m_ip}" "test" ;; + "no") err_disabled_mach "${m_name}" "${m_ip/ip/IP}" "${m_ip}" ;; + esac + + # Show relevant information about the machine + show_${m_ip}_info + 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. + mkdir patch-symlinks + cd patch-symlinks + 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, if needed. + local old="${WORKDIR}/linux-${F_KV%-*/_/-}" + local new="${WORKDIR}/linux-$(fkv_to_machtype)" + if [[ "${old}" != "${new}" ]]; then + mv "${old}" "${new}" || die + fi + S="${new}" + + # Set the EXTRAVERSION to linux-VERSION-mipsgit-GITDATE + EXTRAVERSION="${EXTRAVERSION}-mipsgit-${GITDATE}" + unpack_set_extraversion +} + +src_prepare() { + # Apply patches to the kernel tree. + eapply "${WORKDIR}/patch-symlinks"/ + + eapply_user +} diff --git a/sys-kernel/mips-sources/mips-sources-4.19.219.ebuild b/sys-kernel/mips-sources/mips-sources-4.19.219.ebuild deleted file mode 100644 index 4a6e74a5e687..000000000000 --- a/sys-kernel/mips-sources/mips-sources-4.19.219.ebuild +++ /dev/null @@ -1,347 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -# EAPI Version -EAPI="8" - -#//------------------------------------------------------------------------------ - -# 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="4.18" -K_FROM_GIT="yes" -ETYPE="sources" - -# Inherit Eclasses -inherit kernel-2 -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 symlink" - -# 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 - [[ "${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" -} - -fkv_to_machtype() { - # For any machines that use external patches, we rename the source - # tree to match the machine type. - local fkv="${F_KV%-*}" - local v="${fkv}" - for x in {ip27,ip28,ip30}; do - use ${x} && v="${v}.${x}" && break - done - - echo "${v}" -} - -pkg_postinst() { - if ! use symlink; then - return 0 - fi - - local kern_sym="/usr/src/linux" - - # Check that /usr/src/linux is safe to overwrite - if [[ -e "${kern_sym}" && ! -L "${kern_sym}" ]]; then - die "${kern_sym} already exists, but is not a symbolic link" - fi - - # Symlink /usr/src/linux as appropriate - local kern_ver=$(fkv_to_machtype) - ln -snf "linux-${kern_ver}" "${kern_sym}" -} - -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 - continue - fi - - # 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? - case "${m_enable}" in - "test") err_disabled_mach "${m_name}" "${m_ip/ip/IP}" "${m_ip}" "test" ;; - "no") err_disabled_mach "${m_name}" "${m_ip/ip/IP}" "${m_ip}" ;; - esac - - # Show relevant information about the machine - show_${m_ip}_info - 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. - mkdir patch-symlinks - cd patch-symlinks - 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, if needed. - local old="${WORKDIR}/linux-${F_KV%-*/_/-}" - local new="${WORKDIR}/linux-$(fkv_to_machtype)" - 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() { - # Apply patches to the kernel tree. - eapply "${WORKDIR}/patch-symlinks"/ - - eapply_user -} diff --git a/sys-kernel/mips-sources/mips-sources-4.19.226.ebuild b/sys-kernel/mips-sources/mips-sources-4.19.226.ebuild new file mode 100644 index 000000000000..4a5ac6447052 --- /dev/null +++ b/sys-kernel/mips-sources/mips-sources-4.19.226.ebuild @@ -0,0 +1,347 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# EAPI Version +EAPI="8" + +#//------------------------------------------------------------------------------ + +# 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="4.18" +K_FROM_GIT="yes" +ETYPE="sources" + +# Inherit Eclasses +inherit kernel-2 +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 symlink" + +# 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 + [[ "${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" +} + +fkv_to_machtype() { + # For any machines that use external patches, we rename the source + # tree to match the machine type. + local fkv="${F_KV%-*}" + local v="${fkv}" + for x in {ip27,ip28,ip30}; do + use ${x} && v="${v}.${x}" && break + done + + echo "${v}" +} + +pkg_postinst() { + if ! use symlink; then + return 0 + fi + + local kern_sym="/usr/src/linux" + + # Check that /usr/src/linux is safe to overwrite + if [[ -e "${kern_sym}" && ! -L "${kern_sym}" ]]; then + die "${kern_sym} already exists, but is not a symbolic link" + fi + + # Symlink /usr/src/linux as appropriate + local kern_ver=$(fkv_to_machtype) + ln -snf "linux-${kern_ver}" "${kern_sym}" +} + +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 + continue + fi + + # 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? + case "${m_enable}" in + "test") err_disabled_mach "${m_name}" "${m_ip/ip/IP}" "${m_ip}" "test" ;; + "no") err_disabled_mach "${m_name}" "${m_ip/ip/IP}" "${m_ip}" ;; + esac + + # Show relevant information about the machine + show_${m_ip}_info + 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. + mkdir patch-symlinks + cd patch-symlinks + 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, if needed. + local old="${WORKDIR}/linux-${F_KV%-*/_/-}" + local new="${WORKDIR}/linux-$(fkv_to_machtype)" + 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() { + # Apply patches to the kernel tree. + eapply "${WORKDIR}/patch-symlinks"/ + + eapply_user +} diff --git a/sys-kernel/mips-sources/mips-sources-5.4.163.ebuild b/sys-kernel/mips-sources/mips-sources-5.4.163.ebuild deleted file mode 100644 index 2d6925802846..000000000000 --- a/sys-kernel/mips-sources/mips-sources-5.4.163.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="8" - -#//------------------------------------------------------------------------------ - -# Version Data -GENPATCHREV="6" # 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 -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 symlink" - -# 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 - [[ "${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" -} - -fkv_to_machtype() { - # For any machines that use external patches, we rename the source - # tree to match the machine type. - local fkv="${F_KV%-*}" - local v="${fkv}" - for x in {ip27,ip28,ip30}; do - use ${x} && v="${v}.${x}" && break - done - - echo "${v}" -} - -pkg_postinst() { - if ! use symlink; then - return 0 - fi - - local kern_sym="/usr/src/linux" - - # Check that /usr/src/linux is safe to overwrite - if [[ -e "${kern_sym}" && ! -L "${kern_sym}" ]]; then - die "${kern_sym} already exists, but is not a symbolic link" - fi - - # Symlink /usr/src/linux as appropriate - local kern_ver=$(fkv_to_machtype) - ln -snf "linux-${kern_ver}" "${kern_sym}" -} - -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 - continue - fi - - # 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? - case "${m_enable}" in - "test") err_disabled_mach "${m_name}" "${m_ip/ip/IP}" "${m_ip}" "test" ;; - "no") err_disabled_mach "${m_name}" "${m_ip/ip/IP}" "${m_ip}" ;; - esac - - # Show relevant information about the machine - show_${m_ip}_info - 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- The only supported graphics card right is Newport (XL)." - einfo "\t- There is no driver for Extreme (XZ)." - 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." - echo -e "" - ewarn "Things that might work, but have problems, or are unknown:" - 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- 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." - ewarn "\t- Other XIO-based devices, like various Impact addons, remain untested" - ewarn "\t\040\040and are not guaranteed to work." - ewarn "\t- Upon rebooting, Octane may not return to the PROM. Holding down the" - ewarn "\t\040\040reset button for up to ten seconds, releasing, then pressing it" - ewarn "\t\040\040again for one or two seconds may trigger the system to return" - ewarn "\t\040\040to the PROM. Please wait at least five seconds after each attempt" - ewarn "\t\040\040to see if the machine responds. As a last resort, unplugging the" - ewarn "\t\040\040power cord for 30 seconds will also work, but be aware the power" - ewarn "\t\040\040supplies on these systems will not appreciate this due to their" - ewarn "\t\040\040relative old age." - echo -e "" - einfo "Things that DO work:" - einfo "\t- SMP support." - einfo "\t- Impact (MGRAS), console only." - einfo "\t- VPro (Odyssey), console only." - einfo "\t- PCI card cages (showbox) should work for many devices, except certain" - einfo "\t\040\040types such as PCI-to-PCI bridges (USB hubs, USB flash card readers)." - einfo "\t- SCSI, RTC, basic PCI, IOC3 Ethernet, keyboard, and mouse. Please" - einfo "\t\040\040report any problems with these devices." - einfo "\t- SGI AceNIC/Tigon II gigabit cards will work in the PCI card cage/shoebox." - 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." - einfo "\t- Framebuffer console is limited to 4MB. Anything greater" - einfo "\t\040\040specified when building the kernel will oops or" - einfo "\t\040\040panic the kernel." - echo -e "" - eerror "IP32 Systems may be unstable and prone to lockups under a 5.4.x LTS kernel." - eerror "The cause is unknown at this time." - 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. - mkdir patch-symlinks - cd patch-symlinks - 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, if needed. - local old="${WORKDIR}/linux-${F_KV%-*/_/-}" - local new="${WORKDIR}/linux-$(fkv_to_machtype)" - 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() { - # Apply patches to the kernel tree. - eapply "${WORKDIR}/patch-symlinks"/ - - eapply_user -} diff --git a/sys-kernel/mips-sources/mips-sources-5.4.174.ebuild b/sys-kernel/mips-sources/mips-sources-5.4.174.ebuild new file mode 100644 index 000000000000..a5221ea90099 --- /dev/null +++ b/sys-kernel/mips-sources/mips-sources-5.4.174.ebuild @@ -0,0 +1,344 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# EAPI Version +EAPI="8" + +#//------------------------------------------------------------------------------ + +# Version Data +GENPATCHREV="7" # 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 +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 symlink" + +# 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 + [[ "${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" +} + +fkv_to_machtype() { + # For any machines that use external patches, we rename the source + # tree to match the machine type. + local fkv="${F_KV%-*}" + local v="${fkv}" + for x in {ip27,ip28,ip30}; do + use ${x} && v="${v}.${x}" && break + done + + echo "${v}" +} + +pkg_postinst() { + if ! use symlink; then + return 0 + fi + + local kern_sym="/usr/src/linux" + + # Check that /usr/src/linux is safe to overwrite + if [[ -e "${kern_sym}" && ! -L "${kern_sym}" ]]; then + die "${kern_sym} already exists, but is not a symbolic link" + fi + + # Symlink /usr/src/linux as appropriate + local kern_ver=$(fkv_to_machtype) + ln -snf "linux-${kern_ver}" "${kern_sym}" +} + +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 + continue + fi + + # 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? + case "${m_enable}" in + "test") err_disabled_mach "${m_name}" "${m_ip/ip/IP}" "${m_ip}" "test" ;; + "no") err_disabled_mach "${m_name}" "${m_ip/ip/IP}" "${m_ip}" ;; + esac + + # Show relevant information about the machine + show_${m_ip}_info + 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- The only supported graphics card right is Newport (XL)." + einfo "\t- There is no driver for Extreme (XZ)." + 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." + echo -e "" + ewarn "Things that might work, but have problems, or are unknown:" + 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- 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." + ewarn "\t- Other XIO-based devices, like various Impact addons, remain untested" + ewarn "\t\040\040and are not guaranteed to work." + ewarn "\t- Upon rebooting, Octane may not return to the PROM. Holding down the" + ewarn "\t\040\040reset button for up to ten seconds, releasing, then pressing it" + ewarn "\t\040\040again for one or two seconds may trigger the system to return" + ewarn "\t\040\040to the PROM. Please wait at least five seconds after each attempt" + ewarn "\t\040\040to see if the machine responds. As a last resort, unplugging the" + ewarn "\t\040\040power cord for 30 seconds will also work, but be aware the power" + ewarn "\t\040\040supplies on these systems will not appreciate this due to their" + ewarn "\t\040\040relative old age." + echo -e "" + einfo "Things that DO work:" + einfo "\t- SMP support." + einfo "\t- Impact (MGRAS), console only." + einfo "\t- VPro (Odyssey), console only." + einfo "\t- PCI card cages (showbox) should work for many devices, except certain" + einfo "\t\040\040types such as PCI-to-PCI bridges (USB hubs, USB flash card readers)." + einfo "\t- SCSI, RTC, basic PCI, IOC3 Ethernet, keyboard, and mouse. Please" + einfo "\t\040\040report any problems with these devices." + einfo "\t- SGI AceNIC/Tigon II gigabit cards will work in the PCI card cage/shoebox." + 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." + einfo "\t- Framebuffer console is limited to 4MB. Anything greater" + einfo "\t\040\040specified when building the kernel will oops or" + einfo "\t\040\040panic the kernel." + echo -e "" + eerror "IP32 Systems may be unstable and prone to lockups under a 5.4.x LTS kernel." + eerror "The cause is unknown at this time." + 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. + mkdir patch-symlinks + cd patch-symlinks + 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, if needed. + local old="${WORKDIR}/linux-${F_KV%-*/_/-}" + local new="${WORKDIR}/linux-$(fkv_to_machtype)" + 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() { + # Apply patches to the kernel tree. + eapply "${WORKDIR}/patch-symlinks"/ + + eapply_user +} -- cgit v1.2.3