WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: How does TC run from RAM?  (Read 1644 times)

Offline nim108

  • Full Member
  • ***
  • Posts: 107
How does TC run from RAM?
« on: April 07, 2014, 09:53:45 AM »
Hey guys,

I was hoping the TC team can help me with this (even though the question isn't entirely TC related). I'm currently building a kernel/OS from scratch using Buildroot (I'd love to use TC but I can't as we have to customize every little thing). Buildroot generates a rootfs.ext2 filesystem (or ext3 or ext4 or whatever the partition type may be) that can be dd'ed onto the target partition (which will put /bin, /etc, /tmp/ /usr all on the partition properly). However, I wanted to load this rootfs entirely from RAM so that I can store everything on the one boot partition. This also makes updates a breeze and corruption a non-issue. What are the steps I'd need to take to launch this gzipped file into memory (from the kernel perspective and Syslinux perspective)? I want to follow whatever approach TC took to do this. I will definitely look at TC sources but I wanted more of a general overview of what I'd have to do. Thanks. This is still by far my favorite tiny Linux distribution and we are using it on multiple projects here for a wide variety of applications.

Should my starting point be that I take the TC 3.8.x modified kernel and do a make oldconfig to use that for Buildroot's new kernel? That should have the proper config options set for initramfs correct? I would do this, but I'm looking to understand the process rather than hack it together.
« Last Edit: April 07, 2014, 10:20:37 AM by nim108 »

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: How does TC run from RAM?
« Reply #1 on: April 07, 2014, 10:29:33 AM »
There is plenty of information accessible from the Iinycorelinux home page.
http://distro.ibiblio.org/tinycorelinux/
Basically it loads the initfs the same way other Linux distributions do, but never pivot root to a disk based root file system.

Offline nim108

  • Full Member
  • ***
  • Posts: 107
Re: How does TC run from RAM?
« Reply #2 on: April 07, 2014, 11:32:59 AM »
Nevermind, think I got it. Buildroot has an option to generate an initramfs for you and kernel is configured by default to enable initramfs and it seems to boot up fine. I'll have to play around with it to make sure I didn't break anything. Cool concept; didn't know the kernel / OS config makes it so easy to do now. Used to have to build it manually.

If anyone else was curious about this, here is a very good official reference: https://www.kernel.org/doc/Documentation/filesystems/ramfs-rootfs-initramfs.txt
« Last Edit: April 08, 2014, 04:00:25 AM by nim108 »