Not a member yet? Why not Sign up today
Create an account  

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 
Tigerite's kernel for Microsoft Surface devices

#1
Hello to everybody!  Smile I think that I'm a fortunate guy because I have seen very nice kernels along my brief life with Linux. When XanMod appears everything changed: it was (and it is) a revolution in kernel development. Who was able to imagine the still fastest 500Hz kernel fully tuned with too much advantages in performance than almost every kernel you are able to find, absolutely well maintained day after day, version after version? I'll tell you: nobody. And I was there to enjoy it!  Smile

Now I'm a fortunate guy again: I have seen to born another promising kernel following the Ubuntu/Mint/Debian's philosophy on two kernels for image, and also two for headers. Just the flavour of the old way applied to the newest ideas: mixing XanMod and Liquorix. Initially thought for Microsoft Surface devices, it runs in almost every computer -- and we have his creator as a member of us, Tigerite!  Wink

This is an example of how the good ideas grow by themselves, furthermore with the best tribute to XanMod, as it's using its patches and tweaks. Also it opens very good threads for the development of the XanMod kernel while testing new features. Smile
Quote:[b]
You should use this kernel if you have any Microsoft Surface device because it's the best fit for them. Also you may install this 625Hz kernel if you are inside any of these next scenarios:
*
1. Your system/CPU is only 32bit and you want to feel the most likely Xanmod kernel.
2. You need any of its features, explained and listed in its own PPA site.

To install this 32/64bit kernel from Tigerite's PPA in your system, please read carefully:
https://launchpad.net/~tigerite/+archive/ubuntu/kernel
Code:
# alternative method for ubuntu from 12.04 to 16.04 included and derived or equivalent systems
$ echo "deb http://ppa.launchpad.net/tigerite/kernel/ubuntu trusty main" | sudo tee /etc/apt/sources.list.d/tigerite-kernel-trusty.list
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 984AE706D31B333A && sudo apt-get update
[i]Edit: you can get also the four individual packages one by one directly at the PPAs (linux-headers, linux-headers-all, linux image and linux image-extra 32/64bit, as you need).

Edit2: if you are a Debian user, please let us to know about your experience, thanks!
Edit3: in order to download the packages you should install the required file -- see PPA.

Adding this PPA you can install also the latest GCC 5.3.1, thermald and more. If you need to delete the Surface kernel maintaining the other installed software from it:
Code:
# to remove the normal branch, just identify and remove the packages from Tigerites's PPA as the next example
$ sudo dpkg -l | grep linux-image && sudo dpkg -l | grep linux-headers && sudo apt-get remove --purge linux-image-4.4-surface linux-image-extra-4.4-surface linux-image-surface && sudo apt-get remove --purge linux-headers-4.4-surface linux-surface linux-headers-surface-4.4 linux-headers-surface
# to remove the bfs branch, just identify and remove the packages from Tigerites's PPA as the next example
$ sudo dpkg -l | grep linux-image && sudo dpkg -l | grep linux-headers && sudo apt-get remove --purge linux-image-4.4-surface-bfs linux-image-extra-4.4-surface-bfs linux-image-surface-bfs && sudo apt-get remove --purge linux-headers-4.4-surface-bfs linux-headers-surface-bfs linux-surface-bfs linux-surface-bfs-headers-4.4 linux-headers-surface-bfs-4.4
Edit: to remove the entire PPA see these instructions.

If you have any doubt, I'm sure that our member Tigerite will answer it. Thank you Tigerite for using XanMod patches, and thank you Xan for helping us so much! Smile

*
Note: please, do notice that this isn't a topic about speed, performance, CPU temperature, memory consumption or whatever other comparison with Xan's kernel but a topic for open development, proposals, brainstorming and new threads for kernel building itself -- always useful for our proud users in the free and collaborative world of Linux/GNU. Smile
"(...) the grandest occasion the past or present has seen, or the future can hope to see." -- Cervantes.
Reply

#2
Most recent kernel for Microsoft Surface devices with all XanMod patches:

