Skip to content

Comment on Android Booting Shenanigans

Comments

I have zero background/knowledge about this topic, so forgive me if it's a stupid question; but the article is very confusing to me.

In the terminology section, it says

    initramfs: a section in Android’s boot image that the Linux kernel will use as rootfs
And
    SAR: System-as-root. That is, the device uses system as rootdir instead of rootfs
In Boot Methods section, it says something like
    The kernel uses initramfs as rootdir ..
So far, it has

* initramfs as rootfs

* system as rootdir (or "rootfs as rootdir" if no SAR)

* initramfs as rootdir

I get that the whole point of this article is about "A as B" for some booting shenanigans, but this mapping relationship doesn't make sense to me. rootfs somehow appears in both ends.

Also, for method A and C, it says "uses initramfs as rootdir" but the table lists "rootfs" instead of initramfs?

The terminology is confusing and the article isn't doing a good job of explaining it.

"Rootfs" is an im-memory virtual filesystem used to hold the root. The bootloader will read the initramfs into ram before executing the kernel, then the kernel will use that in memory data to construct the rootfs filesystem. For non root partitions you would use a loopback device or tmpfs.

Since system is a normal partition, the kernel can use the normal disk/filesystem drivers as a root device.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.