Hi, can you hear me?
Up next we have Julian with automatic boot assessments.
Okay, hello everyone.
So today I'm going to, my name is Julian Malca and I'm a PhD student at Telecom Paris.
And today I'm going to talk about automatic boot counting, automatic boot assessment with boot counting, sorry.
And so what I will talk about is why we need automatic boot assessments.
What is automatic boot assessment and like one of an implementation that is a system-deboot counting, I'll show a demo.
So why do we need automatic boot assessments?
Because we are using NixOS, we have like something I call the NixOS benediction.
It's very difficult to break your system.
You really have to want it to break your system.
And even if you mess up your NixOS configuration, you can just roll back to a past generation and just be solved by the NixOS magic.
But sometimes this benediction has limits.
And let's say if you are administrator for a remote server, you perform some kind of server update, let's say kernel update.
And you mess up.
You choose a kernel that cannot boot your root partition.
And at next boot what is going to happen is that it's going to fail to boot.
And if you don't have any physical like BMC, then you will need physical intervention to revive the server.
So this is this kind of problem we solve with automatic boot assessment.
So boot assessment is any kind of technology really that can, and I can only assess if a boot entry is bootable or not.
And we have one example that is system-deboot boot counting.
So boot counting is a feature of, as I said, system-deboot.
And the idea is the following.
Each boot entry has a counter when created.
Each time system-deboot tries an entry, the counter for this entry is decreased by one.
If the entry is booted successfully, and I will define what booted successfully means, then the counters are removed permanently.
But if the counters for an entry have ever reached zero, then the entry is marked as bad, and it's sorted in the boot menu at the end.
Just if I get just a little bit more in depth of how this works.
The counters are embedded in the entries' name, file names.
So you have the file name, then you have the plus separator, then the number of remaining trials, then the number of failed trials.
So this is generation nine.
It has four remaining trials and one failed, and it adds, at the beginning, five trials set.
Counters are decreased by system-deboot when it booted the entries by simply renaming the file.
And you have to define some definition of a successful boot by scheduling whatever you want.
You need to be started successfully before the boot-complete target.
So when the boot-complete target is reached, then the entry is renamed by the system-deboot, the bless entry unit, that is going to remove the counter.
And we are done with this entry.
We consider it good forever.
Okay, let me show you a demo.
Right, so here I am in a VM, I am booted, and I'll show you that in the configuration.nix, I have enabled the feature and set the number of trials to be two for any entry.
The VM is booted successfully, but I will do a massive mistake.
I am emulating a mistake.
I have a BKHFS file system and I will rename it as X4.
So it means that now this partition will definitely not get mounted, and when I will rebuild, it will even change the kernel to a kernel not supporting BKHFS.
So now it's rebuilding my configuration.
You see when I am done rebuilding, I get no error, no nothing.
I think everything is good.
I show you the boot entries.
The boot entries, you have five boot entries, and the last one as a counter, you see the dash five plus two, two trials for this entry.
And now I will reboot this VM.
So what happens when I reboot?
At the beginning, everything is fine.
My generation five is sorted first.
It will try to boot it.
Kernel crashes.
It reboots.
Now it's still sorted first because we have two trials for this entry.
Again, kernel crashes, reboots.
And now you will see it's now sorted last and we are going to boot generation number four.
And of course we are going to boot it successfully and that's it, that's the feature.
It's available currently as a PR.
It will be merged very soon and be available in the next lesson table.
Thank you.