diff options
Diffstat (limited to 'sys-kernel/mips-sources')
-rw-r--r-- | sys-kernel/mips-sources/Manifest | 14 | ||||
-rw-r--r-- | sys-kernel/mips-sources/metadata.xml | 14 | ||||
-rw-r--r-- | sys-kernel/mips-sources/mips-sources-4.14.243.ebuild (renamed from sys-kernel/mips-sources/mips-sources-4.14.241.ebuild) | 120 | ||||
-rw-r--r-- | sys-kernel/mips-sources/mips-sources-4.19.203.ebuild (renamed from sys-kernel/mips-sources/mips-sources-4.19.200.ebuild) | 113 | ||||
-rw-r--r-- | sys-kernel/mips-sources/mips-sources-5.4.140.ebuild (renamed from sys-kernel/mips-sources/mips-sources-5.4.137.ebuild) | 113 |
5 files changed, 203 insertions, 171 deletions
diff --git a/sys-kernel/mips-sources/Manifest b/sys-kernel/mips-sources/Manifest index 5e16024741fb..415c4cce3115 100644 --- a/sys-kernel/mips-sources/Manifest +++ b/sys-kernel/mips-sources/Manifest @@ -5,10 +5,10 @@ DIST mips-sources-4.14.0-patches-v3.tar.xz 287468 BLAKE2B 24212e2d6ca784986d0e3e 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 mipsgit-4.14.0-20180128.diff.xz 1008 BLAKE2B 2a317ff97aab096883680c6b653e993aee31994e6caec52c52dfbbb61f1dc1f25d03ebd3182fa122923a67aeee0aa598b36e603692333e4c9ccdc741fd456d96 SHA512 378deb1bc1d10a6b4912e5e4a0d6fcab28952e2e59c35fc879601841cf8160081b318a2598ef74db225e95f0f26483f6b9a56a348811b1ee7b8934391dd271ae -DIST patch-4.14.241.xz 4387084 BLAKE2B 7d3126cbb14d1e5459689314b4a465712f66bc4b88392ad8514811cbfca5a2110c3f3c8cf577d86ac7aa5c8cd699336aed1f51368cae0a7e47f36c6ff8758393 SHA512 2f509afd824f1a924c10d763c1608b401c098c2e4084922bcc1b9a3ab558bd43ba3a62c232a99be5717666eb32baa93ca4a2b7c233b8184df567aaf1a5dc92da -DIST patch-4.19.200.xz 4167064 BLAKE2B 5216e28d2a8cb22415d94a3f397f86cb0bdb9bc8d05be5d6a679e5ef58342c188e2ec37c7469cda0a61ebed42929597a2a4175f56f2b7912494ffc801e1a5189 SHA512 c979cbc8016b5c7409494940ab652f997807a459f008225fda79000c23b46e2f3c4fffa70b746b40a8d07ee0e9654511d1ecd9fab5016c8bdd1977ae51ef5dd4 -DIST patch-5.4.137.xz 3214908 BLAKE2B de1d58f6100e89cee5c103748cab753c4dab425e730695af61000bd4fb2f1a8d4c699aaf32f1dc77c28778477466a2ca24e14b9efca882608cc4166dc51ffb02 SHA512 30da56861035f55ce11fd0db06fb4f289b51753f3f24b5e863b77f23d53dab38edb7cfe80c528d394fb70a7b46d66f47adc9e2e765feebc7b0b293e7515631a3 -EBUILD mips-sources-4.14.241.ebuild 13089 BLAKE2B e4f37d9c18e427d34ad02127bf8693e8660cbf63e6b662c6fdfc56f15ecfec390a3a88b546ec7fe4d58e82dc595419d344150986e33fa2b8d5813734f55cec05 SHA512 666aeaadb71ea5b96c3a42f9416f2fbc1848fa01a0630020e6a3d81afa32172b2263f604a09f0b7c1b106cf9e85cca2e5d3a265bff4baaab2b8ec464e88f7a2c -EBUILD mips-sources-4.19.200.ebuild 12687 BLAKE2B f8f62e3facb08bec95910e088c47b49124ce29b90dd67a47b39c4d7117d26619b1e3bd2c6a3143ed13e9caa0fc45cf8e9c734f406cc56c1b89b2b41149958304 SHA512 cf3b84bf2b1a4a343fb3b9c2eae33ffaf6285be80e734ee4486d149ef4bb837ca9f73975f7aabc7d14194d17f0794a8cd0bd4a30c99fcd1868011a41a4430807 -EBUILD mips-sources-5.4.137.ebuild 12687 BLAKE2B cdddc8a92b49d3df0bcbfdf4a68924be5cbe878a151988041fddd1ffc18a059c871a565bf9fc3798b90681f3235f6fe73d29c9374949398f34d5625b2e294430 SHA512 9166f0a5d893988cfae1c088178435908c11dce730e74d1a72cff261b90ea0a14bcc6e251ea76366a7a18da40488e8405d194ef1abaf90ea859e89598f6fc3cb -MISC metadata.xml 659 BLAKE2B 0a4de62c5b7f4b11765e722d0cb95491d8502bacb0ac3265192c87398482fda7425fdc6d74db3c30d28782bd739b4f10b12a20b90722be96a41d350c9a211d7f SHA512 16b3055ff4e57c8cd0c5f393450095bd30f6f8da580bd82fce200715c023add333a8055a1c67303a6f7f7fed2bfea287f695c825a7d328ecab147b44ff6845e1 +DIST patch-4.14.243.xz 4395156 BLAKE2B a9a57aaf8fac8b35ecfa52f6086d20cca8593370075e23476dfa8ae1a6219d9a415df2c3e6e88d7d775927cc05ab89280a24464c0664b9485c11ac2e66f712ec SHA512 a85571c72cf814acdff0829269f5a352d2626eef367f3aae978ae86a5cb3a47e117406af5bc8bbb5c6c76d3ead8cb8d2f572ab3e3dc4ae94c17e0b1a445d3c0b +DIST patch-4.19.203.xz 4181892 BLAKE2B fd681104c226a3f7031f983e026fe5522daa3bfcf0e0ae30f71ff67e599c69974a3d556ee5bef66a6de380c2e89c282c9d8ceed35a9cd14fd30b6a116944e8fb SHA512 c75f24116e05d5e857b9200017906f3ca35f961b53e7b3966499f16209b67a8c4ad185359e4b20a3a5cb72bd9f799423c7ac65630a670f5f15837b146926b1a6 +DIST patch-5.4.140.xz 3240512 BLAKE2B ca28f6c97802d72d9ca30b9383bbb633e6dcdd1ba24643399dce781d0501b3db377d640509e71f8bf8c1fe4e113e2b6403f4b8bc50b5360b43cc4e6dfafef34b SHA512 ae2824a4f4732c8f723c97dfd80f1b104f144c827b98581f9e2eafc33b3bde881cbe90aeaaea014ce0a2b10f03406217816e7b6e9fe195c42cee88c204f66044 +EBUILD mips-sources-4.14.243.ebuild 13016 BLAKE2B a864230a2c9b4dfc94d22779ed54fddaa25362aec1d81e7dcc3dca53cc2ac20d925e50a8d9b63315751c5b92c09eb5fa341bad84306c9e92e170068f2cdd3aa2 SHA512 e5e4891f0cf247943173126a820536d4d71216f951e894861da2afc9af917a24ab6555ffce07f06df93c00ed2e1559ac34ca774ceafd86b400e6bef086d080be +EBUILD mips-sources-4.19.203.ebuild 12725 BLAKE2B 0f3ff9d4160d0da3d7aa4b9f62b66104fdae2fc32ed56963202cb9303449a44d6fa4e427b8310b34242f02e16c857b36ebd0a0aca501c28fc77f476216ee54e5 SHA512 da902e69cf09f57a51a2d79bfdf60293fe48fbfe1d7ae493c842ba1b347181bcb553517eb6302f943bd6be602cfd4d6407323a70f0ec59e99dd4652f879aef06 +EBUILD mips-sources-5.4.140.ebuild 12725 BLAKE2B 7f9afb6b814e29f89b2b718a06bf5f94929d46b28674cc784486dae3b478fc44363e347e814ef55a91b1f592b0c7486c6870d0cf76cc05946efab725dbc93ec9 SHA512 895af98e852d4294635dae3a9c7f14f0277b0fca5a92f80cbd6a1380855877f3745e5a6ece5e9760024d592c202ebea12c726037f695285fff91c862636794ce +MISC metadata.xml 896 BLAKE2B 3f3ca232b60661fb59ed3b9cd4193cc904595bbc3152b1b3f874d7942cc7f2a5711a49c986886d36c4206a373d946e0bc25bfc22694c30e734e0e6bb7acabf7e SHA512 d9993a6099dbc8f24c6f3e42d4de5c6ad5191e4e08d20b651347b1cd2ef6ad682078bcf7ab67f99a1bd342a6bcbecaa7b4dd5acbb24ee3c65f9eda68b6078853 diff --git a/sys-kernel/mips-sources/metadata.xml b/sys-kernel/mips-sources/metadata.xml index 83fb9fad8bd8..002d56c04eb6 100644 --- a/sys-kernel/mips-sources/metadata.xml +++ b/sys-kernel/mips-sources/metadata.xml @@ -5,13 +5,21 @@ <email>mips@gentoo.org</email> <name>Mips Team</name> </maintainer> + + <upstream> + <remote-id type="cpe">cpe:/o:linux:linux_kernel</remote-id> + </upstream> + + <longdescription> + Kernel.org LTS releases that focus on fixing any issues with + current in-tree MIPS systems (primarily SGI), as well as adding + missing support for any out-of-tree systems via custom patches. + </longdescription> + <use> <flag name="ip27">Enables additional support for SGI Origin (IP27)</flag> <flag name="ip28">Enables additional support for SGI Indigo2 Impact R10000 (IP28)</flag> <flag name="ip30">Enables support for SGI Octane (IP30, 'Speedracer')</flag> <flag name="experimental">Apply experimental (80xx) patches.</flag> </use> - <upstream> - <remote-id type="cpe">cpe:/o:linux:linux_kernel</remote-id> - </upstream> </pkgmetadata> diff --git a/sys-kernel/mips-sources/mips-sources-4.14.241.ebuild b/sys-kernel/mips-sources/mips-sources-4.14.243.ebuild index e32d7a2792a8..0db2aa7260a7 100644 --- a/sys-kernel/mips-sources/mips-sources-4.14.241.ebuild +++ b/sys-kernel/mips-sources/mips-sources-4.14.243.ebuild @@ -2,7 +2,7 @@ # Distributed under the terms of the GNU General Public License v2 # EAPI Version -EAPI="6" +EAPI="8" #//------------------------------------------------------------------------------ @@ -24,7 +24,7 @@ K_FROM_GIT="yes" ETYPE="sources" # Inherit Eclasses -inherit kernel-2 eapi7-ver +inherit kernel-2 detect_version # Version Data @@ -35,7 +35,7 @@ BASE_KV="$(ver_cut 1-2).0" # Portage Vars HOMEPAGE="https://wiki.gentoo.org/wiki/Project:MIPS" KEYWORDS="-* ~mips" -IUSE="experimental ip27 ip28 ip30" +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 '*'. @@ -78,15 +78,17 @@ err_disabled_mach() { # 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}\" " + [[ "${m_use}" != "skip" ]] \ + && has_use="USE=\"${m_use}\" " # Print error && (maybe) die echo -e "" - if [ "${is_test}" != "test" ]; then + 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." + [[ "${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" @@ -110,17 +112,33 @@ err_only_one_mach_allowed() { die "Only one machine-type patchset allowed" } -pkg_postinst() { - # Symlink /usr/src/linux as appropriate - local my_ksrc="${S##*/}" +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} && my_ksrc="${my_ksrc}.${x}" + use ${x} && v="${v}.${x}" && break done - if [ ! -e "${ROOT}usr/src/linux" ]; then - rm -f "${ROOT}usr/src/linux" - ln -sf "${my_ksrc}" "${ROOT}/usr/src/linux" + 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() { @@ -140,35 +158,37 @@ pkg_setup() { 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}" + if ! use ${m_ip}; then + continue + fi - # Make sure only one of these exclusive machine patches is selected - [ "${arch_is_selected}" = "no" ] \ - && arch_is_selected="yes" \ - || err_only_one_mach_allowed + # Fetch the value indiciating if the machine is enabled or not + m_enable="DO_${m_ip/ip/IP}" + m_enable="${!m_enable}" - # 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}" + # Make sure only one of these exclusive machine patches is selected + [[ "${arch_is_selected}" = "no" ]] \ + && arch_is_selected="yes" \ + || err_only_one_mach_allowed - # Show relevant information about the machine - show_${m_ip}_info - fi + # 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" ] \ + if [[ "${arch_is_selected}" = "no" ]]; then + [[ "${DO_IP22}" = "no" ]] \ && err_disabled_mach "SGI Indy/Indigo2 R4x00" "IP22" "skip" \ || show_ip22_info - [ "${DO_IP32}" = "no" ] \ + [[ "${DO_IP32}" = "no" ]] \ && err_disabled_mach "SGI O2" "IP32" "skip" \ || show_ip32_info @@ -189,10 +209,8 @@ show_ip22_info() { 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)" + ewarn "IP27 Origin 2k/Onyx2 systems may be prone to sudden hard lockups." + ewarn "The exact trigger is unknown at this time." echo -e "" } @@ -283,9 +301,8 @@ src_unpack() { # 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}" + mkdir patch-symlinks + cd patch-symlinks for x in ../mips-patches-${BASE_KV}/*.patch; do ln -s "${x}" "${x##../mips-patches-*/}" done @@ -314,15 +331,13 @@ src_unpack() { 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}" + # 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}" @@ -330,13 +345,8 @@ src_unpack() { } src_prepare() { - local psym="patch-symlinks" - - # Now go into the kernel source and patch it. - cd "${S}" - eapply "${WORKDIR}/${psym}"/ + # Apply patches to the kernel tree. + eapply "${WORKDIR}/patch-symlinks"/ eapply_user } - -#//------------------------------------------------------------------------------ diff --git a/sys-kernel/mips-sources/mips-sources-4.19.200.ebuild b/sys-kernel/mips-sources/mips-sources-4.19.203.ebuild index 52f4f25547f4..4a6e74a5e687 100644 --- a/sys-kernel/mips-sources/mips-sources-4.19.200.ebuild +++ b/sys-kernel/mips-sources/mips-sources-4.19.203.ebuild @@ -2,7 +2,7 @@ # Distributed under the terms of the GNU General Public License v2 # EAPI Version -EAPI="6" +EAPI="8" #//------------------------------------------------------------------------------ @@ -23,7 +23,7 @@ K_FROM_GIT="yes" ETYPE="sources" # Inherit Eclasses -inherit kernel-2 eapi7-ver +inherit kernel-2 detect_version # Version Data @@ -34,7 +34,7 @@ BASE_KV="$(ver_cut 1-2).0" # Portage Vars HOMEPAGE="https://wiki.gentoo.org/wiki/Project:MIPS" KEYWORDS="-* ~mips" -IUSE="experimental ip27 ip28 ip30" +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 '*'. @@ -73,15 +73,17 @@ err_disabled_mach() { # 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}\" " + [[ "${m_use}" != "skip" ]] \ + && has_use="USE=\"${m_use}\" " # Print error && (maybe) die echo -e "" - if [ "${is_test}" != "test" ]; then + 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." + [[ "${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" @@ -105,17 +107,33 @@ err_only_one_mach_allowed() { die "Only one machine-type patchset allowed" } -pkg_postinst() { - # Symlink /usr/src/linux as appropriate - local my_ksrc="${S##*/}" +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} && my_ksrc="${my_ksrc}.${x}" + use ${x} && v="${v}.${x}" && break done - if [ ! -e "${ROOT}usr/src/linux" ]; then - rm -f "${ROOT}usr/src/linux" - ln -sf "${my_ksrc}" "${ROOT}/usr/src/linux" + 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() { @@ -135,35 +153,37 @@ pkg_setup() { 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}" + if ! use ${m_ip}; then + continue + fi - # Make sure only one of these exclusive machine patches is selected - [ "${arch_is_selected}" = "no" ] \ - && arch_is_selected="yes" \ - || err_only_one_mach_allowed + # Fetch the value indiciating if the machine is enabled or not + m_enable="DO_${m_ip/ip/IP}" + m_enable="${!m_enable}" - # 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}" + # Make sure only one of these exclusive machine patches is selected + [[ "${arch_is_selected}" = "no" ]] \ + && arch_is_selected="yes" \ + || err_only_one_mach_allowed - # Show relevant information about the machine - show_${m_ip}_info - fi + # 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" ] \ + if [[ "${arch_is_selected}" = "no" ]]; then + [[ "${DO_IP22}" = "no" ]] \ && err_disabled_mach "SGI Indy/Indigo2 R4x00" "IP22" "skip" \ || show_ip22_info - [ "${DO_IP32}" = "no" ] \ + [[ "${DO_IP32}" = "no" ]] \ && err_disabled_mach "SGI O2" "IP32" "skip" \ || show_ip32_info @@ -276,9 +296,8 @@ src_unpack() { # 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}" + mkdir patch-symlinks + cd patch-symlinks for x in ../mips-patches-${BASE_KV}/*.patch; do ln -s "${x}" "${x##../mips-patches-*/}" done @@ -307,17 +326,10 @@ src_unpack() { 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 + # 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}" @@ -328,13 +340,8 @@ src_unpack() { } src_prepare() { - local psym="patch-symlinks" - - # Now go into the kernel source and patch it. - cd "${S}" - eapply "${WORKDIR}/${psym}"/ + # Apply patches to the kernel tree. + eapply "${WORKDIR}/patch-symlinks"/ eapply_user } - -#//------------------------------------------------------------------------------ diff --git a/sys-kernel/mips-sources/mips-sources-5.4.137.ebuild b/sys-kernel/mips-sources/mips-sources-5.4.140.ebuild index c0810db4f528..94978afac917 100644 --- a/sys-kernel/mips-sources/mips-sources-5.4.137.ebuild +++ b/sys-kernel/mips-sources/mips-sources-5.4.140.ebuild @@ -2,7 +2,7 @@ # Distributed under the terms of the GNU General Public License v2 # EAPI Version -EAPI="6" +EAPI="8" #//------------------------------------------------------------------------------ @@ -23,7 +23,7 @@ K_FROM_GIT="yes" ETYPE="sources" # Inherit Eclasses -inherit kernel-2 eapi7-ver +inherit kernel-2 detect_version # Version Data @@ -34,7 +34,7 @@ BASE_KV="$(ver_cut 1-2)" # Portage Vars HOMEPAGE="https://wiki.gentoo.org/wiki/Project:MIPS" KEYWORDS="-* ~mips" -IUSE="experimental ip27 ip28 ip30" +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 '*'. @@ -73,15 +73,17 @@ err_disabled_mach() { # 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}\" " + [[ "${m_use}" != "skip" ]] \ + && has_use="USE=\"${m_use}\" " # Print error && (maybe) die echo -e "" - if [ "${is_test}" != "test" ]; then + 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." + [[ "${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" @@ -105,17 +107,33 @@ err_only_one_mach_allowed() { die "Only one machine-type patchset allowed" } -pkg_postinst() { - # Symlink /usr/src/linux as appropriate - local my_ksrc="${S##*/}" +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} && my_ksrc="${my_ksrc}.${x}" + use ${x} && v="${v}.${x}" && break done - if [ ! -e "${ROOT}usr/src/linux" ]; then - rm -f "${ROOT}usr/src/linux" - ln -sf "${my_ksrc}" "${ROOT}/usr/src/linux" + 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() { @@ -135,35 +153,37 @@ pkg_setup() { 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}" + if ! use ${m_ip}; then + continue + fi - # Make sure only one of these exclusive machine patches is selected - [ "${arch_is_selected}" = "no" ] \ - && arch_is_selected="yes" \ - || err_only_one_mach_allowed + # Fetch the value indiciating if the machine is enabled or not + m_enable="DO_${m_ip/ip/IP}" + m_enable="${!m_enable}" - # 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}" + # Make sure only one of these exclusive machine patches is selected + [[ "${arch_is_selected}" = "no" ]] \ + && arch_is_selected="yes" \ + || err_only_one_mach_allowed - # Show relevant information about the machine - show_${m_ip}_info - fi + # 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" ] \ + if [[ "${arch_is_selected}" = "no" ]]; then + [[ "${DO_IP22}" = "no" ]] \ && err_disabled_mach "SGI Indy/Indigo2 R4x00" "IP22" "skip" \ || show_ip22_info - [ "${DO_IP32}" = "no" ] \ + [[ "${DO_IP32}" = "no" ]] \ && err_disabled_mach "SGI O2" "IP32" "skip" \ || show_ip32_info @@ -276,9 +296,8 @@ src_unpack() { # 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}" + mkdir patch-symlinks + cd patch-symlinks for x in ../mips-patches-${BASE_KV}/*.patch; do ln -s "${x}" "${x##../mips-patches-*/}" done @@ -307,17 +326,10 @@ src_unpack() { 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 + # 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}" @@ -328,13 +340,8 @@ src_unpack() { } src_prepare() { - local psym="patch-symlinks" - - # Now go into the kernel source and patch it. - cd "${S}" - eapply "${WORKDIR}/${psym}"/ + # Apply patches to the kernel tree. + eapply "${WORKDIR}/patch-symlinks"/ eapply_user } - -#//------------------------------------------------------------------------------ |