9

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

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

How to use clearlinux kernel for ubuntu?

Hoping for a step-by-step copy/paste guide to replace ubuntu kernel with clearlinux kernel. still incomplete copy/paste code. I wish it will be completed someday.

**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) ...

BEFORE REBOOT 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

2
+500

I don't have specific experience with ClearLinux, but it looks like you can:

# 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

That should download the upstream kernel to a folder below ~/patched_source (it will tell you the exact name) and apply ClearLinux's own patches and default config.

You can then proceed to compile the kernel as usual, for instance:

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

Disabling the CONFIG_RETPOLINE mitigation makes it possible to compile with Ubuntu's gcc (at a cost, obviously).

The usual warnings apply: try in a VM first, secure boot can be tricky, there might be some Ubuntu-specific patches missing, ...

If you feel adventurous you can also add some of their own cmdline options to /etc/default/grub (like the ones in lines 8-15)

15
  • android@clr:~/clearlinux_patches/scripts (master) $ ./develop.sh ~/patched_source grep: /home/android/patched_source: Is a directory Apr 28 '20 at 3:40
  • *stuck at above - going no further Apr 28 '20 at 3:40
  • Corrected the first arg. But, I will add, be careful.
    – Jacopo
    Apr 28 '20 at 20:22
  • stuck still......... Apr 29 '20 at 2:52
  • Note that I changed a line: ./scripts/develop.sh linux.spec ~/patched_source
    – Jacopo
    Apr 29 '20 at 3:22
2

Thanks to @Jacopo I am reposting this for my future refrence.

How to install clearlinux gcc in ubuntu?

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

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 

post install freezing kernel

sudo apt-mark hold linux-generic linux-image-generic linux-headers-generic
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.