首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >如何用clearlinux内核替换ubuntu20.04内核?

如何用clearlinux内核替换ubuntu20.04内核?
EN

Ask Ubuntu用户
提问于 2020-04-25 14:45:58
回答 2查看 2.8K关注 0票数 10

https://github.com/clearlinux-pkgs/linux

https://aur.archlinux.org/packages/linux-clear/

如何为ubuntu使用clearlinux内核?

希望有一个逐步复制/粘贴指南,用clearlinux内核替换ubuntu内核。复制/粘贴代码仍然不完整。我希望有一天能完成。

代码语言:javascript
运行
复制
**DONE**
android@nazar:~/patched_source/linux-5.6.10$ cd ../
android@nazar:~/patched_source$ ls
linux-5.6.10                             linux-headers-5.6.10+_5.6.10+-1_amd64.deb
linux-5.6.10+_5.6.10+-1_amd64.buildinfo  linux-image-5.6.10+_5.6.10+-1_amd64.deb
linux-5.6.10+_5.6.10+-1_amd64.changes    linux-libc-dev_5.6.10+-1_amd64.deb
android@nazar:~/patched_source$ uname -a
Linux nazar 5.4.0-26-generic #30-Ubuntu SMP Mon Apr 20 16:58:30 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
android@nazar:~/patched_source$ sudo dpkg -i ../*.deb 
[sudo] password for android: 
dpkg: error: cannot access archive '../*.deb': No such file or directory
android@nazar:~/patched_source$ sudo dpkg -i *.deb 
Selecting previously unselected package linux-headers-5.6.10+.
(Reading database ... 152012 files and directories currently installed.)
Preparing to unpack linux-headers-5.6.10+_5.6.10+-1_amd64.deb ...
Unpacking linux-headers-5.6.10+ (5.6.10+-1) ...
Selecting previously unselected package linux-image-5.6.10+.
Preparing to unpack linux-image-5.6.10+_5.6.10+-1_amd64.deb ...
Unpacking linux-image-5.6.10+ (5.6.10+-1) ...
Preparing to unpack linux-libc-dev_5.6.10+-1_amd64.deb ...
Unpacking linux-libc-dev:amd64 (5.6.10+-1) over (5.4.0-26.30) ...
Setting up linux-headers-5.6.10+ (5.6.10+-1) ...
Setting up linux-image-5.6.10+ (5.6.10+-1) ...
 * dkms: running auto installation service for kernel 5.6.10+                                           
Kernel preparation unnecessary for this kernel.  Skipping...
applying patch 0002-Makefile.patch...patching file Makefile
Hunk #1 succeeded at 113 with fuzz 1.
Hunk #2 succeeded at 132 with fuzz 2 (offset 1 line).

applying patch 0003-Make-up-for-missing-init_MUTEX.patch...patching file src/wl/sys/wl_linux.c
Hunk #1 succeeded at 111 with fuzz 2 (offset 12 lines).

applying patch 0010-change-the-network-interface-name-from-eth-to-wlan.patch...patching file src/wl/sys/wl_linux.c
Hunk #1 succeeded at 221 (offset -14 lines).

applying patch 0013-gcc.patch...patching file Makefile

applying patch 0019-broadcom-sta-6.30.223.248-3.18-null-pointer-fix.patch...patching file src/wl/sys/wl_linux.c
Hunk #1 succeeded at 2169 (offset 12 lines).

applying patch 0020-add-support-for-linux-4.3.patch...patching file src/shared/linux_osl.c

applying patch 0021-add-support-for-Linux-4.7.patch...patching file src/wl/sys/wl_cfg80211_hybrid.c

applying patch 0022-add-support-for-Linux-4.8.patch...patching file src/wl/sys/wl_cfg80211_hybrid.c
Hunk #1 succeeded at 2391 (offset 3 lines).
Hunk #2 succeeded at 2501 (offset 3 lines).
Hunk #3 succeeded at 2933 (offset 9 lines).

applying patch 0023-add-support-for-Linux-4.11.patch...patching file src/include/linuxver.h
patching file src/wl/sys/wl_linux.c
Hunk #1 succeeded at 2919 (offset 4 lines).

applying patch 0024-add-support-for-Linux-4.12.patch...patching file src/wl/sys/wl_cfg80211_hybrid.c
Hunk #1 succeeded at 55 (offset 5 lines).
Hunk #2 succeeded at 472 (offset 5 lines).
Hunk #3 succeeded at 2371 (offset 5 lines).
Hunk #4 succeeded at 2388 (offset 5 lines).

applying patch 0025-add-support-for-Linux-4.14.patch...patching file src/shared/linux_osl.c
Hunk #1 succeeded at 1080 (offset 4 lines).

applying patch 0026-add-support-for-Linux-4.15.patch...patching file src/wl/sys/wl_linux.c
Hunk #2 succeeded at 2306 (offset 4 lines).
Hunk #3 succeeded at 2368 (offset 4 lines).

applying patch 0027-add-support-for-linux-5.1.patch...patching file src/include/linuxver.h
Hunk #1 succeeded at 595 (offset 4 lines).


Building module:
cleaning build area...
make -j4 KERNELRELEASE=5.6.10+ -C /lib/modules/5.6.10+/build M=/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build....(bad exit status: 2)
ERROR (dkms apport): kernel package linux-headers-5.6.10+ is not supported
Error! Bad return status for module build on kernel: 5.6.10+ (x86_64)
Consult /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/make.log for more information.
                                                                                                 [ OK ]
update-initramfs: Generating /boot/initrd.img-5.6.10+
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.6.10+
Found initrd image: /boot/initrd.img-5.6.10+
Found linux image: /boot/vmlinuz-5.4.0-26-generic
Found initrd image: /boot/initrd.img-5.4.0-26-generic
Adding boot menu entry for UEFI Firmware Settings
done
Setting up linux-libc-dev:amd64 (5.6.10+-1) ...

重新启动android@ nazar:~/$ uname -a LinuxNazar5.4.0-26-泛型#30-Ubuntu 20 16:58:30 UTC 2020 x86_64 GNU/Linux

EN

回答 2

Ask Ubuntu用户

发布于 2020-04-28 02:40:03

我没有使用ClearLinux的具体经验,但看起来您可以:

代码语言:javascript
运行
复制
# It's best to first compile their gcc (https://github.com/clearlinux-pkgs/gcc)
mkdir ~/patched_source
git clone https://github.com/clearlinux-pkgs/linux ~/clearlinux_patches
cd ~/clearlinux_patches
./scripts/develop.sh linux.spec ~/patched_source

它应该将上游内核下载到下面的文件夹中(它会告诉您确切的名称),并应用ClearLinux自己的补丁和默认的config

然后,您可以像往常一样继续编译内核,例如:

代码语言:javascript
运行
复制
cd that_folder
CC=/the/clearlinux/gcc make -j4 bindeb-pkg
# This will take a while and create a few linux-xxx.deb files in the parent directory
sudo dpkg -i ../*.deb   # Or just the latest

禁用CONFIG_RETPOLINE缓解功能使得可以使用Ubuntu的gcc进行编译(显然需要付出代价)。

通常的警告适用于:首先在VM中尝试,安全引导可能很棘手,可能会有一些特定于Ubuntu的补丁丢失,.

如果您感到冒险,也可以将一些他们自己的cmdline选项添加到/etc/default/grub中(如第8-15行中的那些)。

票数 3
EN

Ask Ubuntu用户

发布于 2020-05-06 07:47:37

多亏了@Jacopo,我重新发布了这篇文章,供我将来参考。

如何在乌本图安装透明线gcc?

https://cdn.download.clearlinux.org/releases/33040/clear/x86_64/os/包/

代码语言:javascript
运行
复制
android@nazar:~/
wget https://cdn.download.clearlinux.org/releases/33030/clear/x86_64/os/Packages/gcc7-7.5.0-440.x86_64.rpm
sudo apt install alien git curl flex bison libssl-dev
sudo alien gcc7-7.5.0-440.x86_64.rpm
sudo dpkg -i gcc7_7.5.0-441_amd64.deb
gcc7 -v
mkdir ~/patched_source
git clone https://github.com/clearlinux-pkgs/linux ~/clearlinux_patches
cd ~/clearlinux_patches
git clone https://github.com/clearlinux-pkgs/linux ~/clearlinux_patches
cd ~/clearlinux_patches
./scripts/develop.sh linux.spec ~/patched_source
git config --global user.email "you@example.com"
./scripts/develop.sh linux.spec ~/patched_source
cd /home/android/patched_source/linux*
CC=/the/clearlinux/gcc make -j4 bindeb-pkg
sudo dpkg -i ../*.deb 

安装后冻结内核

代码语言:javascript
运行
复制
sudo apt-mark hold linux-generic linux-image-generic linux-headers-generic
票数 3
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1230903

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档