How to remaster Clear Linux Live

It is well known how to create a Live USB from Clear Linux ISO.
Such Live version of Clear Linux appears to work well.
So in order to preserve changes on such Live USB version of Clear Linux: How can we remaster such Live Clear Linux instance, so next time it boots all changes and installs are there?

Such a thing wouldn’t be difficult at all. You could install some bundles and create a user etc., but you would have very limited space and performance on a usb. I suppose an interesting thing could be to create some sort of appliance that boots the os into ram from usb, then mounts other drives for swap and/or persistence. A truly stateless paradigm.

In general I do agree with your assessment and the scenario you outlined would be superior. However in a way Live USB already satisfies some of the requirements you mentioned:

  • Live USB is primarily read only. This is a huge difference from such system being installed on USB, in which case there would be lots of writes, which would be not suitable for USB unless such USB is SSD or disk.
  • With Live USB, being mostly read the operating system, whatever is needed would be read into memory and execute from there. Should anything else happens to be required later would be read from USB.
  • Changes would not be preserved, so it boots the same way each time.
  • Should important changes be required then remaster would preserve them as they were the first time.

I feel this is similar to what you had in mind too, except on-going persistence is not required. Clear Linux is an excellent performer and boots current Live USB rather quickly so I am trying to leverage such excellent system and combine with Live capability.
So when you say that to accomplish remaster is not difficult to do, would you please recommend some methods?
Greatly appreciated.
Thanks and Regards.

Just to add, in principle I would be attempting creation of such an appliance you outlined, although as the first step it would be not as complex. Just no persistence after all is configured and installed and remastered. The challenge of persistence could be handled as next step. This way some progress could be achieved quicker and results sooner.
In general I think and agree with you such stateless fully configure appliance would be a terrific feature. Imagine just sticking such Clear Linux USB in any machine and boot, resulting in fully configured system… Clear Linux is small enough for this and extremely well designed. Way better designed than any other Linux.
Thanks again and best Regards.

1 Like

Except that I’m a bit confused now. You want a read only iso that rebuilds itself to reflect current state at each shutdown? Idk … mabye someone like Ken Thompson would be better suited to answer that one.

1 Like

Well, what I mean specifically is almost exactly the appliance you had in mind. But as the first step towards this:

  • On the base of the current Clear Linux USB, install all the required software and configure, configure desktop, printers, networking, etc. I understand it is possible…
  • After complete configuration, all installed, configured, etc., this Live USB would be burned as new version through remaster I think or some equivalent way. I do not know how though.
  • Such new fully configured Live USB of Clear Linux would boot with all the software but would be still missing persistence, which I do not know how to accomplish. However persistence is not that important anymore at this point because all is already configured so such appliance would boot the same way. User file persistence could be accomplished through SMB share or something.

I think that in effect this would be the stateless appliance you mentioned in the first reply except not automatic persistence.

1 Like

I see. Am few long running appliances achieve this using configs. In such a scenario you need to copy a config file to somewhere before shutdown then import the config again after the next boot. You could for instance get everything set up how to wanted it then push the steps you used to or as a setup script then run it after each boot.

This looks to me a complex way to do this but perhaps not if I were more familiar with internals of Clear Linux. I will try to figure out all this…
Would you know if such Live USB, after installs and configuration could be remastered or exported to an ISO or something to retain all composition? I think in Linux world it is common to remaster or ISO snapshot but I do not know how…
ISO snapshot of running system would be perfect as such ISO could be base for new Live…

Sorry, what config file were you actually referring to as the one to save before shutdown and import after next boot?
Your help is greatly appreciated. Thanks.

you can export an image with dd. The problem with what you are envisioning is that even if you were to clone the currently mounted iso nothing has actually been written to it so… Why not just install Clear linux?

You would have to do this manually.
For instance copy your bash_history to a git repository. Then download it on your next login and re run it.

I may be wrong but when I boot the Clear Linux Live USB it is no longer the read-only ISO from which it originated. So after I configure CL on such USB I do not want to replicate the original image with dd but rather the newly configured system to include all installations. So if nothing actually has been written to such Live USB then it is a problem for me and quite different than most other Linux systems which allow configuring Live instance and remastering. I have been doing this all the time.
Do I understand you well, that Clear Linux Live cannot be configured and remastered?

yes it can.

Perhaps I miss to understand what you mean… I did read this part before and it seems to address process how to replicate install of Clear Linux on another machine. I do not see where in that link it says how to remaster Clear Linux LIVE instance. Am I missing this part somewhere?
I apologize if it is obvious and just my oversight…

To my knowledge no, clear linux does not provide a tool to boot live desktop installer cd, install a few bundles and connect printer etc, then export current state as new Clear linux live. There may be third party tools that could help do something similar such as this one I’ve googled for you. CL does however provide many tools for building custom images i.e clr-installer os-install and even mixer which is a very powerful dev tool.

Thanks. Disappointing news as it is to me. I will look into options such as the third party tools to use for Clear Linux…

I think it can be much easier than what you’ve been thinking.

The live ISO image is built by a program, which can be found in clr-installer repository. That implies you can hack the building process to include your custom choice of bundles.

1 Like

Thanks for the info. This is great to know…
Would this be too silly question: How can I find this program and clr-installer repository in the first place?
Is this one of bundles among Software repository on CL desktop?
Greatly appreciated.
Thanks much and Regards…

It’s a repository on GitHub.

I haven’t tried this myself. I think to add custom bundles, you only need to modify the bundles filed in

And notice that there are two sections defines the scripts to run before and after the building of live ISO image:

pre-install: [
   {cmd: "${yamlDir}/"}

post-install: [
   {cmd: "${yamlDir}/ ${chrootDir}"},
   {cmd: "${yamlDir}/ ${chrootDir}"},
   {cmd: "${yamlDir}/ ${chrootDir}"},
   # Uncomment to install latest master of swupd into image for testing
   #  {cmd: "${yamlDir}/ ${chrootDir}"},

I believe you can add a custom script to post-install for more modifications.

1 Like