Code:
~$ dmesg | grep -i -e 'bfs' -e 'bfq' -e 'toi' -e 'tux' -e 'uksm'
[    1.998243] BFQ I/O-scheduler: v7r11
[    2.790312] TuxOnIce 3.3 (http://tuxonice.net)
[    3.019278] UKSM: relative memcmp_cost = 112 hash=3275309526 cmp_ret=0.
[    3.053764] BFS CPU scheduler v0.466 by Con Kolivas.
[    3.053767] BFS enhancement patchset v4.4_0466_vrq3 by Alfred Chen.
~$ uname -a
Linux tropic 4.4.0-7-generic #22surface11 ZEN SMP Fri Feb 26 15:51:55 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Smile
"(...) the grandest occasion the past or present has seen, or the future can hope to see." -- Cervantes.
Reply

#3
Tigerite, as you have decided not to build low-latency kernels, wouldn't be a good idea rename them from linux-image-4.4.0-7-generic to linux-image-4.4.0-7-surface11 or also linux-image-4.4.0-7-surface11-bfs or something related?  ???
"(...) the grandest occasion the past or present has seen, or the future can hope to see." -- Cervantes.
Reply

#4
Yes that's my plan eventually. My preference would be to have BFS as the default, but as 4.4 has shown it isn't always kept up-to-date and changes in the mainline kernel can often prevent it from either working or being patch-able. Liquorix does seem to be updated more often, along with BFQ and TuxOnIce (UKSM is another matter, but it has remained basically unchanged since 4.0). So it may be wise to have just -surface for future releases where BFS isn't available for some time, then -surface-bfs for when it is updated. I would then add both to the linux-surface and linux-surface-bfs meta packages, similar to how Ubuntu does with -generic and -lowlatency to track the latest release.

Thankyou for all of your kind words, by the way. It's been quite an effort to get everything combined into one kernel but I think the end result is worth it Smile
Reply

#5
Thank you too for solving my notebook's suspend/resume problem.  Big Grin Latest XanMod still hasn't the patch.  :-[ Anyway, if you decide to open two flavours you shouldn't mind about the updating plans of Liquorix or whatever people, as you release your packages when them are ready -- less work for you, less problems too. Furthermore, it would be a better idea to maintain the BFS in the main actually release linux-surface, and then improve a secondary release linux-surface-nonBFS, as the most lightly solution with less work in the PPA -- so the users knows exactly what it doesn't have. I meant it's easiest to identify the flavour for the patch that is not inside. I guess. ???

Edit: will you upload surface11 to PPA? currently uploaded.
"(...) the grandest occasion the past or present has seen, or the future can hope to see." -- Cervantes.
Reply

#6
That was exactly my thinking, perhaps with -surface and -surface-zen (as without BFS it uses Zen-ified CFS). I'd probably need to add BFS to the uname -a string as otherwise the ZEN would likely confuse people Smile and yes, I updated the PPA (and instructions this time Wink ) as soon as you confirmed suspend/resume to work with it Smile
Reply

#7
(27-02-2016, 07:24 AM)Tigerite link Wrote:That was exactly my thinking, perhaps with -surface and -surface-zen (as without BFS it uses Zen-ified CFS). I'd probably need to add BFS to the uname -a string as otherwise the ZEN would likely confuse people Smile and yes, I updated the PPA (and instructions this time Wink ) as soon as you confirmed suspend/resume to work with it Smile

That is, if both flavours use ZEN there is not difference to make among them in that way. Just remember that the most easiest way of starting the two flavours is to duplicate the linux-surface activator of the current PPA and then renaming it linux-surface-nonbfs or whatever. Also it's very recommended too to change the linux-image-surface and linux-headers-surface to linux-image-surface-nonbfs and linux-image-surface-nonbfs or whatever. Then it's highly probably that you need to change near all the strings of almost every files of the second flavour (i.e. 4.4.0-7-surface8-nonbfs or whatever) to avoid PPA conflicts between both versions). This probably means initial less work because you have now an entire flavour built inside the PPA with people currently using it. Again, it's very probably that you need also to rename the strings of the packages from 'generic' to 'surface' if you consider it will be useful to identify the packages when sudo dpkg -l | grep linux-image and sudo dpkg -l | grep linux-headers) commands.  Tongue Furthermore, will people receive the updates if you change the current linux-surface activator? I guess not, but I'm not sure of this point. :-X

Edit: obviously, there is three ways of working in this issue, a) waiting for the next release (4.4.0-8) to make both flavours completely again starting from zero, b) rename and adapt only all the entire current flavour, upload it to the PPA and wait for next release for built both from zero, the last c) make all the work without waiting for the next release -- recommended if the next release will not available soon. I personally will choose the option 'c' but it implies a lot of work.  :-[
"(...) the grandest occasion the past or present has seen, or the future can hope to see." -- Cervantes.
Reply

#8
With BFS, Zen is relegated to simply changing the sampling down factor of ondemand (which is in XanMod patches anyway) and modifying writeback ratios to use bytes (which could be done through sysctl). So it has very little effect to the BFS version, whereas without BFS it truly makes a difference to "interactivity" by modifying the CPU scheduler values. Therefore I think it's fine to use -zen (I will remove ZEN from the uname when BFS is enabled).

Also -8 is already in Xenial proposed, but I am not going to bother with it as there are only small fixes to overlayfs and ARM boot, neither of which affect us. I would rather wait till they rebase to 4.4.3 and Liquorix publish a patch for that series Smile

The plan is indeed to rename all of the packages. I've already started on the endeavour, and yes linux-surface will keep those up to date; that is actually the easiest part, compared to making the current scripts aware of the new flavours and behaving normally with them Smile the surface11 versioning will also go, as there is no need for it now, they will be part of the package name. Instead I'll probably start from tigerite1 (this works as t comes after s, so it will be picked up by Launchpad as a newer version than any surfaceXX). Smile
Reply

#9
If ZEN is inside the built it doesn't matter what exactly is doing because it's just been included in both flavours -- so the most relevant thing is the presence or the absence of the BFS patch. Furthermore it won't be linux-surface-BFSnonZEN or linux-surface-ZENnonBFS as it would sound so weird IMHO (and also more confusing for the users). Anyway your development plans seem to be well thought and if you include the string 'tigerite' in the packages it also be more relevant for your kernel PPA distribution -- as 'surface' is a trademark but the kernel is yours. Wink I hope to see the results soon, please do receive my good wishes for your future success. 8)

Edit: I also prefer the BFS flavour, it's very stable and also I can suspend/resume rightly.
Edit2: I still think that you have made the Tigerite's patch for Ubuntu correctly resume, and it shoul be added like a patch because it is related with the Ubuntu kernel itself.
"(...) the grandest occasion the past or present has seen, or the future can hope to see." -- Cervantes.
Reply

#10
I agreed with you in the end and indeed went with -surface and -surface-nonbfs Wink the first attempt failed, I'm hoping the second will compile successfully.. there's so much to change to add/modify flavours!
Reply

#11
(27-02-2016, 06:26 PM)Tigerite link Wrote:I agreed with you in the end and indeed went with -surface and -surface-nonbfs Wink the first attempt failed, I'm hoping the second will compile successfully.. there's so much to change to add/modify flavours!

Be sure that the results will worth the effort, because you'll have two stable flavours by the 'prize' of one. You've learnt so much from past failures and them won't catch you again by surprise -- and just think that the flavour with no BFS will be easy to be maintained in the future, just one patch less to count. Anyway, I'm quite sure that you'll proud when ready. I'll download them to test when done. 8)

