r/linux • • Nov 20 '19

Kernel Google outlines plans for mainline Linux kernel support in Android

https://arstechnica.com/gadgets/2019/11/google-outlines-plans-for-mainline-linux-kernel-support-in-android/
1.0k Upvotes

305 comments sorted by

385

u/jdrch Nov 20 '19

Although this is a great initiative, Google is once again trying to solve a hardware (standardization) problem with software. What's really needed to enable an generic Android kernel is mobile implementation of ARM PCIe, but Google is completely ignoring that. This leads to some pretty disingenuous comments from what should be one of the smartest organizations in the world, such as:

"Today, we don't know what it takes to be added to the kernel to run on a [specific] Android device," Android Kernel Team lead Sandeep Patil told the group at LPC 2019. "We know what it takes to run Android but not necessarily on any given hardware. So our goal is to basically find all of that out, then upstream it and try to be as close to mainline as possible."

LOL what? It's almost like an ARM PCIe spec and the x86 equivalent don't exist. Doing things the right way would be via hardware partnerships that ensure compatibility (think of something similar to WinHEC - a show, not a partnership, but still - for Android.)

But wait, it gets worse: Google's proposed solution is to upend the entire current Linux kernel model for the sake of Android. Holy. Shit.

Google's proposal for bringing Android closer to mainline Linux (How is there not a silly "project" name for this yet?) involves stabilizing Linux's in-kernel ABI and having a stable interface for the Linux kernel and hardware vendors to write to. Google wants to decouple the Linux kernel from its hardware support.

The Linux community has been against the idea of a stable interface for some time, with the suggestion that if you want the ability to quickly update a kernel, open source your drivers and get them in the main kernel tree, where any changes will be taken care of for you.

But that's not all, folks: the above proposal would only partially solve the Android kernel problem:

So this wouldn't allow devices to upgrade from one version of the Linux kernel to another

🤦‍♂️🤦‍♂️🤦‍♂️

245

u/electricprism Nov 20 '19

TL;DR; Lets do all these things to the Linux Kernel in the name of achieving a goal and then completely miss the goal.

126

u/jdrch Nov 20 '19

Pretty much. The entire approach is just embarrassingly bad. I'm surprised they weren't laughed or sarcastically clapped off the stage.

27

u/le_pman Nov 20 '19

I'm surprised they weren't laughed or sarcastically clapped off the stage.

I haven't watched anything, but I sure hope that someone called them out the way your first comment did.

21

u/jdrch Nov 20 '19

FTA there's a nearly 4 hour long video of their LPC presentation.

54

u/[deleted] Nov 20 '19

I'm expecting Linus to drop expletives within a week (not sarcasm, whole idea Google is pushing is fucking stupid)

→ More replies (7)

13

u/blu3jack Nov 20 '19

Sounds like Google engineering

69

u/matheusmoreira Nov 20 '19 edited Nov 20 '19

The unstable kernel ABI is a major incentive for hardware manufacturers to contribute their drivers into the mainline kernel. If they don't do that, the kernel keeps evolving while they get left behind and must pay the maintenance costs. I believe it's how the kernel developers maintain their leverage. Contribute your drivers because nobody is gonna waste time supporting you otherwise.

If the ABI is stabilized, that leverage is lost. Cheap minimum effort proprietary drivers for a single architecture become viable. This is how Windows works to this day: manufacturers release a driver for specific versions of Windows and processor architectures. The drivers would of course stop working with the next/64 bit version of Windows and they never made a new driver because the product is old and they think it's a waste of time and money to support it.

A stable ABI is a great thing for the companies since they can cheap out on the software development and keep it closed. Doesn't seem so great for the long term health of the kernel though: the drivers won't be compatible with other architectures, won't be updated to take advantage of new code, will prevent breaking changes from being made even if they are improvements, can't be backported to older kernels, etc.

So if anything it will hurt people's ability to update the kernel. It seems Google just wants to make it cheaper to develop drivers for Linux. The kernel developers want to make it expensive to develop drivers outside Linux.

Can Google really do this though? How do they plan to stabilize the ABI? The people in charge of Linux have made it clear they don't support out-of-tree code. Can Google somehow commit enough people to this task to compete with the scale of the Linux project?

11

u/SanityInAnarchy Nov 20 '19

Unfortunately, Android is the perfect case study for where that incentive doesn't work at all:

If the ABI is stabilized, that leverage is lost. Cheap minimum effort proprietary drivers for a single architecture become viable.

But that's exactly what Android vendors do today. They'll fork the whole damned kernel and do whatever they want anywhere in the tree, and there's a whole mess of binary blobs that will only ever work with that specific kernel. They'll backport critical security fixes for however long they need to support that specific SoC (seems like 3 years at most), and then drop the entire thing on the floor.

The whole incentive to upstream your drivers is so the community can maintain them for you. But if you aren't planning to maintain them at all, that doesn't save you anything.

So the point of a stable ABI would be: At least when they drop support, you can still update the pieces of the kernel that aren't related to their shitty driver. Which is exactly what happens on Windows -- there isn't always perfect forwards-compatibility (64-bit is a notable example), but there's plenty of old hardware that continues to work on new Windows versions.

6

u/jdrch Nov 20 '19

there's plenty of old hardware that continues to work on new Windows versions.

I daresay that situation is better on Linux where the drivers live in the kernel and are the responsibility of kernel devs. This allows Linux to basically support hardware forever as long as a matching driver exists in the kernel. OTOH, hardware can drop out of Windows support the hardware OEM doesn't provide driver updates corresponding to Windows OS updates.

5

u/[deleted] Nov 21 '19

But manufacturers are ok with hardware no longer being supported after 9 months so you need to get new one.

→ More replies (1)

3

u/SanityInAnarchy Nov 21 '19

That's true, and that's also probably why ChromeOS has a way better update story than Android. (Google basically delivers the entire OS and everything else, so they support the devices for 5+ years.)

I wonder why that hasn't worked on mobile. I guess nvidia could never get away with forcing you to run an nvidia-only kernel, because a desktop can have components from a bunch of different manufacturers who all have to get along in the same kernel?

But there's some other differences: Weird, gimmicky, vendor-specific hardware tends to be plugged into PCs via USB, and there's apparently just standard ways of talking to USB devices from userland now. So I was surprised to learn that all this RGB madness is supported by some random Github projects, but at least one of those seems to be entirely userland. Printer drivers live in CUPS in userland. Google's Titan keys don't really have specific drivers, Chrome just talks to them directly.

