Commit Graph

9577 Commits

Author SHA1 Message Date
Dees Troy 4bf3b0d804 Make SELinux automatic if present 2013-09-12 10:38:15 -05:00
Vojtech Bocek 05534209f1 Add TWFunc::Exec_Cmd() with no 'result' agrument
Signed-off-by: Vojtech Bocek <vbocek@gmail.com>

Change-Id: Id8acff1ac9b3c7e4b562c80562a8ff42a1d132b9
2013-09-12 15:36:40 +00:00
Dees Troy f193f88e6d Make fixing su perms automatic
In 4.3+ with SELinux, su perms will be lost on every reboot so
users will get the prompt to fix su perms in TWRP every time. Make
fixing the su perms automatic instead of nagging the user.

Change-Id: Ia8a2652018db5e1f6ffc5fec2a4ac0db3a8f32bb
2013-09-12 09:11:32 -05:00
Dees Troy b21cc64ca8 Pull ROM info from build.prop for backup names
Change-Id: I7847fca22b5d4f0a35da41625b15bd677a1e9768
2013-09-12 09:11:13 -05:00
Dees Troy 893136dc45 Merge "Kang in older minzip for building in CM9 & CM7" into twrp2.7 2013-09-12 09:10:49 -05:00
Dees Troy 237b83b54c Merge "print out md5s to recovery.log" into twrp2.7 2013-09-12 09:10:01 -05:00
The Android Automerger c287321e9c merge in klp-release history after reset to klp-dev 2013-09-12 06:00:47 -07:00
Doug Zongker 743e24f161 am 1306a7ef: am cc2958fd: fix secure adb in recovery
* commit '1306a7effafab77cf2769091619518c2ab263ee8':
  fix secure adb in recovery
2013-09-11 17:23:33 -07:00
Doug Zongker 1306a7effa am cc2958fd: fix secure adb in recovery
* commit 'cc2958fd7f32f79d1a034eee005e04afeb310a87':
  fix secure adb in recovery
2013-09-11 13:39:03 -07:00
Doug Zongker cc2958fd7f fix secure adb in recovery
Recovery's init.rc was missing a line (added to the main system's
init.rc in change Ic97fd464440ff4a29fc9da7ad15949ac5215ade3) is
required for secure adb to work.

Change-Id: Id79b94d2abb4cbe3cca7cabeb4bc5faf7205e56b
2013-09-11 13:24:32 -07:00
Nick Kralevich 08ef9a9570 updater: Delete dead code
set_perm and set_perm_recursive are no longer used. Delete.

Change-Id: I3bb40b934b6c093b24b88aa4ed6f3c7de2bb52f0
2013-09-11 11:37:10 -07:00
Nick Kralevich d456944f02 Don't apply permission changes to symlink.
Bug: 10183961
Bug: 10186213
Bug: 8985290
Change-Id: I57cb14af59682c5f25f1e091564548bdbf20f74e
2013-09-10 17:13:23 -07:00
Nick Kralevich 53e8f30918 am af677d78: am e461251e: Don\'t apply permission changes to symlink.
* commit 'af677d786e6333187ccbd4f7fe6f371a09b71645':
  Don't apply permission changes to symlink.
2013-09-10 15:51:42 -07:00
Nick Kralevich af677d786e am e461251e: Don\'t apply permission changes to symlink.
* commit 'e461251e2caa5561cf6a315bffaebfd4eb896b1d':
  Don't apply permission changes to symlink.
