From 28461d7890d7bd7794dcdd01dfba2f5108ab90f0 Mon Sep 17 00:00:00 2001 From: fosslinux Date: Tue, 28 Nov 2023 11:44:05 +1100 Subject: [PATCH 1/2] Fix handling of extract --- sysa/helpers.sh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/sysa/helpers.sh b/sysa/helpers.sh index 3ee9e2d..b80e205 100755 --- a/sysa/helpers.sh +++ b/sysa/helpers.sh @@ -199,6 +199,7 @@ build() { cd "${SOURCES}" unset -f src_unpack src_prepare src_configure src_compile src_install src_postprocess + unset extract } interpret_source_line() { @@ -231,12 +232,6 @@ default_src_get() { # Intelligently extracts a file based upon its filetype. extract_file() { f="${3:-$(basename "${1}")}" - if test $# -gt 3; then - shift 3 - extract="$*" - else - extract= - fi # shellcheck disable=SC2154 case "${noextract}" in *${f}*) From fcaaad81052ec7ce060ace5a0ee5967749469d9d Mon Sep 17 00:00:00 2001 From: fosslinux Date: Tue, 28 Nov 2023 11:48:44 +1100 Subject: [PATCH 2/2] Change linux headers to 4.9.10 instead of 5.10.41 Unifies tarball distfiles. --- .../linux-headers-4.9.10.sh} | 11 +- sysa/linux-headers-4.9.10/patches/musl.patch | 160 ++++++++++++++++++ .../patches/winsize.patch | 0 sysa/linux-headers-4.9.10/sources | 1 + .../patches/sed-args.patch | 18 -- sysa/linux-headers-5.10.41/sources | 1 - sysa/run2.sh | 2 +- 7 files changed, 168 insertions(+), 25 deletions(-) rename sysa/{linux-headers-5.10.41/linux-headers-5.10.41.sh => linux-headers-4.9.10/linux-headers-4.9.10.sh} (85%) create mode 100644 sysa/linux-headers-4.9.10/patches/musl.patch rename sysa/{linux-headers-5.10.41 => linux-headers-4.9.10}/patches/winsize.patch (100%) create mode 100644 sysa/linux-headers-4.9.10/sources delete mode 100644 sysa/linux-headers-5.10.41/patches/sed-args.patch delete mode 100644 sysa/linux-headers-5.10.41/sources diff --git a/sysa/linux-headers-5.10.41/linux-headers-5.10.41.sh b/sysa/linux-headers-4.9.10/linux-headers-4.9.10.sh similarity index 85% rename from sysa/linux-headers-5.10.41/linux-headers-5.10.41.sh rename to sysa/linux-headers-4.9.10/linux-headers-4.9.10.sh index e1c2d8e..a8ba583 100755 --- a/sysa/linux-headers-5.10.41/linux-headers-5.10.41.sh +++ b/sysa/linux-headers-4.9.10/linux-headers-4.9.10.sh @@ -3,7 +3,7 @@ # # SPDX-License-Identifier: GPL-3.0-or-later -extract="linux-5.10.41/scripts linux-5.10.41/include linux-5.10.41/arch/x86/include linux-5.10.41/arch/x86/entry" +extract="linux-4.9.10/scripts linux-4.9.10/include linux-4.9.10/arch/x86/include linux-4.9.10/arch/x86/entry" src_prepare() { default @@ -31,7 +31,8 @@ src_install() { headers="$(find . -type f -name "*.h")" cd "${base_dir}" for h in ${headers}; do - scripts/headers_install.sh "${d}/${h}" "${DESTDIR}${PREFIX}/include/${h}" + path="$(dirname "${h}")" + scripts/headers_install.sh "${DESTDIR}${PREFIX}/include/${path}" "${d}/${path}" "$(basename "${h}")" done done @@ -47,9 +48,9 @@ src_install() { # Generate linux/version.h # Rules are from makefile - VERSION=5 - PATCHLEVEL=10 - SUBLEVEL=42 + VERSION=4 + PATCHLEVEL=9 + SUBLEVEL=10 VERSION_CODE="$((VERSION * 65536 + PATCHLEVEL * 256 + SUBLEVEL))" echo '#define LINUX_VERSION_CODE '"${VERSION_CODE}" \ > "${DESTDIR}${PREFIX}/include/linux/version.h" diff --git a/sysa/linux-headers-4.9.10/patches/musl.patch b/sysa/linux-headers-4.9.10/patches/musl.patch new file mode 100644 index 0000000..39a55e3 --- /dev/null +++ b/sysa/linux-headers-4.9.10/patches/musl.patch @@ -0,0 +1,160 @@ +SPDX-FileCopyrightText: 2018 Felix Janda + +SPDX-License-Identifier: GPL-2.0-only + +Applies cleanly (backport). + +From c0bace798436bca0fdc221ff61143f1376a9c3de Mon Sep 17 00:00:00 2001 +From: Date: Mon, 1 Jan 2018 19:33:20 +0100 +Subject: uapi libc compat: add fallback for unsupported libcs + +libc-compat.h aims to prevent symbol collisions between uapi and libc +headers for each supported libc. This requires continuous coordination +between them. + +The goal of this commit is to improve the situation for libcs (such as +musl) which are not yet supported and/or do not wish to be explicitly +supported, while not affecting supported libcs. More precisely, with +this commit, unsupported libcs can request the suppression of any +specific uapi definition by defining the correspondings _UAPI_DEF_* +macro as 0. This can fix symbol collisions for them, as long as the +libc headers are included before the uapi headers. Inclusion in the +other order is outside the scope of this commit. + +All infrastructure in order to enable this fallback for unsupported +libcs is already in place, except that libc-compat.h unconditionally +defines all _UAPI_DEF_* macros to 1 for all unsupported libcs so that +any previous definitions are ignored. In order to fix this, this commit +merely makes these definitions conditional. + +This commit together with the musl libc commit + +http://git.musl-libc.org/cgit/musl/commit/?id=04983f2272382af92eb8f8838964ff944fbb8258 + +fixes for example the following compiler errors when is +included after musl's : + +./linux/in6.h:32:8: error: redefinition of 'struct in6_addr' +./linux/in6.h:49:8: error: redefinition of 'struct sockaddr_in6' +./linux/in6.h:59:8: error: redefinition of 'struct ipv6_mreq' + +The comments referencing glibc are still correct, but this file is not +only used for glibc any more. + +Signed-off-by: Felix Janda +Reviewed-by: Hauke Mehrtens +Signed-off-by: David S. Miller +--- + include/uapi/linux/libc-compat.h | 55 +++++++++++++++++++++++++++++++++++++++- + 1 file changed, 54 insertions(+), 1 deletion(-) + +(limited to 'include/uapi/linux/libc-compat.h') + +diff --git include/uapi/linux/libc-compat.h include/uapi/linux/libc-compat.h +index 282875cf805657..8254c937c9f455 100644 +--- include/uapi/linux/libc-compat.h ++++ include/uapi/linux/libc-compat.h +@@ -168,46 +168,99 @@ + + /* If we did not see any headers from any supported C libraries, + * or we are being included in the kernel, then define everything +- * that we need. */ ++ * that we need. Check for previous __UAPI_* definitions to give ++ * unsupported C libraries a way to opt out of any kernel definition. */ + #else /* !defined(__GLIBC__) */ + + /* Definitions for if.h */ ++#ifndef __UAPI_DEF_IF_IFCONF + #define __UAPI_DEF_IF_IFCONF 1 ++#endif ++#ifndef __UAPI_DEF_IF_IFMAP + #define __UAPI_DEF_IF_IFMAP 1 ++#endif ++#ifndef __UAPI_DEF_IF_IFNAMSIZ + #define __UAPI_DEF_IF_IFNAMSIZ 1 ++#endif ++#ifndef __UAPI_DEF_IF_IFREQ + #define __UAPI_DEF_IF_IFREQ 1 ++#endif + /* Everything up to IFF_DYNAMIC, matches net/if.h until glibc 2.23 */ ++#ifndef __UAPI_DEF_IF_NET_DEVICE_FLAGS + #define __UAPI_DEF_IF_NET_DEVICE_FLAGS 1 ++#endif + /* For the future if glibc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */ ++#ifndef __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO + #define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 1 ++#endif + + /* Definitions for in.h */ ++#ifndef __UAPI_DEF_IN_ADDR + #define __UAPI_DEF_IN_ADDR 1 ++#endif ++#ifndef __UAPI_DEF_IN_IPPROTO + #define __UAPI_DEF_IN_IPPROTO 1 ++#endif ++#ifndef __UAPI_DEF_IN_PKTINFO + #define __UAPI_DEF_IN_PKTINFO 1 ++#endif ++#ifndef __UAPI_DEF_IP_MREQ + #define __UAPI_DEF_IP_MREQ 1 ++#endif ++#ifndef __UAPI_DEF_SOCKADDR_IN + #define __UAPI_DEF_SOCKADDR_IN 1 ++#endif ++#ifndef __UAPI_DEF_IN_CLASS + #define __UAPI_DEF_IN_CLASS 1 ++#endif + + /* Definitions for in6.h */ ++#ifndef __UAPI_DEF_IN6_ADDR + #define __UAPI_DEF_IN6_ADDR 1 ++#endif ++#ifndef __UAPI_DEF_IN6_ADDR_ALT + #define __UAPI_DEF_IN6_ADDR_ALT 1 ++#endif ++#ifndef __UAPI_DEF_SOCKADDR_IN6 + #define __UAPI_DEF_SOCKADDR_IN6 1 ++#endif ++#ifndef __UAPI_DEF_IPV6_MREQ + #define __UAPI_DEF_IPV6_MREQ 1 ++#endif ++#ifndef __UAPI_DEF_IPPROTO_V6 + #define __UAPI_DEF_IPPROTO_V6 1 ++#endif ++#ifndef __UAPI_DEF_IPV6_OPTIONS + #define __UAPI_DEF_IPV6_OPTIONS 1 ++#endif ++#ifndef __UAPI_DEF_IN6_PKTINFO + #define __UAPI_DEF_IN6_PKTINFO 1 ++#endif ++#ifndef __UAPI_DEF_IP6_MTUINFO + #define __UAPI_DEF_IP6_MTUINFO 1 ++#endif + + /* Definitions for ipx.h */ ++#ifndef __UAPI_DEF_SOCKADDR_IPX + #define __UAPI_DEF_SOCKADDR_IPX 1 ++#endif ++#ifndef __UAPI_DEF_IPX_ROUTE_DEFINITION + #define __UAPI_DEF_IPX_ROUTE_DEFINITION 1 ++#endif ++#ifndef __UAPI_DEF_IPX_INTERFACE_DEFINITION + #define __UAPI_DEF_IPX_INTERFACE_DEFINITION 1 ++#endif ++#ifndef __UAPI_DEF_IPX_CONFIG_DATA + #define __UAPI_DEF_IPX_CONFIG_DATA 1 ++#endif ++#ifndef __UAPI_DEF_IPX_ROUTE_DEF + #define __UAPI_DEF_IPX_ROUTE_DEF 1 ++#endif + + /* Definitions for xattr.h */ ++#ifndef __UAPI_DEF_XATTR + #define __UAPI_DEF_XATTR 1 ++#endif + + #endif /* __GLIBC__ */ + +-- +cgit + diff --git a/sysa/linux-headers-5.10.41/patches/winsize.patch b/sysa/linux-headers-4.9.10/patches/winsize.patch similarity index 100% rename from sysa/linux-headers-5.10.41/patches/winsize.patch rename to sysa/linux-headers-4.9.10/patches/winsize.patch diff --git a/sysa/linux-headers-4.9.10/sources b/sysa/linux-headers-4.9.10/sources new file mode 100644 index 0000000..b986c50 --- /dev/null +++ b/sysa/linux-headers-4.9.10/sources @@ -0,0 +1 @@ +https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.9.10.tar.gz 97ff15f9550c6e85c25173b3cf5c7e89a2d39fb923112f2c8bc2729cf64bf6d8 diff --git a/sysa/linux-headers-5.10.41/patches/sed-args.patch b/sysa/linux-headers-5.10.41/patches/sed-args.patch deleted file mode 100644 index f030cab..0000000 --- a/sysa/linux-headers-5.10.41/patches/sed-args.patch +++ /dev/null @@ -1,18 +0,0 @@ -SPDX-FileCopyrightText: 2021 fosslinux - -SPDX-License-Identifier: GPL-2.0-only - -We do not have the '-E' argument in our version of sed. But it is -functionally equivalent to '-r' (at least for this purpose). - ---- scripts/headers_install.shk 2021-06-01 18:48:44.732934584 +1000 -+++ scripts/headers_install.sh 2021-06-01 18:48:56.954050654 +1000 -@@ -29,7 +29,7 @@ - exit 1 - fi - --sed -E -e ' -+sed -r -e ' - s/([[:space:](])(__user|__force|__iomem)[[:space:]]/\1/g - s/__attribute_const__([[:space:]]|$)/\1/g - s@^#include @@ diff --git a/sysa/linux-headers-5.10.41/sources b/sysa/linux-headers-5.10.41/sources deleted file mode 100644 index c07bd3a..0000000 --- a/sysa/linux-headers-5.10.41/sources +++ /dev/null @@ -1 +0,0 @@ -https://mirrors.kernel.org/pub/linux/kernel/v5.x/linux-5.10.41.tar.gz 84d2079a20ba32f5e2d5bc79a5dcb1de94d0176c67d75d5a20d533ea6c90d691 linux-5.10.41.tar.gz linux-5.10.41/scripts linux-5.10.41/include linux-5.10.41/arch/x86/include linux-5.10.41/arch/x86/entry diff --git a/sysa/run2.sh b/sysa/run2.sh index 6d21eca..986e097 100755 --- a/sysa/run2.sh +++ b/sysa/run2.sh @@ -65,7 +65,7 @@ build findutils-4.2.33 build musl-1.2.4 -build linux-headers-5.10.41 '' '' linux-5.10.41 +build linux-headers-4.9.10 '' '' linux-4.9.10 build gcc-4.0.4 pass2.sh