The kernel may have no stable API/ABI internally, but its userland API is stable, so I guess Linux accidentally solved this problem specifically for USB gadgets on the desktop.


All that said, I've seen some absurdly old Windows drivers run on modern Windows. Heck, that ABI is probably the reason a lot of early Linux wifi support was done by running Windows drivers on Linux via NDISWrapper.

→ More replies (1)

3

u/jdrch Nov 20 '19

they never made a new driver because the product is old and they think it's a waste of time and money to support it.

There are plenty of legacy products that still have current OS release driver support, at least in the Windows ecosystem. But yeah Linux does support older hardware better.

I agree with the rest of what you said.

→ More replies (1)

24

u/mfuzzey Nov 20 '19

Yes exactly and remember this isn't *just* about closed source drivers but also code quality and evolutivity.

From bad to good there is

  • Vendor closed source driver
  • Vendor open source driver
  • Mainline driver

Embedded Linux, even Android has been getting much better over the years. There are, these days, few closed source *kernel* drivers. There are loads of *userspace* blobs and *firmware* blobs (that are loaded into some external processor) but they are different and not as bad (since they do not limit the kernel's evolution nor pose the same security risks as unauditable kernel code).

Most vendors now *do* ship source for their *kernel* drivers. But, when they do not contribute that code upstream, the quality is often very poor. Just today I was looking at a touchscreen. There is a (open source) vendor driver and, now, a mainline driver that can both drive the same hardware.

I ran checkpatch on both:

mainline driver: 0 errors, 1 warnings, 247 lines checked

vendor driver:: 348 errors, 133 warnings, 1122 lines checked

Most vendors have come to realize that, mid term, it is best to get their code into mainline. They may still do "quick and dirty" initial code in their "vendor BSP" to get something that is functionally complete out quickly with the silicon but the good ones *also* have people contributing to the mainline drivers (either directly or through a consortium such as Linaro). The mainline code takes longer to get baked but the quality is vastly superior thanks to all the review and the acceptance standards. It is also generally smaller and sometimes faster.

By removing some of the "pain" of being out of tree I fear some vendors may go back to code dumps.

Furthermore a stable kernel API would limit the improvements possible to the rest of the kernel, which is, ultimately, bad for everyone.

It shouldn't really change that much for closed source drivers since, *in the kernel* they are already at best a legal gray area and at worst downright illegal.

10

u/londons_explorer Nov 20 '19

An in-tree shim which provides a consistent interface for drivers would probably be what they'd build.

It might have parallels to FUSE (which provides a consistent interface), just without the userspace part.

→ More replies (1)

7

u/tokinstew Nov 20 '19

If the ABI is stabilized, that leverage is lost. Cheap minimum effort proprietary drivers for a single architecture become viable. This is how Windows works to this day: manufacturers release a driver for specific versions of Windows and processor architectures. The drivers would of course stop working with the next/64 bit version of Windows and they never made a new driver because the product is old and they think it's a waste of time and money to support it.

This is basically the story of my old netbook. It had a 64 bit processor but the company who did the integrated graphics (SavageVR?) only made drivers for Windows 7 32 bit. There was one driver for linux packaged for some obscure distro that required an old kernel and old versions of other packages.

→ More replies (9)

90

u/hackingdreams Nov 20 '19

PCIe is not a magical solution here. What you're really saying is you want ARM to be more PC-like with firmware-defined hardware tables like ACPI's DSDTs... and those are just a whole different kind of nightmare. You're essentially pushing a purely software defined problem into a firmware-defined problem, which is even slower to be updated, buggier, and riskier to update for machines in the field.

And Google's argument is different: Google wants something more stable to code against, period. But Linux is decidedly unstable to avoid design-induced brain damage and to allow for fixing architectural issues as they occur over time...

The true tl;dr here is that Google's opening the floor for the argument for Fuchsia to replace Linux in some future Android version - they're going to look back on this and say "whelp, Linux is beyond our control," and that will be the end of it. Since Google will be in full control of its lifecycle, they can declare bits of it "stable," and since it's all still software, it's still got the benefits of being field updateable without the hardware loss risk of bricking devices. The downside is that, for those of us who use phones where companies refuse to upstream drivers, those drivers are 100% going to be closed sourced and we'll likely lose the ability to control the software on our own machines... but that doesn't really trouble Google in the slightest.

17

u/_riotingpacifist Nov 20 '19

I fear we have reached an age when the big 4 now control enough of the market that they no longer benefit from FOSS development, to not just reimplement it themselves.

Unlike Google moving to mainline (both android & servers) in the past, where it cost them more to port fixes and improvements, than it did to contribute back (Google have never been open sourcing for anything than buisness reasons).

It's already visible with Amazon permanently forking Foss for their services (although the switch to KVM was likely because their xen is too forked to get good performance out of).

It's ironic as Microsoft adopt FOSS (at least for now), that Google, Amazon & Apple are moving away from it.

9

u/mirh Nov 20 '19

(Google have never been open sourcing for anything than buisness reasons).

What cannot be a business reason?

From contributions to Coreboot to LinuxBoot.. that wasn't really *needed*.

Apple are moving away from it.

Really? The last open thing I can remember from them is opencl. Maybe. They already buried it and can't even remember it.

7

u/_riotingpacifist Nov 20 '19

What cannot be a business reason?

Good point, I meant that they did these things, because it gave them a business advantage (less maintenance), rather than out of benevolence. And I'm now worried that that business advantage no longer exists as the big 4 control so much of the market.

From contributions to Coreboot to LinuxBoot.. that wasn't really needed.

Doesn't that reduce the maintenance overhead on them? I mean it is possible probable, I exaggerated, small things like GSOC, etc, may be out of benevolence, but the bigger stuff:

  • mainlining google kernel improvements
  • mainlining android kernel improvements
  • Kubernetes

Were all done because of business drivers, rather than benevolence, and if those drivers aren't there, google can move away from such openness quite quickly (see also removing of xmpp support for their messaging platforms)

Really? The last open thing I can remember from them is opencl.

Darwin is mostly open source, yet is being replaced by iOS where they can, and while they have never been FLOSS friendly that is a big move.

→ More replies (10)
→ More replies (7)
→ More replies (2)

3

u/Pas__ Nov 20 '19

It's not like the stable kernel - supported for 6 years or so doesn't have a stable API.

This was the whole point of treble, no? https://zdnet3.cbsistatic.com/hub/i/r/2017/10/02/74af8271-7040-4dec-956c-8b51b2e415bf/resize/1200x675/aef9507de3e87ff1f1f1c61d4f7637aa/linux-lts-kernel.png

Furthermore, there are [will be or might be] devices in 6 years that will be completely different from what we have today, so good luck stable-porting that without a consortium agreeing on some ad-hoc standard.

5

u/JORGETECH_SpaceBiker Nov 21 '19

The ad-hoc standard stablished in mainline kernels is called Device Tree Overlays and is already the norm on a lot of ARM development boards to better support the hardware, a great example of doing it right is Armbian.

→ More replies (3)

6

u/masta Nov 20 '19 edited Nov 20 '19

To be fair firmware is just software in disguise. Also there with you about PCI vs Device trees..... But that is a false argument. Different arm board partners reimplementing the same code is the problem. This problem currently deep, both into enterprise Arm (which uses pci, acpi, dst, etc..), and mobile with uses dev trees. So the problem the OP was complaining about is actually solved, sorta..... But not really. Mobile arm still uses device tree's, and that is fine. They both resolve the same set of problems. But that is not the problem. Under both systems developers are writing equivalent code in their drivers, which is there problem Google is aiming to solve.

→ More replies (3)

40

u/1_p_freely Nov 20 '19

I think there's only so much that Google can do here. ARM devices aren't like the PC, vendors of hardware pretty much hate openness. They want your two year old phone to be non-updatable landfill material almost as much as the carrier that sold it to you does!

31

u/hackingdreams Nov 20 '19

I think there's only so much that Google can do here.

There's plenty Google could do here. There's not a lot that Google's willing to do here. Doing more would require enforcing more regulations on Android and making vendors play ball or freezing them out. But, Google doesn't want to do that.

Google is the Microsoft of the mobile computing world - they have plenty of clout to write hardware standards and make hardware vendors play to them if they want to be in on the game... but they don't for numerous reasons (from not wanting to invoke the US Department of Justice's wrath to not wanting to have to tell vendors they've been working with for a decade that their open source policies have been deleterious to the software ecosystem and risk alienating them into a coup/fork situation ala Huawai). Whether or not that's good enough... that's up for debate and discussion. But let's not pretend Google is some impotent leaf in the wind - they're the fucking tree.

They want your two year old phone to be non-updatable landfill material almost as much as the carrier that sold it to you does!

And let's be completely honest: Google wants this too. People not updating hardware quickly enough is part of why software updates matter so much. If Google could make everyone dump their legacy Android devices the way that Apple users do the microsecond Apple releases the next iDevice, they'd do it. But the long tail of users for Android devices looks more like the population of the world than they do first world hipsters, so that kind of turn over is purely a pipe dream - this is where Google is well and truly stuck and where they don't have as much option as they want.

This is why they want more stable software interfaces - they simply don't want to have to pay for doing all of this software maintenance themselves, and they're willing to bet they can bend the kernel maintainers, since it's a riskless bet for them - either they win, or they lose and switch to their own OS, in which case they get what they want either way.

16

u/1_p_freely Nov 20 '19

I seem to recall Torvalds explaining how proprietary ARM based stuff is. But you are right though that if Google wanted, they could start throwing their weight around with Android now that it dominates the market. (Because where else would the vendors go?)

I really wish Google would force vendors to provide updates to phones for at least 3 years or else they don't get Google Play. That would be a start.

→ More replies (5)

6

u/justjanne Nov 20 '19

And before anyone uses the Pixel devices as example why Google is supposedly trying to do long term support: the Pixel 1 doesn't even get updates anymore. That's planned obsolescence.

→ More replies (7)
→ More replies (6)

12

u/[deleted] Nov 20 '19

They want your two year old phone to be non-updatable landfill material almost as much as the carrier that sold it to you does!

Which is exactly why we should not make it easier for them to just drop a binary blob and forget about it. Because that's what google is trying to do. That makes future bugs discovered in driver very hard to fix too

1

u/jdrch Nov 20 '19

That makes future bugs discovered in driver very hard to fix too

Perhaps, but I think in the suggested model vendors would be responsible for their own drivers. This would make driver support trend closer to the Windows desktop model.

3

u/[deleted] Nov 21 '19

Perhaps, but I think in the suggested model vendors would be responsible for their own drivers.

Anything that doesn't end in driver being open source is a bad model. This model encourages not open sourcing/mainlining changes. Fixing an old driver's source code to work with new ABI/different OS is way easier than reverse-engineering it

This would make driver support trend closer to the Windows desktop model.

... yeah the model where old hardware just straight up won't work with new software. It only works for windows because the support window for each release is massive compared to anything android

Aside from that, mainlining indirectly leads to more code reuse between the drivers of similar type, which means less potential for bugs and fixes for them would fix it for all.

→ More replies (5)

2

u/jdrch Nov 20 '19

vendors of hardware

Nearly all hardware vendors hate openness. The vast majority of PC hardware and associated blobs are proprietary. Windows solves that with a stable driver API, while Linux and BSD solve it by including open source hardware drivers in their kernels.

5

u/quaderrordemonstand Nov 20 '19 edited Nov 20 '19

This has often been Google's way. Start with the desired solution and fit the problem to it. It's a common problem with "clever" people who want their "clever" answer to be the solution to everything.

That attitude applied when there tech lead was asked why they chose Java for Android and he said "we tried all the alternatives and they sucked". Which explains things like Dart, turning JS into Java because they can't cope with change.

1

u/jdrch Nov 20 '19

why they chose Java for Android

IIRC that decision was made before Google acquired Andy Rubin's startup, and Google couldn't rewrite Android in a different language + deploy associated tooling in time to compete with iOS.

2

u/quaderrordemonstand Nov 20 '19

Perhaps it was Andy Rubin that said it? I remember reading it several times back when Android was relatively new, I recall that exact phrasing was used. Now I can't find it anywhere and can't remember who actually said it. I wonder if Google has deleted it from the internet since.

It still speaks to the ivory tower attitude of Google's people, whoever said it. Every other language except Java sucks. It might also be the one language that person likes using but that's irrelevant, he definitely checked all the others. I also recall Android being a frame rate crap shoot at that time when iOS was super smooth. Its improved since thought almost certainly not because of anything to do with Java.

2

u/jdrch Nov 20 '19

Every other language except Java sucks

I mean, you also have to bear in mind that at that point in time Java was the most popular programming language. Android (the startup) wanted to make the OS easy to adopt, develop for, and support. They didn't want to force devs to learn something completely new. I'm not asserting choosing Java achieved those goals, but I do think that was their motivation.

Clearly it left them with a lot of technical debt and a licensing/patent nightmare as a result.

1

u/EternityForest Nov 20 '19

Is someone actively teaching and promoting this "One elegant solution for all problems" thing?

Like, what's going on in those computer science classes anyway? Do they teach LISP and everyone tries to replicate that same experience of programming and forgets all about practicality and established standards?

→ More replies (1)

2

u/tso Nov 20 '19

Iirc Intel formed Moblin back in the day because to make their for-phone Atom low power Enugu they has to dump PCI enumeration. And this made Microsoft balk at porting Windows to it.

Keep in mind that when Microsoft made ARM based Windows RT tablets a few years back, their OEM partners had to use special SOCs that had a PCI bus.

That said, there something "equivalent to PCI enumeration for ARM SOCs, IIRC, Devicetree. But it is up to each individual SOC vendor to support it, and i don't know how common that is.

1

u/jdrch Nov 20 '19

Devicetree

1st time hearing of it, thanks for the info.

15

u/[deleted] Nov 20 '19

PCIe wouldn't solve antything (would be nice ? hell yeah, but not solve the problem). The root of the problem is that vendors do not want to put extra effort to mainline their drivers (....which let's be fair, probably is marginal compared to device sales).

