Comment by bee_rider
Reaching the the legal hammer out to be a last resort, but IMO, EOL-ing a device should require open sourcing it and handing over any info required for administration to the users. Or refund for full price.
A device which can not be administered by the end user is administered (perhaps negligently) by the company who sold it.
I would love that, but I can see some issues: Embedded stuff (e.g. in your car) might use a proprietary RTOS, like "VxWorks" [1]. Then the developers might had to use a commercial toolchain from e.g. Hightec [2]. They could also have licensed some 3rd party libs. What about external verification tools for critical stuff? What about cloud-connected services (e.g. music streaming)?
For a manufacturer to opensource "all that's necessary to build, deploy and use the soft-/hardware", the whole ecosystem would need a massive paradigm shift.
For certain device classes this is probably much easier than for others. And expecting/dictating a reasonable lifetime from a product might be the better choice - and as the EU directive regarding user-replacable smartphone batteries shows, this goes beyond software.
[1] https://en.wikipedia.org/wiki/VxWorks [2] https://hightec-rt.com/products/development-platform