Skip to content

Commit

Permalink
Use linux headers 4.9.10 instead of 5.10.41
Browse files Browse the repository at this point in the history
  • Loading branch information
fosslinux committed Nov 25, 2023
1 parent 9c4f69f commit cc436d4
Show file tree
Hide file tree
Showing 8 changed files with 116 additions and 24 deletions.
1 change: 1 addition & 0 deletions lib/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import shutil
import subprocess
import tarfile
import requests

class Generator():
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}")"
bash -x scripts/headers_install.sh "${DESTDIR}${PREFIX}/include/${path}" "${d}/${path}" "$(basename "${h}")"
done
done

Expand All @@ -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"
Expand Down
108 changes: 108 additions & 0 deletions steps/linux-headers-4.9.10/patches/musl.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
--- include/uapi/linux/libc-compat.h 2017-02-15 10:26:10.000000000 +1100
+++ include/uapi/linux/libc-compat.h 2021-05-28 21:17:44.000000000 +1000
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/*
* Compatibility interface for userspace libc header coordination:
*
@@ -167,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__ */

1 change: 1 addition & 0 deletions steps/linux-headers-4.9.10/sources
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.9.10.tar.gz 97ff15f9550c6e85c25173b3cf5c7e89a2d39fb923112f2c8bc2729cf64bf6d8
18 changes: 0 additions & 18 deletions steps/linux-headers-5.10.41/patches/sed-args.patch

This file was deleted.

1 change: 0 additions & 1 deletion steps/linux-headers-5.10.41/sources

This file was deleted.

2 changes: 1 addition & 1 deletion steps/manifest
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ improve: populate_device_nodes
build: gcc-4.0.4 #pass1.sh
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
build: gcc-4.0.4 #pass2.sh
build: util-linux-2.19.1
jump: move_disk ( KERNEL_BOOTSTRAP == True )
Expand Down

0 comments on commit cc436d4

Please sign in to comment.