Linux explicit lack of stable driver ABI have its drawbacks (to put it mildly) but it did push many hardware vendors to just upstream as much of their driver code as possible, as the moment they do it they stop needing to "catch up" with kernel changes as any later changes of internals would be upon people doing the changes, not the driver authors. Which might even be cheaper for longtime for the vendor.

Instead of pushing vendors to mainline drivers as soon as possible, Google is basically making it easier to not to upstream them.

10

u/[deleted] Nov 20 '19

A lot of the changes Google makes to the upstream LTS kernel before sharing it with chip manufacturers aren’t upstreamed. I think more effort to upstream from Google and the device vendors certainly couldn’t hurt.

8

u/mfuzzey Nov 20 '19

PCIe by itself wouldn't solve anything.

Yes it allows device enumeration, as does USB. But the device tree does that too.

Once you've found the devices that are present, be it through "hardware" enumeration like PCIe / USB or software definition like DT / ACPI you still need a driver for each device.

With device tree plus a lot of the other nice stuff (like the common clock framework, pin control etc etc) that have come to ARM over the past years it is now possible to ship a single Linux kernel and set of modules that will boot on a wide variety of ARM hardware, and indeed classical Linux distributions that support ARM do exactly that. You may need a device tree file for your device in addition but that's it.

Things that do help are common hardware interfaces that allow a single driver to be used on multiple different pieces of hardware. USB does that a lot with "classes". You virtually never need a custom driver for a USB stick or hard drive because they all implement the "mass storage" device class, nor for keyboards and mice because they all implement HID.