2013-09-10 15:50:08 -07:00
Nick Kralevich e461251e2c Don't apply permission changes to symlink.
Bug: 10183961
Bug: 10186213
Bug: 8985290
Change-Id: I57cb14af59682c5f25f1e091564548bdbf20f74e
2013-09-10 15:34:19 -07:00
The Android Automerger c4a3a4bcc8 merge in klp-release history after reset to klp-dev 2013-09-10 14:28:02 -07:00
Dees Troy b7ae098e21 Kang in older minzip for building in CM9 & CM7
CM7 and CM9 do not have libselinux needed in the newer minzip.
2013-09-10 20:47:46 +00:00
Nick Kralevich c724eee592 am cc421662: am 5dbdef0e: updater: introduce and set_metadata and set_metadata_recursive
* commit 'cc421662d7f9b68627204b8c8bfb4a5cada74125':
  updater: introduce and set_metadata and set_metadata_recursive
2013-09-10 11:20:40 -07:00
Nick Kralevich 863f4ef587 am 5ae88e89: am 3328e3bc: Revert "Update OTA installer to understand SELinux filesystem labels"
* commit '5ae88e899836e7e3350db55ac47aee6f219cf126':
  Revert "Update OTA installer to understand SELinux filesystem labels"
2013-09-10 11:20:39 -07:00
Nick Kralevich cc421662d7 am 5dbdef0e: updater: introduce and set_metadata and set_metadata_recursive
* commit '5dbdef0e5b8a841fadc64d016d10ce81a962b284':
  updater: introduce and set_metadata and set_metadata_recursive
2013-09-10 11:18:24 -07:00
Nick Kralevich 5ae88e8998 am 3328e3bc: Revert "Update OTA installer to understand SELinux filesystem labels"
* commit '3328e3bc81161c2a57ea94d304162276facdd826':
  Revert "Update OTA installer to understand SELinux filesystem labels"
2013-09-10 11:18:24 -07:00
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
bigbiff bigbiff 6b059548df print out md5s to recovery.log 2013-09-10 10:28:26 -04:00
Dees Troy abaa9ca8f3 Merge "Hack-fix build with different system/core/charger versions" into twrp2.7 2013-09-10 08:46:29 -05:00
Dees Troy bc365b5e44 Merge "another fix to ignore space then = sign" into twrp2.7 2013-09-10 08:45:23 -05:00
Dees Troy c2e9bc74a1 Fix zip folder selection when storage path is similar
If internal is /sdcard and external is /sdcard-ext then the zip
path used to stay on /sdcard-ext when trying to switch to internal
storage. Using Get_Root_Path instead of resizing will ensure that
the path changes properly.
2013-09-10 00:16:31 +00:00
bigbiff bigbiff c03121d2ac another fix to ignore space then = sign 2013-09-09 19:14:35 -04:00
Nick Kralevich 3328e3bc81 Revert "Update OTA installer to understand SELinux filesystem labels"
This reverts commit 627eb30f73.

Bug: 10183961
Bug: 10186213
2013-09-09 10:47:14 -07:00
Vojtech Bocek 65fdcddec6 Hack-fix build with different system/core/charger versions
Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
2013-09-06 21:32:22 +02:00
Dees_Troy 84f683a322 Merge "Add more args to make_ext4fs command" into twrp2.7 2013-09-06 11:41:05 -05:00
Dees_Troy 5295d581a5 Add more args to make_ext4fs command 2013-09-06 15:51:08 +00:00
Dees_Troy 399f480dc7 Fix libselinx flags in libtar 2013-09-06 15:16:00 +00:00
Dees Troy 8807a1ead6 Merge "libtar: store SELinux file context in tar archives" into twrp2.7 2013-09-05 14:53:36 -05:00
Vojtech Bocek 25fd68d098 libtar: store SELinux file context in tar archives
* Using RedHat's "RHT.security.selinux=" tag in extended
  tar header (type 'x')

Signed-off-by: Vojtech Bocek <vbocek@gmail.com>

Change-Id: I102e492e4fa5b8a08fae4d34eb36386862509b4d
2013-09-05 21:43:52 +02:00
Dees_Troy 512376ccc7 Extract file_contexts from zips if it exists
Update binary will now extract file_contexts if it exists in the
root of the zip to /tmp

