No description
Find a file
Nick Kralevich 5dbdef0e5b updater: introduce and set_metadata and set_metadata_recursive
Introduce two new updater functions:

* set_metadata
* set_metadata_recursive

Long term, these functions are intended to be more flexible replacements
for the following methods:

* set_perm
* set_perm_recursive

Usage:

  set_metadata("filename", "key1", "value1", "key2", "value2", ...)
  set_metadata_recursive("dirname", "key1", "value1", "key2", "value2", ...)

Description:

set_metadata() and set_metadata_recursive() set the attributes on a file/directory
according to the key/value pairs provided. Today, the following keys are
supported:

* uid
* gid
* mode (set_perm_extd only)
* fmode (set_perm_extd_recursive only)
* dmode (set_perm_extd_recursive only)
* selabel
* capabilities

Unknown keys are logged as warnings, but are not fatal errors.

Examples:

* set_metadata("/system/bin/netcfg", "selabel", "u:object_r:system_file:s0");

This sets the SELinux label of /system/bin/netcfg to u:object_r:system_file:s0.
No other changes occur.

* set_metadata("/system/bin/netcfg", "uid", 0, "gid", 3003, "mode", 02750, "selabel", "u:object_r:system_file:s0", "capabilities", 0x0);

This sets /system/bin/netcfg to uid=0, gid=3003, mode=02750,
selinux label=u:object_r:system_file:s0, and clears the capabilities
associated with the file.

* set_metadata_recursive("/system", "uid", 0, "gid", 0, "fmode", 0644, "dmode", 0755, "selabel", "u:object_r:system_file:s0", "capabilities", 0x0);

All files and directories under /system are set to uid=0, gid=0,
and selinux label=u:object_r:system_file:s0. Directories are set to
mode=0755.  Files are set to mode=0644 and all capabilities are cleared.

Bug: 10183961
Bug: 10186213
Bug: 8985290
Change-Id: Ifdcf186a7ed45265511dc493c4036e1ac5e3d0af
2013-09-10 10:24:24 -07:00
applypatch am a69b50c5: am 901b898d: recovery: remove O_DIRECT, use O_SYNC only 2013-07-11 14:23:44 -07:00
edify recovery: move log output to stdout 2013-07-09 12:50:24 -07:00
etc recovery: fix rebooting 2013-08-30 12:20:16 -07:00
fonts more font improvements and cleanup 2013-03-07 13:34:24 -08:00
minadbd minadbd: remove unnecessary header files. 2013-03-01 09:16:26 -08:00
minelf remove retouching code from updater 2012-02-28 12:30:13 -08:00
minui recovery: move log output to stdout 2013-07-09 12:50:24 -07:00
minzip Revert "Update OTA installer to understand SELinux filesystem labels" 2013-09-09 10:47:14 -07:00
mtdutils recovery: move log output to stdout 2013-07-09 12:50:24 -07:00
res/images more font improvements and cleanup 2013-03-07 13:34:24 -08:00
testdata verifier: update to support certificates using SHA-256 2013-04-10 11:32:17 -07:00
tools Fixed unused param warnings for check-lost+found 2012-08-21 16:03:46 -04:00
updater updater: introduce and set_metadata and set_metadata_recursive 2013-09-10 10:24:24 -07:00
adb_install.cpp support "sideload over ADB" mode 2012-01-10 10:18:17 -08:00
adb_install.h support "sideload over ADB" mode 2012-01-10 10:18:17 -08:00
Android.mk Add liblog 2013-04-09 21:41:29 -07:00
bootloader.cpp Move to using the new unified fstab in recovery. 2013-02-19 17:37:22 -08:00
bootloader.h turn recovery into a C++ binary 2011-10-31 10:24:09 -07:00
CleanSpec.mk Add a CleanSpec for bootable/recovery 2013-02-22 11:29:02 +00:00
common.h recovery: turn on text display for install errors in debug builds 2013-05-21 11:18:38 -07:00
default_device.cpp support "sideload over ADB" mode 2012-01-10 10:18:17 -08:00
device.h support "sideload over ADB" mode 2012-01-10 10:18:17 -08:00
install.cpp recovery: install packages in a known mount environment 2013-08-21 13:44:35 -07:00
install.h add simple text to recovery UI 2012-08-22 17:26:40 -07:00
make-overlay.py change the default recovery assets to be in holograph style 2011-03-02 10:38:02 -08:00
NOTICE Automated import from //branches/master/...@140824,140824 2009-03-24 18:36:42 -07:00
recovery.cpp recovery: fix use of init reboot method 2013-09-03 14:29:54 -07:00
roots.cpp recovery: install packages in a known mount environment 2013-08-21 13:44:35 -07:00
roots.h recovery: install packages in a known mount environment 2013-08-21 13:44:35 -07:00
screen_ui.cpp recovery: install packages in a known mount environment 2013-08-21 13:44:35 -07:00
screen_ui.h notify about pending long press 2013-07-31 11:35:12 -07:00
ui.cpp notify about pending long press 2013-07-31 11:35:12 -07:00
ui.h notify about pending long press 2013-07-31 11:35:12 -07:00
verifier.cpp verifier: update to support certificates using SHA-256 2013-04-10 11:32:17 -07:00
verifier.h verifier: update to support certificates using SHA-256 2013-04-10 11:32:17 -07:00
verifier_test.cpp recovery: turn on text display for install errors in debug builds 2013-05-21 11:18:38 -07:00
verifier_test.sh verifier: update to support certificates using SHA-256 2013-04-10 11:32:17 -07:00