Home
Categories
WIKI
Topic
User
LANGUAGE:
中文
English
Kernel 5.8.-rc6升级分享
Experiences and Insight
1160
views ·
0
replies ·
To
floor
Go
mmlmonkey
deepin
2020-07-25 22:27
Author
本帖最后由 mmlmonkey 于 2020-7-25 14:29 编辑
今日有兴趣升级一下最新内核尝鲜按照 @
kirin2018
大佬的帖子
https://bbs.deepin.org/post/194265#
和这两篇blog
https://www.kpromise.top/update-deepin-linux-kernel-to-latest/
https://www.htcp.net/4824.html
成功编译出来内核的deb 我传了蓝奏云
地址是https://wws.lanzous.com/inWjxez1hif https://wws.lanzous.com/iecvQez1hgd https://wws.lanzous.com/iRGs5ez1hfcsudo dpkg -i *deb 即可
但是发现deepin-anything bcmwl dkms会有error 简单看了一看 做了以下更改 可以成功生成module
1.Deepin-anything的 sudo dedit /usr/src/deepin-anything-0.0/vfs_change.c
第一处是 大概128行位置
time_t shifted_secs = vc->ts.tv_sec + hour_shift*3600;
Copy the Code
这里我google好一会 发现都是说time_t修改来解决2038年问题的新闻 但是没有人说怎么改这个类型 就交给编译器自己玩吧
所以直接放进函数
//time_t shifted_secs = vc->ts.tv_sec + hour_shift*3600;
struct tm ts;
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0)
time_to_tm(vc->ts.tv_sec + hour_shift*3600, 0, &ts);
#else
time64_to_tm(vc->ts.tv_sec + hour_shift*3600, 0, &ts);
#endif
Copy the Code
第二处
大概334行之后 这个是因为 file_operations的弃用 现在更改为了 procfs_ops
我们给他套上条件即可
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
static struct proc_ops procfs_ops = {
//.owner = THIS_MODULE,
.proc_open = open_vfs_changes,
.proc_read = read_vfs_changes,
.proc_ioctl = ioctl_vfs_changes,
.proc_lseek = no_llseek,
//.llseek = generic_file_llseek,
.proc_release = release_vfs_changes,
};
#else
static struct file_operations procfs_ops = {
.owner = THIS_MODULE,
.open = open_vfs_changes,
.read = read_vfs_changes,
.unlocked_ioctl = ioctl_vfs_changes,
.proc_lseek = no_llseek,
//.llseek = generic_file_llseek,
.release = release_vfs_changes,
};
#endif
Copy the Code
deepin-anything的就这么多
2.bcmwl这个其实吧我是不想管的 直接sudo apt remove bcmwl-kernel-source 就可以眼不见心不烦了
本着送佛送到西的原则 搜了一搜 大概是两个问题 ioremap_nocache 被弃用 ioremap可有替代 还有就是 file_operations
sudo dedit /usr/src/bcmwl-6.30.223.271+bdcom/src/wl/sys/wl_linux.c
在第583行之后
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
if ((wl->regsva = ioremap(dev->base_addr, PCI_BAR0_WINSZ)) == NULL) {
WL_ERROR(("wl%d: ioremap() failed\n", unit));
goto fail;
}
#else
if ((wl->regsva = ioremap_nocache(dev->base_addr, PCI_BAR0_WINSZ)) == NULL) {
WL_ERROR(("wl%d: ioremap() failed\n", unit));
goto fail;
}
#endif
Copy the Code
在781行之后
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
bar1_addr = (uchar *)ioremap(pci_resource_start(pdev, 2),
bar1_size);
#else
bar1_addr = (uchar *)ioremap_nocache(pci_resource_start(pdev, 2),
bar1_size);
#endif
Copy the Code
在3348行之后
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
static const struct proc_ops wl_fops = {
//.owner = THIS_MODULE,
.proc_read = wl_proc_read,
.proc_write = wl_proc_write,
};
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
static const struct file_operations wl_fops = {
.owner = THIS_MODULE,
.read = wl_proc_read,
.write = wl_proc_write,
};
#endif
Copy the Code
保存后再修改sudo dedit /usr/src/bcmwl-6.30.223.271+bdcom/src/shared/linux_osl.c
在943行之后
void *
osl_reg_map(uint32 pa, uint size)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
return (ioremap((unsigned long)pa, (unsigned long)size));
#else
return (ioremap_nocache((unsigned long)pa, (unsigned long)size));
#endif
}
Copy the Code
最后 重新sudo dpkg -i *deb 即可 结果如下
astrali@astrali-PC:~/ker$ dkms status
bcmwl, 6.30.223.271+bdcom, 5.3.0-3-amd64, x86_64: installed
bcmwl, 6.30.223.271+bdcom, 5.4.46, x86_64: installed
bcmwl, 6.30.223.271+bdcom, 5.8.0-rc6, x86_64: installed
deepin-anything, 0.0, 5.3.0-3-amd64, x86_64: installed
deepin-anything, 0.0, 5.4.46, x86_64: installed
deepin-anything, 0.0, 5.8.0-rc6, x86_64: installed
nvidia, 450.57, 5.3.0-3-amd64, x86_64: installed
nvidia, 450.57, 5.4.46, x86_64: installed
nvidia, 450.57, 5.8.0-rc6, x86_64: installed
Copy the Code
不保证work 如bug请找专门负责人去修
enjoy
Reply
Like 0
Favorite
View the author
All Replies
T***7@outlook.com
deepin
2023-02-22 19:21
#1
It has been deleted!
Please
sign
in first
Featured Collection
Change
[Tutorial] deepin25 WSL Offline Installation Guide
UOS AI 2.8 Released! Three New Intelligent Agents & Major Evolution
Solid Q&A | deepin 25 Common Questions – The Immutable System Edition
New Thread
Popular Events
More
今日有兴趣升级一下最新内核尝鲜按照 @kirin2018 大佬的帖子
https://bbs.deepin.org/post/194265#
和这两篇blog
https://www.kpromise.top/update-deepin-linux-kernel-to-latest/
https://www.htcp.net/4824.html
成功编译出来内核的deb 我传了蓝奏云
地址是https://wws.lanzous.com/inWjxez1hif https://wws.lanzous.com/iecvQez1hgd https://wws.lanzous.com/iRGs5ez1hfcsudo dpkg -i *deb 即可
但是发现deepin-anything bcmwl dkms会有error 简单看了一看 做了以下更改 可以成功生成module
1.Deepin-anything的 sudo dedit /usr/src/deepin-anything-0.0/vfs_change.c
第一处是 大概128行位置
所以直接放进函数
第二处
大概334行之后 这个是因为 file_operations的弃用 现在更改为了 procfs_ops
我们给他套上条件即可
2.bcmwl这个其实吧我是不想管的 直接sudo apt remove bcmwl-kernel-source 就可以眼不见心不烦了
本着送佛送到西的原则 搜了一搜 大概是两个问题 ioremap_nocache 被弃用 ioremap可有替代 还有就是 file_operations
sudo dedit /usr/src/bcmwl-6.30.223.271+bdcom/src/wl/sys/wl_linux.c
在第583行之后
在943行之后
最后 重新sudo dpkg -i *deb 即可 结果如下
不保证work 如bug请找专门负责人去修
enjoy