summaryrefslogtreecommitdiffstats
path: root/rootdir
diff options
context:
space:
mode:
authorAlex Deymo <deymo@google.com>2016-02-29 17:23:36 -0800
committerAlex Deymo <deymo@google.com>2016-03-02 14:17:42 -0800
commitbb968fb04db3ec5227e84571e1c6bfd265836085 (patch)
tree0bbba52375fa2a0c1bc198ba7dbc170bade9938f /rootdir
parent68de85bda98d7d03f63134209f9e2c149cad1852 (diff)
downloadcore-bb968fb04db3ec5227e84571e1c6bfd265836085.tar.gz
core-bb968fb04db3ec5227e84571e1c6bfd265836085.tar.bz2
core-bb968fb04db3ec5227e84571e1c6bfd265836085.zip
Add /postinstall partition when using the A/B updater.
The new top level directory /postinstall is used by the A/B updater to mount the new partition and run a post-install program before rebooting into that new system. init.rc was extended to label this new directory since the initrd has no extended attributes. Bug: 27177071 TEST=`ls -laZ /` shows the /postinstall directory on edison-eng Change-Id: I6cdee7eb1d61ac7d447528962a4fad1a7bbf138d
Diffstat (limited to 'rootdir')
-rw-r--r--rootdir/Android.mk5
-rw-r--r--rootdir/init.rc3
2 files changed, 8 insertions, 0 deletions
diff --git a/rootdir/Android.mk b/rootdir/Android.mk
index d90f988cc..d53af2ffe 100644
--- a/rootdir/Android.mk
+++ b/rootdir/Android.mk
@@ -70,6 +70,11 @@ ifdef BOARD_ROOT_EXTRA_SYMLINKS
; mkdir -p $(dir $(TARGET_ROOT_OUT)/$(word 2,$(p))) \
; ln -sf $(word 1,$(p)) $(TARGET_ROOT_OUT)/$(word 2,$(p)))
endif
+# The A/B updater uses a top-level /postinstall directory to mount the new
+# system before reboot.
+ifeq ($(AB_OTA_UPDATER),true)
+ LOCAL_POST_INSTALL_CMD += ; mkdir -p $(TARGET_ROOT_OUT)/postinstall
+endif
include $(BUILD_SYSTEM)/base_rules.mk
diff --git a/rootdir/init.rc b/rootdir/init.rc
index 1f63fcf74..2b1209978 100644
--- a/rootdir/init.rc
+++ b/rootdir/init.rc
@@ -23,6 +23,9 @@ on early-init
# Shouldn't be necessary, but sdcard won't start without it. http://b/22568628.
mkdir /mnt 0775 root system
+ # Set the security context of /postinstall if present.
+ restorecon /postinstall
+
start ueventd
on init