Skip to content

Commit 3193f23

Browse files
authored
Merge pull request microsoft#111 from miguelinux/kernelconfig-refactoring
Kernelconfig refactoring and add missing patches
2 parents 2dad06f + c66398b commit 3193f23

10 files changed

Lines changed: 97 additions & 45 deletions

docs/customosbuildinstructions.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ A LCOW custom Linux OS image was divided into two parts: a Linux kernel module a
99

1010
- Have your 4.11 kernel source tree ready
1111

12-
- Apply additional [4.11 patches](../kernelconfig/4.11/patches_readme.md) to your 4.11 kernel source tree
12+
- Apply additional [4.11 patches](../kernel/README.md) to your 4.11 kernel source tree
1313

14-
- Use the recommended [Kconfig](../kernelconfig/4.11/kconfig_for_4_11/) to include all LCOW necessary kernel components
14+
- Use the recommended [Kconfig](../kernel/kernel_config-4.11.x) to include all LCOW necessary kernel components
1515

1616
- Build your kernel
1717

@@ -21,7 +21,7 @@ A LCOW custom Linux OS image was divided into two parts: a Linux kernel module a
2121

2222
## How to construct user-mode components
2323

24-
The expected user mode directory structure is required to constructed as follows: [See the complete user-mode file list](../kernelconfig/4.11/completeUsermodeFileLists.md/)
24+
The expected user mode directory structure is required to constructed as follows: [See the complete user-mode file list](../kernel/completeUsermodeFileLists.md)
2525

2626
Under the / directory, it should have the following subdirectories:
2727

@@ -46,7 +46,7 @@ Here are the expected contents of each subdirectory /file
4646
1. Subdirectories with **empty** contents: /tmp /proc /dev /run /etc /usr /mnt /sys
4747

4848
2. **/init**
49-
This is the [init script file](../kernelconfig/4.11/scripts/init_script)
49+
This is the [init script file](../kernel/scripts/init_script)
5050

5151
3. **/root** : this is the home directory of the root account.
5252

@@ -82,7 +82,7 @@ Here are the expected contents of each subdirectory /file
8282

8383
7. **/bin** : binaries in this subdir are categorised into four groups
8484

85-
- [GCS binaries](gcsbuildinstructions.md/)
85+
- [GCS binaries](gcsbuildinstructions.md)
8686

8787
/bin/exportSandbox
8888
/bin/gcs

