Le 08/06/2019 à 19:36, Simon McVittie a écrit :
It's also very suitable for preinstalled hardware, where it's sometimes
referred to as the "out of the box experience": the hardware vendor does
the partitioning and the "unpack installation image" step (in practice
via a disk image), then ships the device, and the buyer starts from the
first boot into the installed system (which could start by expanding
the disk image from its minimal size to a disk-filling partition, so
one disk image can work for many disk sizes).

If the pre-prepared installation image is in a suitable format (for
example an unpacked tree, squashfs or OSTree, but not a tarball or an
OCI image), then there's no reason it couldn't also be bootable as a
stateless live system.

I maintain a tool called debootstick that ressembles what you describes. It can pack a highly customized OS into a bootable USB image.

The tool lets you take care of the customization step: you specify the customized chroot directory as input, and debootstick turns it into a bootable disk image. (This means partitionning, formatting, installing a linux kernel package if missing, a BIOS / UEFI bootloader etc.)
Thus, a classical approach is: debootstrap, then chroot, then debootstick.
But here is another one: docker build from dockerfile (or docker container run), then docker export, then debootstick.

Currently, the tool is suited to build custom live systems, and it also has a feature to move the live OS from the USB media to an internal disk. But it is not suited for mass installation (at least not yet) because the OS-move feature is based on pvmove (LVM): the OS is moved, not copied.
We might be able to provide a "mass-installation mode" in the future.

Anyway, whatever the tool:
* working with an image is often handy: you can test it thoroughly with kvm, before booting real hardware. * I believe squashfs-based systems are suited to short-term usage only, because some major parts of the OS (bootloader and kernel) have to remain outside of the squashfs image, which leads to a quite hazardous OS setup IMHO (regarding security updates for instance). Moreover the squashfs + writable partition + union fs scheme is counter-productive regarding disk space over the long term, after many files have been modified or removed. If you just want an installer, it is fine, but I would not recommend it for any other kind of "live" system.

Etienne

Reply via email to