This is the second time I’m trying to upgrade from 22.11 to 23.05. In the first after rebooting X server just wouldn’t start, but I had the 6.x.x Linux kernel.
Steps I followed now:
sudo nix-channel --list
This step returns the only channel available: nixos https://nixos.org/channels/nixos-22.11
I just notice that in the upgrade Manual it says that step 4 should be sudo nix-channel --update nixos, not sure why I omitted the “nixos”, but I recal that I had created this upgrade script after my first attempt, and it was based on the Manual.
At the end of the upgrade, which suprisingly didn’t fail, but I could see some collision warnings, and also a systemd related warning that I’m attaching. I’m attaching also the output of neofetch that shows that I’m still using the 5.x.x Linux Kernel.
warning: the following units failed: systemd-oomd.socket
× systemd-oomd.socket - Userspace Out-Of-Memory (OOM) Killer Socket
Loaded: loaded (/etc/systemd/system/systemd-oomd.socket; linked; preset: enabled)
Active: failed (Result: trigger-limit-hit) since Fri 2023-06-30 08:18:55 CEST; 12s ago
Duration: 4d 7h 6min 57.024s
Triggers: ● systemd-oomd.service
Condition: start condition failed at Fri 2023-06-30 08:18:58 CEST; 10s ago
└─ ConditionControlGroupController=memory was not met
Docs: man:systemd-oomd.service(8)
Listen: /run/systemd/oom/io.system.ManagedOOM (Stream)
Jun 26 01:11:58 pi systemd[1]: Listening on Userspace Out-Of-Memory (OOM) Killer Socket.
Jun 30 08:18:55 pi systemd[1]: systemd-oomd.socket: Trigger limit hit, refusing further activation.
Jun 30 08:18:55 pi systemd[1]: systemd-oomd.socket: Failed with result 'trigger-limit-hit'.
Jun 30 08:18:58 pi systemd[1]: Userspace Out-Of-Memory (OOM) Killer Socket was skipped because of an unmet condition check (ConditionControlGroupController=memory).
warning: error(s) occurred while switching to the new configuration
Any pointers on where exactly I blundered? If necessary I can share my configuration.nix file in a pastebin.
Thank you very much for the community and for this lovely OS.
Mike
ps: I’m afraid rebooting because X might not start. But I understand that at some point I will have to (or it will happen randomly, by a random power cut).
ps2: most likely I’ve used sudo nix-channel --update instead of sudo nix-channel --update nixos because I had found this community comment.
You’re thinking about a couple of different red herrings, to start. 1) sudo nix-channel --update just means to update every channel the user has, so omitting the nixos argument doesn’t matter. 2) The systemd-oomd error is an issue with the rpi kernel. To fix it, you can add cgroup_enable=memory to your kernel params.
As for why you’re still on linux 5.15, I don’t exactly understand the text of your post.
So you did have linux 6.x at some point? What did you do that made it go back?
I’m also noticing that in your screenshot where you showed your systemd-oomd error, it looks like you did nixos-rebuild switch after a major update. This is fine, though it’s perhaps preferable to use nixos-rebuild boot and then reboot when it comes to major updates. But the point I’m getting at here is that it looks like you started debugging right after a nixos-rebuild switch to the new version before rebooting? In this scenario, the kernel hasn’t updated yet, so neofetch would still say the old kernel version. A reboot has to happen before the kernel will appear updated.
Regarding the system-oomd error I’ll try following your suggestion.
So you did have linux 6.x at some point? What did you do that made it go back?
Yes. I had 6.x.x kernel when I tried the major upgrade for the first time. I then reverted back to 22.11 because I couldn’t get X work in 23.05 at that time. Having a “deprecated” NixOS seemed preferable than banging my head over an X-server crashing issue and blocking me from using the system…
But the point I’m getting at here is that it looks like you started debugging right after a nixos-rebuild switch to the new version before rebooting?
I don’t really understand the question…I followed the steps 1-5. If those did a major update, then yes, you’re right. I changed the channel from 22.11 to 23.05 intending to do a major upgrade without rebooting, so that I might avoid the X-server issue…
I guess I’ll have to reboot either way, and then most likely revert to 22.11 again (if things go south)
It seems that after all it was my mistake, I was indeed using a Tarball (what an ugly workaround…) that contained the 5.x.x kernel. So this is why.
It seems to me that X-server works fine with the 5.x.x kernel plus the 23.05 channel, so I’ll try using this and see how far it goes.
I know it’s still a temporary solution, but it seems that with the raspberryPi NixOS/nixos-hardware/ files, using a tarball like the following is the most compact (but also ugly) way to set up the kernel in the configuration.nix file:
{ config, pkgs, lib, ... }:
let
user = "milia";
password = <PASSWD>;
hostname = "pi";
in
{
## Boot information, and kernel version
imports = ["${fetchTarball "https://github.com/NixOS/nixos-hardware/archive/4cc688ee711159b9bcb5a367be44007934e1a49d.tar.gz" }/raspberry-pi/4"]; # Since 23.05
#imports = ["${fetchTarball "https://github.com/NixOS/nixos-hardware/archive/936e4649098d6a5e0762058cb7687be1b2d90550.tar.gz" }/raspberry-pi/4"]; # Since 21.11
system.stateVersion = "22.11"; #"21.11"; # Did you read the comment?
...
I’ll surely check the documentation shared as I want to understand better how things work and perhaps find a more elegant solution like the boot.kernelPackages = pkgs.linuxKernel.kernels.linux_5_15;.
I’ll pick this answer as the solution to my original question, as it’s closer to what I was looking for. Thanks.
Do yourself a favour here and set up nixos-hardware the way they recommend in the README. Either via an additional channel or using flakes (note that the latter is still considered unstable).
No, it’s not. fetchTarball is not mentioned a single time in the README.
What do you mean by “it doesn’t work”? Please be more precise when asking questions, just saying “it doesn’t work” makes it much harder for us to understand your problem.
Did you add the channel as the readme explains?
What does nix-channel --update && nix-channel --list retun?
You’re right. I confused fetchGit with fetchTarball.
What do you mean by “it doesn’t work”? Please be more precise when asking questions, just saying “it doesn’t work” makes it much harder for us to understand your problem.
Did you add the channel as the readme explains?
Kindly refer to my initial post that is rather precise.
What does nix-channel --update && nix-channel --list retun?
Now it returns the 22.11 and nixos-hardware channels, because I had to backtrack to the deprecated version in order to be able to work.
Anyhow, I’ll follow in the future the README suggestions when I feel adventurous enough.
Consider this ticket resolved and feel free to close it.