Skip to content

Commit 0a29d2b

Browse files
committed
update new file
0 parents  commit 0a29d2b

File tree

8 files changed

+29427
-0
lines changed

8 files changed

+29427
-0
lines changed

.github/workflows/build.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: auto build engine
2+
3+
on:
4+
release:
5+
types: [published]
6+
schedule:
7+
- cron: "0 16 * * *"
8+
push:
9+
branches:
10+
- master
11+
watch:
12+
types: [started]
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-24.04
17+
18+
steps:
19+
- name: Install build depedencies
20+
run: |
21+
sudo apt update
22+
sudo apt install -y flex bison libelf-dev dwarves
23+
24+
- name: Bulid kernel
25+
run: |
26+
git clone https://github.com/torvalds/linux.git --depth 1 linux
27+
#git clone https://github.com/microsoft/WSL2-Linux-Kernel --depth 1 linux
28+
#git clone https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git -b for-kbuild-bot/current-stable --depth 1 linux
29+
wget --no-check-certificate https://raw.githubusercontent.com/ActiveIce/WSL2-Linux-Kernel/master/dxgkrnl.patch
30+
wget --no-check-certificate https://raw.githubusercontent.com/ActiveIce/WSL2-Linux-Kernel/master/fix.patch
31+
pushd linux
32+
git apply ../dxgkrnl.patch --reject
33+
git apply ../fix.patch --reject
34+
#dxgkrnl patch fix commit
35+
#120ae58593630819209a011a3f9c89f73bcc9894
36+
#0069455bcbf9ea73ffe4553ed6d2b4e4cad703de
37+
wget --no-check-certificate -P Microsoft https://raw.githubusercontent.com/microsoft/WSL2-Linux-Kernel/linux-msft-wsl-6.6.y/arch/x86/configs/config-wsl
38+
#scripts/config --disable PREEMPT_NONE
39+
#scripts/config --enable PREEMPT_RT
40+
make -j$(nproc) KCONFIG_CONFIG=Microsoft/config-wsl LOCALVERSION=""
41+
popd
42+
43+
- name: Upload kernel
44+
uses: actions/upload-artifact@main
45+
with:
46+
name: bzImage
47+
path: linux/arch/x86/boot/bzImage
48+
49+
push:
50+
needs: build
51+
runs-on: ubuntu-24.04
52+
53+
steps:
54+
- name: Checkout
55+
uses: actions/checkout@main
56+
57+
- name: Clean
58+
run: |
59+
rm bzImage
60+
61+
- name: Download kernel
62+
uses: actions/download-artifact@main
63+
with:
64+
name: bzImage
65+
path: ./
66+
67+
- name: Commit
68+
run: |
69+
git config --global user.email "[email protected]"
70+
git config --global user.name "GitHub Actions"
71+
git checkout --orphan new_branch
72+
git add -A
73+
git commit -am "update new file"
74+
git branch -D master
75+
git branch -m master
76+
git push origin master --force

LICENSE

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# WSL2-Linux-Kernel
2+
3+
[![auto build engine](https://github.com/ActiveIce/WSL2-Linux-Kernel/workflows/auto%20build%20engine/badge.svg)](https://github.com/ActiveIce/WSL2-Linux-Kernel/actions)
4+
![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/torvalds/linux?color=informational&label=verison)
5+
![GPU Compute](https://img.shields.io/badge/CUDA-Support-brightgreen)
6+
7+
## 系统要求
8+
9+
Windows 10 版本 2004 (OS 内部版本 20145) 或更高版本
10+
``` PowerShell
11+
winver.exe
12+
```
13+
14+
启用 “适用于 Linux 的 Windows 子系统” “虚拟机平台” (需要重启)
15+
``` PowerShell
16+
wsl.exe --install
17+
```
18+
19+
## 下载
20+
21+
下载系统镜像、引导程序、内核至同一文件夹
22+
23+
[Ubuntu 24.04 (Noble)](https://cloud-images.ubuntu.com/wsl/noble/current/ubuntu-noble-wsl-amd64-wsl.rootfs.tar.gz)
24+
25+
[Ubuntu Loader](https://raw.githubusercontent.com/ActiveIce/WSL2-Linux-Kernel/master/ubuntu.exe)
26+
27+
[WSL2-Linux-Kernel](https://raw.githubusercontent.com/ActiveIce/WSL2-Linux-Kernel/master/bzImage)
28+
29+
30+
`ubuntu-noble-wsl-amd64-wsl.rootfs.tar.gz` 重命名为 `install.tar.gz`
31+
32+
## 配置
33+
在用户文件夹的根目录 `C:\Users\<yourUserName>` 新建文件 `.wslconfig`
34+
35+
`.wslconfig` 文件中按格式填入内核路径、分配CPU核心数、分配内存数量
36+
37+
``` PowerShell
38+
[wsl2]
39+
kernel=D:\\Ubuntu\\bzImage
40+
processors=4
41+
memory=4GB
42+
```
43+
44+
## 安装和使用
45+
``` PowerShell
46+
.\ubuntu.exe --ui=tui
47+
```
48+
49+
首次使用按提示设置用户名和密码即可
50+
51+
52+
#### 清理 VHDX 磁盘
53+
VHDX 磁盘文件不会随着 Ubuntu 系统内文件的删除而变小,若磁盘文件太大,可以手动缩小
54+
55+
##### 方法一
56+
57+
清理命令 ( `select vdisk file=` 后面参数是 VHDX 文件的路径)
58+
``` PowerShell
59+
wsl.exe --exec sudo fstrim /
60+
wsl.exe --shutdown
61+
diskpart
62+
select vdisk file="D:\Ubuntu\ext4.vhdx"
63+
attach vdisk readonly
64+
compact vdisk
65+
detach vdisk
66+
exit
67+
```
68+
69+
##### 方法二
70+
71+
启用 “Windows Powershell 的 Hyper-V 模块” (需要重启)
72+
``` PowerShell
73+
dism.exe /online /enable-feature /featurename:Microsoft-Hyper-V-Management-PowerShell /all /norestart
74+
```
75+
清理命令 ( `-Path` 后面参数是 VHDX 文件的路径)
76+
``` PowerShell
77+
wsl.exe --shutdown
78+
Mount-VHD -Path "D:\Ubuntu\ext4.vhdx" -ReadOnly
79+
Optimize-VHD -Path "D:\Ubuntu\ext4.vhdx" -Mode Full
80+
Dismount-VHD -Path "D:\Ubuntu\ext4.vhdx"
81+
```

bzImage

16.4 MB
Binary file not shown.

0 commit comments

Comments
 (0)