After downloading the patch-4.6.4.xz from http://kernel.org, what are the next steps to prepare the build of a version 4.6.4 Linux kernel? (Choose two.)

A. Uncompress the file and move the resulting directory to /usr/src/linux
B. Apply the patch file to the kernel source directory containing kernel version 4.6.0
C. Apply the patch file to the kernel source directory containing kernel version 4.6.3
D. Uncompress the file using xz to get the uncompressed patch file
E. Use patch to apply the uncompressed patch file to the source directory of any previous kernel version

题解

「patch-4.6.4.xz」是 XZ 压缩档,需要先将其解压缩,或是使用「xzcat」指令来读取内容。patch 档的命名方式为:「patch-4.6.4」是针对「4.6.0」制作的 diff。「patch-4.6.3-4」是针对「4.6.3」制作的 diff。「patch-4.6」是针对「4.5.0」制作的 diff。

选项 A,要编译 Linux 内核的话,需在「/usr/src/linux」目录中进行,但 patch 档并不能直接用来覆写源代码,需要搭配「patch」指令来使用。

选项 B,正确,在解压缩之后,再透过「patch」指令来套用。如果不事先解压缩的话也可以搭配「xzcat」指令来读取文件。

选项 C,先前的 Linux 内核源代码如果不是 4.6.0 版的话,必须先套用其它 patch 档来固定到 4.6.0 版。

选项 D,正确。

选项 E,先前的 Linux 内核源代码如果不是 4.6.0 版的话,必须先套用其它 patch 档来固定到 4.6.0 版。