summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2015-09-22rootdev: Don't try to access /dev/block.android-wear-n-preview-3android-wear-n-preview-1android-n-preview-4android-n-preview-3android-n-preview-2android-n-preview-1android-cts_7.1_r1android-cts-7.1_r9android-cts-7.1_r8android-cts-7.1_r7android-cts-7.1_r6android-cts-7.1_r5android-cts-7.1_r4android-cts-7.1_r3android-cts-7.1_r29android-cts-7.1_r28android-cts-7.1_r27android-cts-7.1_r26android-cts-7.1_r25android-cts-7.1_r24android-cts-7.1_r23android-cts-7.1_r22android-cts-7.1_r21android-cts-7.1_r20android-cts-7.1_r2android-cts-7.1_r19android-cts-7.1_r18android-cts-7.1_r17android-cts-7.1_r16android-cts-7.1_r15android-cts-7.1_r14android-cts-7.1_r13android-cts-7.1_r12android-cts-7.1_r11android-cts-7.1_r10android-cts-7.1_r1android-cts-7.0_r9android-cts-7.0_r8android-cts-7.0_r7android-cts-7.0_r6android-cts-7.0_r5android-cts-7.0_r4android-cts-7.0_r33android-cts-7.0_r32android-cts-7.0_r31android-cts-7.0_r30android-cts-7.0_r3android-cts-7.0_r29android-cts-7.0_r28android-cts-7.0_r27android-cts-7.0_r26android-cts-7.0_r25android-cts-7.0_r24android-cts-7.0_r23android-cts-7.0_r22android-cts-7.0_r21android-cts-7.0_r20android-cts-7.0_r2android-cts-7.0_r19android-cts-7.0_r18android-cts-7.0_r17android-cts-7.0_r16android-cts-7.0_r15android-cts-7.0_r14android-cts-7.0_r13android-cts-7.0_r12android-cts-7.0_r11android-cts-7.0_r10android-cts-7.0_r1android-7.1.2_r9android-7.1.2_r8android-7.1.2_r6android-7.1.2_r5android-7.1.2_r4android-7.1.2_r39android-7.1.2_r38android-7.1.2_r37android-7.1.2_r36android-7.1.2_r33android-7.1.2_r32android-7.1.2_r30android-7.1.2_r3android-7.1.2_r29android-7.1.2_r28android-7.1.2_r27android-7.1.2_r25android-7.1.2_r24android-7.1.2_r23android-7.1.2_r2android-7.1.2_r19android-7.1.2_r18android-7.1.2_r17android-7.1.2_r16android-7.1.2_r15android-7.1.2_r14android-7.1.2_r13android-7.1.2_r12android-7.1.2_r11android-7.1.2_r10android-7.1.2_r1android-7.1.1_r9android-7.1.1_r8android-7.1.1_r7android-7.1.1_r61android-7.1.1_r60android-7.1.1_r6android-7.1.1_r59android-7.1.1_r58android-7.1.1_r57android-7.1.1_r56android-7.1.1_r55android-7.1.1_r54android-7.1.1_r53android-7.1.1_r52android-7.1.1_r51android-7.1.1_r50android-7.1.1_r49android-7.1.1_r48android-7.1.1_r47android-7.1.1_r46android-7.1.1_r45android-7.1.1_r44android-7.1.1_r43android-7.1.1_r42android-7.1.1_r41android-7.1.1_r40android-7.1.1_r4android-7.1.1_r39android-7.1.1_r38android-7.1.1_r35android-7.1.1_r33android-7.1.1_r32android-7.1.1_r31android-7.1.1_r3android-7.1.1_r28android-7.1.1_r27android-7.1.1_r26android-7.1.1_r25android-7.1.1_r24android-7.1.1_r23android-7.1.1_r22android-7.1.1_r21android-7.1.1_r20android-7.1.1_r2android-7.1.1_r17android-7.1.1_r16android-7.1.1_r15android-7.1.1_r14android-7.1.1_r13android-7.1.1_r12android-7.1.1_r11android-7.1.1_r10android-7.1.1_r1android-7.1.0_r7android-7.1.0_r6android-7.1.0_r5android-7.1.0_r4android-7.1.0_r3android-7.1.0_r2android-7.1.0_r1android-7.0.0_r9android-7.0.0_r8android-7.0.0_r7android-7.0.0_r6android-7.0.0_r5android-7.0.0_r4android-7.0.0_r36android-7.0.0_r35android-7.0.0_r34android-7.0.0_r33android-7.0.0_r32android-7.0.0_r31android-7.0.0_r30android-7.0.0_r3android-7.0.0_r29android-7.0.0_r28android-7.0.0_r27android-7.0.0_r24android-7.0.0_r21android-7.0.0_r19android-7.0.0_r17android-7.0.0_r15android-7.0.0_r14android-7.0.0_r13android-7.0.0_r12android-7.0.0_r11android-7.0.0_r10android-7.0.0_r1nougat-releasenougat-mr2.3-releasenougat-mr2.2-releasenougat-mr2.1-releasenougat-mr2-security-releasenougat-mr2-releasenougat-mr2-pixel-releasenougat-mr2-devnougat-mr1.8-releasenougat-mr1.7-releasenougat-mr1.6-releasenougat-mr1.5-releasenougat-mr1.4-releasenougat-mr1.3-releasenougat-mr1.2-releasenougat-mr1.1-releasenougat-mr1-volantis-releasenougat-mr1-security-releasenougat-mr1-releasenougat-mr1-flounder-releasenougat-mr1-devnougat-mr1-cts-releasenougat-mr0.5-releasenougat-dr1-releasenougat-devnougat-cts-releasenougat-bugfix-releasebrillo-m9-releasebrillo-m9-devbrillo-m8-releasebrillo-m8-devbrillo-m7-releasebrillo-m7-mr-devbrillo-m7-devbrillo-m10-releasebrillo-m10-devBertrand SIMONNET
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
2015-09-22Revert "rootdev: Don't try to access /dev/block."Bertrand Simonnet
This breaks when built with clang This reverts commit 4a2bdd8006a5ddf166bcc8973c135799da453e09. Change-Id: I2f89a9c19de91d4c46dce110e36a32551134e5d5
2015-09-21rootdev: Don't try to access /dev/block.Bertrand SIMONNET
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
2015-09-01Add Android.mk.Bertrand SIMONNET
BUG: 22953719 Change-Id: Ie7d9ff703e50210e1b6a1ab8bd7f52ae6a6e46f7
2015-08-28rootdev: Add license files.Bertrand SIMONNET
BUG: 22953719 Change-Id: I04cea1655d85f988b8c803047b08bd19c7e19cdc
2015-03-14rootdev: Use large file support (LFS)Dan Ehrenberg
Without LFS, stat fails with -EOVERFLOW on devices with major:minor numbers that don't fit within 8 bits on 32-bit architecutres. This patch turns on LFS to allow that, fixing a bringup but on a new platform. BUG=chromium:464024 TEST=Booted onto a machine and successfully ran rootdev with a large major:minor number. Change-Id: I3dfe698e65366f4608705f56894988d2643e375f Signed-off-by: Dan Ehrenberg <dehrenberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/258550 Reviewed-by: Mike Frysinger <vapier@chromium.org> Commit-Queue: Mike Frysinger <vapier@chromium.org>
2014-12-12tests: make it more flexible for the ebuildMike Frysinger
The current code requires rootdev to be in $PWD which fails when we build out of tree (like the ebuild). BUG=chromium:441571 TEST=`FEATURES=test emerge-link rootdev` passes Change-Id: I99173ceb557099c20b43f5a31b87107a144efa20 Reviewed-on: https://chromium-review.googlesource.com/234921 Trybot-Ready: Mike Frysinger <vapier@chromium.org> Reviewed-by: Yunlian Jiang <yunlian@chromium.org> Commit-Queue: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org>
2014-12-12fix --block handling with invalid pathsMike Frysinger
The rootdev program was printing the path buffer even when the library call failed. In that case, the buffer most likely is uninitialized. Make sure we seed it with a NUL byte so it's always valid. BUG=chromium:441571 TEST=`FEATURES=test emerge-link rootdev` passes Change-Id: I00d334376de9bedee0a3fac3b1a74e48237c06b7 Reviewed-on: https://chromium-review.googlesource.com/234920 Trybot-Ready: Mike Frysinger <vapier@chromium.org> Reviewed-by: Yunlian Jiang <yunlian@chromium.org> Commit-Queue: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org>
2014-04-01fix building w/ABIs that have broken stat structuresMike Frysinger
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>
2013-11-06fix flag handlingMike Frysinger
Make sure we respect CPPFLAGS and don't hardcode BUG=None TEST=`emerge-x86-alex rootdev` uses right flags Change-Id: I668af9e02b842ddc54f60e07d313a564cc927413 Reviewed-on: https://chromium-review.googlesource.com/175522 Reviewed-by: Liam McLoughlin <lmcloughlin@chromium.org> Commit-Queue: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org>
2013-11-06rootdev: link against librootdevMike Frysinger
We create a lib out of rootdev.c, so have our main program use it rather than duplicate the code in the main program. BUG=None TEST=`emerge-x86-alex rootdev` still works and rootdev is linked against the prog (and works) Change-Id: If649007ddb9499f2217ad0af3f1d30115587dd3d Reviewed-on: https://chromium-review.googlesource.com/175521 Reviewed-by: Liam McLoughlin <lmcloughlin@chromium.org> Commit-Queue: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org>
2013-11-06support out-of-tree buildsMike Frysinger
This will allow us to avoid doing a git clone. BUG=None TEST=`emerge-x86-alex rootdev` still works Change-Id: I2515981c5aa426eebecc6333d8ae7b50276ae577 Reviewed-on: https://chromium-review.googlesource.com/175520 Reviewed-by: Liam McLoughlin <lmcloughlin@chromium.org> Commit-Queue: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org>
2013-08-20Avoid some identifier confusionChris Masone
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>
2013-07-12Fixed reference to overlapping (the same) string.Paul Taysom
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>
2012-09-25Modified rootdev to handle stacked device mappersPaul Taysom
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>
2011-11-14rootdev: Prevent infinite recursion when parsing /sys/block.Bryan Freed
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>
2010-08-30rootdev: fix -d, add -c and -r. ifdefs for so useWill Drewry
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
2010-07-26rootdev.c: Added -d option to strip trailing partition numberKobi Cohen-Arazi
Change-Id: I2afbb0a8546f48224292433e2efcf0a868c7a1c6 Review URL: http://codereview.chromium.org/2814040 Patch from Kobi Cohen-Arazi <kobic@codeaurora.org>.
2010-06-15rootdev: cleanup, remove files symlinkZdenek Behan
deleted: files Review URL: http://codereview.chromium.org/2815007
2010-06-15rootdev: fix review inheritance for rootdev repoZdenek Behan
new file: inherit-review-settings-ok Review URL: http://codereview.chromium.org/2816005
2010-06-15rootdev: rework the repo into a "new eclass"-friendly layoutZdenek Behan
* Move all files from files/ to . * Fix LICENCE symlink * Create files -> . symlink to remain backwards compatible Review URL: http://codereview.chromium.org/2847007
2010-03-16Adding source for rootdev utility.Bill Richardson