kernel/README.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Custom Linux kernel for LCOW
2+
3+
Here you will find the steps to build a custom kernel for the
4+
Linux Hyper-V container on Windows (**LCOW**). To build the full image,
5+
please follow the instruction from [how to produce a custom Linux OS
6+
image](../docs/customosbuildinstructions.md)
7+
8+
## Patches
9+
10+
So far **LCOW** is based on Linux Kernel 4.11, you can download the Linux source
11+
code from [kernel.org](https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.11.tar.xz).
12+
13+
Once you get the _4.11 kernel_, apply all the patches files located in the
14+
[patches-4.11.x](./patches-4.11.x) directory. You should be in the Linux kernel
15+
source directory
16+
17+
```
18+
patch -p1 < /path/to/kernel/patches-4.11.x/0001-*
19+
patch -p1 < /path/to/kernel/patches-4.11.x/0002-*
20+
```
21+
22+
or in a simple line
23+
24+
```
25+
for p in /path/to/kernel/patches-4.11.x/*.patch; do patch -p1 < $p; done
26+
```
27+
28+
Beside the patches located in the [patches-4.11.x](./patches-4.11.x) directory,
29+
you need to apply a set of patches to enable the **Hyper-V vsock transport**
30+
feature in the Linux kernel. Please refer to the following section to view the
31+
instructions to get them.
32+
33+
#### Instructions for getting Hyper-V vsock patch set
34+
35+
These patches enables the **Hyper-V vsock transport** feature,
36+
this instructions is to get them from a developer repository and
37+
assuming you have a _Linux GIT repository_ already
38+
39+
```
40+
git config --global user.name "yourname"
41+
git config --global user.email youremailaddress
42+
43+
git remote add -f dexuan-github https://github.com/dcui/linux.git
44+
45+
git cherry-pick c248b14174e1337c1461f9b13a573ad90a136e1c
46+
git cherry-pick 008d8d8bc0c86473a8549a365bee9a479243e412
47+
git cherry-pick 4713066c11b2396eafd2873cbed7bdd72d1571eb
48+
git cherry-pick 1df677b35ff010d0def33f5420773015815cf843
49+
git cherry-pick 3476be340d2ff777609fca3e763da0292acbfc45
50+
git cherry-pick b5566b1b6e5cb19b381590587f841f950caabe4d
51+
git cherry-pick 6f1aa69011356ff95ed6c57400095e5f2d9eb900
52+
git cherry-pick 2fac74605d2db862caaaf4890239b57095fba832
53+
git cherry-pick 2e307800c6a01cd789afe34eccbcabf384959b3f
54+
git cherry-pick 83c8635b893bbc0b5b329c632cea0382d5479763
55+
git cherry-pick a2c08e77b8ceb1f146cdc5136e85e7a4c2c9b7cb
56+
git cherry-pick be1ce15dfbdfe3f42c8ed23c5904674d5d90b545
57+
git cherry-pick 8457502df9dd379ddbdfa42a8c9a6421bb3482f1
58+
git cherry-pick 1b91aa6d0e745d9765e3d90058928829f0b0bd40
59+
git cherry-pick 531389d1dc73e2be3ee5dbf2091b6f5e74d9764c
60+
git cherry-pick c49aced6328557e6c1f5cf6f58e1fae96fb58fa0
61+
git cherry-pick 651dae7de6c6f066c08845ec7335bfb231d5eabe
62+
```
63+
64+
Another way to get the patches is to download them from the following list and
65+
apply them in the same order:
66+
67+
1. https://github.com/dcui/linux/commit/c248b14174e1337c1461f9b13a573ad90a136e1c.patch
68+
2. https://github.com/dcui/linux/commit/008d8d8bc0c86473a8549a365bee9a479243e412.patch
69+
3. https://github.com/dcui/linux/commit/4713066c11b2396eafd2873cbed7bdd72d1571eb.patch
70+
4. https://github.com/dcui/linux/commit/1df677b35ff010d0def33f5420773015815cf843.patch
71+
5. https://github.com/dcui/linux/commit/3476be340d2ff777609fca3e763da0292acbfc45.patch
72+
6. https://github.com/dcui/linux/commit/b5566b1b6e5cb19b381590587f841f950caabe4d.patch
73+
7. https://github.com/dcui/linux/commit/6f1aa69011356ff95ed6c57400095e5f2d9eb900.patch
74+
8. https://github.com/dcui/linux/commit/2fac74605d2db862caaaf4890239b57095fba832.patch
75+
9. https://github.com/dcui/linux/commit/2e307800c6a01cd789afe34eccbcabf384959b3f.patch
76+
10. https://github.com/dcui/linux/commit/83c8635b893bbc0b5b329c632cea0382d5479763.patch
77+
11. https://github.com/dcui/linux/commit/a2c08e77b8ceb1f146cdc5136e85e7a4c2c9b7cb.patch
78+
12. https://github.com/dcui/linux/commit/be1ce15dfbdfe3f42c8ed23c5904674d5d90b545.patch
79+
13. https://github.com/dcui/linux/commit/8457502df9dd379ddbdfa42a8c9a6421bb3482f1.patch
80+
14. https://github.com/dcui/linux/commit/1b91aa6d0e745d9765e3d90058928829f0b0bd40.patch
81+
15. https://github.com/dcui/linux/commit/531389d1dc73e2be3ee5dbf2091b6f5e74d9764c.patch
82+
16. https://github.com/dcui/linux/commit/c49aced6328557e6c1f5cf6f58e1fae96fb58fa0.patch
83+
17. https://github.com/dcui/linux/commit/651dae7de6c6f066c08845ec7335bfb231d5eabe.patch
84+
85+
### Patches structure
86+
87+
In the [patches-4.11.x](./patches-4.11.x) directory you will find the
88+
following patches:
89+
90+
- [9pfs: added vsock transport support](./patches-4.11.x/0001-Added-vsock-transport-support-to-9pfs.patch)
91+
92+
- [nvdimm: Lower minimum PMEM size](./patches-4.11.x/0002-NVDIMM-reducded-ND_MIN_NAMESPACE_SIZE-from-4MB-to-4K.patch)
File renamed without changes.

kernelconfig/4.11/patch_9pfs_vsock-transport.patch renamed to kernel/patches-4.11.x/0001-Added-vsock-transport-support-to-9pfs.patch

File renamed without changes.

kernelconfig/4.11/patch_lower-the-minimum-PMEM-size.patch renamed to kernel/patches-4.11.x/0002-NVDIMM-reducded-ND_MIN_NAMESPACE_SIZE-from-4MB-to-4K.patch

File renamed without changes.

kernelconfig/4.11/patch_hyperv_vsock_patch_instruction.txt

Lines changed: 0 additions & 24 deletions
This file was deleted.

kernelconfig/4.11/patches_readme.md

Lines changed: 0 additions & 12 deletions
This file was deleted.

kernelconfig/4.11/readme.txt

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)