Gentoo Archives: gentoo-soc

From: "Robin H. Johnson" <robbat2@g.o>
To: gentoo-soc@l.g.o
Subject: Re: [gentoo-soc] GSoC 2017: Atom Gentoo
Date: Thu, 30 Mar 2017 18:54:50
Message-Id: robbat2-20170330T183939-295144158Z@orbis-terrarum.net
In Reply to: [gentoo-soc] GSoC 2017: Atom Gentoo by Huimin Zhang
1 On Thu, Mar 30, 2017 at 02:57:21AM -0700, Huimin Zhang wrote:
2 > Atom Gentoo will have a build script that will generate a disk image,
3 > complete with bootloader, to be cloned to disks for deployment. I suspect
4 > BIOS is a lot more prevalent than UEFI for servers and virtualization so a
5 > BIOS bootloader will be default. The default kernel config should be
6 > tailored for virtualization.
7 The image-building part will probably already be very similar to the
8 OpenStack diskimage-builder tool, you can possibly benefit from that.
9
10 > Each installation of Atom Gentoo consists of two separate partitions for
11 > the root filesystem. Only one will be in use at a time, and the other will
12 > be used for upgrades. If an upgrade fails, the partially upgraded partition
13 > should be reset to be a copy of the other partition. If an upgrade
14 > succeeds, the unupgraded partition should copy the contents of the upgraded
15 > partition.
16 Why sticking to writable filesystems here? This could be treated via
17 block-level replication, with squashfs or read-only optimized
18 filesystems, and verified via dm-verity or similar, providing options
19 for verified boot.
20
21 I presume you were thinking of something like OverlayFS for the stateful
22 layer, but that could also be used for one or more application R/O
23 layers.
24
25 These ideas aren't new, look at how the OS is handled in Android &
26 ChromeOS, you'll see many of them together. Even Docker's container
27 build model is very similar to this.
28
29 > The logic for choosing which partition to boot and maintaining the two
30 > partitions will be handled in the init of initramfs, and the functionality
31 > of generating such an initramfs could be patched into genkernel.
32 As the genkernel author, there have been debates about replacing the
33 initramfs-generation portion with Dracut (which requires porting of some
34 of the existing initramfs functionality to Dracut) [this is probably a
35 GSOC project candidate as well, but it'll be a lot of work].
36
37 > For updates, Atom Gentoo can rsync from a server that was defined at build
38 > time. By using rsync the updates are diff-only instead of fetching the full
39 > image each time. This can run automatically in the background as a cronjob,
40 > updating the root partition not currently in use.
41 Since the start & final state can be known, you can pre-generate the
42 delta (see rsync --write-batch etc), or go even more efficent by looking
43 at block layer transfers (including bindiff of squashfs, zfs/btrfs send
44 & other models).
45
46 > Should Atom Gentoo be minimal to the point of excluding portage and not
47 > being self-sufficient? Since Atom Gentoo will receive full atomic OS
48 > updates, it doesn’t really need to update its own packages, and perhaps
49 > package management as a whole can be offloaded? This makes a lot of sense
50 > for mass deployment.
51 Putting the packages in a different layer could be valuable.
52
53 > For building Atom Gentoo, should the starting point be one of the Gentoo
54 > Stage 3 tarballs or even earlier? I am leaning towards “even earlier”,
55 > which will be necessary if portage is cut out of Atom Gentoo.
56 Move it to the packages layer maybe, or a "dev" layer.
57
58 > Should Atom Gentoo use a specific stdlib? I think uClibc and musl fit this
59 > project well, but I haven’t worked with them before.
60 Having multiple options shouldn't be a hurdle here ;-).
61
62 --
63 Robin Hugh Johnson
64 Gentoo Linux: Dev, Infra Lead, Foundation Trustee & Treasurer
65 E-Mail : robbat2@g.o
66 GnuPG FP : 11ACBA4F 4778E3F6 E4EDF38E B27B944E 34884E85
67 GnuPG FP : 7D0B3CEB E9B85B1F 825BCECF EE05E6F6 A48F6136

Replies

Subject Author
Re: [gentoo-soc] GSoC 2017: Atom Gentoo Rich Freeman <rich0@g.o>