← Back to team overview

ubuntu-phone team mailing list archive

Re: No loop mount option

 

Hi Dmitrijs,

Thanks for working on this!

On Wed, Nov 13, 2013 at 09:16:17PM +0000, Dmitrijs Ledkovs wrote:
> I've raised a merge proposal below, to allow initramfs to mount system
> partition direct as an ubuntu rootfs.
> At the moment this is a fallback, as apart from the emulator, it's not
> possible to have a large enough system partition to hold ubuntu
> rootfs.

> A matching patch for build/ android project is attached as a file.

> The patch for the emulator package changes the behaviour slightly:
> * sdcard.img is dropped
> * ubuntu-system.img & ubuntu-userdata.img are generated
> * if no options specified: ubuntu-system.img is embedded inside
> ubuntu-userdata.img & normal (loop) based mount is performed

> * if "-no-loop" is specified to the build script, ubuntu-system.img is
> not embedded.

> ubuntu-system.img is provisioned as the system.img (/dev/mtdblock0)
> and ubuntu-userdata.img is provisioned as userdata.img
> (/dev/mtdblock1).

I don't quite understand this.  My understanding is that we need three
images¹ for the emulator:

 - the initramfs
 - the system partition
 - the userdata partition

¹ (well, possibly more, but that these are the three required for boot)

If we're loopback, the userdata partition (ubuntu-userdata.img) has the
Ubuntu root filesystem on it as a loopback file, /system.img; and the system
partition (yaff-system.img) contains the root filesystem for the Android
container - which is unpacked to a tmpfs before booted.

If we're not loopback, we still have the userdata partition
(ubuntu-userdata.img), and system.img then becomes the Ubuntu root
filesystem.

What happens to the Android filesystem that was on system.img before?  Was
this system.img actually completely redundant (because the root fs we are
using lives somewhere else)?

> Once booted without loop both / and /userdata are normal partitions
> (this is in RW mode)
> /dev/mtdblock1 on /userdata type ext4 (rw,relatime,data=ordered)
> /dev/mtdblock0 on / type ext4 (rw,relatime,data=ordered)

> Note that android container is still launched from a loop-mounted
> .img. I will check if it would be possible to supported unpacked
> android container under /var/lib/lxc/android/rootfs
> Also at the moment emulator is still using MTD partitions, instead of
> GPT formatted MMC device. That's also a TODO.

Where does that loop-mounted .img live?  Is this
/var/lib/lxc/android/system.img within system.img (the Ubuntu rootfs)?

(I guess it's no wonder that we're keen to get rid of the loop mounting,
there are way too many images with the same name running around ;)

Anyway, it sounds like you're making good progress towards having a "proper"
system partition - kudos!

Thanks,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slangasek@xxxxxxxxxx                                     vorlon@xxxxxxxxxx

Attachment: signature.asc
Description: Digital signature


Follow ups

References