→ More replies (1)

3

u/EternityForest Nov 20 '19

I'm not sure why they can't just define a stable subset and have two parallel APIs. Maybe the stable one is slower because it's a wrapper, but one layer of C wrapping would hardly be noticable these days.

0

u/[deleted] Nov 20 '19

[deleted] — view deleted comment

8

u/oskarw85 Nov 20 '19

It's not like Linux would fall because of Google.

3

u/jdrch Nov 20 '19

Yeah Intel is the biggest code contributor anyway.

14

u/TeutonJon78 Nov 20 '19

Or push their design for Ziron towards the kernel so they can avoid all that pesky work of HW drivers that would be already solved for them then.

9

u/nosuchthingastwo Nov 20 '19

They don't care what happens with the Linux kernel -- they're just trying to decouple Android from Linux. Then they'll be able to use Zircon/Fuscia as the base for their phones going forward. They'll leave Linux behind.

11

u/DotNetPhenom Nov 20 '19

Isnt that what open source is all about? If you dont like the way its being done, fork it and do it yourself?

7

u/jdrch Nov 20 '19

fork it and do it yourself

Technically, yes. But if you wind up with a solution no one uses without the manpower to support it yourself, you're in deep trouble.

In software, scaling results from user base, not "better" solutions.

→ More replies (2)

2

u/Ecopath Nov 20 '19

I feel like that would be just fine all around. Better that than trying to stay involved and trampling open-source things.

→ More replies (1)
→ More replies (1)

4

u/jdrch Nov 20 '19

we'll just use our own kernel

While maintaining legacy binary compatibility and without retooling the entire dev ecosystem? Good luck to them with that.

4

u/jdrch Nov 20 '19

if you don't do what we want, we'll just use our own kernel

The irony of this is Linux kernel devs might help them pack and even hold the door open for them so they can leave post haste.

5

u/nixd0rf Nov 21 '19

"and if you don't do what we want, we'll just use our own kernel".

I hope the kernel community would just reply "go ahead". Linux was much more beneficial to Android than Android was to Linux.

They're going to drop Linux anyways sooner or later so who cares.

→ More replies (1)

0

u/[deleted] Nov 20 '19

[deleted] — view deleted comment

11

u/TeutonJon78 Nov 20 '19

Not such much anymore. Most of them are just running reference ARM cores and some even just run reference ARM GPU cores as well.

5

u/londons_explorer Nov 20 '19

Camera, radio, and DSP components still have a massive amount of custom logic in binary blob drivers. In many cases, more engineering effort has gone into the driver than the silicon design.

3

u/mfuzzey Nov 20 '19

Not, usually, in *kernel* drivers.

That normally goes either in a *userspace* driver or *firmware*.

The kernel drivers are usually open source, though often not mainlined, and pretty dumb, just handing memory allocation and the low level communication with the device.

→ More replies (3)

1

u/jdrch Nov 20 '19

keep that a trade secret

The PC ecosystem's hardware is almost 100% proprietary, yet the same Windows and Linux and BSD installers work on all x64 machines.

→ More replies (3)
→ More replies (13)

80

u/VelvetElvis Nov 20 '19

I bet this is where they blame the Linux kernel community and ditch android for their new OS with a more "business friendly" kernel license and no legal issues with Oracle.

5

u/jdrch Nov 20 '19

ditch android

Good luck. Android is to Google what Win32 is to Microsoft. As much as they might like to get away from it, I don't think they can. Too much inertia.

6

u/rbenchley Nov 20 '19

I doubt they're going to ditch the Android name, but I could easily see them ditching Linux and basing future versions of the OS around Zircon/Fuchsia. They've already committed code to Fuchsia to build the Android Runtime, so if they decided to transition from Linux, the ART would provide support for legacy Android apps, with Flutter available for newer Fuchsia/Android apps.

