OS in updatable image

This forum is for discussion about general software issues.

OS in updatable image

Postby adontz » Wed Feb 25, 2015 2:50 pm

Hello,

On high level, I want to create upgradeable custom OS build.
My first thought about how that can be implemented was I need to boot OS from some image file and later to be able to update that file from booted OS. I've read some docs, searched how can it be done, found some keywords like squashfs, unionfs, overlayfs, NOOBS, but still not sure.

Now I think about something like this: I have mmcblk0p1 FAT32 partition mounted as boot, large enought for two OS images (like 4-5Gb or so), with some, let's say, alarm-15.squashfs file on it. Device boots from "/boot/alarm-15.squashfs" readonly root (which is OK for me) and continues with mounting mmcblk0p2 /var/ read-write, so I have working system. Boot partition is R/W too, so I create (download) new file alarm-16.squashfs on it and somehow switch (by editing cmdline.txt for instance) to new file, restart RPi and I'm done with upgrade.

While this seems like a good idea, there are a lot of details I did not figure out yet.

So if somebody done that before, please can you share links to some useful docs, blog posts or any other thing which can help me.
adontz
 
Posts: 15
Joined: Tue Jun 17, 2014 4:10 pm

Re: OS in updatable image

Postby WarheadsSE » Wed Feb 25, 2015 3:32 pm

Arch isn't exactly designed for this. It is doable, however. It will simply take a large amount of work on your part, for which I can not sit and hand-hold to make happen.
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: OS in updatable image

Postby adontz » Wed Feb 25, 2015 3:51 pm

Oh, I'm not asking to build this into Arch, I'm just asking if somebody did that before and can share information.
adontz
 
Posts: 15
Joined: Tue Jun 17, 2014 4:10 pm

Re: OS in updatable image

Postby WarheadsSE » Wed Feb 25, 2015 4:49 pm

into Arch, or with Arch.
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: OS in updatable image

Postby adontz » Thu Feb 26, 2015 12:43 pm

Not asking to build into, but asking how to build with, if somebody did that before.

I understand that I may finish with highly customized setup, but I think it will be much less effort to customize existing distribution boot process, rather that learn buildbot, linux-from-scratch, etc. and build whole userspace from scratch.

For instance I already have read-only root with read-write "/var/" setup and it is not hard at all if you know what you are doing.
adontz
 
Posts: 15
Joined: Tue Jun 17, 2014 4:10 pm

Re: OS in updatable image

Postby WarheadsSE » Thu Feb 26, 2015 1:58 pm

Then you need to decide on your OS image file type.

I have used squashfs for RO layer, and then AUFS'd a tmpfs as a RW layer over the top, but thanks to systemd, you don't really even need that. Although, when you get into stacking, you really want to look into an initramfs so that you can keep mounting /var out of the way of the booting system spin-up.
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm


Return to General

Who is online

Users browsing this forum: No registered users and 8 guests