merge in jb-mr2-release history after reset to jb-mr2-dev
diff --git a/adb/commandline.c b/adb/commandline.c
index cbe4616..a927423 100644
--- a/adb/commandline.c
+++ b/adb/commandline.c
@@ -383,7 +383,7 @@
}
}
-int adb_download_buffer(const char *service, const void* data, int sz,
+int adb_download_buffer(const char *service, const char *fn, const void* data, int sz,
unsigned progress)
{
char buf[4096];
@@ -419,7 +419,7 @@
sz -= xfer;
ptr += xfer;
if(progress) {
- printf("sending: '%s' %4d%% \r", service, (int)(100LL - ((100LL * sz) / (total))));
+ printf("sending: '%s' %4d%% \r", fn, (int)(100LL - ((100LL * sz) / (total))));
fflush(stdout);
}
}
@@ -451,11 +451,11 @@
data = load_file(fn, &sz);
if(data == 0) {
- fprintf(stderr,"* cannot read '%s' *\n", service);
+ fprintf(stderr,"* cannot read '%s' *\n", fn);
return -1;
}
- int status = adb_download_buffer(service, data, sz, progress);
+ int status = adb_download_buffer(service, fn, data, sz, progress);
free(data);
return status;
}
diff --git a/include/sync/sw_sync.h b/include/sync/sw_sync.h
new file mode 100644
index 0000000..3bf4110
--- /dev/null
+++ b/include/sync/sw_sync.h
@@ -0,0 +1,37 @@
+/*
+ * sw_sync.h
+ *
+ * Copyright 2013 Google, Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __SYS_CORE_SW_SYNC_H
+#define __SYS_CORE_SW_SYNC_H
+
+#include "sync.h"
+
+__BEGIN_DECLS
+
+/*
+ * sw_sync is mainly intended for testing and should not be compiled into
+ * production kernels
+ */
+
+int sw_sync_timeline_create(void);
+int sw_sync_timeline_inc(int fd, unsigned count);
+int sw_sync_fence_create(int fd, const char *name, unsigned value);
+
+__END_DECLS
+
+#endif /* __SYS_CORE_SW_SYNC_H */
diff --git a/include/sync/sync.h b/include/sync/sync.h
index 918acf6..2e5d82f 100644
--- a/include/sync/sync.h
+++ b/include/sync/sync.h
@@ -49,14 +49,6 @@
struct sync_pt_info *itr);
void sync_fence_info_free(struct sync_fence_info_data *info);
-/* sw_sync is mainly inteded for testing and should not be complied into
- * production kernels
- */
-
-int sw_sync_timeline_create(void);
-int sw_sync_timeline_inc(int fd, unsigned count);
-int sw_sync_fence_create(int fd, const char *name, unsigned value);
-
__END_DECLS
#endif /* __SYS_CORE_SYNC_H */
diff --git a/rootdir/Android.mk b/rootdir/Android.mk
index 64ff522..e6887bb 100644
--- a/rootdir/Android.mk
+++ b/rootdir/Android.mk
@@ -7,25 +7,6 @@
etc/dbus.conf \
etc/hosts
-ifeq ($(TARGET_PRODUCT),full)
-copy_from += etc/vold.fstab
-endif
-
-ifeq ($(TARGET_PRODUCT),full_x86)
-copy_from += etc/vold.fstab
-endif
-
-ifeq ($(TARGET_PRODUCT),full_mips)
-copy_from += etc/vold.fstab
-endif
-
-# the /system/etc/init.goldfish.sh is needed to enable emulator support
-# in the system image. In theory, we don't need these for -user builds
-# which are device-specific. However, these builds require at the moment
-# to run the dex pre-optimization *in* the emulator. So keep the file until
-# we are capable of running dex preopt on the host.
-#
-copy_from += etc/init.goldfish.sh
copy_to := $(addprefix $(TARGET_OUT)/,$(copy_from))
copy_from := $(addprefix $(LOCAL_PATH)/,$(copy_from))
@@ -56,20 +37,6 @@
# init.usb.rc is handled by build/target/product/core.rc
-# Just like /system/etc/init.goldfish.sh, the /init.godlfish.rc is here
-# to allow -user builds to properly run the dex pre-optimization pass in
-# the emulator.
-file := $(TARGET_ROOT_OUT)/init.goldfish.rc
-$(file) : $(LOCAL_PATH)/etc/init.goldfish.rc | $(ACP)
- $(transform-prebuilt-to-target)
-ALL_PREBUILT += $(file)
-$(INSTALLED_RAMDISK_TARGET): $(file)
-
-file := $(TARGET_ROOT_OUT)/ueventd.goldfish.rc
-$(file) : $(LOCAL_PATH)/etc/ueventd.goldfish.rc | $(ACP)
- $(transform-prebuilt-to-target)
-ALL_PREBUILT += $(file)
-$(INSTALLED_RAMDISK_TARGET): $(file)
# create some directories (some are mount points)
DIRS := $(addprefix $(TARGET_ROOT_OUT)/, \
diff --git a/rootdir/etc/init.goldfish.rc b/rootdir/etc/init.goldfish.rc
deleted file mode 100644
index a0c1c4f..0000000
--- a/rootdir/etc/init.goldfish.rc
+++ /dev/null
@@ -1,82 +0,0 @@
-on early-init
- export EXTERNAL_STORAGE /mnt/sdcard
- mkdir /mnt/sdcard 0000 system system
- # for backwards compatibility
- symlink /mnt/sdcard /sdcard
-
-on boot
- setsebool in_qemu 1
- restorecon /sys/qemu_trace/process_name
- restorecon /sys/qemu_trace/state
- restorecon /sys/qemu_trace/symbol
- setprop ARGH ARGH
- setprop net.eth0.gw 10.0.2.2
- setprop net.eth0.dns1 10.0.2.3
- setprop net.gprs.local-ip 10.0.2.15
- setprop ro.radio.use-ppp no
- setprop ro.build.product generic
- setprop ro.product.device generic
-
-# fake some battery state
- setprop status.battery.state Slow
- setprop status.battery.level 5
- setprop status.battery.level_raw 50
- setprop status.battery.level_scale 9
-
-# disable some daemons the emulator doesn't want
- stop dund
- stop akmd
-
-# start essential services
- start qemud
- start goldfish-logcat
- start goldfish-setup
-
- setprop ro.setupwizard.mode EMULATOR
-
-# enable Google-specific location features,
-# like NetworkLocationProvider and LocationCollector
- setprop ro.com.google.locationfeatures 1
-
-# For the emulator, which bypasses Setup Wizard, you can specify
-# account info for the device via these two properties. Google
-# Login Service will insert these accounts into the database when
-# it is created (ie, after a data wipe).
-#
-# setprop ro.config.hosted_account username@hosteddomain.org:password
-# setprop ro.config.google_account username@gmail.com:password
-#
-# You MUST have a Google account on the device, and you MAY
-# additionally have a hosted account. No other configuration is
-# supported, and arbitrary breakage may result if you specify
-# something else.
-
-service goldfish-setup /system/etc/init.goldfish.sh
- user root
- group root
- oneshot
-
-# The qemu-props program is used to set various system
-# properties on boot. It must be run early during the boot
-# process to avoid race conditions with other daemons that
-# might read them (e.g. surface flinger), so define it in
-# class 'core'
-#
-service qemu-props /system/bin/qemu-props
- class core
- user root
- group root
- oneshot
-
-service qemud /system/bin/qemud
- socket qemud stream 666
- oneshot
-
-# -Q is a special logcat option that forces the
-# program to check wether it runs on the emulator
-# if it does, it redirects its output to the device
-# named by the androidboot.console kernel option
-# if not, is simply exits immediately
-
-service goldfish-logcat /system/bin/logcat -Q
- oneshot
diff --git a/rootdir/etc/init.goldfish.sh b/rootdir/etc/init.goldfish.sh
deleted file mode 100755
index ece75b4..0000000
--- a/rootdir/etc/init.goldfish.sh
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/system/bin/sh
-
-# Setup networking when boot starts
-ifconfig eth0 10.0.2.15 netmask 255.255.255.0 up
-route add default gw 10.0.2.2 dev eth0
-
-# ro.kernel.android.qemud is normally set when we
-# want the RIL (radio interface layer) to talk to
-# the emulated modem through qemud.
-#
-# However, this will be undefined in two cases:
-#
-# - When we want the RIL to talk directly to a guest
-# serial device that is connected to a host serial
-# device by the emulator.
-#
-# - We don't want to use the RIL but the VM-based
-# modem emulation that runs inside the guest system
-# instead.
-#
-# The following detects the latter case and sets up the
-# system for it.
-#
-qemud=`getprop ro.kernel.android.qemud`
-case "$qemud" in
- "")
- radio_ril=`getprop ro.kernel.android.ril`
- case "$radio_ril" in
- "")
- # no need for the radio interface daemon
- # telephony is entirely emulated in Java
- setprop ro.radio.noril yes
- stop ril-daemon
- ;;
- esac
- ;;
-esac
-
-# Setup additionnal DNS servers if needed
-num_dns=`getprop ro.kernel.ndns`
-case "$num_dns" in
- 2) setprop net.eth0.dns2 10.0.2.4
- ;;
- 3) setprop net.eth0.dns2 10.0.2.4
- setprop net.eth0.dns3 10.0.2.5
- ;;
- 4) setprop net.eth0.dns2 10.0.2.4
- setprop net.eth0.dns3 10.0.2.5
- setprop net.eth0.dns4 10.0.2.6
- ;;
-esac
-
-# disable boot animation for a faster boot sequence when needed
-boot_anim=`getprop ro.kernel.android.bootanim`
-case "$boot_anim" in
- 0) setprop debug.sf.nobootanimation 1
- ;;
-esac
-
-# set up the second interface (for inter-emulator connections)
-# if required
-my_ip=`getprop net.shared_net_ip`
-case "$my_ip" in
- "")
- ;;
- *) ifconfig eth1 "$my_ip" netmask 255.255.255.0 up
- ;;
-esac
diff --git a/rootdir/etc/ueventd.goldfish.rc b/rootdir/etc/ueventd.goldfish.rc
deleted file mode 100644
index 8de7049..0000000
--- a/rootdir/etc/ueventd.goldfish.rc
+++ /dev/null
@@ -1,5 +0,0 @@
-# These settings are specific to running under the Android emulator
-/dev/qemu_trace 0666 system system
-/dev/qemu_pipe 0666 system system
-/dev/ttyS* 0666 system system
-/proc 0666 system system
diff --git a/rootdir/etc/vold.fstab b/rootdir/etc/vold.fstab
deleted file mode 100644
index 4aad8dc..0000000
--- a/rootdir/etc/vold.fstab
+++ /dev/null
@@ -1,24 +0,0 @@
-## Vold 2.0 Generic fstab
-## - San Mehat (san@android.com)
-##
-
-#######################
-## Regular device mount
-##
-## Format: dev_mount <label> <mount_point> <part> <sysfs_path1...>
-## label - Label for the volume
-## mount_point - Where the volume will be mounted
-## part - Partition # (1 based), or 'auto' for first usable partition.
-## <sysfs_path> - List of sysfs paths to source devices
-######################
-
-## Example of a standard sdcard mount for the emulator / Dream
-# Mounts the first usable partition of the specified device
-dev_mount sdcard /mnt/sdcard auto /devices/platform/goldfish_mmc.0 /devices/platform/msm_sdcc.2/mmc_host/mmc1
-
-## Example of a dual card setup
-# dev_mount left_sdcard /sdcard1 auto /devices/platform/goldfish_mmc.0 /devices/platform/msm_sdcc.2/mmc_host/mmc1
-# dev_mount right_sdcard /sdcard2 auto /devices/platform/goldfish_mmc.1 /devices/platform/msm_sdcc.3/mmc_host/mmc1
-
-## Example of specifying a specific partition for mounts
-# dev_mount sdcard /sdcard 2 /devices/platform/goldfish_mmc.0 /devices/platform/msm_sdcc.2/mmc_host/mmc1
diff --git a/run-as/Android.mk b/run-as/Android.mk
index 043cc3a..a8f2885 100644
--- a/run-as/Android.mk
+++ b/run-as/Android.mk
@@ -3,6 +3,8 @@
LOCAL_SRC_FILES:= run-as.c package.c
+LOCAL_SHARED_LIBRARIES := libselinux
+
LOCAL_MODULE:= run-as
include $(BUILD_EXECUTABLE)
diff --git a/run-as/run-as.c b/run-as/run-as.c
index 20e1530..9eb09ae 100644
--- a/run-as/run-as.c
+++ b/run-as/run-as.c
@@ -29,6 +29,7 @@
#include <time.h>
#include <stdarg.h>
+#include <selinux/android.h>
#include <private/android_filesystem_config.h>
#include "package.h"
@@ -162,6 +163,11 @@
return 1;
}
+ if (selinux_android_setcontext(uid, 0, NULL, pkgname) < 0) {
+ panic("Could not set SELinux security context: %s\n", strerror(errno));
+ return 1;
+ }
+
/* User specified command for exec. */
if (argc >= 3 ) {
if (execvp(argv[2], argv+2) < 0) {