21

u/chubby601 Nov 20 '19

They plan to support java on their new OS too.

56

u/gregkh Verified Nov 20 '19

Wow, the crazyWmisunderstandings in this thread is way worse than normal for r/linux.

I'm helping to work with this team to achieve this goal, it has nothing to do with closed source anything, stable apis to keep drivers out of the tree, or anything else loony like that. It is all in the goal to have device kernels be quicker to update with the latest LTS kernel releases to get the newest bug and security updates.

And PCIe has nothing to do with any of this, who knows where that came from...

If anyone has any specific questions about this whole thing, ask away!

0

u/jdrch Nov 20 '19

It is all in the goal to have device kernels be quicker to update with the latest LTS kernel releases to get the newest bug and security updates

How do reconcile that statement with this one, from the article:

So this wouldn't allow devices to upgrade from one version of the Linux kernel to another

10

u/gregkh Verified Nov 20 '19

What they mean is from one "major" version to another.

For example, this will not do anything to help with moving a device from the 4.9.y LTS kernel series to the 4.14.y LTS kernel series. That's an impossible dream due to horrid SoC out-of-tree code that adds 3 million lines to the kernel tree.

What they will be able to do is to easily move along a LTS kernel release series. For example they could have updated from 4.14.154 to 4.14.155 (which was released today) quite easily as the in-kernel api for drivers would not have changed in the android tree.

This is nothing new, it's exactly the same thing that the Enterprise Linux distros (RHEL and SLES) have been doing for 15+ years. They keep in-kernel api stability to make their customers happy. This is just taking the same tools they use and doing it for the Android ecosystem.

→ More replies (12)
→ More replies (6)

92

u/[deleted] Nov 20 '19

Fuck google just force all manufacturers to open source their drivers and add them to the kernel.

29

u/jdrch Nov 20 '19

just force all manufacturers to open source their drivers

As the article points out, that approach hasn't worked:

Open sourcing drivers is an absolute deal breaker for many hardware companies, though, and no amount of advocacy or product degradation is going to change that.

The solution is to require the use of ARM's PCIe spec in Android devices. This would allow hardware to declare itself to the kernel at boot, which in turn allows the kernel to accommodate said hardware if it has drivers on hand.

Currently, SoC hardware can't declare itself to the kernel, and so the kernel has to know hardware configs of target devices a priori. That's one of the reasons most ARM kernels have to be built per device.

BTW, AFAIK, this problem isn't unique to Android; it exists for all platforms that lack PCIe or an equivalent thereof.

15

u/tkln Nov 20 '19

That's just complete nonsense. On ARM64 there's a single (1) upstream kernel build configuration which results in a kernel image that's bootable on ALL of ARM64 platforms supported by the upstream kernel. Furthermore many of the legacy 32-bit targets are supported by multi_v7_defconfig and multi_v5_defconfig build configurations in the same manner. Discovering hardware hasn't been an actual issue for many years. The description of the hardware is given to the kernel usually by the bootloader in the form of a device tree which allows the kernel load the correct drivers and initialize them properly. Have you actually ever built an upstream kernel for ARM? The issues with SoC vendors has nothing to do with device discoverability.

1

u/jdrch Nov 20 '19

Yeah I'm learning in the comments. Thanks!

→ More replies (1)

19

u/[deleted] Nov 20 '19

Sorry I'm just frustrated lol. So many people have to put in so much work to get custom roms working when the manufacturers could just give them the source code, but ofc they won't do that.

4

u/jdrch Nov 20 '19

custom roms working when the manufacturers could just give them the source code

Yeah that's annoying. The good news is that as long as the kernel is open sourced (GPL requirement) you're likely to be able to at least get the ROM to boot.

17

u/[deleted] Nov 20 '19

Until they fuxking lock the bootloader.

Thank's Verizon.

7

u/jdrch Nov 20 '19

lock the bootloader

That's a separate issue. You can have completely open source OS and drivers with locked bootloaders. Also, bootloader locking prevents attackers from loading a custom OS that can compromise your data. I don't like it any more than you do, but it's not intrinsically bad. It's a tool like anything else that can be used to help or harm.

8

u/[deleted] Nov 20 '19

Bootloaders should be lockable but they should also be rekeyable.

→ More replies (3)
→ More replies (15)
→ More replies (1)

14

u/Tweenk Nov 20 '19

The solution is to require the use of ARM's PCIe spec in Android devices. This would allow hardware to declare itself to the kernel at boot, which in turn allows the kernel to accommodate said hardware if it has drivers on hand.

PCIe has approximately nothing to do with what you are describing, and hardware discoverability is not the reason why Android devices need custom kernels. Custom kernels are a direct consequence of the lack of a stable driver API.

Currently, SoC hardware can't declare itself to the kernel

That's simply not true:

https://elinux.org/Device_Tree_Reference

BTW, AFAIK, this problem isn't unique to Android; it exists for all platforms that lack PCIe or an equivalent thereof.

PCIe is not the only machine-discoverable bus, and discoverability hasn't been the actual problem for many years.

2

u/jdrch Nov 20 '19 edited Nov 20 '19

a direct consequence of the lack of a stable driver API.

Interesting. So I take it that desktop Linux pulls this off by simply placing the drivers in the kernel, but Android can't do the same because OEMs (currently) won't upstream their driver code? Is that correct?

14

u/hak8or Nov 20 '19

Device tree has to be created by the vendor, and the way drivers consume data from device tree changes drastically over time, partially because device tree doesn't have as rigid of a standard, and what is standardized took years compared to when it was first released.

You've got drivers wanting explicit phandles to some nodes, sometimes they instead use subsystems to handle dependancies, or sometimes they need to have a parent instead of at the root node. Sometimes drivers don't handle dependencies well, so if their order in device tree changes then all hell breaks loose because their probe() gets called in an unexpected order.

Device tree doesn't expose information the same way pcie does because it's still not standardized as well.

3

u/Bobjohndud Nov 20 '19

this is google we are talking about. "upstream your drivers or go to hell" would be quite a powerful statement from google, considering that many of these manufacturers would have their income cut by 5 if they didn't get gapps.

1

u/jdrch Nov 20 '19

many of these manufacturers would have their income cut by 5

That doesn't seem to happening to Huawei.

→ More replies (5)

2

u/EternityForest Nov 20 '19

You don't need PCIe for devices to declare themselves. As long as you can actually fit all the different drivers in flash, why can't they just arbitrarily decide that device config is stored in an I2C flash chip on the first interface at a certain address?

