<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>
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>
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, 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.
<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
<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>
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
<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>
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