History log of /system/core/init/devices.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
0e63e61eb54b893cd8f58f0e031b28511cd13866 21-Jun-2017 Tom Cherry <tomcherry@google.com> Revert "init: poll in first stage mount if required devices are not found"

Bug: 62864413

This reverts commit 5f4e8eac8a0db87a43ed7a930103f4241c22d479.

Change-Id: I6f35b920bb52875c8ef430d3e20b205fda5165e8
/system/core/init/devices.h
5f4e8eac8a0db87a43ed7a930103f4241c22d479 20-Jun-2017 Tom Cherry <tomcherry@google.com> init: poll in first stage mount if required devices are not found

First stage mount in init currently attempts to regenerate uevents for
specific devices to create the corresponding dev nodes. However, this
is racy as first stage mount happens early in the boot process and
it's possible that some of these devices have not yet been created by
the kernel.

To fix this issue, init will poll on the uevent socket for up to 10
seconds waiting for the kernel to create the required device. It will
return false and panic if this 10 second timeout passes.

Note that the same uevent socket is used in the uevent regeneration
and the polling code, so there is no race if the device is created
after the uevent regeneration and before polling starts; the first
poll will pick up the device.

Bug: 62681642
Bug: 62682821
Test: Boot bullhead
Test: Boot sailfish
Test: Boot hikey + hotplug/unplug sdcard
Merged-In: I4a6ff043eb7115b729ca4954ebc6c9e000132993
Change-Id: I4a6ff043eb7115b729ca4954ebc6c9e000132993
/system/core/init/devices.h
1fa0251930371aa0069e6ea20602b604c02f4f48 15-May-2017 Bowgo Tsai <bowgotsai@google.com> init: moving get_block_device_symlinks() to public API

This is required for init to get by-name symlinks in the first stage
mount with AVB.

Bug: 37552224
Test: first stage mount /vendor with vboot 2.0 (AVB)
Change-Id: Ib067753f651ecea4d4d26215da9294f1c607d95e
Merged-In: Ia0f290542eb1cffce5ae876dfedb453dde960253
/system/core/init/devices.h
35403ebaf85aa229973275be9f5229d453799811 09-Feb-2017 Sandeep Patil <sspatil@google.com> init: early_mount: add support to mount non-verity partitions early