Also, how does Raspbian support all the different Pi's with one image?

1

u/jdrch Nov 20 '19

how does Raspbian support all the different Pi's with one image?

The same way Apple supports iDevices. Raspberry Pi Foundation controls both Raspbian and the (static) SoC hardware configs. Google controls Android, but it has no control over Samsung, LG, etc. hardware configs.

→ More replies (1)

4

u/Kazumara Nov 20 '19

if it has drivers on hand.

That's the real problem, not discoverability.

9

u/gregkh Verified Nov 20 '19

All android kernel drivers/code is already open source, that's not an issue here at all. Getting them merged upstream is an issue, but a separate one.

6

u/fat-lobyte Nov 20 '19

just force all manufacturers

Easy peasy. Not difficult at all....

→ More replies (3)

83

u/[deleted] Nov 20 '19

[removed] — view removed comment

78

u/[deleted] Nov 20 '19

"Oh but if we open source everything, then our competitors will be able to use our code! And it will be less secure! And people's phone's will start exploding!" also manufacturers

22

u/[deleted] Nov 20 '19

I think that's mostly the sales people working at the SoC and integration vendors, not the engineers. Sales guys have got to work around IP licensing and agreements that make no sense for end users, so they make up excuses.

8

u/[deleted] Nov 20 '19

Their competition: “That’s your code? Wouldn’t touch it with a 10 foot pole... In a container... On a network-less machine... on fire!”

1

u/jdrch Nov 20 '19

then our competitors will be able to use our code!

I think this is the big hangup. I don't think anyone in their right mind still believes software license and security (as far as CVEs are concerned) are related.

10

u/rhelative Nov 20 '19

Considering most high-throughput peripheral devices just use some kind of ARM-based core (see: everything ath10k-related), you're literally on the money there

13

u/[deleted] Nov 20 '19

this would actually be great... This happens with lots of hardware in x86.

But it's okay because you can package the firmware separately from the kernel and just install both packages in a base install.

10

u/TeutonJon78 Nov 20 '19

still be better than what we have. At least it could float with kernel versions then. And they could control their own driver code to load their blobs.

Right now it's all hidden in custom kernel versions.

5

u/theferrit32 Nov 20 '19

Probably, but that's still better than nothing.

→ More replies (1)

6

u/[deleted] Nov 20 '19

Preparing for the issues with Oracle as a contingency plan?

3

u/jdrch Nov 20 '19

No, I think Kotlin fixed that problem.

6

u/[deleted] Nov 20 '19

May just be exploring this to move away from that product. Oracle hasn't been the friendliest company to deal with at my job

14

u/NatoBoram Nov 20 '19

Oracle is always the worst company to work with. I've seen horrible code and horrible software, but no one is as downright malicious as Oracle. Even Microsoft is not as bad as Oracle.

1

u/jdrch Nov 20 '19

Oracle hasn't been the friendliest company to deal with at my job

They're generally awful, but I don't think this has anything to do with Java or Oracle's software patents or software licenses.

2

u/yaaaaayPancakes Nov 20 '19

Android dev here - Kotlin doesn't fix the problem around the Java interfaces Google pulled into the Android SDK and got sued over. Those interfaces they used are still there in the OS. I think they're trying to mitigate that issue by moving from Apache Harmony -> OpenJDK impls of the interfaces.

Kotlin kinda sits on top of things. It's it's own language, but can target multiple platforms (JVM, JS, and Native). On Android, the kotlinc compiler compiles things down to java bytecode prior to be running through D8, which spits out the Dalvik bytecode that ART executes.

2

u/jdrch Nov 20 '19

Appreciate the clarification!

5

u/bartturner Nov 20 '19

This has nothing to do with Oracle.

But also we are in a lot bigger trouble if SCOTUS rules in favor of Oracle.

2

u/[deleted] Nov 20 '19

So is this going to work the same way as Mac OS with how Mac OS uses kext files (kernel extensions)? Basically, Linux kernel will have hardware plugins that "extend" the kernel to support the new hardware. Sounds very similar to the Mac OS kernel and kexts.

1

u/jdrch Nov 20 '19

I'm not sure, but if you really think of it, Android's model is closer to BSD's than Linux's. MacOS uses BSD kernel code. So there's that.

137

u/ylyn Nov 20 '19

FWIW, they are not proposing to upstream stable ABI support. That would be pretty absurd.

They are just providing a stable ABI for each LTS version of their fork. Many other distributions already do that e.g. Red Hat.

See https://lwn.net/Articles/800452/

9

u/[deleted] Nov 21 '19

Still, with Google sway they should push for mainlining the code, not wasting development effort on actively making long term driver support worse

30

u/citewiki Nov 20 '19

This is way over my head. Should I agree with Google or OP? My pitchforks are ready

20

u/khleedril Nov 20 '19

How will you decide who's recommendation to go with? This is the shit of the Internet now, isn't it: so much low-quality writing swamps the wisdom of those actually qualified to comment on things.

13

u/mirh Nov 20 '19

How will you decide who's recommendation to go with?

By reading the damn sources? u/ylyn already linked why OP's comment is misguided.

Let alone all this circlejerk over pcie qualities.

4

u/vanilla082997 Nov 20 '19

I'm glad to see more pervasive use of the phrase circlejerk. 👍

→ More replies (3)

1

u/Jannik2099 Nov 21 '19

Take out your double-edged pitchfork and poke both of them!

1

u/totemcatcher Nov 20 '19

I'm guessing Google uses this ass-backwards integration to appease nervous hardware vendors who refuse to work with mainline Linux for fear of revealing anything about their hardware (patent infringements, exploits, sloppy design, etc).

2

u/jdrch Nov 20 '19 edited Nov 20 '19

refuse to work with mainline Linux for fear of revealing anything about their hardware

Google's Pixel and Google Android implementations are also closed source, which means that as far as this point is concerned, Google is in the same boat at Android OEMs.

The primary motivation for closed source licensing has always been to protect trade secrets and/or enable monetization of the software. In my experience running all manner of closed and open source software, software license has no bearing on quality, security, compliance, etc.

4

u/minilandl Nov 20 '19

Nice ideas but custom kernel developers on XDA already use parts of mainline anyway

6

u/aliendude5300 Nov 20 '19

Lol no, this will never happen.

2

u/[deleted] Nov 20 '19

This thread had me thinking there was another thing called PCIE that I some how missed out on.

0

u/[deleted] Nov 20 '19

