summaryrefslogtreecommitdiff
path: root/pcr/crosstool-ng/ctng-libre.patch
blob: f0e92ecad2391c0d8badcf2b82496583bff447bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
diff --git a/scripts/build/kernel/linux.sh b/scripts/build/kernel/linux.sh
index 49fe613..957f369 100644
--- a/scripts/build/kernel/linux.sh
+++ b/scripts/build/kernel/linux.sh
@@ -44,13 +44,8 @@ do_kernel_get() {
                 k_ver="${CT_KERNEL_VERSION}"
                 ;;
         esac
-        case "${CT_KERNEL_VERSION}" in
-            2.6.*)  rel_dir=v2.6;;
-            3.*)    rel_dir=v3.x;;
-            4.*)    rel_dir=v4.x;;
-        esac
-        korg_base="http://www.kernel.org/pub/linux/kernel/${rel_dir}"
-        CT_GetFile "linux-${CT_KERNEL_VERSION}"         \
+        korg_base="http://linux-libre.fsfla.org/pub/linux-libre/releases/${CT_KERNEL_VERSION}-gnu"
+        CT_GetFile "linux-libre-${CT_KERNEL_VERSION}-gnu"         \
                    "${korg_base}"                       \
                    "${korg_base}/longterm/v${k_ver}"    \
                    "${korg_base}/longterm"
@@ -66,13 +61,18 @@ do_kernel_extract() {
 
     # If using a custom directory location, nothing to do
     if [ "${CT_KERNEL_LINUX_CUSTOM}" = "y"    \
-         -a -d "${CT_SRC_DIR}/linux-${CT_KERNEL_VERSION}" ]; then
+         -a -d "${CT_SRC_DIR}/linux-libre-${CT_KERNEL_VERSION}-gnu" ]; then
         return 0
     fi
 
     # Otherwise, we're using either a mainstream tarball, or a custom
     # tarball; in either case, we need to extract
-    CT_Extract "linux-${CT_KERNEL_VERSION}"
+    CT_Extract "linux-libre-${CT_KERNEL_VERSION}-gnu"
+
+    # The following IF statement is a hack, it renames the source directory so that CT_Patch will work on the libre kernel.
+    if [ -d "${CT_SRC_DIR}/linux-libre-${CT_KERNEL_VERSION}-gnu" ]; then
+        mv "${CT_SRC_DIR}/linux-libre-${CT_KERNEL_VERSION}-gnu" "${CT_SRC_DIR}/linux-${CT_KERNEL_VERSION}"
+    fi
 
     # If using a custom tarball, no need to patch
     if [ "${CT_KERNEL_LINUX_CUSTOM}" = "y" ]; then