Understanding Image Size (MicroSD, F2FS, rootfs size)

Hello,
So I've been tinkering around with a NanoPi R2S, which is a device with no fixed storage and a Micro SD card slot.

As this is a brand new device, I've been relying on the snapshot builds, which write a grand total of 7.8 MB to my SD card, which has a capacity of 8 GB.

Upon first boot, an overlay filesystem is generated, which after much poking and prodding seems to be F2FS (spent 3 hours today trying to track down a JFFS2 filesystem here based on the documentation, oh did I laugh...).

This overlay always seems to be sized at 104 MB. Adding this and the kernel partition together makes 128 MB, though there is some free space before the first partition where all the Rockchip boot code goes.

I would ideally like the overlay to be at least double what it is at the moment. Is there a location in the image source where this is configured? Tried manually resizing the partition but the device failed to complete booting.

Spent a bit of time examining the source and I can see the key variable is CONFIG_TARGET_ROOTFS_SIZE, which is set to 104 by default for most targets.

Is it enough to override this in the imagebuilder config?

OK, I've figured it out:-

  1. Download the imagebuilder for the device in question
  2. Extract the archive into a temp location
  3. Open ".config" and change "CONFIG_TARGET_ROOTFS_PARTSIZE" from its default of 104 to something else (I've just built with 232, for a 256MB image)
  4. Change anything else as necessary (e.g. "CONFIG_IPV6=n")
  5. Run "make image"
  6. Locate generated compressed image
  7. Burn image to device's main storage
  8. Profit?
2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.