I am attempting to boot my RPi completely from RAM over PXE without an SD card or any other local storage. I have already successfully configured the bootloader to boot from network, and am using dnsmasq's DHCP and TFTP servers to transmit the kernel to the bootloader. I would now like my operating system to be packaged in a single image, so that the root file system can be mounted from ramdisk.
I found several guides and threads online on this topic, but nothing exhaustive:
What I have done so far:
I found several guides and threads online on this topic, but nothing exhaustive:
- Booting Debian from a RAM disk
- Linux - Load your root partition to RAM and boot it
- Using an initramfs on the RPi.
- How can I use an init ramdisk (initramfs) on boot up Raspberry Pi?
What I have done so far:
- Patched /etc/default/raspberrypi-kernel to enable INITRD=Yes. According to the guide, this will enable generation of /boot/initrd.img-KVER.
- I ran as root: `update-initramfs -c -k $(uname -r)`. This produced the actual image.
- Does the generated .img file contain just the kernel, or does it also have the root partition as well? It seems a bit too small for that.
- How do I convince the kernel to use a root file system from an image? Do I need to modify /boot/cmdline.txt? I would imagine that at least the `root=` parameter will need to be changed.
- I have seen people in my situation change /etc/fstab to mount the root file system as tmpfs. Do I need to do that as well? And if I do it, every new tmpfs is empty -- how will this get populated with my system's data?
Statistics: Posted by pmane — Thu Jan 18, 2024 10:43 am