Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c4000050 authored by Blagovest Kolenichev's avatar Blagovest Kolenichev
Browse files

dm: Restore reverted changes



This is a preparation change for merging android-4.14.114 into
msm-4.14 branch.

The following changes need to be reverted, otherwise boot
stuck on rootfs mount:

efe83653 Revert "CHROMIUM: dm: boot time specification of dm="
afaef205 Revert "ANDROID: dm: do_mounts_dm: Rebase on top of 4.9"
357c3d31 Revert "ANDROID: dm: do_mounts_dm: fix dm_substitute_devices()"
71eb40b7 Revert "ANDROID: dm: do_mounts_dm: Update init/do_mounts_dm.c to the latest ChromiumOS version."

The above reverted changes are required when 'system is root'
and the mount instructions (including dm-verity) for system
image is provided by the bootloader through the kernel cmdline
even with AVB 2.0. Dynamic/Super partition has not been enabled
internally which will ensure system image is mounted by early
init. Since this will only be supported for new launches of Q,
still these changes are required to be present for OTA devices.

Change-Id: Ie6c093cdd2d1dc1e578ebce06b3923f81c06ed6f
Signed-off-by: default avatarBlagovest Kolenichev <bkolenichev@codeaurora.org>
parent c680586c
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -837,6 +837,9 @@

	dis_ucode_ldr	[X86] Disable the microcode loader.

	dm=		[DM] Allows early creation of a device-mapper device.
			See Documentation/device-mapper/boot.txt.

	dma_debug=off	If the kernel is compiled with DMA_API_DEBUG support,
			this option disables the debugging code at boot.

+42 −0
Original line number Diff line number Diff line
Boot time creation of mapped devices
===================================

It is possible to configure a device mapper device to act as the root
device for your system in two ways.

The first is to build an initial ramdisk which boots to a minimal
userspace which configures the device, then pivot_root(8) in to it.

For simple device mapper configurations, it is possible to boot directly
using the following kernel command line:

dm="<name> <uuid> <ro>,table line 1,...,table line n"

name = the name to associate with the device
	after boot, udev, if used, will use that name to label
	the device node.
uuid = may be 'none' or the UUID desired for the device.
ro = may be "ro" or "rw".  If "ro", the device and device table will be
	marked read-only.

Each table line may be as normal when using the dmsetup tool except for
two variations:
1. Any use of commas will be interpreted as a newline
2. Quotation marks cannot be escaped and cannot be used without
   terminating the dm= argument.

Unless renamed by udev, the device node created will be dm-0 as the
first minor number for the device-mapper is used during early creation.

Example
=======

- Booting to a linear array made up of user-mode linux block devices:

  dm="lroot none 0, 0 4096 linear 98:16 0, 4096 4096 linear 98:32 0" \
  root=/dev/dm-0

Will boot to a rw dm-linear target of 8192 sectors split across two
block devices identified by their major:minor numbers.  After boot, udev
will rename this target to /dev/mapper/lroot (depending on the rules).
No uuid was assigned.
+39 −0
Original line number Diff line number Diff line
@@ -1986,6 +1986,45 @@ void dm_interface_exit(void)
	dm_hash_exit();
}


/**
 * dm_ioctl_export - Permanently export a mapped device via the ioctl interface
 * @md: Pointer to mapped_device
 * @name: Buffer (size DM_NAME_LEN) for name
 * @uuid: Buffer (size DM_UUID_LEN) for uuid or NULL if not desired
 */
int dm_ioctl_export(struct mapped_device *md, const char *name,
		    const char *uuid)
{
	int r = 0;
	struct hash_cell *hc;

	if (!md) {
		r = -ENXIO;
		goto out;
	}

	/* The name and uuid can only be set once. */
	mutex_lock(&dm_hash_cells_mutex);
	hc = dm_get_mdptr(md);
	mutex_unlock(&dm_hash_cells_mutex);
	if (hc) {
		DMERR("%s: already exported", dm_device_name(md));
		r = -ENXIO;
		goto out;
	}

	r = dm_hash_insert(name, uuid, md);
	if (r) {
		DMERR("%s: could not bind to '%s'", dm_device_name(md), name);
		goto out;
	}

	/* Let udev know we've changed. */
	dm_kobject_uevent(md, KOBJ_CHANGE, dm_get_event_nr(md));
out:
	return r;
}
/**
 * dm_copy_name_and_uuid - Copy mapped device name & uuid into supplied buffers
 * @md: Pointer to mapped_device
+1 −0
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@
#include <linux/vmalloc.h>
#include <linux/blkdev.h>
#include <linux/namei.h>
#include <linux/mount.h>
#include <linux/ctype.h>
#include <linux/string.h>
#include <linux/slab.h>
+0 −2
Original line number Diff line number Diff line
@@ -80,8 +80,6 @@ void dm_set_md_type(struct mapped_device *md, enum dm_queue_mode type);
enum dm_queue_mode dm_get_md_type(struct mapped_device *md);
struct target_type *dm_get_immutable_target_type(struct mapped_device *md);

int dm_setup_md_queue(struct mapped_device *md, struct dm_table *t);

/*
 * To check the return value from dm_table_find_target().
 */
Loading