[REF] LVM Partition Remapping

Search This thread

kaluoshi

Inactive Recognized Developer
Sep 2, 2011
1,450
5,655
South Italy
It will not work with selinux enforced unless you add a few other changes
This is wip

https://gerrit.omnirom.org/11178
https://gerrit.omnirom.org/11277

thanks however, even with making selinux permissive and adding seliux permissions. Still can not get device to boot

wondering if my implementation is wrong somehow

last_kmesg:

Code:
[    8.008765] SELinux: Could not set context for /cache:  Read-only file system
[    8.009439] SELinux: Could not set context for /data:  Read-only file system
[    8.019378] SELinux: Could not set context for /data:  Read-only file system
[    8.019660] SELinux: Could not set context for /data/lvm:  Read-only file system
[    8.019809] SELinux: Could not set context for /data/lvm/backup:  Read-only file system
[    8.019951] SELinux: Could not set context for /data/lvm/backup/lvpool:  Read-only file system
[    8.020030] SELinux: Could not set context for /data/lvm/archive:  Read-only file system
[    8.020179] SELinux: Could not set context for /data/lvm/archive/lvpool_00000-926546556.vg:  Read-only file system
[    8.020285] SELinux: Could not set context for /data/lvm/lock:  Read-only file system
[    8.021577] SELinux:  Could not stat /data/misc/sensors: No such file or directory.

Take a look here now i leaved a comment with a commit :) https://gerrit.omnirom.org/#/c/11277/
 

javier.pc

Senior Member
Mar 23, 2010
248
74
Valencia
I've been using LVM with Omni for months, first with 4.4 and since some weeks with 5.0.2 test builds. Today I've tried to test 5.1 and now I'm unable to configure LVM. After install 5.1 test build I can't get phone signal; wifi was ok, but phone doesn't. So I ask for clues and @maxwen answered me that I was using wrong firmware/modem. I tried to install the right one and due to a terrible mistake I flashed a wrong modem, bricking my phone. Impossible to boot in system or recovery, only in fastboot. Using the unbrick tool I've been able to restore my phone, but now I can't configure LVM. I've tried with several TWRP versions downloaded from official TWRP site and the twrp_find7_lvm_09012014.img provided in the LVM post, but I can see several messages saying "Unable to mount 'Internal_sd'" and then "Failed".
Is there something I can do?
Thanks for your help.
 

javier.pc

Senior Member
Mar 23, 2010
248
74
Valencia
I've been using LVM with Omni for months, first with 4.4 and since some weeks with 5.0.2 test builds. Today I've tried to test 5.1 and now I'm unable to configure LVM. After install 5.1 test build I can't get phone signal; wifi was ok, but phone doesn't. So I ask for clues and @maxwen answered me that I was using wrong firmware/modem. I tried to install the right one and due to a terrible mistake I flashed a wrong modem, bricking my phone. Impossible to boot in system or recovery, only in fastboot. Using the unbrick tool I've been able to restore my phone, but now I can't configure LVM. I've tried with several TWRP versions downloaded from official TWRP site and the twrp_find7_lvm_09012014.img provided in the LVM post, but I can see several messages saying "Unable to mount 'Internal_sd'" and then "Failed".
Is there something I can do?
Thanks for your help.

Solved; I needed to format internal SD partition.
Thanks.
 
  • Like
Reactions: leungclj

kishd

Senior Member
Oct 25, 2011
560
196
Been looking at the thread on Oppo forums for the Chinese lollipop version. Looks like the bricks are beginning to pile up. Why did Oppo decide to go this silly route for their Chinese ROM?
 

Entropy512

Senior Recognized Developer
Aug 31, 2007
14,095
25,088
Owego, NY
Been looking at the thread on Oppo forums for the Chinese lollipop version. Looks like the bricks are beginning to pile up. Why did Oppo decide to go this silly route for their Chinese ROM?