Edit: the trick is finish the most easiest work, then the difficult. Wink
"(...) the grandest occasion the past or present has seen, or the future can hope to see." -- Cervantes.
Reply

#12
Success this time Smile it only took two iterations rather than 11, at least Wink I also disabled Ubuntu's ABI and module checks, because that would just have required another patch, copying the old generic twice (as surface and surface-nonbfs) then deleting generic, which seemed.. a little pointless at best. Now I need to modify the linux-meta package and also duplicate it, for -nonbfs (they should be separate as the versions may not always be the same).

Hmm just noticed something odd, it didn't build the -image-extra package any more. Wonder why not?
Reply

#13
Ok, figured out why -extra package was not built, yet another file needed to be duplicated and another made aware of the two new flavours. Jeez, hopefully this is the last one. At least everything else built I guess Smile
Reply

#14
Third time lucky, it worked - now all copied to tigerite/kernel Smile
Reply

#15
(27-02-2016, 08:22 PM)Tigerite link Wrote:Ok, figured out why -extra package was not built, yet another file needed to be duplicated and another made aware of the two new flavours. Jeez, hopefully this is the last one. At least everything else built I guess Smile

Amazing job and in less time than expected, Tigerite!  8)
Edit: will it be possible to download the two flavours by the PPA at the same time?
https://launchpad.net/~tigerite/+archive.../+packages
"(...) the grandest occasion the past or present has seen, or the future can hope to see." -- Cervantes.
Reply

