logo

blog

My website can't be that messy, right? git clone https://hacktivis.me/git/blog.git

Install Gentoo via Floppy.xhtml (3268B)


  1. <article xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" class="h-entry">
  2. <a href="/articles/Install%20Gentoo%20via%20Floppy"><h1>Install Gentoo via Floppy</h1></a>
  3. <p>Okay, so here are the files I generated for it:</p>
  4. <ul>
  5. <li><a href="https://lanodan.eu/pastes/2019-04-10T15:26:10-make-initrd-smol.sh">make-initrd-smol.sh</a>: a slightly modified version of <a href="/git/make-initrd/">make-initrd</a> to only copy a static busybox</li>
  6. <li><a href="https://lanodan.eu/pastes/2019-04-10T15:25:50-init">init</a>: the init file I wrote, included in the initramfs of the floppy image, could be done better</li>
  7. <li><a href="https://lanodan.eu/pastes/2019-04-10T13:05:05-fdimage">fdimage</a>: The floppy image (2.88 MB), done with <code>make fdimage288 FDINITRD=/boot/initramfs-smol.cpio.xz</code></li>
  8. </ul>
  9. <p>Some people might be wondering why I did this: Well, I saw this <a href="http://sakamoto.pl/weblog/07-windows-3-flash-edition/">blogpost of cramming Windows 3.1 + some extra in the coreboot virtual floppy</a>. And looking at how my kernel images where relatively well stripped down (5 MB for the kernel of my VPS and about the same size for my other machines) and that busybox is damn small (~700 Kilobytes), yet has all the neccesarry userspace tools required to install gentoo (iproute2, udhcpc, fdisk, mkfs, wget, …).</p>
  10. <p>Also while the floppy version isn’t very useful nowadays, the kernel+initramfs is quite useful for netbooting or installation on a VPS which already has a Linux Install but doesn’t have a good enough ISO, which I basically never have since I use ZFS and interestingly Alpine Linux, which can be used for that, isn’t much present (I already had a quite generic kernel+initrd but 4 times bigger).</p>
  11. <p>It was quite fun to do, even if I needed to launch the VM quite a lot of time until I got all the drivers for QEMU to work. And so, here is what is present in the kernel:</p>
  12. <ul>
  13. <li>Architecture: amd64</li>
  14. <li>USB: Human Interface Device (HID), Mass Storage (only USB 2.0)</li>
  15. <li>SATA (w/ PATA): Generic platform devices + AHCI + Intel PIIX (for QEMU)</li>
  16. <li>Storage: msdos/GPT partitions, Ext2, FAT (in unicode)</li>
  17. <li>Networking: IPv4+IPv6, TCP, Intel+Realtek cards</li>
  18. <li>Graphics: reuses the VGA framebuffer</li>
  19. <li>Compression: XZ on kernel + initramfs</li>
  20. </ul>
  21. <p>Note: The permissions for the <code>/dev</code> files are wrong, which is probably why udhcpc is broken. And it requires you to put <code>FEATURES="-userfetch"</code> in <code>/etc/portage/make.conf</code>. I guess this will make me fix some stuff in make-initrd.</p>
  22. <p>btw I managed to not hit the floppy limit (except when I tried without XZ on the initramfs), but I didn’t find a way to see the occupied size on the floppy. I would probably have tried to cram more stuff in it like tinyx / tinyxserver and/or useful recovery tools. Such a floppy-based linux was <a href="http://distro.ibiblio.org/baslinux/">Basic Linux</a> from 2005 but it’s apparently dead and it used either DOS for booting or two floppies.</p>
  23. <p><a href="https://queer.hacktivis.me/notice/9hfVvXwIIuJhiPGbEu">Fediverse post for comments</a>, published on 2019-04-10T15:21:04Z, last updated on 2019-04-10T15:52:20Z</p>
  24. </article>