nexus511 / gpd-ubuntu-packages

This repository shall provide the base for building ubuntu packages from most of the patches currently used to get linux on the gpd-pocket.
GNU General Public License v3.0
73 stars 4 forks source link

Updating kernel to 4.14.0 #34

Closed nexus511 closed 6 years ago

nexus511 commented 6 years ago

We are already using a kernel that is mostly 4.14.0 as it contains a lot of patches by Hans that properly rebase on 4.14.0 but not 4.13.0.

We should migrate forward to 4.14.0 soon.

sobukus commented 6 years ago

I just tried Hans' repo as a 4.14 preview ... cloned, configured using the config from your kernel (4.13.0-2-generic, pulled from /boot, not /proc/config.gz, which would be more reassuring).

The result was a system where wifi authentication did not work, while I am able to see the networks just fine. Also my USB-C hub was not recognised at all, while it at least partially works under the old kernel (appears in lsusb, along with the ethernet device in it, but no charging, for example).

Am I missing some special tricks to get a working kernel?

nexus511 commented 6 years ago

@sobukus Good to know that you see the same problems I have. That is actually the reason, why I have not pushed the new kernel to the repos yet.

Wifi basically works, but there are problems with apparmor on my Xubuintu image which seem to be kernel related. The result of this is that dhclient cannot be started by NetworkManager. Manually assigning an IP address from the console works and I can then connect to the internet. My understanding is that we are facing SElinux problems on that end.

I have only done SElinux stuff on android before so I need to find some time looking at this but I think that will just need some configuration change that is hopefully rather trivial and introduced by the updated kernel and something incompatible with the recent kernel. (just guessing here)

I also think that I do not see the Bluetooth device. So for now the kernel is making things worse (at least when I use the Ubuntu default configuration).

@jwrdegoede Is there something that we should keep in mind when configuring the kernel? Ubuntu basically builds most things as loadable modules. Does that cause trouble with Bluetooth?

As firmware, I am using the latest "firmware-images" from the upstream repo that now contains the firmware for the broadcom-chip. I also use the same configuration (.txt) for the module we are using with the former kernel versions.

I have the feeling that I am just doing something stupidly wrong here as it just does not work properly.

jwrdegoede commented 6 years ago

Hi,

On 06-10-17 11:20, nexus511 wrote:

I also think that I do not see the Bluetooth device. So for now the kernel is making things worse (at least when I use the Ubuntu default configuration).

@jwrdegoede https://github.com/jwrdegoede Is there something that we should keep in mind when configuring the kernel? Ubuntu basically builds most things as loadable modules. Does that cause trouble with Bluetooth?

I had to build the dw_dmac driver into the kernel because of module load ordering issues. Try setting all CONFIG_DW_DMAC options to y in your .config.

Regards,

Hans

sobukus commented 6 years ago

Ah, yes, I failed to mentally connect those apparmor messages that filled dmesg. That explains the failed network setup. Last I checked, Ubuntu has AppArmor instead of SELinux. So we have to check what happens with that kernel module … and one could try to simply stop AppArmor for testing.

I am a little worried that I've seen less signs of life from my USB-C hub with the new kernel. What should one expect, actually? In the end, I'd like to have both Ethernet and a video output working …

nexus511 commented 6 years ago

@sobukus I have not yet checked USB-C on this kernel. I will after bluetooth works.

Let's see. I started recompiling with DW_DMAC builtin and hope that this will fix Bluetooth.

nexus511 commented 6 years ago

Okay. I still do not have bluetooth when settin CONFIG_DW_DMAC* to builtin.

I also have still trouble with AppArmor. If I set the failing scripts to "app-complain", wifi is working with the new kernel.

Next steps I will try are merging Hans kernel completely into the build-scripts and see, if this resolves the Bluetooth issues.

I will also need to find out, what actually breaks AppArmor as disabling is really a stupid option.

I would be willing to go for another kernel without Bluetooth but not without Wifi. So I continue working on this.

sigboe commented 6 years ago

@nexus511 I am using 4.14-rc3 on arch linux using jwrdegoede kernel.

nexus511 commented 6 years ago

@sigboe Well...

nexus511 commented 6 years ago

I have now merged Hans configuration into the Ubuntu build system using some python script.

So the configuration works now but is a complete mess (there are items missing and stuff like that). I now need to sort out, what options specifically make the difference regarding the bluetooth support. I guess that there is some module (besides the CONFIG_DW_DMAC) that actually needs to be compiled into the kernel instead of being provided as a module.

The kernel settings also break AppArmor. Maybe it is all related to this at the end. As disabling AppArmor is not a good idea (as its decreasing the device security), I need some time to find a workaround on that.

I will publish the kernel nevertheless as I think it is already broken on the current kernel but I will need to dig into that later and the settings will need additional work to properly support the requirements for Ubuntu.

Ah: And now the audio output is shitty again.

nexus511 commented 6 years ago

I have a kernel now and try to push it today. The problem is still that AppArmor is not working properly (at least for 16.04.3) on cupsd, cups-browserd and dhclient.

As patching AppArmor rules is no option as this would break upstream updates at some point, I might instead set those processes to complain mode and try to file a bugreport for those processes.

@jwrdegoede It basically also needs the serial interfaces to be compiled into the kernel for Bluetooth. It took me some time taking your config apart. Thank you for your work on the kernel again.

nexus511 commented 6 years ago

I have uploaded kernel 4.14.0-10.gpd and updated the linux-firmware package.

The kernel does not support AppArmor and thus Wifi and cupsd are working now. I file another bug that AppArmor is broken.

The kernel has now working bluetooth again.