#16
(27-02-2016, 11:13 PM)Tigerite link Wrote:Third time lucky, it worked - now all copied to tigerite/kernel Smile

Congratulations, Tigerite. I hadn't seen your latest post! 8)
Edit: there is no linux-surface-nonbfs to download the non-bfs flavour.

Code:
# new packages to be installed
  linux-headers-4.4.0-7-surface linux-image-4.4.0-7-surface
  linux-image-extra-4.4.0-7-surface
# packages to be updated
  linux-headers-4.4.0-7 linux-headers-surface linux-image-surface
  linux-libc-dev linux-surface linux-tools-common
# packages to autoremove
linux-headers-4.4.0-7-generic linux-image-4.4.0-7-generic
  linux-image-extra-4.4.0-7-generic

One depmod error and one dkms warning found:
Code:
Removing linux-headers-4.4.0-7-generic (4.4.0-7.22surface11) ...
Removing linux-image-extra-4.4.0-7-generic (4.4.0-7.22surface11) ...
depmod: ERROR: fstatat(4, hid-multitouch.ko): No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-7-generic /boot/vmlinuz-4.4.0-7-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-7-generic /boot/vmlinuz-4.4.0-7-generic
dkms: WARNING: Linux headers are missing, which may explain the above failures.
      please install the linux-headers-4.4.0-7-generic package to fix this.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-7-generic /boot/vmlinuz-4.4.0-7-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-7-generic
The link /vmlinuz.old is a damaged link
Removing symbolic link vmlinuz.old
you may need to re-run your boot loader[grub]
The link /initrd.img.old is a damaged link
Removing symbolic link initrd.img.old
you may need to re-run your boot loader[grub]

Two old package need to be removed manually:
Code:
$ sudo apt-get remove --purge linux-image-4.4.0-7-generic linux-image-extra-4.4.0-7-generic

Ubuntu packages have the same problem when updating the kernel. I think the obvious solution is just remove the kernel-images first and then the kernel-headers.  :-X