There's a lot of evidence that the international and domestic teams don't communicate as often as they should (seems like it's the fault of the domestic teams) - While usually, the international team "follows" the domestic team, in the case of partitioning experiments, the international team is WAY ahead.
 
  • Like
Reactions: kishd

hulicow

Senior Member
Aug 24, 2013
259
84
@Entropy512 What are your comments about this?

I made some kernel updates and the random reboots should be fixed now.

Also, nightlies now ship with updated modem from Spectrum v1.1 beta and updated blobs.

LVM will not be supported by CM because it's more of a hack than a real solution and it's a security compromise.

Does LVM is a really security compromise?
 

prashantfind7

Member
Feb 6, 2016
21
2
Hey listen.. I'm installing omni rom 6.0. I'm using Oppo Find 7 with coloros 2.1.5i (lollipop)
How can do I proceed with LVM storage method? I have TWRP as my recovery. I tried installing (setuplvm_find7_FULL_WIPE_09012014.zip) in recovery mode the process failed and when I rebooted, the phone got stucked at the logo. I removed my battery and reinstalled it. The phone is working. How should I change to LVM partition?

---------- Post added at 12:40 PM ---------- Previous post was at 12:37 PM ----------

Yes.

Sent from my FIND7 using Tapatalk

Hey listen.. I'm installing omni rom 6.0. I'm using Oppo Find 7 with coloros 2.1.5i (lollipop)
How can do I proceed with LVM storage method? I have TWRP as my recovery. I tried installing (setuplvm_find7_FULL_WIPE_09012014.zip) in recovery mode the process failed and when I rebooted, the phone got stucked at the logo. I removed my battery and reinstalled it. The phone is working. How should I change to LVM partition?
 

maxwen

Senior Member
Jun 10, 2012
8,051
10,278
Hey listen.. I'm installing omni rom 6.0. I'm using Oppo Find 7 with coloros 2.1.5i (lollipop)
How can do I proceed with LVM storage method? I have TWRP as my recovery. I tried installing (setuplvm_find7_FULL_WIPE_09012014.zip) in recovery mode the process failed and when I rebooted, the phone got stucked at the logo. I removed my battery and reinstalled it. The phone is working. How should I change to LVM partition?

---------- Post added at 12:40 PM ---------- Previous post was at 12:37 PM ----------



Hey listen.. I'm installing omni rom 6.0. I'm using Oppo Find 7 with coloros 2.1.5i (lollipop)
How can do I proceed with LVM storage method? I have TWRP as my recovery. I tried installing (setuplvm_find7_FULL_WIPE_09012014.zip) in recovery mode the process failed and when I rebooted, the phone got stucked at the logo. I removed my battery and reinstalled it. The phone is working. How should I change to LVM partition?

Hey listen - dont fu... crosspost :(
 
  • Like
Reactions: BadonlaparkJR

griMa010100

Member
Mar 15, 2018
17
2
Hi guys,
My OPPO find 7a is doing very weird things. I am trying to describe what is does, because I lack a proper expression.
I do a fresh install of a custom Rom (I used LineageOS and Omni) with or without open_gapps and SuperSu after around 10 minutes telephone starts to open and close apps in a very rapid fashion. It really renders the phone unusable.
I suspected whole problem comes from LVM. Thats why I am here.

I used mount command before and after "weird behaviour":

before:
Code:
rootfs on / type rootfs (ro,seclabel,relatime)
tmpfs on /dev type tmpfs (rw,seclabel,nosuid,relatime,size=939100k,nr_inodes=176430,mode=755)
devpts on /dev/pts type devpts (rw,seclabel,relatime,mode=600)
proc on /proc type proc (rw,relatime,gid=3009,hidepid=2)
sysfs on /sys type sysfs (rw,seclabel,relatime)
selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,seclabel,relatime)
none on /acct type cgroup (rw,relatime,cpuacct)
tmpfs on /mnt type tmpfs (rw,seclabel,relatime,size=939100k,nr_inodes=176430,mode=755,gid=1000)
none on /dev/cpuctl type cgroup (rw,relatime,cpu)
/dev/block/platform/msm_sdcc.1/by-name/system on /system type ext4 (ro,seclabel,noatime,data=ordered)
/dev/lvpool/userdata on /data type ext4 (rw,seclabel,nosuid,nodev,noatime,noauto_da_alloc,errors=panic,data=ordered)
/dev/block/platform/msm_sdcc.1/by-name/cache on /cache type ext4 (rw,seclabel,nosuid,nodev,noatime,noauto_da_alloc,errors=panic,data=ordered)
/dev/block/platform/msm_sdcc.1/by-name/persist on /persist type ext4 (rw,seclabel,nosuid,nodev,relatime,noauto_da_alloc,errors=panic,data=ordered)
/dev/block/platform/msm_sdcc.1/by-name/modem on /firmware type vfat (ro,context=u:object_r:firmware_file:s0,noatime,uid=1000,gid=1000,fmask=0337,dmask=0227,codepage=cp437,iocharset=iso8859-1,shortname=lower,errors=remount-ro)
tmpfs on /storage type tmpfs (rw,seclabel,relatime,size=939100k,nr_inodes=176430,mode=755,gid=1000)
/dev/fuse on /mnt/runtime/default/emulated type fuse (rw,nosuid,nodev,noexec,noatime,user_id=1023,group_id=1023,default_permissions,allow_other)
/dev/fuse on /storage/emulated type fuse (rw,nosuid,nodev,noexec,noatime,user_id=1023,group_id=1023,default_permissions,allow_other)
/dev/fuse on /mnt/runtime/read/emulated type fuse (rw,nosuid,nodev,noexec,noatime,user_id=1023,group_id=1023,default_permissions,allow_other)
/dev/fuse on /mnt/runtime/write/emulated type fuse (rw,nosuid,nodev,noexec,noatime,user_id=1023,group_id=1023,default_permissions,allow_other)
/dev/block/vold/public:179_65 on /mnt/media_rw/9016-4EF8 type vfat (rw,dirsync,nosuid,nodev,noexec,relatime,uid=1023,gid=1023,fmask=0007,dmask=0007,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
/dev/fuse on /mnt/runtime/default/9016-4EF8 type fuse (rw,nosuid,nodev,noexec,noatime,user_id=1023,group_id=1023,default_permissions,allow_other)
/dev/fuse on /storage/9016-4EF8 type fuse (rw,nosuid,nodev,noexec,noatime,user_id=1023,group_id=1023,default_permissions,allow_other)
/dev/fuse on /mnt/runtime/read/9016-4EF8 type fuse (rw,nosuid,nodev,noexec,noatime,user_id=1023,group_id=1023,default_permissions,allow_other)
/dev/fuse on /mnt/runtime/write/9016-4EF8 type fuse (rw,nosuid,nodev,noexec,noatime,user_id=1023,group_id=1023,default_permissions,allow_other)

after:
Code:
rootfs on / type rootfs (ro,seclabel,relatime)
tmpfs on /dev type tmpfs (rw,seclabel,nosuid,relatime,size=939100k,nr_inodes=176430,mode=755)
devpts on /dev/pts type devpts (rw,seclabel,relatime,mode=600)
proc on /proc type proc (rw,relatime,gid=3009,hidepid=2)
sysfs on /sys type sysfs (rw,seclabel,relatime)
selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,seclabel,relatime)
none on /acct type cgroup (rw,relatime,cpuacct)
tmpfs on /mnt type tmpfs (rw,seclabel,relatime,size=939100k,nr_inodes=176430,mode=755,gid=1000)
none on /dev/cpuctl type cgroup (rw,relatime,cpu)
/dev/block/platform/msm_sdcc.1/by-name/system on /system type ext4 (ro,seclabel,noatime,data=ordered)
/dev/lvpool/userdata on /data type ext4 (rw,seclabel,nosuid,nodev,noatime,noauto_da_alloc,errors=panic,data=ordered)
/dev/block/platform/msm_sdcc.1/by-name/cache on /cache type ext4 (rw,seclabel,nosuid,nodev,noatime,noauto_da_alloc,errors=panic,data=ordered)
/dev/block/platform/msm_sdcc.1/by-name/persist on /persist type ext4 (rw,seclabel,nosuid,nodev,relatime,noauto_da_alloc,errors=panic,data=ordered)
/dev/block/platform/msm_sdcc.1/by-name/modem on /firmware type vfat (ro,context=u:object_r:firmware_file:s0,noatime,uid=1000,gid=1000,fmask=0337,dmask=0227,codepage=cp437,iocharset=iso8859-1,shortname=lower,errors=remount-ro)
tmpfs on /storage type tmpfs (rw,seclabel,relatime,size=939100k,nr_inodes=176430,mode=755,gid=1000)
/dev/fuse on /mnt/runtime/default/emulated type fuse (rw,nosuid,nodev,noexec,noatime,user_id=1023,group_id=1023,default_permissions,allow_other)
/dev/fuse on /storage/emulated type fuse (rw,nosuid,nodev,noexec,noatime,user_id=1023,group_id=1023,default_permissions,allow_other)
/dev/fuse on /mnt/runtime/read/emulated type fuse (rw,nosuid,nodev,noexec,noatime,user_id=1023,group_id=1023,default_permissions,allow_other)
/dev/fuse on /mnt/runtime/write/emulated type fuse (rw,nosuid,nodev,noexec,noatime,user_id=1023,group_id=1023,default_permissions,allow_other)

ad before: I think this is the correct way. It is mounted to 9016-4EF8.
ad after: Something forced to unmount 9016-4EF8.

I am a very interested to solve this problem, but I admit I am a bit lost here. My best guess it is has something to do with permission etc.
I'd be very happy someone could guide me in the right direction.
Cheers griMa
 
Last edited:

griMa010100

Member
Mar 15, 2018
17
2
Hi guys,
My OPPO find 7a is doing very weird things. I am trying to describe what is does, because I lack a proper expression.
I do a fresh install of a custom Rom (I used LineageOS and Omni) with or without open_gapps and SuperSu after around 10 minutes telephone starts to open and close apps in a very rapid fashion. It really renders the phone unusable.
I suspected whole problem comes from LVM. Thats why I am here.

Please disregard my post. After a bit more research, I think it is probably my touch screen (digitizer). I ordered a new one, I do not want her let go. :D
 

Top Liked Posts

  • There are no posts matching your filters.
  • 29
    OK, this thread is going to be a work in progress, intended to serve as a reference for the work I've been doing on LVM partition remapping.

    My work was done initially on a Find 7, but this should eventually be usable on many other devices (I have the Find 5 and N1 in mind for when I return from vacation). Also, this would not have been possible without the work Steven676 did years ago on the Nexus S, which has been used by all AOSP-derivative projects to support the Samsung Aries (Galaxy S) family for quite some time now.

    The current state of things is that the patches are solid and work very well for the system side of things, but there is still a bit of work needed on the recovery side of things. This is due to TWRP having an architectural limitation I need to work on - Whether a device uses emulated storage or not is set at compile time, which is a problem if your design requires automatic detection of configuration at run time.

    One of the key design goals here was to support both normal and LVM configurations automatically with a single build that detects which configuration is present on a device at run time.

    A second key design goal was that the underlying partition table of the device is not touched in any way. Touching the partition table of a mobile device in the field is a fundamentally dangerous operation, as many partitions contain data that is device-unique or will render a device unbootable if altered. Recovery methods that involve DDing partition images to nonstandard partitions is asking for trouble due to typos... There's no protection against a user typoing the name of a critical partition.

    Initially, I'm going to dump the contents of an email I wrote to someone giving them documentation on how to integrate LVM into their project. Over time I'll clean up and reorganize this post, including adding some more links. Also, since this email was written, I've added a LOT of comments to each patch explaining what is going on.

    For additional documentation, especially a more user-oriented view of things (such as how to set this up if you want to use it with Omni nightlies) - see the Omni nightlies thread on XDA.

    So here goes:

    How it's implemented - the complete patch set is at:
    https://gerrit.omnirom.org/#/q/topic:find7_lvm - Expect this to periodically change as work on this feature continues (Note: All patches required to support nightly builds of Omni have been merged. At this point, all remaining work that I expect is on polishing up TWRP.)

    With the rest of this post, I'll talk about each individual patch and what it does.

    https://gerrit.omnirom.org/#/c/9273/ - This is a patch against frameworks/base which adds an alternative to storage_list.xml called storage_list_lvm.xml - The frameworks will choose storage_list_lvm.xml instead of storage_list.xml if the property ro.lvm_storage is set to 1 - The device init scripts will set this property if they detect an LVM configuration.

    https://gerrit.omnirom.org/#/c/9207/ - This is an Omni-specific patch. Omni builds for both the Find 7 and OnePlus One (also known as find7op) and both share a common device tree. The LVM patches do not apply to the find7op, so we move init.recovery.rc out of the msm8974-common tree - You likely don't have to worry about this unless you also have a -common tree for find7 and find7op

    https://gerrit.omnirom.org/#/c/9276/ - Normal Android kernel ramdisks do not include busybox or any form of shell, making it impossible to run shell scripts without /system mounted. Since we need to run a shell script prior to mounting partitions, we need to add busybox to the ramdisk. This patch does that. For legal reasons you may wish to replace busybox with system/core/toolbox and system/core/sh - I have not tried doing so. If you choose to stay with busybox, you will have to provide the busybox source code in order to comply with the GPL.

    https://gerrit.omnirom.org/#/c/9205/ - This adds the LVM binary and LVM configuration file to the ramdisks of both normal boot and recovery. This patch does not actually begin doing anything with the binaries, I separated it out from the other patches as a way to keep things organized so I could start working with the binaries when I began this project. The original source code and documentation for the binary is at https://github.com/steven676/android-lvm-mod

    One change I made in lvm.conf that differs from the Samsung aries family (galaxysmtd, fascinatemtd, captivatemtd, etc.) is that I changed the filter line to only allow the userdata and sdcard partitions. This prevents LVM's vgscan from accidentally determining another partition is a physical volume, and also prevents users from accidentally running pvcreate on a critical partition.

    https://gerrit.omnirom.org/#/c/9206/ - This is where all of the "heavy lifting" is done. I'm going to work on adding more comments to the init scripts and shell scripts to document them tonight and tomorrow, but I'll try to explain things here.

    Android's init system is a bit limited in that it's very difficult to have conditional behavior defined in init.rc - which appears to be why Qualcomm loves to use shell scripts called from init. Similarly, much of the LVM magic happens in three shell scripts (which execute at three different phases within the boot sequence).

    In the early-init phase, the two "wait" blocks ensure that the underlying block devices are ready before vgscan/vgchange are called. This will probably slow down booting by a few fractions of a second unfortunately.

    vgscan will scan the volumes defined in lvm.conf (in this case, only the userdata and sdcard partitions) for LVM physical volumes. If LVM physical volumes are detected and form a proper volume group, vgscan will create appropriate device nodes. With the configuration I'm using, the device node will be /dev/lvpool/userdata - which consists of a single logical volume that merges the sdcard and physical userdata physical volumes (partitions). The configuration of lvm.conf prevents LVM commands (especially pvcreate) from altering partitions we don't want to alter. If someone accidentally tries to, for example, run pvcreate on the system partition, it will give an error indicating that the partition was not part of the filter.

    vgchange will activate the physical volumes detected by vgscan

    lvm_init.sh will check to see if /dev/lvpool/userdata exists, and copy fstab.qcom.lvm to fstab.qcom, init.fs.rc.lvm to init.fs.rc, and twrp.fstab.lvm to twrp.fstab if it does. If it does not, it selects fstab.qcom.std, etc.

    In the "on init" section, the init script exports all environment variables from init.fs.rc, and creates all storage-related directories and symlinks needed for both configurations (except for when they conflict). lvm_symlinks.sh will create directories/symlinks that must be configuration-specific. Just like lvm_init.sh - it decides what to do based on whether /dev/lvpool/userdata exists

    In the "on fs" section - we do an SELinux restorecon on /dev/mapper/lvpool-userdata (/dev/lvpool/userdata would probably work here too). If it doesn't exist, this will fail gracefully without causing any issues.

    In "on early-boot" - lvm_setprop.sh uses /system/bin/setprop to set ro.lvm_storage to 0 or 1 depending on the detected configuration. The property service is not available until early-boot - so this cannot be in lvm_init.sh or lvm_symlinks.sh This propery is used by the frameworks/base patch above to determine which storage_list to choose.

    At the end of the init.qcom.rc, the fuse daemon for emulated storage is added for all configurations. (I could not figure out a good way to make this conditional based on whether LVM was present or not). In a non-LVM configuration, it runs but is harmless - it maps /data/media (which is empty) to /mnt/shell/emulated (which nothing is looking at due to the environment variables and symlinks set in the "on init" section )

    You will probably notice that Omni's standard storage configuration is fairly different from ColorOS - this is due to the way KitKat storage works, but it allowed us to get away without using Oppo's ext4 permissions hacks in our kernel (by remapping permissions instead, in a manner similar to how the emulated storage system works) The way we handle our /sdcard partition does interoperate without issues with the ColorOS approach.

    https://gerrit.omnirom.org/#/c/9279/ is a patch specifically for TWRP. TWRP currently determines whether to use emulated storage (/sdcard on /data/media) at build time instead of at run time. Until I have time to fix this, the patch here operates as a workaround. It is similar to the behavior of the fuse sdcard daemon in the previous patch - it maps /data/media to /sdcard whether the configuration is actually emulated storage or not. If the device is not using emulated storage (LVM), mapping of /data/media to /sdcard is still mostly harmless. However it does result in undesirable changes to TWRP's user interface. DO NOT USE THIS APPROACH IN PRODUCTION RELEASES. It's a horrible hack. You'll need to figure out how to properly do /data/media handling depending on whether LVM is present or not based on how your own recovery architecture works.

    https://gerrit.omnirom.org/#/c/9281/ adds "raw" sdcard and userdata partition entries to the partition table for the LVM configuration. This allows a user to return their device to a standard configuration by formatting the underlying sdcard and userdata partitions directly, instead of the removelvm ZIP at the beginning of this email. - To be abandoned, this patch was squashed into 9206
    13
    FAQ

    Q: Coldbird already had repartitioning support. Why did you create this different approach?
    A: Even before he started work, I strongly recommended that he not touch the partition table of the device. It's a really bad idea and is fundamentally dangerous. It's pure luck that someone hasn't hardbricked yet. (A number of people have come close.) If you read through his thread and the ColorOS 2.0.2 thread, you'll see that the repartitioning approach fails frequently, and in multiple ways. (Missing partition contents, partition table ending early, etc. The latter is really scary, one person had the process fail at mmcblk0p19 - what if someone else's partition table write operation aborted even earlier?.) Also, nearly everyone that has implemented support for that approach has needed a separate build to support it. (Oppo is the first to manage autodetection.) I also provided him all of the reference information from Steven676's work.

    LVM is far safer. The underlying partition table is not touched in any way. Instead, LVM remaps sectors on the fly so that two partitions that are not adjacent to each other on the physical storage appear as a single contiguous partition to the filesystem drivers. Linux has supported LVM for on the order of a decade, if not more. I've been using LVM on my file server since 2006. (Yes, the system is 8 years old and still working other than needing a new power supply after a thunderstorm. Nothing to do with LVM. :) ) In addition, the lvm.conf configuration used here provides protection against accidental typos causing damage. Undoing the changes is as simple as doing a wipe of /data and /sdcard from any standard recovery and can be done in seconds, not of running a special batch file that runs a bunch of fastboot commands and takes 4-5 minutes. Similarly, the LVM setup process currently described in the Omni thread involves flashing a single ZIP from recovery that takes only 10-15 seconds, and most of that process is flashing an LVM-aware recovery. (The only limitation currently is that the ZIP must be on external storage - USB OTG or MicroSD)

    To put it simply, it Just Works. No need to back up a pile of partitions other than /data and /sdcard because those partitions are never touched or altered.

    Q: I have a device with a ridiculously oversized /system partition, can I get some of that back for /data?
    A: Yes, you can. Add the physical /system partition to the lvm.conf filters and add it to the lvpool when creating it, then create a smaller /system LV out of this big pool. (see updater.sh in device/samsung/aries-common/ of any AOSP-derivative for hints here.) Be careful though - leave enough spare space for growth (new Android versions, etc.) While it should be possible to use some of the LVM tools along with ext4 resize tools to reorganize the LVs without wiping, this is very difficult and you'll probably have to make users wipe /data if you want to alter /system.
    9
    OK. There's a minor bug in recent TWRP releases where it seems to insist on constantly remounting the internal SD. It also double-mounts the internal SD, also mounting it to /and-sec

    This is what causes the following failure in recovery.log:
    Code:
      Can't open /dev/block/platform/msm_sdcc.1/by-name/sdcard exclusively.  Mounted filesystem?
    run_program: child exited with status 5
    when setuplvm attempts to pvcreate on the sdcard partition

    Workaround: Explicitly unmount /and-sec in the recovery script.

    Attached is:
    Updated setuplvm which works with recent TWRP releases (should include 2.8.0.1) - it REQUIRES an LVM-aware recovery now, and no longer flashes its own LVM-aware recovery
    A repost of removelvm which should be self-explanatory and should work with nearly any recovery other than stock

    Later this week I'm going to work on splitting this into two threads: Reference for developers, and reference for users. This thread was intended to be the developer reference for people wanting to implement LVM into their projects. :)

    EDIT: REMEMBER, AS HAS BEEN STATED BEFORE: YOU MUST FLASH THIS FROM THE EXTERNAL SD. FLASHING FROM THE INTERNAL SD OR ADB SIDELOAD WILL FAIL.
    6
    Nice work, I hope all the patches can be widely used on some other devices and other roms.

    Yup. I know Andre from PA was working on it last week but I haven't heard from him lately.

    My priority when I return from vacation will be fixing up the TWRP side of things. It's working for now, but the user interface on non-LVM configs is a little funky thanks to RECOVERY_SDCARD_ON_DATA being compile time. This has never been a problem before since a single TWRP binary never had to support two different configurations before. I plan on either doing a property-based approach or fstab-based like CWM. (It should be possible for someone to make a CWM build that automatically detects configuration without any modifications to CWM, based on reading the code - but I haven't tried it myself.)

    Once TWRP is in better shape, I plan on doing the Find 5 and N1. These will have the challenge of not having a MicroSD slot, so I may have to change TWRP so that it use /tmp instead of /sdcard when doing "adb sideload", or at least gives the user that option.
    6
    Thanks for your answer.

    Seems I misunderstood the way it's implemented here. All space is allocated to /data? So there's no more internal sdcard right?
    But in that case an external sdcard is mandatory. How is it managed when there's no sdcard?

    Enjoy!

    Android has supported emulated storage (where /data/media is mapped to /sdcard with a special FUSE daemon that makes /sdcard have DOS-like permissions despite an underlying ext4 partition) since ICS. It's pretty much the standard in all new devices - the Find 7 is to my knowledge the only device launched in 2014 not to use emulated storage. Most devices in 2013 also did - Oppos were again the rare exception.

    As I understand it - for some reason Chinese users prefer the legacy pre-ICS partitioning scheme. My guess is due to UMS vs. MTP - MTP is required for access to emulated storage, UMS can't be used, but a lot of older desktop OSes have issues with MTP. So Oppo finds themselves in conflict between their home market (China) and expanding in the West. That said, the Find 7 was kind of a screwup in achieving this goal, since the internal sdcard partition was ext4 which meant UMS was a no-go for it.
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone