Am I a Linux Dinosaur?
Oct. 25th, 2022 06:58 am![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
While I’ve been in the hospital, I’ve been playing with my new Surface Pro 6, installing Ubuntu on it, and basically getting it up and running. Having Linux ona Surface Pro is a practice in old-fashioned Linux hacking; you have be prepared for a hardware platform that isn’t going to hold your hand. Despite that, I love the Surface Pro form factor, the screen is beautiful, and it actually runs some games very well. I’ve been playing Dead Space on it under Wine, for example, and it looks gorgeous on that retina screen!
One of the problems I’ve been having is that I’ve been unable to get the camera up and running. I wanted to be able to Zoom with my wife, Omaha, now and then. The Surface Pros 5 through 9 come with what are called “soft cameras”; they’re mostly just CCDs and lenses, and all of the processing of the imagery is not done with specialized hardware as it was in earlier computers, but in drivers that run on specialized processors on the camera board.
I searched on Google and found a Redditor who was having the exact same problem I was, and his post was within the past week. While I’m often terrible at solving my own problems, I figured if I could solve his problem, I’d solve mine, and I like helping other people solve their problems.
The problem turned out to be a bit of a detective story. I read his post and that made me look closely at the error, which read “This driver is excluded from being installed on this version of the Linux kernel.” We were both running Linux 6.0, the latest, so it wasn’t that surprising that the driver wasn’t up-to-date for it. I dug in and found the script for building and installing the driver (remember, this is Linux, we get lots of stuff in source code). I told the guy, “The script says that if it can’t tell if Video For Linux v2 (V4L2) is configured in the kernel, make the kernel requirement impossible to meet, causing that failure. I can’t tell if that means the Surface Pro kernel team didn’t configure V4L2, or if you and I are just missing that configuration file. I’ll figure it out tomorrow; right now, I’m in the hospital recovering from COVID and I run out of energy fast.”
The next day I was able to tell him, “So, I made some progress.” I hacked the build script to tell me where to find the kernel config file it was looking for, but it didn’t print it. I hacked further to send that info to a file so it wouldn’t get lost. That file turned out to be a link, which led to another link, which finally led to the kernel config file for the Linux Surface Pro kernel. I searched for V4L2, and there were a bunch of them in there, but none of them matched the exact token the driver’s build script was looking for. Instead, there were two similar tokens that said “V4L2IC2” and “V4L2PCI”, which told me that in Linux 6, V4L2 had two different configurations, the modern “IC2” chipset, and the older “PCI” chipset. IC2 was configured on the Surface Pro.
I told him all this and said, “We have three choices: we can find when the kernel team did this, we can complain to the V4L2 team that their script is out of date, or we can hack it ourselves. I’m gonna hack. After a nap.”
That afternoon, I edit the driver build script. I say, “Instead of looking for V4L2, look for V4L2I2C, which we know is configured.” I look up how to run the build system, the install system, and the kernel activation system, and sure enough, it works! I explain the steps in detail, how to change the token, run the build/install/activate, and he comes back a few hours later saying it worked and thanked me because my instructions were really clear and detailed!
I felt really good about that. I felt really good about being able to call my wife over Zoom.
I also felt surprised that no one else had helped him. No one else had addressed his problem. I mean, yeah, there aren’t that many people silly enough to run Linux on a modern Surface Pro, but there are enough that there’s a whole team dedicated to it on Github. And the new “soft cameras,” which are now on lots of laptops and not just the Surfaces, are hellishly complicated, with their own issues.
And then it hit me: Elf, you are old.
What I had been doing was something called kernel config hacking. In the 90s, every Linux user was a master config hacker. You had to be. You often got Linux as a bundle of source code you had to build yourself with your own toolkit of compilers, linkers, and libraries. You had to physically open up your computer and catalog, “Okay, I have this network card, and this video card, and this much memory, and this kind of hard drive connector,” and then modify the kernel configuration file by hand to match that inventory, then build the thing and hope it ran. Every Linux user mastered this skill.
In the modern era, nobody does that anymore. Instead, all the drivers for all the computers in the world come with your Linux install. On boot, the kernel probes the hardware, which now tells the kernel what’s available, and the kernel loads the drivers it needs automatically. Kernel configs these days consist of “build all the things as plug-in modules, and we’ll load what we need at runtime.”
Kernel config hacking is now an estoric skill. Nobody needs it anymore except in very rare cases like this one. Hell, I had to figure out how the DKMS (Dynamic Kernel Module Support) build system worked, as that was new to me. “In my day, sonny, we used
I can’t tell if this proves that I’m useful, or a dinosaur. Nobody learns how to spot that a DKMS file is just a shell script? Nobody knows how to hack around stdout/stderr swallowing? Nobody knows how to search a kernel config file for clues? All of that is estorica now.
It was such an odd experience to realize I have this skill set so few people need nowadays.
Maybe I’m still a useful dinosaur.
It was also sort of frustrating that it took me six hours to solve, distributed over two days, but I’m currently very metabolically challenged and often passing out at random, managing the pain of my current condition.
One of the problems I’ve been having is that I’ve been unable to get the camera up and running. I wanted to be able to Zoom with my wife, Omaha, now and then. The Surface Pros 5 through 9 come with what are called “soft cameras”; they’re mostly just CCDs and lenses, and all of the processing of the imagery is not done with specialized hardware as it was in earlier computers, but in drivers that run on specialized processors on the camera board.
I searched on Google and found a Redditor who was having the exact same problem I was, and his post was within the past week. While I’m often terrible at solving my own problems, I figured if I could solve his problem, I’d solve mine, and I like helping other people solve their problems.
The problem turned out to be a bit of a detective story. I read his post and that made me look closely at the error, which read “This driver is excluded from being installed on this version of the Linux kernel.” We were both running Linux 6.0, the latest, so it wasn’t that surprising that the driver wasn’t up-to-date for it. I dug in and found the script for building and installing the driver (remember, this is Linux, we get lots of stuff in source code). I told the guy, “The script says that if it can’t tell if Video For Linux v2 (V4L2) is configured in the kernel, make the kernel requirement impossible to meet, causing that failure. I can’t tell if that means the Surface Pro kernel team didn’t configure V4L2, or if you and I are just missing that configuration file. I’ll figure it out tomorrow; right now, I’m in the hospital recovering from COVID and I run out of energy fast.”
The next day I was able to tell him, “So, I made some progress.” I hacked the build script to tell me where to find the kernel config file it was looking for, but it didn’t print it. I hacked further to send that info to a file so it wouldn’t get lost. That file turned out to be a link, which led to another link, which finally led to the kernel config file for the Linux Surface Pro kernel. I searched for V4L2, and there were a bunch of them in there, but none of them matched the exact token the driver’s build script was looking for. Instead, there were two similar tokens that said “V4L2IC2” and “V4L2PCI”, which told me that in Linux 6, V4L2 had two different configurations, the modern “IC2” chipset, and the older “PCI” chipset. IC2 was configured on the Surface Pro.
I told him all this and said, “We have three choices: we can find when the kernel team did this, we can complain to the V4L2 team that their script is out of date, or we can hack it ourselves. I’m gonna hack. After a nap.”
That afternoon, I edit the driver build script. I say, “Instead of looking for V4L2, look for V4L2I2C, which we know is configured.” I look up how to run the build system, the install system, and the kernel activation system, and sure enough, it works! I explain the steps in detail, how to change the token, run the build/install/activate, and he comes back a few hours later saying it worked and thanked me because my instructions were really clear and detailed!
I felt really good about that. I felt really good about being able to call my wife over Zoom.
I also felt surprised that no one else had helped him. No one else had addressed his problem. I mean, yeah, there aren’t that many people silly enough to run Linux on a modern Surface Pro, but there are enough that there’s a whole team dedicated to it on Github. And the new “soft cameras,” which are now on lots of laptops and not just the Surfaces, are hellishly complicated, with their own issues.
And then it hit me: Elf, you are old.
What I had been doing was something called kernel config hacking. In the 90s, every Linux user was a master config hacker. You had to be. You often got Linux as a bundle of source code you had to build yourself with your own toolkit of compilers, linkers, and libraries. You had to physically open up your computer and catalog, “Okay, I have this network card, and this video card, and this much memory, and this kind of hard drive connector,” and then modify the kernel configuration file by hand to match that inventory, then build the thing and hope it ran. Every Linux user mastered this skill.
In the modern era, nobody does that anymore. Instead, all the drivers for all the computers in the world come with your Linux install. On boot, the kernel probes the hardware, which now tells the kernel what’s available, and the kernel loads the drivers it needs automatically. Kernel configs these days consist of “build all the things as plug-in modules, and we’ll load what we need at runtime.”
Kernel config hacking is now an estoric skill. Nobody needs it anymore except in very rare cases like this one. Hell, I had to figure out how the DKMS (Dynamic Kernel Module Support) build system worked, as that was new to me. “In my day, sonny, we used
Make
and we liked it!”I can’t tell if this proves that I’m useful, or a dinosaur. Nobody learns how to spot that a DKMS file is just a shell script? Nobody knows how to hack around stdout/stderr swallowing? Nobody knows how to search a kernel config file for clues? All of that is estorica now.
It was such an odd experience to realize I have this skill set so few people need nowadays.
Maybe I’m still a useful dinosaur.
It was also sort of frustrating that it took me six hours to solve, distributed over two days, but I’m currently very metabolically challenged and often passing out at random, managing the pain of my current condition.