Page 1 of 1

Examples/advice of running linux "live" from initramfs

Posted: Thu Jul 30, 2020 5:02 pm
by jceajcea
Hi there!

I wonder if there is any project out there that runs linux from an initramfs?. Of course, minimum Linux, since it is running from RAM, let's say < 500MB uncompressed.

I need to run my idea from initramfs and I wonder if I can learn/steal from somebody else already doing something similar.

Advice welcomed too.

Some details: The idea is to run the Raspberry from PXE (network booting) without using the usual NFS root filesystem. I want it to run from RAM using a ramdisk.

Since PXE boot is slow because TFTP is slow (and raspberry PXE booting is fragile and too much sensitive to packet loss), I would love to provide a small "initramfs" that just do DHCP and a HTTP/socket fetch to further populate the ramdisk. This would be next step. First step would be to run from (a big) initramfs.

Thanks.

Re: Examples/advice of running linux "live" from initramfs

Posted: Thu Jul 30, 2020 6:21 pm
by thagrol
Buildroot? (ask google et al for more info)

Re: Examples/advice of running linux "live" from initramfs

Posted: Thu Jul 30, 2020 6:52 pm
by DougieLawson

Re: Examples/advice of running linux "live" from initramfs

Posted: Thu Jul 30, 2020 11:41 pm
by jceajcea
Cool. Thanks for the suggestions.

I am evaluating too "raspbian-ua-netinst". The point is that PXE booting is SLOW and fragile, so it would be faster to do a minimal booting via PXE and then download a real OS in a RAMDISK from a webserver, instead of trying to deliver a 300MB payload thru the venerable but "slow as snail" TFTP.

I am currently pursuing both approaches. Good progress so far.

Links and suggestions very welcomed.

Thanks.

PS: I will publish tutorials and software in the future, your time and effort will not be wasted in a blackhole (me).

Re: Examples/advice of running linux "live" from initramfs

Posted: Fri Jul 31, 2020 4:41 am
by jceajcea
Maybe this issue would be of interest to you: https://github.com/debian-pi/raspbian-u ... issues/524 . TL;DR: gauging interest in PXE support for "raspbian-ua-netinst".

Re: Examples/advice of running linux "live" from initramfs

Posted: Sat Aug 01, 2020 8:28 pm
by JovianPyx
+1 for tinycore - specifically piCore.

I've been using piCore for a pi zero-w with a camera that stays on 24x7. It supports lighttpd (light weight web server) so I can see the camera (pointed at the front porch) image over wifi. piCore also supports wiringPi. My application uses about 250 megabytes so about half the pi zero RAM is free.

The tinycore documentation is quite good.

Re: Examples/advice of running linux "live" from initramfs

Posted: Tue Aug 11, 2020 9:33 pm
by cybersmythe
At work we use Yocto https://www.yoctoproject.org/ but I'd not be all that anxious to set that up from scratch if I didn't have to.

I keep thinking that it should be possible to take something like Debian's debootstrap to build a ramdisk image, but it keeps not working.

Mostly, I'm commenting because I'm interested in a solution that works for generating functional initrd images because everything I want to do with a pi requires one, so this is kind of a +1.

Re: Examples/advice of running linux "live" from initramfs

Posted: Wed Aug 12, 2020 2:39 pm
by dickon
mkinitramfs and friends just work -- I use them on my Pis. Minor issue with kernel updates not triggering a rebuild, but I've worked around that.