Threads like this remind me I'm in over my head on a lot of this stuff. But what frustrates me, even not understanding a lot of the finer details as an end-user is Google's attitude on things like this. Pretty much Google wants to do what it wants to do and their attitude is that the world has to adjust to their wants and needs, not the other way around.

And the worst part? They're not exactly wrong about that.

3

u/jdrch Nov 20 '19

They're not exactly wrong about that.

Except they have been. They haven't been able to (completely) fix the Android ecosystem update problem (yet,) despite years of work. They also got pounded into the dirt on their own platform in the messaging war, etc. Google has a very long list of failures to get partners in line on many things.

1

u/[deleted] Nov 20 '19

How long before Linus kicks them out again, because there’s no incentive for engineers at Google to maintain anything, unless they’re the “paid highly to work here so no one else can hire you” type?

0

u/[deleted] Nov 20 '19

Weren’t they supposed to replace android with fuchsia by now?

1

u/jdrch Nov 20 '19

by now?

No official timeline for Fuschia has ever been published.

0

u/[deleted] Nov 21 '19

I know but it seems like it’s been in development for such a long time.

1

u/jdrch Nov 21 '19

Unless there's an official announcement or roadmap, it's just a science experiment at best.

→ More replies (1)

-4

u/[deleted] Nov 20 '19

google bad, unga bunga

16

u/[deleted] Nov 20 '19

[removed] — view removed comment

24

u/jdrch Nov 20 '19

I'm not sure I understand your question entirely, but AFAIK the GPL affects only what ships with the kernel to begin with. Just because a driver is loaded doesn't mean it's part of the kernel. Android OEMs still have to release their custom kernels to meet GPL requirements, but they can keep the proprietary drivers closed source keeping them outside the kernel.

Hopefully that helps clarify things.

6

u/ElvishJerricco Nov 20 '19

I thought .ko kernel modules still had to be GPL'd, since importing kernel headers makes them derivatives of the kernel. Isn't this the whole reason for the debate as to whether ZFS-on-linux can be shipped in compiled binary form?

4

u/jdrch Nov 20 '19

kernel modules still had to be GPL'd, since importing kernel headers makes them derivatives of the kernel

I'm not a tech lawyer, but I do believe there are many real world counterexamples to this.

whether ZFS-on-linux can be shipped in compiled binary form

Huh? No, ZoL can can be hosted as a compiled binary in a repository just fine. The question has always been whether it can be shipped within AND as part of the kernel as Btrfs, etc. are. Popular opinion is that's not legally the case.

The magic of Linux is that the it's a kernel, and so its license applies to the kernel only (unless adopted by some other OS components, at the will of the latter's devs.) You can certainly have many other components that interact with the kernel that use a different license, such as drives, filesystems, etc.

Whether or not the legality/license compliance of those other things has any practical consequence is dependent on the interest possible claimants have in a court case. So far, that interest has been sufficiently low to allow closed source driver and kernel interoperability at least at the non-commercial/consumer level.

4

u/ElvishJerricco Nov 20 '19 edited Nov 20 '19

The debate about ZFS heated up when Canonical started shipping it in Ubuntu repositories. SFC, for instance, believe that even a .ko constitutes a Linux derivative, even without including ZFS in the kernel source tree: https://sfconservancy.org/blog/2016/feb/25/zfs-and-linux/

Though, Canonical, and Software Freedom Law Center, believe it falls within the "equity of the license", meaning they believe neither license's apparent intent is to prevent things like ZFS binaries from being distributed. However they do admit that interpreting the licenses literally would yield the conclusion that distributing ZFS binaries would be a GPLv2 violation.

EDIT: Quote from the SFLC article, Torvalds, in response to a claim that kernel modules are excepted:

I have heard many people reference the fact that the although the Linux Kernel is under the GNU GPL license, that the code is licensed with an exception clause that says binary loadable modules do not have to be under the GPL.

Nope. No such exception exists.

Anyway, my point is that yes, there is debate, even around .ko's

1

u/jdrch Nov 20 '19

there is debate

Fair enough. Thanks for the info.

2

u/[deleted] Nov 20 '19

I think it's also worth pointing out that kernel modules (.ko) are loaded into the kernel and become as much of a part of the kernel as the upstream kernel code.

Definitely a blurry line.

4

u/ElvishJerricco Nov 20 '19

I don't think that in particular has anything to do with it. The GPLv2 issue stems from distribution only. GPLv2 doesn't care at all what you do in private (such as loading arbitrary code into your kernel at runtime). It just cares how the licensed code gets distributed. And the issue in the case of .ko's is just that any .ko contains Linux header code in binary form; hence distributing a .ko inherently means you're distributing Linux header code.

2

u/[deleted] Nov 20 '19

Afaik.

The GPL only covers derivative work. The argument to not open source a device driver is that most of the work happens outside of the kernel (in the device) and it is therefore mostly original work.

That's how Nvidia frames it anyway.

4

u/ElvishJerricco Nov 20 '19

The drivers that fit that description are drivers that are not distributed as .ko files. There's a lot of ways to do this. For instance, there's nothing in any version of GPL that prevents you from distributing an installer that downloads GPL'd code and links it against non-GPL'd code at install-time on the end-user's machine; but the .ko that results on the end-user's machine is not something that can be distributed.

So IIRC, nvidia distributes a little bit of GPL'd open source code that can be linked against separately distributed proprietary object binaries at install-time to produce a .ko driver for their GPUs. The small shim of open source code takes care of all the communication with the kernel, and the proprietary objects actually implement the meat of the driver. These two components are distributed separately, then compiled together by the installer. The resulting .ko file is considered derivative of the kernel, but it was never distributed so that's ok.

1

u/jdrch Nov 20 '19

This is an excellent explanation.

→ More replies (9)

9

u/[deleted] Nov 20 '19

I thought .ko kernel modules still had to be GPL'd, since importing kernel headers makes them derivatives of the kernel.

The kernel isn't strictly GPLv2, it has an exception for exactly what you describe:

NOTE! This copyright does *not* cover user programs that use kernel
 services by normal system calls - this is merely considered normal use
 of the kernel, and does *not* fall under the heading of "derived work".

https://github.com/torvalds/linux/blob/master/LICENSES/exceptions/Linux-syscall-note

2

u/mfuzzey Nov 20 '19

No.

The part you quote concerns userspace. Syscalls are interface between the kernel and userspace. So, in userspace, you can do what you like without being concerned with the GPL, at least providing you don't use userspace GPL libraries. The kernel's license is irrelevant to userspace.