This is done by parsing 'androidboot.fstab=<fstab>' kernel cmdline
option to get the fstab file that *only* specifies partitions to be
mounted early (i.e. in init's first stage).

Note that, the same fstab file may not be used as an argument to
mount_all later in the boot as that will cause fs_mgr to fail with
EBUSY.

TODO:
- Possibly add a new mount_mode so the same fstab can be used for
early_mount, 'mount_all --early/--late' etc.
- Add support for dm-verity enabled partitions to mount early.
- Add support for getting fstab arguments through DT instead of kernel
cmdline.

Bug: 27805372

Test:
Boot angler by passing a seperate fstab file using the kernel
cmdline option to mount vendor partition early, remove the vendor
partition entry from the main fstab file for the test.

Boot sailfish by passing a seperate fstab entry via device tree
to mount vendor partition early. Remove vendor partition entry from
the main fstab file for the test

Change-Id: I18785b893c54c8cee960ab44d5e8f83e5d624aa8
Signed-off-by: Sandeep Patil <sspatil@google.com>
/system/core/init/devices.h
44a3ee2cd1d73e8577d5612285c9000b47e848b6 09-Feb-2017 Sandeep Patil <sspatil@google.com> init: remove the existing early_mount code

keeps parts of the code that are still needed for the fs_mgr
+ dt based implementation

b/27805372

Test: boot angler, sailfish without regressions

Change-Id: I1b08f8b7b4f2e67118d328443a5011c0f5ead919
Signed-off-by: Sandeep Patil <sspatil@google.com>
/system/core/init/devices.h
957e4ab0b5c5f0ed006a287ba7cc387ce7db4d27 08-Feb-2017 Sandeep Patil <sspatil@google.com> init: refactor: add support for doing early coldboot

We don't want to spend time creating devices that are unncessesary
during early (init first-stage) mount. So, refactor the devices code
tha allows us to call into coldboot and has the

- ability to only create devices that are specified by the caller
- ability to stop coldboot cycle when all devices that the caller is
interested in
- ability to run coldboot for a specific syspath
- ability to run ueventd code unmodified

Test: Tested boot on angler, sailfish

Change-Id: Id8f3492380696760414eadc20d624d300c904f8e
Signed-off-by: Sandeep Patil <sspatil@google.com>
/system/core/init/devices.h
99c4a8a6b3852c33828b03cbd0aef0c625957a39 01-Feb-2016 Hung-ying Tyan <tyanh@google.com> Mount /vendor and /odm early

Right now these two partitions are mounted in the fs stage of the init
process. As a result, many vendor/ODM files needed earlier in the boot
process (e.g., init.<hardware>.rc, fstab.<hardware>.rc,
uevent.<hardware>.rc, SELinux policy files etc) can only live on the root
partition.

To prevent vendors/ODMs from polluting the root partition, this patch makes
it possible to mount the vendor and ODM partitions in the first stage of the
init process. The fstab info of both partitions to be mounted early is
composed from new kernel cmdline arguments android.early.prefix and
android.early.fstab.

For example, with:
android.early.prefix=/sys/devices/1010000.msdc0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/
android.early.fstab=mmcblk0p10+/odm+ext4+ro+verify\nmmcblk0p09+/vendor+ext4+ro+verify

the final fstab string will be:
/sys/devices/1010000.msdc0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p10 /odm ext4 ro verify
/sys/devices/1010000.msdc0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p09 /vendor ext4 ro verify

The android.early.prefix is optional. When it is missing, the final fstab
string will be directly converted from android.early.fstab.

This patch also makes sure that the early mounted partitions are dm-verity
enabled so that they are trust worthy to store system files.

BUG=27805372

Change-Id: I3cf32482a5ec65445ba3aedab2164c7ba8f12694
/system/core/init/devices.h
f3cf438714aa1284d8a58e2f3b108ba93f6d3abb 04-Feb-2015 Elliott Hughes <enh@google.com> Build init as C++.

This is just the minimal change to keep it building.

Change-Id: I245c5b8413a1db114576c81462eb5737f5ffcef2
/system/core/init/devices.h
c0c1ffea588c7d3c565b79d4f8bf3d4a8f75abc9 02-Jul-2012 Daniel Leung <daniel.leung@intel.com> init/ueventd: adds wildcard matching for ueventd rules

The sysfs nodes can change from devices to devices for
a particular class of peripheral. Some of them even change
after suspend/resume, e.g. rfkill for USB bluetooth adapters.

This patch adds to the way how ueventd rules with wildcard are
handled. In addition to matching the prefix with a trailing
wildcard, now rules can have wildcard anywhere in the rule.
The wildcard matching is implemented using fnmatch(), where
its matching is simliar to shell pathname expansion. It suits
this particular usage model well. To avoid abuse, the number of
slashes has to match between path name and the rule.

For example, instead of creating a rule to match:

/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/bluetooth/hci0/rfkill*

, this would suffice:

/sys/devices/pci0000:00/0000:00:1d.0/*/*/*/*/bluetooth/hci0/rfkill*

The prefix matching behavior is retained, such that those
rules do not have to pay for processing penalty with fnmatch().

Change-Id: I3ae6a39c838f6d12801cb71958e481b016f731f5
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
/system/core/init/devices.h
bc57d4ce925a62f14c28c55e0ff28af1114f12be 27-Oct-2010 Brian Swetland <swetland@google.com> init: support owner/permission setting for sysfs attributes of devices

This should be much nicer than peppering init.rc with chown/chmod
directives.

Also, remove some dead code and obsolete comments.

Change-Id: I10895f10a9cf2f1226c8d12976cd3db3743da9ec
/system/core/init/devices.h
f83d0b9af5cbe4440cc41ceaa8a7806a13c86282 21-Apr-2010 Colin Cross <ccross@android.com> init: Move uevent handling to an external ueventd process

Change-Id: Iea6c56013062ade633a1754f7bcf8cf09b3dedc1
/system/core/init/devices.h
0dd7ca6e87abb689700c5e3a816a949b03b1154b 14-Apr-2010 Colin Cross <ccross@android.com> init: Move device_fd to devices.c

Change-Id: I11ed0f3e1b95d2cff4fdbd80b915c01572f76b0e
/system/core/init/devices.h
dd7bc3319deb2b77c5d07a51b7d6cd7e11b5beb0 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/system/core/init/devices.h
e54eebbf1a908d65ee8cf80bab62821c05666d70 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/system/core/init/devices.h
4f6e8d7a00cbeda1e70cc15be9c4af1018bdad53 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
/system/core/init/devices.h