Age | Commit message (Collapse) | Author |
|
When the device used to back a path is found in /sys/block, rootdev will
double check that /dev/block/<device name> exists and that the dev_t
matches the one in /sys/block/.
On Android, the manufacturer can add an SELinux context for that device
node which will prevent core daemons from accessing it, failing the call
to rootdev.
To avoid this, rootdev should return the device node path without trying
to access it.
This CL also enable building with Clang to ensure we use the strictest
compiler possible.
BUG: 24143423
BUG: 24267261
TEST: metricsd starts and find the main disk without any SELinux denial.
TEST: builds with clang and -Werror.
Change-Id: Icfe64695c28277d4c8eb9c89de1e13a767a703b8
|
|
This breaks when built with clang
This reverts commit 4a2bdd8006a5ddf166bcc8973c135799da453e09.
Change-Id: I2f89a9c19de91d4c46dce110e36a32551134e5d5
|
|
When the device used to back a path is found in /sys/block, rootdev will
double check that /dev/block/<device name> exists and that the dev_t
matches the one in /sys/block/.
On Android, the manufacturer can add an SELinux context for that device
node which will prevent core daemons from accessing it, failing the call
to rootdev.
To avoid this, rootdev should return the device node path without trying
to access it.
BUG: 24143423
BUG: 24267261
TEST: metricsd starts and find the main disk without any SELinux denial.
Change-Id: I4c0fb2800ac84ff451974990c6228ee10528c0f0
|
|
BUG: 22953719
Change-Id: Ie7d9ff703e50210e1b6a1ab8bd7f52ae6a6e46f7
|
|
If the system's stat buffer is broken and doesn't declare st_dev as a
dev_t, we hit a build failure when we try to pass it into a func that
expects a dev_t.
Add some checks to handle this case. It produces the same code on sane
ABIs, so other than ugliness, it should be fine.
BUG=chromium:358419
TEST=`emerge-link rootdev` produces same code
TEST=`emerge-daisy rootdev` produces same code
TEST=`emerge-mipsel-o32-generic rootdev` now works
Change-Id: I956436e0c40318c8f2ac61b2e202ec739132c245
Reviewed-on: https://chromium-review.googlesource.com/192550
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
|
|
Some toolchains are confused by have a local variable with the same
name as a function. FIXIT!
BUG=None
TEST=compilashunz
Change-Id: Id7befbcfc9c2cbcd14f4a229cbc8687e1f7ad72c
Reviewed-on: https://gerrit.chromium.org/gerrit/66294
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
Commit-Queue: Chris Masone <cmasone@chromium.org>
|
|
The intent of the rootdev_get_device_slave is to allow the slave and
the device to be the same string but it is not required. Added a
test for the case where they are the same string to not do the
strncpy.
Linux has vixed the problem of a limited number of stacked devices,
so I fixed the comment that referred to it.
BUG=chromium:259893
TEST=rootdev -s
Change-Id: I04d84799e77c678f1330e1bcf72cddaf9ac68c4c
Reviewed-on: https://gerrit.chromium.org/gerrit/61707
Tested-by: Paul Taysom <taysom@chromium.org>
Reviewed-by: Yunlian Jiang <yunlian@chromium.org>
Commit-Queue: Paul Taysom <taysom@chromium.org>
|
|
Rootdev only went down one level when traversing the device tree.
With the addition of the bootcache device mapper, we need to
go multiple levels for the -s option for rootdev.
BUG=chromium-os:25441
TEST=used it with bootcache to find boot device.
Change-Id: Ica82dc150e403d0e49e4d8074c0b920b20e4cccc
Reviewed-on: https://gerrit.chromium.org/gerrit/31851
Commit-Ready: Paul Taysom <taysom@chromium.org>
Reviewed-by: Paul Taysom <taysom@chromium.org>
Tested-by: Paul Taysom <taysom@chromium.org>
|
|
The mmcblk driver of the 3.0.8 kernel adds mmcblk0boot0 and mmcblk0boot1
directories under /sys/block or /sys/block/mmcblk0. I have seen it both ways.
The device symlink in those directories points to "../../mmcblk0" which
points to the grandparent directory.
When rootdev scans /sys/block looking for a device that matches "/", it
can fall into this loop and recurse until failure.
While a proper fix would detect loops to prevent recursion, that adds
considerable complexity to the directory scan.
This relatively simple solution limits recursion depth to 5 to prevent
infinitely looping. It will fail to find device matches beyond 5 levels
of directories, but we are nowhere near that in today's systems. We find
matches at level 3 as best I can tell.
BUG=chromium-os:22855
TEST=Run rootdev and check for failures.
Change-Id: I9ef3aa0a6d6f8143dd0b9e012ba4bb4adfa0c73b
Reviewed-on: https://gerrit.chromium.org/gerrit/11575
Reviewed-by: Will Drewry <wad@chromium.org>
Commit-Ready: Bryan Freed <bfreed@chromium.org>
Tested-by: Bryan Freed <bfreed@chromium.org>
|
|
Multiple changes:
- Ensure the -d flag trims off all of the partition info and only if there is a partition
- Add -c, device node creation for platform-agnostic /dev/ROOT, /dev/ROOT0 and /dev/ROOT1
- Add -r, resolve the first slave if the device is a device-mapper device
- Add -s, create a symlink from the found device to /dev/ACTIVE_ROOT
- Adds short-circuiting if /dev/ACTIVE_ROOT exists to both dm resolution and
normal lookups
- Add support for building a library with a reusable header and interfaces
I'll follow this up with a change to install <rootdev/rootdev.h> and the .so in
the ebuild if the interface is at all interesting. If prefered, I can just add:
rootdev -s -r to chromeos_startup, then AU can just rely on readlink(/dev/ACTIVE_ROOT).
BUG=chromium-os:5988
TEST=built for x86-generic testing with vroot: -r, -s, -c, -d and combos
switching to non-vroot to test now
can someone test arm for me?
Change-Id: Ibab8072afb012ea77d457517f1849e0917d02892
Review URL: http://codereview.chromium.org/3141038
|
|
Change-Id: I2afbb0a8546f48224292433e2efcf0a868c7a1c6
Review URL: http://codereview.chromium.org/2814040
Patch from Kobi Cohen-Arazi <kobic@codeaurora.org>.
|
|
* Move all files from files/ to .
* Fix LICENCE symlink
* Create files -> . symlink to remain backwards compatible
Review URL: http://codereview.chromium.org/2847007
|