Skip to main content
20 events
when toggle format what by license comment
Aug 11, 2021 at 12:00 history tweeted twitter.com/StackRaspi/status/1425426787425738765
Aug 11, 2021 at 10:59 vote accept Adambean
Aug 11, 2021 at 10:59 answer added Adambean timeline score: 0
Nov 27, 2020 at 17:59 answer added ElectRocnic timeline score: 1
Feb 17, 2020 at 16:22 comment added Adambean Well, I'm not sure which of the above steps did it, but after all of this and using specifically the "4.19.97-v7l+" kernel, it worked. This was a guess though, as I spotted in an initramfs shell that attempting insmod $(find /usr -type f -name "*dm-mod*") that it returned "insmod: can't insert ......: invalid module format". The only major difference in steps taken I can see is inserting extra kernel modules into "/etc/initramfs-tools/modules" and running update-initramfs -u prior to building, along with the symlinks to mmcblk. Not sure who's answer I should be accepting :)
Feb 17, 2020 at 8:29 comment added Adambean Unfortunately all of the above has not resolved the issue.
Feb 17, 2020 at 8:08 comment added Adambean There is definitely an initramfs reference, as "initramfs initramfs.gz followkernel". "initramfs.gz" exists with a modified timestamp matching when I last ran mkinitramfs.
Feb 16, 2020 at 10:03 comment added Adambean Thanks for all this additional information both! I've got a lot to try out here, including the addition of module names to "/etc/initramfs-tools/modules" to force include modules for mkinitramfs.
Feb 16, 2020 at 9:17 comment added Malvineous @goldilocks: Sorry you are right, it seems I only got as far in the docs as all kernels must have initramfs (even if it's just empty), but I didn't get to the part where it said you can pass an external one in using the initrd parameter and it will overwrite whatever is included in the built in (and possibly empty) initramfs. Of course now that I think about it it seems obvious, having to patch a precompiled kernel with a user-specific initramfs would be a huge headache!
Feb 15, 2020 at 16:03 comment added goldilocks @Adambean You should check /boot/config.txt to see if there is any reference to an initramfs in there. If not, I think this is a problem.
Feb 15, 2020 at 14:36 comment added goldilocks ..However, a kernel built for a very specific platform, (such as the Raspberry Pi kernel) doesn't need to bother with that because the specific drivers might as well be built in. Hence the default Pi kernel does NOT use an initramfs (and a stock Raspbian image does not include one), but it is capable of doing so without being recompiled. It's put in the boot filesystem. I'm just unsure whether it may use a default value, although searching online a bit reveals you can indicate an initramfs in /boot/config.txt (as opposed to the cmdline.txt method I mentioned).
Feb 15, 2020 at 14:36 comment added goldilocks ...that the kernel might need to mount the root filesystem (at which point it can use /lib/modules; this is also the reason you need one with an encrypted filesystem -- unless you built the encryption drivers into the kernel). These drivers need to cover a range of commonplace hardware (and fs types), and it is not convenient to build them all into the kernel, hence the initramfs. Which also means you can build an initramfs and use it without rebuilding the kernel.
Feb 15, 2020 at 14:35 comment added goldilocks @Malvineous WRT "is depecreciated": Yes, but initrd= is still the kernel parameter used to indicate the path of an external initramfs (which is why I wrote "any kind of" -- anyway, they're normally not compiled in, if you have a normal linux box, go look at the grub2 config, it will be using initrd=/path/to/initramfs). "it's impossible to build a modern kernel without initramfs": Enabling and building them is still an option; I'm on an x64 box with a custom 5.4 kernel built by me, no initramfs. The major reason for using an initrd/ramfs is to facilitate loading of drivers...
Feb 15, 2020 at 2:10 comment added Malvineous @goldilocks initrd is deprecated but pretty sure it's impossible to build a modern kernel without initramfs. initrd was a separate file, initramfs is embedded into the kernel image itself.
Feb 14, 2020 at 17:44 comment added Adambean @goldilocks yep this system was running very normally until a reboot to apply a kernel update. The boot partition with the necessary configuration to start up Raspbian on the 2nd partition is still all there.
Feb 14, 2020 at 17:44 comment added Adambean @Malvineous I didn't think of symlinking the devices to redirect mmcblk to sd. I'll try that right meow :)
Feb 14, 2020 at 15:23 comment added goldilocks "Other than a reinstall, would you have any advice on building a good initramfs to resolve this encryption issue?" -> It's implied here that you've had this working, but normally Raspbian does not use an initrd of any kind. As far as I'm aware it requires an option set on the kernel command-line, but I don't see one here (mebbe there is a hardcoded default to something in the first partition?). Have you had it working before?
Feb 14, 2020 at 14:04 comment added Malvineous You could symlink or mknod /dev/mmcblk0p1 to /dev/sdf1 and so on for the other partitions if you wanted to avoid all the sed stuff. Basically you have to figure out how to get the missing module into the initramfs. Most distros have a config file you can edit to list additional modules that should be included, e.g. this one for Ubuntu which might give you some hints. If you can figure that out, regenerating the initramfs as you've done should be all you need to get the system going again.
Feb 14, 2020 at 13:40 review First posts
Feb 14, 2020 at 22:32
Feb 14, 2020 at 13:37 history asked Adambean CC BY-SA 4.0