Age-verification at OS levels was always a terrible idea. It's difficult to see under what rationale Linux should be granted an exception for this dumb idea. The solution is just to repeal the law and flog the sponsors.
It's not really that terrible. If you're going to do age verification, you have two choices: browser or operating system. All else is all but guaranteed to be either a privacy disaster, a usability disaster, or both. And either way, every operating system needs to support multiple users, or the "I used dad's iPad to browse porn and buy firearms" problem makes the verification useless.
And major operating system or browser vendors that cater to the general public should make it available by default, because doing so prevents the "You downloaded the AdultCheck module, so you must be a pervert" logic that some people might use to attack people.
What's terrible is the idea of mandating that it be performed at the OS level, rather than just mandating that the OS doesn't get in the way. Browser-level verification is actually far preferable, because there's no need to bake that into an authentication framework when you can just send it out to a browser window. Leave that tiny bit of integration complexity to the companies that actually require it. But this only works if the OS supports multiple users, so that the browser's cookies and storage are not shared across multiple users.
For devices that don't have multiple users, baking it in at the OS level really is the only way, but it could just as easily be solved by baking it in at the browser level and changing the OS to allow multiple users per device. Unfortunately, such technical details are way too subtle a point for most lawmakers to understand, so obviously they did it in the most wrong way possible.