But kernel modules are concerned by the GPL. And indeed most are already open source. Though often not mainlined Most vendors do not use closed source kernel blobs but only closed source userspace and firmware blobs.

By default kernel nodules are considered derivative works of the kernel and hence subject to the GPL, unless there are specific reasons otherwise. Such as Nvidias kernel blob which was not written for Linux but Windows and uses a GPL shim to interface with the kernel

2

u/[deleted] Nov 20 '19

Such as Nvidias kernel blob which was not written for Linux but Windows and uses a GPL shim to interface with the kernel

No it certainly wasn't written for Windows, the nvidia Linux driver is a user-space driver with an open source kernel module. This is how most proprietary drivers work in order to avoid to creating derivative works.

By default kernel nodules are considered derivative works of the kernel and hence subject to the GPL, unless there are specific reasons otherwise.

I'd be curious to see the legal precedent for that, if there is one. I've seen a lot of opinions on the matter but never found it being tested in court.

1

u/jdrch Nov 20 '19

never found it being tested in court.

Microsoft tested it by showing up to companies' doorsteps and telling them to pay licensing fees or risk a court case. I don't think a single one chose the latter.

2

u/[deleted] Nov 21 '19

I may have missed that, I'm aware of the patent issues, wasn't aware of Microsoft asserting the GPL on kernel modules though.

1

u/jdrch Nov 21 '19

I'm aware of the patent issues

That's what I was referring to. Used the wrong terminology, sorry.

1

u/mfuzzey Nov 20 '19

No it certainly wasn't written for Windows, the nvidia Linux driver is a user-space driver with an open source kernel module. This is how most proprietary drivers work in order to avoid to creating derivative works.

I was only talking about the kernel part, not the user space blob.

Yes saying it was written for Windows was a bit of a short cut. The Nvidia kernel driver consists of two parts, a Linux specific, source provided GPLd 'shim' (which is usually compiled from source when you install / update the driver) and a multiplatform kernel blob that is loaded by the shim and contains the core part of the kernel driver. The kernel blob is not written specially for Linux and does not directly use anything in the kernel, only abstractions provided by the shim but is used on both Linux and Windows, which is enough to make a reasonable claim of it not being a derived work.

I'd be curious to see the legal precedent for that, if there is one. I've seen a lot of opinions on the matter but never found it being tested in court.

It has never been tested in court AFAIK

10

u/ElvishJerricco Nov 20 '19 edited Nov 20 '19

The ZFS kernel module is not a user program that uses kernel services by normal system calls. It is a kernel module that includes kernel APIs from kernel header files. User programs do no such thing. EDIT: To clarify further, that "NOTE!" is NOT an exception. It's a note, pointing out that user programs don't include kernel sources to use the kernel ABI.

1

u/[deleted] Nov 20 '19

I don't have familiarity with how ZFS is implemented or what controversies surround it but drivers, like nvidia's for example, typically use an open source kernel module which then communicates with a closed source user-space driver that exploits that syscall exception.

...though now that I type that I realised you did indeed explicitly say <i>.ko</i> which is why that module is open source. But this is generally how companies ship closed source drivers for Linux, not as a .ko but as a closed source user-space driver that interfaces with the kernel via that module.

-1

u/[deleted] Nov 20 '19

ZFS is open source (MIT iirc). But it cannot be integrated into the kernel because if incompatible licenses.

That same incompatibility makes it questionable to distribute the compiled kernel modules. As those are considered derivative work of the kernel.

An open source shim here makes no sense because it is open source to begin with

9

u/[deleted] Nov 20 '19

ZFS is open source (MIT iirc). But it cannot be integrated into the kernel because if incompatible licenses.

I'm not sure about the implementation of the integration but ZFS certainly isn't MIT, in fact the reason for the questionable license compatibility with the kernel is because it is CDDL.

But let me just rephrase that from "open source kernel module" to "compatibly-licensed kernel module", that's how the nvidia driver works: a compatibly-licensed kernel module "shim" that acts as the interface between the kernel and the user-space closed source driver.

3

u/[deleted] Nov 20 '19

A loaded driver is part of the kernel by any definition you can think of.

I'm sure there's some stuff that you need to implement in the kernel core but a loaded driver effectively becomes part of the kernel.

4

u/bubblethink Nov 20 '19

This is not true. The cases where kernel drivers are proprietary are few and far in between. NVIDIA comes to mind, but that works (in theory anyway) because the NVIDIA driver is not a derivative of the kernel since it is mostly a windows driver that exists independently of the kernel. That argument would be difficult to make for some android arm64 soc.

I think the author is also mixing up a few things here. The fight is not so much about open v/s proprietary in the kernel space. The interesting bits are proprietary in the user space for stuff like GPUs anyway. In this case, it's just about upstreaming and waiting for something to be merged v/s not upstreaming.

6

u/[deleted] Nov 20 '19

The Nvidia driver is not a windows driver, it's just a generic driver that happens to be initially written for Windows.

A windows can't work on Linux but a GPU driver actually has very little interaction with other subsystems so what Nvidia does is to build a blob with all the GPU sauce inside.

What they open source is the interaction between the GPU secret sauce and the system.

The blob is the firmware for the GPU where the actual work happens. And that doesn't change depending on the OS.

3

u/bubblethink Nov 20 '19

Yes, I was making a point. I know it's not the exact same as a windows driver. Windows is crucial to the whole non-derivative argument. You can't make that argument in a vacuum.

3

u/[deleted] Nov 20 '19

The nvidia driver itself is a user-space driver. The kernel module that gets loaded (the bit that you compile when you install the nvidia driver on Linux, which is why you need the kernel headers) is free software.

2

u/bubblethink Nov 20 '19 edited Nov 20 '19

There are a few different things. Earlier, it used to be just the X11 driver. In recent years, there is also a kernel part that is proprietary. Yes, the shim is open source, but that's not all of the kernel driver. The gentoo wiki has more information (https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers)

"The kernel module (nvidia.ko) consists of a proprietary part (commonly known as the "binary blob") which drives the graphics chip(s), and an open source part (the "glue") which at runtime acts as intermediary between the proprietary part and the kernel."

"When the internal ABIs change, then it is not possible to merely fix the "glue", because nobody knows how the glue is used by the proprietary part. Even after managing to patch things up to have things seem to work nicely, the user still risks that running nvidia.ko in the new, unsupported kernel will lead to data loss and hardware failure."

2

u/C4H8N8O8 Nov 20 '19

That's common for firmware.if you don't like it, use Linuxlibre