close

下載來源: https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.1.18.tar.gz

(其實我是下載TI的某一包開發版的開發包, 裡面的BSP (based on kernel 4.1.18), 但我想裡面即使Kernel被TI改過, README也應是相同的)

 

INSTALLING the kernel source:

- If you install the full sources, put the kernel tarball in a
directory where you have permissions (eg. your home directory) and
unpack it:
如果初始化全部的sources, 擺放kernel壓縮包到一個你有權限的資料夾裡並且解壓它:
xz -cd linux-4.X.tar.xz | tar xvf -

Replace "X" with the version number of the latest kernel.
替換"X"成最新kernel的版本號碼
Do NOT use the /usr/src/linux area! This area has a (usually
incomplete) set of kernel headers that are used by the library header
files. They should match the library, and not get messed up by
whatever the kernel-du-jour happens to be.
不要使用/usr/src/linux區域!!此區域有一組(通常不完整地)被Library hearder files所使用的kernel headers
他們應該要與lib相匹配, ...(剩下的解釋應該不重要)
- You can also upgrade between 4.x releases by patching. Patches are
distributed in the xz format. To install by patching, get all the
newer patch files, enter the top level directory of the kernel source
(linux-4.X) and execute:
你也可以藉由patch去更新介於4.x的releases.
patch被分開在xz格式裡(?蛤)
為了經由Patch去做初始化, 取得全部的較新的patch檔案, 進入kernel source(linux-4.x)的最上層資料夾並且執行以下指令:
xz -cd ../patch-4.x.xz | patch -p1

Replace "x" for all versions bigger than the version "X" of your current
source tree, _in_order_, and you should be ok. You may want to remove
the backup files (some-file-name~ or some-file-name.orig), and make sure
that there are no failed patches (some-file-name# or some-file-name.rej).
If there are, either you or I have made a mistake.
替換"x"為所有比你目前source tree的"X"還要大的版本, 這樣應該沒問題.
你也許會想要移除備用檔案們("相同檔名~" 或"相同檔名.orig"), 並且確保沒有任何失敗的patchs("相同檔名#"或"相同檔名.rej")
如果有的話, 可能就是是你或我弄錯了
Unlike patches for the 4.x kernels, patches for the 4.x.y kernels
(also known as the -stable kernels) are not incremental but instead apply
directly to the base 4.x kernel. For example, if your base kernel is 4.0
and you want to apply the 4.0.3 patch, you must not first apply the 4.0.1
and 4.0.2 patches. Similarly, if you are running kernel version 4.0.2 and
want to jump to 4.0.3, you must first reverse the 4.0.2 patch (that is,
patch -R) _before_ applying the 4.0.3 patch. You can read more on this in
Documentation/applying-patches.txt
不同於於4.x kernels的patchs, 4.x.y kernels之patchs(當然也被認知為-stable kernels)
是並沒有遞增上去的(incremental), 而是直接應用於基礎4.x kernel之上.
舉例來說, 如果你的基礎kernel為4.0並且你想要應用4.0.3 patch, 你不能先應用4.0.1與4.0.2 patch.
相似地, 如果你正在跑kernel版本4.0.2且想要跳到4.0.3, 你必須在應用4.0.3 patch之前先倒退4.0.2 patch(也就是 patch -R).
你可以在Documentation/applying-patches.txt裡面讀更多關於此的資訊.
Alternatively, the script patch-kernel can be used to automate this
process. It determines the current kernel version and applies any
patches found.
另外, script patch-kernel可以被使用於自動化此程序.
它決定目前kernerl版本並且應用任何被找到的patchs
linux/scripts/patch-kernel linux

The first argument in the command above is the location of the
kernel source. Patches are applied from the current directory, but
an alternative directory can be specified as the second argument.
這個指令裡一開始的參數為kernel source的位置.
patchs被從目前資料夾去應用, 但是替代資料夾可以在第二個參數去闡明
- Make sure you have no stale .o files and dependencies lying around:
請確保你沒有陳舊的.o檔 並且
cd linux
make mrproper

You should now have the sources correctly installed.

 

--------------------------

話說回來昨天和資深前輩討論後才發現

整包被TI改過後應用於ARM上面的Kernel, 根本不可能patch的方式去進版...orz

只好謹以此篇記錄囧

arrow
arrow
    文章標籤
    Linux kernel
    全站熱搜

    lynn770707 發表在 痞客邦 留言(0) 人氣()