Support for encrypted internal memory extension 42/129342/20
authorKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Fri, 22 Sep 2017 12:01:58 +0000 (14:01 +0200)
committerHyotaek Shim <hyotaek.shim@samsung.com>
Mon, 16 Oct 2017 11:16:44 +0000 (20:16 +0900)
commit906c1fc5c63aa13849e9a0c629999ac4faca2e66
treeba607075bbb14aecfe1d611fbb2724e30f4d82fe
parentc53a417ecb0e1b35d4d316611c0712d3c4a94821
Support for encrypted internal memory extension

- Support device mapper devices. Necessary because dmcrypt uses device mapper.
  It also requires proper udev rules for device mapper. Device mapper devices
  will be marked as BLOCK_MAPPER_DEV (previously
  BLOCK_MMC_EXTENDED_INTERNAL_DEV). Update block.conf file and related logic.

- Support different/unknown filesystems. We don't know what kind of data will
  be on sd card, but we have to be able to detect it. All sdcards are marked as
  BLOCK_MMC_DEV. Listener can distinguish cards by fs_type if needed.

- For devices with non-filesystem FS_USAGE (for example "crypto") we don't need
  2.4 backward compatibility and fixed id.

- Don't generate mount path for devices with non-filesystem FS_USAGE.

- Don't check for primary partition on device mapper devices.

- Don't check multimount for unknown filesystems.

- Trigger card setup UI for cards without LUKS or with garbage on them. Don't
  treat unformatted cards as an error.

- For internal memory extension assign the mountpoint in make_block_data() as
  in case of other types of storage.

- Don't try to mount unknown filesystems.

- In case of device mapper udev events treat "change" as "add" (perhaps this
  can be avoided by providing proper udev rules).

- Update device data when udev "change" event occurs. Formatting partition
  externally (LUKS case) requires manual udev read so that both udev and
  storaged have the actual device state. Also notify listeners about this
  change.

- Allow unmounting internal memory extension card. Not sure why it was disabled.

Change-Id: I26f98b31a24936f0b4524fc5c081163f9c9e4878
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
src/block/block.c
src/block/block.conf
src/block/block.h