Merge "kernel: clean up this madness" into o8.0
diff --git a/bliss-device-targets b/bliss-device-targets
deleted file mode 100644
index 459efd0..0000000
--- a/bliss-device-targets
+++ /dev/null
@@ -1,5 +0,0 @@
-# List Of All Officially Supported Devices
-
-bliss_hammerhead-userdebug
-bliss_shamu-userdebug
-bliss_bullhead-userdebug
diff --git a/bliss.devices b/bliss.devices
index 345e6ae..12cc0c9 100644
--- a/bliss.devices
+++ b/bliss.devices
@@ -1 +1,4 @@
-Test
+bullhead
+shamu
+angler
+victara
diff --git a/config/common.mk b/config/common.mk
index 2aa7865..491c5e5 100644
--- a/config/common.mk
+++ b/config/common.mk
@@ -23,6 +23,7 @@
     vendor/bliss/prebuilt/common/bin/backuptool.functions:install/bin/backuptool.functions \
     vendor/bliss/prebuilt/common/bin/blacklist:system/addon.d/blacklist \
     vendor/bliss/prebuilt/common/bin/whitelist:system/addon.d/whitelist \
+    vendor/bliss/prebuilt/bin/blacklist:system/addon.d/blacklist
 
  # Bootanimation support
 ifneq ($(TARGET_SCREEN_WIDTH) $(TARGET_SCREEN_HEIGHT),$(space))
diff --git a/config/versions.mk b/config/versions.mk
index 2cf0852..5d0ee6e 100644
--- a/config/versions.mk
+++ b/config/versions.mk
@@ -2,7 +2,7 @@
 # Bliss RELEASE VERSION
 BLISS_VERSION_MAJOR = 8
 BLISS_VERSION_MINOR = 0
-BLISS_VERSION_MAINTENANCE = Alpha
+BLISS_VERSION_MAINTENANCE = Beta
 
 VERSION := $(BLISS_VERSION_MAJOR).$(BLISS_VERSION_MINOR)-$(BLISS_VERSION_MAINTENANCE)
 
@@ -35,4 +35,5 @@
 BLISS_DISPLAY_BUILDTYPE := $(BLISS_BUILDTYPE)
 
 PRODUCT_PROPERTY_OVERRIDES += \
-  ro.bliss.version=$(BLISS_DISPLAY_VERSION)
+  ro.bliss.version=$(BLISS_DISPLAY_VERSION) \
+  ro.bliss.build.status=$(BLISS_BUILDTYPE)
diff --git a/prebuilt/common/bin/backuptool.functions b/prebuilt/common/bin/backuptool.functions
index 1925805..b05ed43 100644
--- a/prebuilt/common/bin/backuptool.functions
+++ b/prebuilt/common/bin/backuptool.functions
@@ -7,8 +7,18 @@
 export S=/system
 export V=8.0
 
+copy_file() {
+  cp -dp "$1" "$2"
+  # symlinks don't have a context
+  if [ ! -L "$1" ]; then
+    # it is assumed that every label starts with 'u:object_r' and has no white-spaces
+    local context=`ls -Z "$1" | grep -o 'u:object_r:[^ ]*' | head -1`
+    chcon "$context" "$2"
+  fi
+}
+
 backup_file() {
-  if [ -e "$1" ]; then
+  if [ -e "$1" -o -L "$1" ]; then
     local F=`basename "$1"`
     local D=`dirname "$1"`
     # dont backup any apps that have odex files, they are useless
@@ -16,7 +26,7 @@
       echo "Skipping odexed apk $1";
     else
       mkdir -p "$C/$D"
-      cp -p $1 "$C/$D/$F"
+      copy_file "$1" "$C/$D/$F"
     fi
   fi
 }
@@ -24,11 +34,11 @@
 restore_file() {
   local FILE=`basename "$1"`
   local DIR=`dirname "$1"`
-  if [ -e "$C/$DIR/$FILE" ]; then
+  if [ -e "$C/$DIR/$FILE" -o -L "$C/$DIR/$FILE" ]; then
     if [ ! -d "$DIR" ]; then
       mkdir -p "$DIR";
     fi
-    cp -p "$C/$DIR/$FILE" "$1";
+    copy_file "$C/$DIR/$FILE" "$1";
     if [ -n "$2" ]; then
       echo "Deleting obsolete file $2"
       rm "$2";