在windows的下的wsl安装纯自由内核,在专有软件的监牢中仰望自由

Posted 13 months ago windows cli linux bash microsoft

上回说到。我的x79主机用上了一颗有信仰的cpu

那软件也要有信仰加成

于是我决定 给wsl 换上librekernel内核(gnu认证纯自由软件内核)

https://www.fsfla.org/ikiwiki/selibre/linux-libre/

gimp

直接去下载 linux-libre.fsfla.org/pub/linux-libre/releases/

然后下载

https://github.com/microsoft/WSL2-Linux-Kernel

给ubuntu 安装编译环境


sudo apt install build-essential flex bison dwarves libssl-dev libelf-dev

复制出配置文件到新的libre kernel目录


cp Microsoft/config-wsl linux-6.2/

编辑配置 打开kvm等配置(只粘贴了部分配置,太长了。。 酌情替换)

CONFIG_F2FS_FS=y
CONFIG_F2FS_STAT_FS=y
CONFIG_F2FS_FS_XATTR=y
CONFIG_F2FS_FS_POSIX_ACL=y
CONFIG_F2FS_FS_SECURITY=y
CONFIG_F2FS_CHECK_FS=y
CONFIG_F2FS_FAULT_INJECTION=y
CONFIG_F2FS_FS_COMPRESSION=y
CONFIG_F2FS_FS_LZO=y
CONFIG_F2FS_FS_LZORLE=y
CONFIG_F2FS_FS_LZ4=y
CONFIG_F2FS_FS_LZ4HC=y
CONFIG_F2FS_FS_ZSTD=y
CONFIG_F2FS_IOSTAT=y
CONFIG_F2FS_UNFAIR_RWSEM=y

CONFIG_HAVE_KVM=y
CONFIG_HAVE_KVM_PFNCACHE=y
CONFIG_HAVE_KVM_IRQCHIP=y
CONFIG_HAVE_KVM_IRQFD=y
CONFIG_HAVE_KVM_IRQ_ROUTING=y
CONFIG_HAVE_KVM_DIRTY_RING=y
CONFIG_HAVE_KVM_DIRTY_RING_TSO=y
CONFIG_HAVE_KVM_DIRTY_RING_ACQ_REL=y
CONFIG_HAVE_KVM_EVENTFD=y
CONFIG_KVM_MMIO=y
CONFIG_KVM_ASYNC_PF=y
CONFIG_HAVE_KVM_MSI=y
CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT=y
CONFIG_KVM_VFIO=y
CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT=y
CONFIG_KVM_COMPAT=y
CONFIG_HAVE_KVM_IRQ_BYPASS=y
CONFIG_HAVE_KVM_NO_POLL=y
CONFIG_KVM_XFER_TO_GUEST_WORK=y
CONFIG_VIRTUALIZATION=y
CONFIG_KVM=y
CONFIG_KVM_WERROR=y
CONFIG_KVM_INTEL=y
CONFIG_KVM_AMD=y
CONFIG_KVM_SMM=y

CONFIG_AS_AVX512=y
CONFIG_AS_SHA1_NI=y
CONFIG_AS_SHA256_NI=y
CONFIG_AS_TPAUSE=y

CONFIG_LOCALVERSION="-GNULinux-libre"

编译

make KCONFIG_CONFIG=config-wsl -j15

在windows下的 ~目录下 touch .wslconfig


[experimental]
autoMemoryReclaim=true

[wsl2]
kernel=C:\\Users\\Administrator\\vmlinux

重启wsl

wsl --shutdown

wsl uname -a

点击评论