Commit graph

17 commits

Author SHA1 Message Date
Yifan Hong
4932780606 SYSTEM_ROOT -> get_system_root
Add a get_system_root() function in roots.cpp
which returns / or /system based on fstab.
This factors out the 'if' check from recovery.cpp
and fsck_unshare_blocks.cpp.

Test: boot recovery, mount system
Bug: 118634720
Change-Id: If4947cba3a3f08dbe695fd2b50a9354cd302ee03
2018-11-27 15:57:47 -08:00
David Anderson
2b2f423ef6 recovery: Fix mounting /system with dynamic partitions.
When using dynamic partitions, the blk_device field in fstab_rec must be
translated to a /dev/block/dm-N node with
fs_mgr_update_logical_partition. However, init will not have created
these nodes to begin with since CreateLogicalPartitions is not called in
recovery. This patch addresses both issues.

Note that flashing system through fastbootd will not work while /system is
mounted.

Bug: 118634720
Test: manual test
Change-Id: I06c83309d09eab6b65245b1ed10c51d05398f23e
2018-10-30 13:47:59 -07:00
Tao Bao
3e18f2bf40 roots: Fix an issue with volume_for_path().
The earlier commit in 2dfc1a3898
unintentionally changed the behavior. It gives a different result when
looking up non-existent mount points (e.g. /cache on marlin).

The logic behind volume_for_path("/xyz") is unclear:
- It's fine to return non-null value if it's called by
  ensure_path_mounted() before accessing that file "/xyz". (Just based
  on the function name, we're not actually having this case.)
- It should return nullptr if the caller is interested in the existence
  of that particular mount point "/xyz".

This CL renames the function to volume_for_mount_point(), which does an
exact match by querying the given mount point from libfs_mgr. The former
volume_for_path() has been moved down to function scope for serving
ensure_path_mounted() only.

Test: Build and boot into recovery on bullhead and marlin respectively.
      'View recovery logs'.
Test: 'Mount /system'
Test: 'Apply update from ADB'
Change-Id: I1a16390f57540cae08a2b8f3d439d17886975217
2017-10-02 11:18:13 -07:00
Tao Bao
ac9d94d19c Revert "Revert "Some cleanups to recovery.""
This reverts commit 8584fcf677.

This CL re-lands commit c0319b60f5.
The "stage" and "reason" variables are now declared as global by
dropping the static qualifier, because they may be used by vendor
recovery libraries.

Test: lunch aosp_angler-userdebug; mmma bootable/recovery
Test: lunch aosp_dragon-userdebug; mmma bootable/recovery

Change-Id: I252c346f450079478cff22bbff01590b8ab2e2b3
2016-11-03 11:57:46 -07:00
Dan Albert
8584fcf677 Revert "Some cleanups to recovery."
This reverts commit c0319b60f5.

Reason for revert: Broke builds.

Change-Id: I82aa880b83de5ae6c36fd7567cb001920559a972
2016-10-27 03:08:08 +00:00
Tao Bao
c0319b60f5 Some cleanups to recovery.
- Remove the duplicate gCurrentUI variable in recovery.cpp;
- Refactor the load/save of locale functions;
- Clean up ui_print() to get rid of 256-byte buffer limit;
- Declare ui in common.h;
- Move the typedef of Volume into roots.h.

Test: Build and boot into recovery image.

Change-Id: Ia28c116858ca754133127a5ff9c722af67ad55b7
2016-10-26 14:36:42 -07:00
Paul Lawrence
d0db337d72 Create convert_fbe breadcrumb file to support conversion to FBE
Change-Id: I38b29e1e34ea793e4b87cd27a1d39fa905fddf7a
2015-11-13 07:49:31 -08:00
Tao Bao
abb8f7785e recovery: Allow "Mount /system" for system_root_image.
When system images contain the root directory, there is no entry of
"/system" in the fstab. Change it to look for "/" instead if
ro.build.system_root_image is true. We actually mount the partition
to /system_root instead, and create a symlink to /system_root/system
for /system. This allows "adb shell" to work properly.

Bug: 22855115
Change-Id: Ibac493a5a9320c98ee3b60bd2cc635b925f5454a
2015-07-30 17:22:29 -07:00
Andres Morales
c277762de1 Revert "Erase PST partition if its marked to be erased."
This now gets done at the framework level.
Doing it here breaks the signature on the partition.

This reverts commit ee19387905.

Bug: 19967123
Change-Id: I2a977cb0f0ba94defa1bf9091219398ddc1d3528
(cherry picked from commit 037444642b)
2015-03-31 09:48:50 -07:00
Andres Morales
ee19387905 Erase PST partition if its marked to be erased.
We need to wipe the challenges on this partition
if OEM unlock is enabled, as this is a signal that
the user has opted out of factory reset protection.

go/factory-reset

Bug: 16633064
Change-Id: Icb8f1433bf99ca57813f5b72d5a3dd15fa94a263
2014-08-06 09:58:55 -07:00
Doug Zongker
239ac6abac recovery: install packages in a known mount environment
When installing a package, we should have /tmp and /cache mounted and
nothing else.  Ensure this is true by explicitly mounting them and
unmounting everything else as the first step of every install.

Also fix an error in the progress bar that crops up when you do
multiple package installs in one instance of recovery.

Change-Id: I4837ed707cb419ddd3d9f6188b6355ba1bcfe2b2
2013-08-21 13:44:35 -07:00
Doug Zongker
28ce47cfa6 turn recovery into a C++ binary
Change-Id: I423a23581048d451d53eef46e5f5eac485b77555
2011-10-31 10:24:09 -07:00
Doug Zongker
cc8cd3f3ca remove the notion of "root path"; support mixed flash types
Remove the wacky notion of "roots" and "root paths" (those things that
look like "FOO:some/path" instead of just "/foo/some/path").  Let each
device specify its own table of available partitions and how to mount
them (needed for devices that use both MTD/yaffs2 and EMMC/ext4
partitions).

(Cherrypicked from gingerbread w/slight edits.)

Change-Id: I2479ce76b13e73f1d12035c89386c3a82b3edf51
2010-09-21 14:13:45 -07:00
Doug Zongker
d7d4208976 remove unneeded partition roots
Recovery itself no longer needs to access all these partitions;
manipulation of them is done by the updater binary.  This is a small
first step towards removing roots entirely.

Change-Id: I3fbcada32079a37db4cc097861dfa91e0a08da30
2010-09-17 13:02:48 -07:00
The Android Open Source Project
c24a8e688a auto import from //depot/cupcake/@135843 2009-03-03 19:28:42 -08:00
The Android Open Source Project
ffb48f64fe auto import from //depot/cupcake/@135843 2009-03-03 18:28:14 -08:00
The Android Open Source Project
23580ca27a Initial Contribution 2008-10-21 07:00:00 -07:00