Recovery will replace the existing /file_contexts in the ramdisk
if file_contexts exists in the root of the zip.

This ensure that the proper contexts are used during zip installs.

Change-Id: If22c41101868643b67e6dba6177677c078fcd877
2013-09-05 13:06:16 +00:00
Doug Zongker 9e805d6ca0 allow CheckKey to request mounting /system
Also provide a default implementation of CheckKey that's reasonable
for many devices (those that have power and volume keys).

Change-Id: Icf6c7746ebd866152d402059dbd27fd16bd51ff8
2013-09-04 15:02:29 -07:00
Dees_Troy 1669f89dd2 Update to latest AOSP master
Merge in latest commits from AOSP master and fix merge conflicts
2013-09-04 19:00:58 +00:00
Doug Zongker 15ae0e7867 recovery: fix use of init reboot method
We need to set the system property to "reboot,", not an empty string.

Bug: 10605007
Change-Id: I776e0d273764cf254651ab2b25c2743395b990e0
2013-09-03 15:17:18 -07:00
Doug Zongker e428f62465 am f187a543: am 3b5a987c: recovery: fix use of init reboot method
* commit 'f187a5438d5a0651c344038f2203469e193704f9':
  recovery: fix use of init reboot method
2013-09-03 14:49:43 -07:00
Doug Zongker f187a5438d am 3b5a987c: recovery: fix use of init reboot method
* commit '3b5a987cd7fd76c038e9875b430028216d21ace3':
  recovery: fix use of init reboot method
2013-09-03 14:46:26 -07:00
Doug Zongker 3b5a987cd7 recovery: fix use of init reboot method
We need to set the system property to "reboot,", not an empty string.

Bug: 10605007
Change-Id: I776e0d273764cf254651ab2b25c2743395b990e0
2013-09-03 14:29:54 -07:00
Doug Zongker 79a188cbcf am 366f78a9: am 77ea71d6: recovery: fix rebooting
* commit '366f78a9df45d6648746de8454655224b22c31fd':
  recovery: fix rebooting
2013-08-30 14:10:21 -07:00
Doug Zongker 366f78a9df am 77ea71d6: recovery: fix rebooting
* commit '77ea71d6a85a93c9bf423466e87661b1bf67c512':
  recovery: fix rebooting
2013-08-30 14:05:20 -07:00
Vojtech Bocek 1dc3098a5c Initialize TWPartition::User_Rm_Rf to false in constructor
Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
2013-08-30 21:49:30 +02:00
Doug Zongker 77ea71d6a8 recovery: fix rebooting
Change I84c0513acb549720cb0e8c9fcbda0050f5c396f5 moved reboot
functionality into init but did not update the recovery partition; so
"adb reboot" and /system/bin/reboot in recovery are both broken.

Change-Id: Ie2d14627a686ffb5064256b6c399723636dff116
2013-08-30 12:20:16 -07:00
Hashcode dabfd49bd4 implement "usermrf" fstab flag to force rm -rf * deletion on specific partitions
Change-Id: I58f4a8cedf31e6b6efd88f96a43ed525603ae311
2013-08-30 10:28:15 -07:00
Dees_Troy b3265ab358 Better compatibility by fixing up ext4 & selinux flags 2013-08-30 02:59:14 +00:00
Vojtech Bocek 37aeb8d678 Really fix TWFunc::tw_chmod() for 3-character mode string
Signed-off-by: Vojtech Bocek <vbocek@gmail.com>

Change-Id: I8f03d46235e1c71e8ee510309c9418cde802f50b
2013-08-29 21:35:02 -05:00
bigbiff bigbiff 72e9554261 ignore extra = on install cmd
Change-Id: If9a0e6d4c00f6dd79f76c68ed0370a3101211801
2013-08-30 02:27:25 +00:00
Dees_Troy 7abb7a5813 Fix backup list height on 1080x1920 2013-08-30 02:07:19 +00:00