Code:
~$ sudo dpkg -l | grep linux-image
[sudo] password for ubuntu:
ii  linux-image-3.19.0-51-generic                         3.19.0-51.58~14.04.1                                amd64        Linux kernel image for version 3.19.0 on 64 bit x86 SMP
ii  linux-image-4.4.0-7-surface                           4.4.0-7.22tigerite3                                 amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-4.4.3-xanmod7                             1.160226                                            amd64        Linux kernel, version 4.4.3-xanmod7
ii  linux-image-extra-3.19.0-51-generic                   3.19.0-51.58~14.04.1                                amd64        Linux kernel extra modules for version 3.19.0 on 64 bit x86 SMP
ii  linux-image-extra-4.4.0-7-surface                     4.4.0-7.22tigerite3                                 amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-generic-lts-vivid                         3.19.0.51.36                                        amd64        Generic Linux kernel image
ii  linux-image-surface                                   4.4.0.7.12                                          amd64        Surface Linux kernel image
Code:
~$ sudo dpkg -l | grep linux-headers
ii  linux-headers-3.19.0-51                               3.19.0-51.58~14.04.1                                all          Header files related to Linux kernel version 3.19.0
ii  linux-headers-3.19.0-51-generic                       3.19.0-51.58~14.04.1                                amd64        Linux kernel headers for version 3.19.0 on 64 bit x86 SMP
ii  linux-headers-4.4.0-7                                 4.4.0-7.22tigerite3                                 all          Header files related to Linux kernel version 4.4.0
ii  linux-headers-4.4.0-7-surface                         4.4.0-7.22tigerite3                                 amd64        Linux kernel headers for version 4.4.0 on 64 bit x86 SMP
ii  linux-headers-4.4.3-xanmod7                           1.160226                                            amd64        Linux kernel headers for 4.4.3-xanmod7 on amd64
ii  linux-headers-generic-lts-vivid                       3.19.0.51.36                                        amd64        Generic Linux kernel headers
ii  linux-headers-surface                                 4.4.0.7.12                                          amd64        Surface Linux kernel headers

All fine, suspend/resume works nice and fastest than before. :o
Code:
~$ uname -a
Linux tropic 4.4.0-7-surface #22tigerite3 ZEN SMP Sat Feb 27 20:28:38 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

I'll download and test the non-bfs branch monday as much later. Thanks, Tigerite.  8)
"(...) the grandest occasion the past or present has seen, or the future can hope to see." -- Cervantes.
Reply

#17
Yep, should be, and linux-surface plus linux-surface-nonbfs Wink I'm not sure which would take precedence though, in grub etc I mean.
Reply

#18
(28-02-2016, 06:59 AM)Tigerite link Wrote:Yep, should be, and linux-surface plus linux-surface-nonbfs Wink I'm not sure which would take precedence though, in grub etc I mean.

I guess there is no problem at all, because the full patched one will be the first in GRUB, as the surface-nonbfs should be alphabetically after the surface. But don't worry about it because if somebody needs the non-bfs branch it's for something important and he most probably won't use the full patched one at the same time. Anyway, the package headers-all won't suppose a problem for having the two versions at the same time as it works with all both flavours also 32/64bit architectures, and the other packages shouldd will get their places alphabetically ordered as I said. Please, have a nice sunday, Tigerite, thanks for your hard work! 8)

Edit: just notice the depmod error and the dkms warning are about the uninstallation of the older version, I have seen no error while package replacement yesterday, btw.
Edit2: if XanMod is installed, it will always be the first as it's the highest number.
"(...) the grandest occasion the past or present has seen, or the future can hope to see." -- Cervantes.
Reply

#19
Yes, dpkg complains about one of the VirtualBox modules not matching that in the kernel or some such, which is nonsense as it's the same version, otherwise everything goes in cleanly. The headers_all and libc-dev packages are the same for both versions, as they are built at the same time; there may potentially be a problem if I ever upload just a -nonbfs version because then those will replace the ones for the BFS version, but those are only used for development so shouldn't affect anything. Actually now I think about it, the headers_all in such a situation would not replace the old version anyway, they would both remain installed. So it's only the libc-dev package that is a 'problem' (and I know for sure that is only needed for building a select few packages, never by end users).

I may after all update to the -8 revision by the way, as a tester on reddit (/SurfaceLinux aptly enough Wink ) has spotted a DRM fix which is necessary for the Surface Pro 4. In fact I found a whole patch set which seems to apply against my drm-Intel tree so I'll probably try to include those too Wink
Reply

#20
Oh, and now I have a linux-meta package targeting only the -surface revisions (rather than -generic) I can make the meta packages conflict older versions, so -8 will replace -7 and there won't be a host of kernels installed Wink (I can't do the same for -generic as then your original would also be replaced).

I am though a bit surprised at the lack of linux-surface-nonbfs. That should be there as it's built from the linux-meta-nonbfs - here's the link to the compiled package even?
Reply



[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Forum Jump:


Users browsing this thread:
2 Guest(s)