orivej has quit [Ping timeout: 252 seconds]
orivej has joined #nixos-aarch64
orivej has quit [Ping timeout: 244 seconds]
FRidh has joined #nixos-aarch64
FRidh has quit [Read error: Connection reset by peer]
nschoe has joined #nixos-aarch64
orivej has joined #nixos-aarch64
<nschoe> Hi everyone, I'm trying to get nixOS on my rPi 3 B, I have followed this doc https://nixos.wiki/wiki/NixOS_on_ARM#Installation, I have added the `console=ttyAMA0,115200n8` part to get the UART console, this "works": it reaches NixOS stage 1, and then kernal panics: https://pastecode.xyz/view/44c95c04
<nschoe> Any idea?
<thefloweringash> `switch_root: can't execute '/init': No such file or directory` -- it shouldn't be looking for `/init` (downloading the image now to verify this). Did you perhaps remove the part of the boot line that says `init=...`?
<nschoe> thefloweringash, no I did not change anything.
<nschoe> thefloweringash, literally all I did is: 1/ `dd` the aarch64 img on the sd card, then 2/ mount it, ad append the console=ttyAMA0 thing at the end of the line in order to have the serial console.
<nschoe> thefloweringash, indeed, but when I opened the extlinux.conf file, there was this line:
<nschoe> APPEND systemConfig=/nix/store/sy8zfls2p4g2p7wjls4vyw487a794bkz-nixos-system-nixos-19.03.git.56b9f6fc8e1 init=/nix/store/sy8zfls2p4g2p7wjls4vyw487a794bkz-nixos-system-nixos-19.03.git.56b9f6fc8e1/init loglevel=7 cma=32M console=ttyS0,115200n8 console=ttyAMA0,115200n8 console=tty0
<nschoe> With this (unchaged) line, I had some outputs on the console, but then it hanged at "Starting kernel...".
<nschoe> By looking at the documentation, they said we had to append the console=ttyAMA0 thing. I saw it was there already, but tried to append it anyway, so my new line is:
<nschoe> APPEND systemConfig=/nix/store/sy8zfls2p4g2p7wjls4vyw487a794bkz-nixos-system-nixos-19.03.git.56b9f6fc8e1
<nschoe> init=/nix/store/sy8zfls2p4g2p7wjls4vyw487a794bkz-nixos-system-nixos-19.03.git.56b9f6fc8e1/systemd loglevel=7 cma=32M console=ttyS0,115200n8 console=ttyAMA0,115200n8 console=tty0
<nschoe> console=ttyAMA0,115200n8
<nschoe> And it "worked": I got pass the "Starting kernel", so I thought it was a winner. But then I hit the kernel panic.
<nschoe> But I don't understand / see how it related with the `init` not being found
<thefloweringash> in the line above, there's the bit about init: `init=/nix/store/sy8zfls2p4g2p7wjls4vyw487a794bkz-nixos-system-nixos-19.03.git.56b9f6fc8e1/systemd`
<thefloweringash> I'm still reading the source to make sure my assumptions are valid
<nschoe> thefloweringash, ho no sorry :/
<nschoe> The line I copied is my "attempt": when I got the kernal panic about not finind "init", I tried replacing "init" by "systemd" just in case.
<nschoe> But it did nto work either.
<nschoe> The extlinux.conf file was generated with init=/nix/store/sy8zfls2p4g2p7wjls4vyw487a794bkz-nixos-system-nixos-19.03.git.56b9f6fc8e1/init
<nschoe> (to which I appended the `console=ttyAMA0,115200n8` part, and that's when I hit the kernel panic.
<nschoe> thefloweringash, and for information, I downloaded the image from here: https://www.cs.helsinki.fi/u/tmtynkky/nixos-arm/installer/, `sd-image-aarch64-linux.img`
<nschoe> thefloweringash, I don't know if this is related, but by looking at the boot outputs, I see an "error": https://pastecode.xyz/view/8080ac12
<thefloweringash> line 23 is pretty suspicious, looks like the init fell off
<nschoe> thefloweringash, see the "Loading Environment from FAT... *** Warning - bad CRC, using default environment" part? with a 'Failed (-5)' after it.
<nschoe> Oh yeah that, too. I had not noticed
<nschoe> What does "Ignoring unknown command" mean? o_O
<thefloweringash> I think you need to look super hard at the extlinux.conf. what did you use to edit it? nano is pretty famous for breaking files with long lines
<nschoe> thefloweringash, I used nano indeed. Maybe I should try with emacs
<thefloweringash> if you use nano, be sure to run it with "nano -w"
<nschoe> thefloweringash, I did not indeed
<thefloweringash> otherwise it'll automatically word wrap lines, which I'm guessing caused the very long APPEND line to be split, and then the rest of it ignored
<nschoe> thefloweringash, you know what? Let me reflash the .img entirely on the SD card, then use emacs to edit the extlinux.conf and I'll retry. See if this helps
<thefloweringash> 👍
<nschoe> (got weird unicode character here ?)
<thefloweringash> oh, it was meant to be an emoji for "thumbs up"
<nschoe> thefloweringash, okay ^^
Thra11 has joined #nixos-aarch64
<nschoe> thefloweringash, I have reflashed the SD card, modified the extlinux.conf with emacs, made sure the line was not split up but now I don't understand it: on the serial console (fired by screen), I'm stuck as "Starting kernel...", but on the HDMI display it seemed to have booted "nixos login: root <automatic login)\n [root@nixos:~]# "
<nschoe> So it's like a step back where I can't have the serial console :/
<nschoe> And I still have this warning among the first messages:
<nschoe> DRAM: 948 MiB
<nschoe> Loading Environment from FAT... *** Warning - bad CRC, using default environment
<nschoe> MMC: mmc@7e202000: 0, sdhci@7e300000: 1
<nschoe> RPI 3 Model B (0xa02082)
<thefloweringash> I see a claim on the internet that the rpi3's serial port lives on ttyS0. Maybe delete all the `console=` lines and only set `console=ttyS0,115200` ? At this point I'm a bit lost since I don't have an actual rpi3, but a different aarch64 board.
<nschoe> thefloweringash, I'm trying this, then thanks.
<nschoe> What's bothering me is that it used to work prior to my reflash, and now it doesn't.
<thefloweringash> I wonder if there are sensible defaults. Before the reflash you were effectively booting with a very small command line that didn't have any console= statements
<nschoe> thefloweringash, ok indeed. That might explain it.
orivej has quit [Ping timeout: 244 seconds]
<nschoe> thefloweringash, this gets even weirder: now that only I have only `console=ttyS0,115200n8`, not only does it hang on "Startink kernel" on my serial console, but on the HDMI screen too :)
<nschoe> It's not going down without a fight!
<nschoe> Okay I have tested your theory: I have erased everything on the line, except the "systemConfig", so there's no "init=" nor "console=" anymore and this time I have the same behavior: it boots, I can see everything on the serial console, and it kernel panics.
<nschoe> Cool :) So now I'm seeing if adding back the init=... will make it boot
<nschoe> And it works!
<thefloweringash> yay for sensible defaults
<nschoe> thefloweringash, thanks for sticking with me, and thanks for hinting about nano splitting up the lines *and* that the boot process might have sane defaults!
<thefloweringash> :-)
<nschoe> thefloweringash, the correct thing to do was to remove all `console=xxx` lines and now I'm on stage 2, booted and logged in as root.
<nschoe> thefloweringash, quick question now: the configuration.nix contains just `imports = [ <nixpkgs/nixos/modules/installer/cd-dvd/sd-image-aarch64.nix> ];`. Does it mean I have to make a first `nixos-rebuild` with this, and then ditch this and replace with my own configuration.nix?
<nschoe> I'm asking because https://nixos.wiki/wiki/NixOS_on_ARM#Installation says "Note: the default configuration.nix will contain something like imports = [ <nixos/modules/installer/cd-dvd/sd-image-armv7l-multiplatform.nix> ]; do not include that in your final installation or you will experience interesting problems. It is only for building the installation image!"
<thefloweringash> no need for a first nixos-rebuild; now that it's up and running, you should put your own config in there, remove the installation import, and nixos-rebuild
<nschoe> thefloweringash, okay, thanks for the clarifications.
<nschoe> Welllll let's try to get everything working now :)
<thefloweringash> getting from the pre-built install environment onto an environment built from nixos-rebuild can be a little tricky, but the template on the wiki looks pretty sensible.
<nschoe> thefloweringash, you means this template: https://nixos.wiki/wiki/NixOS_on_ARM#NixOS_installation_.26_configuration ?
<nschoe> thefloweringash, because I saw this one too: https://nixos.wiki/wiki/NixOS_on_ARM/Raspberry_Pi#Raspberry_Pi_3
<thefloweringash> yep
<nschoe> I wonder if they should be merged?
<thefloweringash> the first one is essential setting up the filesystems and bootloader config; the ones in that second page are on top of that, for extra features
<nschoe> I see.
<nschoe> Thanks
<nschoe> `cannot open connection to remote store 'daemon': '/nix/var/nix/db/schema' is corrupt` I guess is bad :/
<thefloweringash> huh, haven't seen that before. does that file exist? what's in it?
<nschoe> thefloweringash, it exists, but has length 0
<thefloweringash> might have been eaten in a forced poweroff. `/nix/var` doesn't exist at all in the image
<thefloweringash> the safe way to recover is to reflash the image; the dangerous way that might work is to write the value "10" to that file, which is what it seems to be on my computers (`echo -n 10 > /nix/var/nix/db/schema`)
<thefloweringash> wouldn't hurt to run `nix-store --verify --check-contents` after you get things going again to make sure the store is still ok
Acou_Bass has quit [Quit: byeeeeeeeeeeeeeee]
Acou_Bass has joined #nixos-aarch64
Thra11 has quit [Ping timeout: 245 seconds]
<nschoe> thefloweringash, thanks, I'm trying this^^
<nschoe> thefloweringash, so you meant that /nix/var should not exit?
<nschoe> But then how does it work?
<thefloweringash> on first boot there's a script that sets up all the initial state
<nschoe> okay. So you're saying this script failed?
<thefloweringash> I'm saying it probably worked, but without a console, there's no way to do a proper shutdown. if you get unlucky when pulling the power, the filesystem may not have had time to write the contents of that file to flash (and others?)
<nschoe> I see
<nschoe> Okay.
<nschoe> I echo-ed 10 inside, and run the --very, it found some errors, and ended up with `warning: not all errors were fixed`
<nschoe> So I guess I'll try to reflash, and redo everything, without plugging the power cord ^^
<nschoe> thansk again for sticking with me and for your tiem and advice
<thefloweringash> probably the safest way
<thefloweringash> no problem :-)
<nschoe> :)
<nschoe> In the documentation page, on the confiuation.nix template they mention:
<nschoe> # Enables the generation of /boot/extlinux/extlinux.conf
<nschoe> boot.loader.generic-extlinux-compatible.enable = true;
<nschoe> which, IIRC makes it so that nixos-rebuild generates a extinux.conf. I wonder if the generated file will be valid (since the one onf the sd-card image doesn't to be: I had to remvoe the console=xxx)
<thefloweringash> if you take that template out, and don't set anything in `boot.kernelParams`, it will only have the things required to boot.
<nschoe> okay so I just have to put whatever I want inside, I see.
<thefloweringash> You can check the contents of the option in your config by running `nixos-option boot.kernelParams`
<nschoe> okay
<nschoe> thanks!
<nschoe> (I understand now: the template doesn't put console=xxx because we don't need it anymore in a normal system. Cool!
Thra11 has joined #nixos-aarch64
<nschoe> thefloweringash, I reflashed, re-modified the extlinux.conf (no unpluging the power cord), edited the configuration.nix with the template-based one, anc nox nixos-rebuild is building. I see some warning (invalid GC head size, some "no such files or directory", but overall it seems to be building fine :))
<nschoe> I don't thinkg I'm out of trouble yet, but it's definitely some progress. Thanks :)
<thefloweringash> the GC heap size thing is #43339, which looks like it was fixed recently
<{^_^}> https://github.com/NixOS/nixpkgs/issues/43339 (by davidak, 16 weeks ago, open): GC Warning: Bad initial heap size 100000 - ignoring it.
<nschoe> I see.
<nschoe> Thanks :)
<thefloweringash> getting late for me, I'd better head off. good luck!
<nschoe> Thanks again :)
<nschoe> Hi again everyone, I have tracked down my issue (on the rPi 3). When I add `boot.kernelPackages = pkgs.linuxPackages_latest;` it fails to build and complain `The bootloader cannot find the proper kernel image.`
<nschoe> ANy idea what I could do?
Thra11 has quit [Ping timeout: 252 seconds]
<clever> nschoe: the name of the kernel binary within the derivation likely isnt what the nix expressions expected
<nschoe> clever, I have "solved" it by replacing the `boot.kernelPackages = pkgs.linuxPackages_latest;` with `boot.kernelPackages = pkgs.linuxPackages`;
<nschoe> clever, I hope it made sense.
s33se has joined #nixos-aarch64
s33se has quit [Client Quit]
<lopsided98> nschoe: That seems like a strange error, and I can't reproduce it. What file name did it say it was looking for?
orivej has joined #nixos-aarch64
<nschoe> lopsided98, The last lines were: building '/nix/store/i0acd8pizgighw7n3qcp35pq91c81798-nixos-system-nixos-19.03pre156996.c70ad805d21.drv'...
<nschoe> The bootloader cannot find the proper kernel image.
<nschoe> (Expecting /nix/store/55l7999chwi8n44ybp3g6jr15gvp16xz-linux-4.19/Image)
<nschoe> builder for '/nix/store/i0acd8pizgighw7n3qcp35pq91c81798-nixos-system-nixos-19.03pre156996.c70ad805d21.drv' failed with exit code 1
<nschoe> error: build of '/nix/store/i0acd8pizgighw7n3qcp35pq91c81798-nixos-system-nixos-19.03pre156996.c70ad805d21.drv' failed
<clever> nschoe: Image is the answer then
<clever> nschoe: what files did exist in /nix/store/55l7999chwi8n44ybp3g6jr15gvp16xz-linux-4.19 ?
<clever> none, only directories exist in there
<clever> something is wrong with that build
<nschoe> clever, I can't tell you now. I solved the issue by using `boot.kernelPackages = pkgs.linuxPackages;` instead of `boot.kernelPackages = pkgs.linuxPackages_latest;`
<nschoe> clever, lopsided98 I have a current (extremely long....) `nixos-rebuild` in progress now, when it's done I can try to restore `_latest` and rebuild to see the error message
<clever> nschoe: that path will still exist in your store
<clever> and its in the binary cache, so you can just `nix-store -r` it on any machine
<nschoe> clever, okay, right. So `ls /nix/store/55l7999chwi8n44ybp3g6jr15gvp16xz-linux-4.19` gives me: `dtbs lib`
<clever> yep
<clever> so id say something went wrong with that build
<lopsided98> Yes, the build in the cache is broken
<nschoe> I'm amazed how you can know this. I'm completely out of my depth here.
<nschoe> clever, ho did you know there was something wrong with the build?
<nschoe> and lopsided98 how do you know the build in the cache is broken?
<nschoe> I want to be in, in your black magic :)
<lopsided98> I ran: nix-build '<nixpkgs>' -A linuxPackages_latest.kernel
<lopsided98> which pulled it from the cache
<lopsided98> and saw that Image was missing
<clever> nschoe: a kernel file is supposed to be in the root dir of a kernel
<lopsided98> I tested a cross-compiled kernel, which does not have the problem
<lopsided98> I'll try building the native kernel locally, but my aarch64 builder takes ~8 hours to build a kernel
<nschoe> lopsided98, okay thanks for the info
<nschoe> clever, oh, okay. this is why.
Thra11 has joined #nixos-aarch64
<lopsided98> I'm trying to find the logs for the Hydra build, but I can't find a successful one of 4.19
<clever> lopsided98: run `nix log /nix/store/55l7999chwi8n44ybp3g6jr15gvp16xz-linux-4.19`
<lopsided98> clever: does that work for you? It just gives me gibberish (seems like random bytes)
<clever> looks like the compression is messed up again
<clever> [root@router:~]# nix run nixpkgs.brotli
<clever> [root@nas:~]# nix log /nix/store/55l7999chwi8n44ybp3g6jr15gvp16xz-linux-4.19 | brotli -d
<clever> that turns it into ascii
<lopsided98> Yeah, something really went wrong in that build
<clever> make[5]: *** [../scripts/Makefile.build:306: sound/i2c/other/ak4114.o] Terminated
<clever> yeah
<lopsided98> I don't know how it didn't get marked as failed
<clever> probably out of ram
<clever> but it failed to fail
<lopsided98> Is there a way to rebuild it and get the rebuilt version into the cache, or do we just have to wait for an update
<clever> lopsided98: hydra really doesnt like it when you rebuild things like that
<clever> and a lot of the caching nix does at many layers will break horribly
Thra11 has quit [Ping timeout: 246 seconds]
nschoe has quit [Quit: Program. Terminated.]