One of the most frequent requests we’ve seen on the Clear Linux OS Forums has been to enable offline installs.
We’re very pleased to announce that as of build 31230, the Clear Linux OS Desktop and Clear Linux OS Server ISO images now support offline installs!
I caught up with John Akre (@jwakre), who was the Clear Linux OS engineer responsible for making this happen.
Chris: Hi John. Before we talk about how you made this happen, can you talk a bit about your background?
Chris: I know making the installer capable of running offline wasn’t high on the priority list for a long time, but I understand that you managed to pull this feature in in addition to your other tasks. Why did you focus on this feature?
John: It’s always just been a constant ask, there’s a lot of desire for it, and it just seemed like it should be a higher priority than what else was sitting around.
Chris: How hard was it to make this happen?
John: Initially I thought it would be alot easier than it was, but to make it efficient with disk space and actually faster than a network install took a while. I had to learn a little bit and also take advantage of some other features, but it wasn’t too bad.
Chris: Could you give some more info about how you got it working?
John: I started with the idea that swupd downloads all the content it needs for an install into the /state directory, and then from the /state directory it performs the update or install. And so I thought that I could have an offline content directory (which is just a ‘/state’ directory from swupd’s perspective) at an alternate location that would store all the offline content that is necessary for a minimum install. And so I did a little work on the swupd side so that I could hard link everything in the offline content with what’s currently in the installer image. By hardlinking I mean one copy of the file contents, but referenced multiple times so it doesn’t use extra disk space by having multiple copies of the same file. That allowed me to be very efficient with disk space I use, so the offline installer support didn’t really add a significant amount of disk space to the images because for the most part I’m hard linking - we’re using existing content on the system. So for example, you have the desktop autostart bundle, which is huge, and I’m hardlinking that in the GUI image, so there’s no disk impact. And so when you’re installing, if the directory at that location exists, swupd will use that.
Chris: So network connectivity is not required.
John: I don’t check for connectivity when it’s not required. I’ve removed the pre-check page. But if you have offline content, and you don’t add any additional bundles, I don’t check the network.
Chris: But if you need an extra bundle?
John: When you try to add an additional bundle, a network check will run in the foreground. For the user, it’s largely transparent.
Chris: And it’s so much faster!
John: Yes, I directly decompress from the ISO to make it even faster. It cut down a lot of time as the ISO is already compressed in a squashfs and so I use unsquashfs to directly decompress it to the target location.
Chris: This offline install is a feature that many people have been asking for. Thank you for implementing this feature, and for your time talking about it!