From 129160ec854dca4c3fedb5bcfbcb56930371da0f Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Fri, 1 Jan 2021 21:06:00 +0000 Subject: gentoo new year resync : 01.01.2021 --- sys-kernel/mips-sources/Manifest | 14 +- .../mips-sources/mips-sources-4.14.206.ebuild | 346 --------------------- .../mips-sources/mips-sources-4.14.213.ebuild | 346 +++++++++++++++++++++ .../mips-sources/mips-sources-4.19.157.ebuild | 344 -------------------- .../mips-sources/mips-sources-4.19.163.ebuild | 344 ++++++++++++++++++++ sys-kernel/mips-sources/mips-sources-5.4.77.ebuild | 344 -------------------- sys-kernel/mips-sources/mips-sources-5.4.85.ebuild | 344 ++++++++++++++++++++ 7 files changed, 1041 insertions(+), 1041 deletions(-) delete mode 100644 sys-kernel/mips-sources/mips-sources-4.14.206.ebuild create mode 100644 sys-kernel/mips-sources/mips-sources-4.14.213.ebuild delete mode 100644 sys-kernel/mips-sources/mips-sources-4.19.157.ebuild create mode 100644 sys-kernel/mips-sources/mips-sources-4.19.163.ebuild delete mode 100644 sys-kernel/mips-sources/mips-sources-5.4.77.ebuild create mode 100644 sys-kernel/mips-sources/mips-sources-5.4.85.ebuild (limited to 'sys-kernel/mips-sources') diff --git a/sys-kernel/mips-sources/Manifest b/sys-kernel/mips-sources/Manifest index b28c7dcf5f1d..0cfb709f402e 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-v2.tar.xz 287560 BLAKE2B 9fb6b07dcb0336be95c86346e13f68877e891a2c97084ce798e3c39cf57a71832ae4ae5b74a0f60ab6f26ed8f08a35fc3704b34361a8426136055d6fb700dac9 SHA512 e163ed8cdef9a027b55794b168fb4dac77dc871c209463ac8344ef932757d48ce39f44af4ba7312ee27ce04b175a3ea2f6eaa8a7929d6beebcbaa3de4a764cd6 DIST mips-sources-4.19.0-patches-v2.tar.xz 289940 BLAKE2B ffca5540cbd663ed3eab3f748dec7727ca6f1abe11ce107fe1780b8191175b77d8c59f70d5e9254f01c43d507f805f081f15bd150f66da1d11e2a91715dcb038 SHA512 c67ac8c6f041a96348a5a6023919fc5586b70b6c3aa52777945d5f1a831e6bd24d867c0318034cf304a3c8f4c6ff0d2af3611b3ad2bc476f3bf3762d39a215f8 -DIST mips-sources-5.4-patches-v1.tar.xz 194672 BLAKE2B 4ad0a5dea0b048dcae34b5e17cc89a0f33d6c7b652a3f5089225b6598bb50f4aff6e66a4d25361d30faead9603a012c2e330b15d6774776d115191dc743d5b1c SHA512 aa70d0cf93d86ad0c7b5fca1a75d6880a7bb99d1790337304575728838cb4fdb85baf102620bae0d2ceccaf253f0757f1e2038a9257354fc359919162ebe2997 +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.206.xz 3995304 BLAKE2B 28b9577ee7bb1f0e935482023ea660f788f0aabbe0e3be743075cdfa4fe263c1d1c50e99a7f7a27fd670820756c5a8c60667a1687666a4b29df790dc37360481 SHA512 5382e138db14e9c6e053ac76ae3d3ce6114ebaf4d0b0588a297bcd358be8c60df35535cf97ac0ae62e9f58673a3ad3fd07de5c2ffb6f0a638624f05cea209bc6 -DIST patch-4.19.157.xz 3601120 BLAKE2B 60cef4a4e72a27278818341ab73e460d7f7340ba7c0e49034484fd196abea0e201e2fad1c08ba7ae9a9629b24c71f95d870322edc3e0f8eac404257eb97e9208 SHA512 d25a416316c7e39fa41213bb47d0d28ede99b6814b02b7ea3fd6872db4386129567c1e5bffc4e20454656e48cd3416d9582f7351c38208f4bd3a31c7c6883907 -DIST patch-5.4.77.xz 2312664 BLAKE2B c90792768d1b8f0c8c191aa27f424664c3fcbcd25ef9898d6f82d8e3bb4c4d768182da5f57dd5ca67a1652afb4912656a5345598d4cc1a3386cdb7060ee94cbb SHA512 8e75b73b9f7b0dad4e767119fe55820784d5a73cce947860273e3bbf69ab9ee6ea9b71cb0cd5734ac3657d8d927063ef4ab4f75202010f625e9d26c9bf491510 -EBUILD mips-sources-4.14.206.ebuild 13188 BLAKE2B 8c8cba859d3b824c6af29707793769f26fa1327dd0e93000c33991a4a718df55179df19fc9446308e0f6672709168fbac425f3e4807c7dec1bdc3e9a9c22eae8 SHA512 4514b89fe739c6b068b56735ff081b69fbc1eac9be9a08278d787e0fa96ab621c017045245605cec310d806afdff7fe7a5effda6e0a6f46fddade9564bb55d32 -EBUILD mips-sources-4.19.157.ebuild 12785 BLAKE2B 00f38b2ab504e7bb13ea6577fc5f636f6c1577b8d8de67a7a19b925da44ccea9c1d86d65270ca6ca34d77cfa0f0a423f714c92424967ef7995ebc536cfc690e0 SHA512 f5dc604700f5867944a10ea6bcba7e1752d8e8af10a3b8f56828f40d085b90a54452c02827f6438d61637827ed2adf3a5f31185ea5eb1ab4ccab7f108f40a656 -EBUILD mips-sources-5.4.77.ebuild 12785 BLAKE2B 12ee45e51f6d9ce625c136d578b0e4804b18b7232f77977c18ebeeef105245579a1e2709c29c2ab7ad066ea523d27a7487f15fd7b52d7c9e3ae79541b216d7d1 SHA512 5f6ca7089cbd59480717cb1863c16c91d3f5cab011905d84477892ad357061fbc8752f270d38ab958223a79039e74754b6aa625929fae463ea17dab39538eaa2 +DIST patch-4.14.213.xz 4083152 BLAKE2B d99d56454b23101cfe0fdbaa9284d1d000d29f73d782783a71b27ec57fd2a19ddeaa24702bb072566d222e3b554c8719b1025cefc243dd1c826793671865cb4b SHA512 dd5cabd8f2422d642bd953e398b2b3fbc11456f8f3ab7846713e27d0339c85e93cd97ce436986b3d6518c4a3e9f8449d9a53e1c6215273cb2b56688adcf2e075 +DIST patch-4.19.163.xz 3661280 BLAKE2B 182cdeec98f3c4a5ec057e3f286f8019ff5cc22d23863a08b820aeb8404fd34afae913c0bdb06c4d4f571c9146cd13778eedba840e2920f9af2348c5c38fad12 SHA512 6302649e09aae6e35d7963de5dbe4edf9e9fe5439e67188bd604929752853e5e57e31c140e76db87f2cf79345ca254e4b9a893489942c87159aea62746e10663 +DIST patch-5.4.85.xz 2424448 BLAKE2B 21d66e5642782d20a620544397f89f2c5fb85c8261582c4cf915623b564973a2e36d7d933c0b088f88c5198a3f889e24f1bf58ba17a0cb615f2223c47855bb7c SHA512 32c2a9e4555d978b05bce821ced22f99b86be97bec50314716f374c3cc4a74da4807bf7735c038e03af2998d85092db770115acf584ed3f6f9c1d8924f159c97 +EBUILD mips-sources-4.14.213.ebuild 13186 BLAKE2B 09f359ec2d1f3a1d5042cb4611d186d1aa531bccd0a693bbd6aba74094aac63ac89820298f2db4ecd2cd1bfbd72894f8120d44e13c896a58e1ba36d025e1f375 SHA512 f2a80f3b8a297d4efff842e7d1d071e26c5b7114a5445153bb1d30f8901560de1135277395937f3457cddfb9eba85bd0197a80b75652e8dd3fac546f90204344 +EBUILD mips-sources-4.19.163.ebuild 12784 BLAKE2B c20f4b73fc8e763effb0b968019bf74d97ff06df89305e1178012ed4e53162ebdbfa1e41390b470361ba98145909eed7be2951c512fda375372b52df00356a90 SHA512 484783ed6ad556ee5bc5e3b3559659d15a3e2afe409c02a5ecc2fe13458e80d943ea379ef4469ae186420e55db787fec6ee27e33377249499fad0a52a53bd093 +EBUILD mips-sources-5.4.85.ebuild 12784 BLAKE2B 2ecf039e5a70c7963c477f98ac4112d2f9fff6d68fb34eb523c49851b8f20443edb51a9be0d1e670458f251e8ef2f2af5127f2b8f9fa3c703d8d37465bad694f SHA512 5632457219e99749dfc481749a0e9c6379f2063920f42cf973520695481befbe6a820b02cbbfbcc484e0dd512469a8a9bd484b8d79c6230e4e29c657f4876f44 MISC metadata.xml 659 BLAKE2B 0a4de62c5b7f4b11765e722d0cb95491d8502bacb0ac3265192c87398482fda7425fdc6d74db3c30d28782bd739b4f10b12a20b90722be96a41d350c9a211d7f SHA512 16b3055ff4e57c8cd0c5f393450095bd30f6f8da580bd82fce200715c023add333a8055a1c67303a6f7f7fed2bfea287f695c825a7d328ecab147b44ff6845e1 diff --git a/sys-kernel/mips-sources/mips-sources-4.14.206.ebuild b/sys-kernel/mips-sources/mips-sources-4.14.206.ebuild deleted file mode 100644 index 552ff7c119b3..000000000000 --- a/sys-kernel/mips-sources/mips-sources-4.14.206.ebuild +++ /dev/null @@ -1,346 +0,0 @@ -# Copyright 1999-2020 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.213.ebuild b/sys-kernel/mips-sources/mips-sources-4.14.213.ebuild new file mode 100644 index 000000000000..9f9dc8ee3367 --- /dev/null +++ b/sys-kernel/mips-sources/mips-sources-4.14.213.ebuild @@ -0,0 +1,346 @@ +# Copyright 1999-2020 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.19.157.ebuild b/sys-kernel/mips-sources/mips-sources-4.19.157.ebuild deleted file mode 100644 index 0f4e9fe47716..000000000000 --- a/sys-kernel/mips-sources/mips-sources-4.19.157.ebuild +++ /dev/null @@ -1,344 +0,0 @@ -# Copyright 1999-2020 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.163.ebuild b/sys-kernel/mips-sources/mips-sources-4.19.163.ebuild new file mode 100644 index 000000000000..076bf3615ae8 --- /dev/null +++ b/sys-kernel/mips-sources/mips-sources-4.19.163.ebuild @@ -0,0 +1,344 @@ +# Copyright 1999-2020 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-5.4.77.ebuild b/sys-kernel/mips-sources/mips-sources-5.4.77.ebuild deleted file mode 100644 index 02a856fcfa9c..000000000000 --- a/sys-kernel/mips-sources/mips-sources-5.4.77.ebuild +++ /dev/null @@ -1,344 +0,0 @@ -# Copyright 1999-2020 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -# EAPI Version -EAPI="6" - -#//------------------------------------------------------------------------------ - -# Version Data -GENPATCHREV="1" # 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 -} - -#//------------------------------------------------------------------------------ diff --git a/sys-kernel/mips-sources/mips-sources-5.4.85.ebuild b/sys-kernel/mips-sources/mips-sources-5.4.85.ebuild new file mode 100644 index 000000000000..bc279adfe801 --- /dev/null +++ b/sys-kernel/mips-sources/mips-sources-5.4.85.ebuild @@ -0,0 +1,344 @@ +# Copyright 1999-2020 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