[Galaxy S III Mini Original Android Development] Android-Andi:
Hey together!

Found some time for golden, not much, but a littlebit :)

Did some work on kernel:

Debloating

Remove unused Boards: remove CODINA , JANICE, KYLE and GAVINI

Remove leftover from RICCO and VENUS

Revert unneded DTB changes

fix a buildwarning in drivers/usb/gadget/android.c

Security

vfs: new internal helper: mnt_has_parent(mnt) (CVE-2014-7970)

vfs: more mnt_parent cleanups … (CVE-2014-7970)

mnt: Prevent pivot_root from creating a loop in the mount tree (fixes CVE-2014-7970)

SELinux: Fix possible NULL pointer dereference in selinux_inode_permission()

selinux: fix sel_netnode_insert() suspicious rcu dereference

selinux: use GFP_ATOMIC under spin_lock

SELinux: if sel_make_bools errors don't leave inconsistent state

SELinux: include definition of new capabilities

SELinux set to permissive on CMD_LINE

On device side i did some changes for TWRP:

ADB access on Windows should be fixed now

MTP seems to work fine in recovery :)

I started working on some SELinux rules, but it seems to be a long way until we can get it booting on selinux enforce.

Package Complete: /ssd1/out/lp5.1/target/product/golden/Slim-golden-5.1.1.beta.0.9-UNOFFICIAL-20151023-0017.zip

#### make completed successfully (14:53 (mm:ss)) ####

Now the ugly part:

It's uploading :p maybe can't publish tonight, but at least after sleep :)

Have a good night!

And before i forget:

Some maybe build on their own in the past and also run into the following issue, if "make clean" or "make clobber" wasn't used:

build/core/base_rules.mk:154: *** kernel/samsung/golden/arch/arm/boot: MODULE.TARGET.EXECUTABLES.zImage already defined by kernel/samsung/golden/arch/arm/boot. Stop.

I found out what's causing it, after i found a workaround from [MENTION=4400604]Meticulus[/MENTION]

From 3f7d860e4f6a4df9512cc0f74960f93c4bc71ba7 Mon Sep 17 00:00:00 2001
From: Meticulus <theonejohnnyd@gmail.com>
Date: Tue, 25 Feb 2014 09:46:01 -0600
Subject: [PATCH] fix: MODULE.TARGET.EXECUTABLES.zImage already defined

- The make file was symlinking to the original source location causing the
android build system to count Android.mk in the kernel source twice,
causing a build error.

Change-Id: I685fd40d8a5bad7f53ebf320ff73f87ea8033f3f
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 7a26272..29e7091 100644
--- a/Makefile
+++ b/Makefile
@@ -422,7 +422,7 @@ PHONY += outputmakefile
# output directory.
outputmakefile:
ifneq ($(KBUILD_SRC),)
-	$(Q)ln -fsn $(srctree) source
+#	$(Q)ln -fsn $(srctree) source
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile \
$(srctree) $(objtree) $(VERSION) $(PATCHLEVEL)
endif

2 ways to fix it properly:

Device side:

From 1e99120f70602376e98b845669f7b121290a9306 Mon Sep 17 00:00:00 2001
From: Andreas Blaesius <skate4life@gmx.de>
Date: Thu, 22 Oct 2015 19:50:13 +0200
Subject: [PATCH] golden: remove TARGET_USE_ST_ERICSSON_KERNEL

Samsung placed an Android.mk file inside our kernel repo which get
used if TARGET_USE_ST_ERICSSON_KERNEL := true is defined to build the
kernel as a part of Android Build.

The make file was symlinking to the original source location, causing
the android build system to count the Android.mk in the kernel source twice.
It is causing a build error if "make clean" or "make clobber" aren't used
before rebuilding the rom/kernel:
build/core/base_rules.mk:154: *** kernel/samsung/golden/arch/arm/boot: MODULE.TARGET.EXECUTABLES.zImage already defined by kernel/samsung/golden/arch/arm/boot. Stop.

Change-Id: If1b1757dcac755eb0d431ad8774fdf93dd6543c2
---
BoardConfig.mk | 1 -
1 file changed, 1 deletion(-)

diff --git a/BoardConfig.mk b/BoardConfig.mk
index 2b04bd9..c099b6f 100755
--- a/BoardConfig.mk
+++ b/BoardConfig.mk
@@ -66,7 +66,6 @@ TARGET_KERNEL_SOURCE := kernel/samsung/golden
endif
BOARD_CUSTOM_BOOTIMG_MK := device/samsung/golden/shbootimg.mk
BOARD_KERNEL_CMDLINE := "androidboot.selinux=permissive"
-TARGET_USE_ST_ERICSSON_KERNEL := true
BOARD_KERNEL_BASE := 0x00000000
BOARD_KERNEL_PAGESIZE := 2048
BOARD_MKBOOTIMG_ARGS := --ramdisk_offset 0x02000000

Kernel side

From ad98c3fe42c640d17d09430e03e99c26aef29f40 Mon Sep 17 00:00:00 2001
From: Andreas Blaesius <skate4life@gmx.de>
Date: Thu, 22 Oct 2015 20:00:38 +0200
Subject: [PATCH] golden: remove Android.mk from Kernelsource

Samsung placed an Android.mk file inside our kernel repo which get
used if TARGET_USE_ST_ERICSSON_KERNEL := true is defined to build the
kernel as a part of Android Build.

The make file was symlinking to the original source location, causing
the android build system to count the Android.mk in the kernel source twice.
It is causing a build error if "make clean" or "make clobber" aren't used
before rebuilding the rom/kernel:
build/core/base_rules.mk:154: *** kernel/samsung/golden/arch/arm/boot: MODULE.TARGET.EXECUTABLES.zImage already defined by kernel/samsung/golden/arch/arm/boot. Stop.

Change-Id: Ia6bcd1a4829ab3aa120620f0d4a93d63bfefbc07
---
Android.mk | 150 -------------------------------------------------------------
Makefile | 2 +-
2 files changed, 1 insertion(+), 151 deletions(-)
delete mode 100644 Android.mk

diff --git a/Android.mk b/Android.mk
deleted file mode 100644
index 7926e52..0000000
--- a/Android.mk
+++ /dev/null
@@ -1,150 +0,0 @@
-#Android makefile to build kernel as a part of Android Build
-ifeq ($(TARGET_USE_ST_ERICSSON_KERNEL),true)
-
-# Give other modules a nice, symbolic name to use as a dependent
-# Yes, there are modules that cannot build unless the kernel has
-# been built. Typical (only?) example: loadable kernel modules.
-.PHONY: build-kernel clean-kernel
-
-PRIVATE_KERNEL_ARGS := -C kernel ARCH=arm CROSS_COMPILE=$(CROSS_COMPILE) LOCALVERSION=$(LOCALVERSION)
-
-PRIVATE_OUT := $(abspath $(PRODUCT_OUT)/root)
-
-PRODUCT_ICS_UPG := janicexx codinaxx gavinixx
-
-# only do this if we are buidling out of tree
-ifneq ($(KERNEL_OUTPUT),)
-ifneq ($(KERNEL_OUTPUT), $(abspath $(TOP)/kernel))
-PRIVATE_KERNEL_ARGS += O=$(KERNEL_OUTPUT)
-endif
-else
-KERNEL_OUTPUT := $(call my-dir)
-endif
-
-build-kernel: $(PRODUCT_OUT)/zImage
-
-# Include kernel in the Android build system
-include $(CLEAR_VARS)
-
-KERNEL_LIBPATH := $(KERNEL_OUTPUT)/arch/arm/boot
-LOCAL_PATH := $(KERNEL_LIBPATH)
-LOCAL_SRC_FILES := zImage
-LOCAL_MODULE := $(LOCAL_SRC_FILES)
-LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE_CLASS := EXECUTABLES
-LOCAL_MODULE_PATH := $(PRODUCT_OUT)
-
-include $(BUILD_PREBUILT)
-
-include $(CLEAR_VARS)
-KERNEL_LIBPATH := $(KERNEL_OUTPUT)
-LOCAL_PATH := $(KERNEL_LIBPATH)
-LOCAL_SRC_FILES := vmlinux
-LOCAL_MODULE := $(LOCAL_SRC_FILES)
-LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE_CLASS := EXECUTABLES
-LOCAL_MODULE_PATH := $(PRODUCT_OUT)
-$(KERNEL_LIBPATH)/$(LOCAL_SRC_FILES): build-kernel
-include $(BUILD_PREBUILT)
-# Configures, builds and installs the kernel. KERNEL_DEFCONFIG usually
-# comes from the BoardConfig.mk file, but can be overridden on the
-# command line or by an environment variable.
-# If KERNEL_DEFCONFIG is set to 'local', configuration is skipped.
-# This is useful if you want to play with your own, custom configuration.
-
-#iifeq ($(ONE_SHOT_MAKEFILE),)
-#$(KERNEL_OUTPUT)/arch/arm/boot/uImage: $(UBOOT_OUTPUT)/tools/mkimage FORCE
-#else
-$(KERNEL_OUTPUT)/arch/arm/boot/zImage: FORCE
-#endif
-
-# only do this if we are buidling out of tree
-ifneq ($(KERNEL_OUTPUT),)
-ifneq ($(KERNEL_OUTPUT), $(abspath $(TOP)/kernel))
-	@mkdir -p $(KERNEL_OUTPUT)
-endif
-endif
-
-ifeq ($(KERNEL_DEFCONFIG),local)
-	@echo Skipping kernel configuration, KERNEL_DEFCONFIG set to local
-else
-	$(MAKE) $(PRIVATE_KERNEL_ARGS) $(KERNEL_DEFCONFIG)
-endif
-
-ifeq ($(SEC_PRODUCT_SHIP),true)
-	kernel/scripts/config --file $(KERNEL_OUTPUT)/.config \
-	--enable CONFIG_SAMSUNG_PRODUCT_SHIP
-endif
-
-ifeq ($(SEC_DEBUG_LEVEL),high)
-	kernel/scripts/config --file $(KERNEL_OUTPUT)/.config \
-	--set-val CONFIG_SEC_DEBUG_LEVEL 2
-else
-ifeq ($(SEC_DEBUG_LEVEL),low)
-	kernel/scripts/config --file $(KERNEL_OUTPUT)/.config \
-	--set-val CONFIG_SEC_DEBUG_LEVEL 0
-endif
-endif
-# Disable SHRM Signature verification feature from here
-ifeq ($(SHRM_ENABLE_FEATURE_SIGNATURE_VERIFICATION),false)
-	kernel/scripts/config --file $(KERNEL_OUTPUT)/.config \
-	--disable CONFIG_U8500_SHRM_ENABLE_FEATURE_SIGNATURE_VERIFICATION
-endif
-
-ifneq ($(findstring $(TARGET_PRODUCT), $(PRODUCT_ICS_UPG)),)
-	kernel/scripts/config --file $(KERNEL_OUTPUT)/.config \
-	--set-str CONFIG_INITRAMFS_SOURCE "$(abspath $(TOP)/$(TARGET_ROOT_OUT))" \
-	--set-val CONFIG_INITRAMFS_ROOT_UID 0 \
-	--set-val CONFIG_INITRAMFS_ROOT_GID 0 \
-	--enable CONFIG_INITRAMFS_COMPRESSION_NONE \
-	--disable CONFIG_INITRAMFS_COMPRESSION_GZIP
-endif
-	$(MAKE) $(PRIVATE_KERNEL_ARGS) zImage
-ifeq ($(KERNEL_NO_MODULES),)
-	$(MAKE) $(PRIVATE_KERNEL_ARGS) modules
-	$(MAKE) $(PRIVATE_KERNEL_ARGS) INSTALL_MOD_PATH:=$(PRIVATE_OUT) modules_install
-else
-	@echo Skipping building of kernel modules, KERNEL_NO_MODULES set
-endif
-	cp -u $(KERNEL_OUTPUT)/vmlinux $(PRODUCT_OUT)
-
-build-kernel2: build-kernel init-symlinks
-	$(MAKE) bootimage
-	$(MAKE) recoveryimage
-
-build-kernel3: build-kernel ramdisk init-symlinks recoveryimage
-	kernel/scripts/config --file $(KERNEL_OUTPUT)/.config \
-	--set-str CONFIG_INITRAMFS_SOURCE "$(abspath $(TOP)/$(TARGET_ROOT_OUT))" \
-	--set-val CONFIG_INITRAMFS_ROOT_UID 0 \
-	--set-val CONFIG_INITRAMFS_ROOT_GID 0 \
-	--enable CONFIG_INITRAMFS_COMPRESSION_NONE \
-	--disable CONFIG_INITRAMFS_COMPRESSION_GZIP
-	$(MAKE) $(PRIVATE_KERNEL_ARGS) zImage
-	cd $(KERNEL_OUTPUT)/arch/arm/boot; \
-	cp -f zImage kernel.bin; \
-	cp -f zImage $(abspath $(PRODUCT_OUT)); \
-	cp -f zImage $(abspath $(PRODUCT_OUT))/kernel.bin; \
-	cp -f zImage $(abspath $(PRODUCT_OUT))/kernel2.bin; \
-	tar cvf $(abspath $(PRODUCT_OUT))/kernel.tar kernel.bin
-
-# Configures and runs menuconfig on the kernel based on
-# KERNEL_DEFCONFIG given on commandline or in BoardConfig.mk.
-# The build after running menuconfig must be run with
-# KERNEL_DEFCONFIG=local to not override the configuration modification done.
-
-menuconfig-kernel:
-# only do this if we are buidling out of tree
-ifneq ($(KERNEL_OUTPUT),)
-ifneq ($(KERNEL_OUTPUT), $(abspath $(TOP)/kernel))
-	@mkdir -p $(KERNEL_OUTPUT)
-endif
-endif
-
-	$(MAKE) $(PRIVATE_KERNEL_ARGS) $(KERNEL_DEFCONFIG)
-	$(MAKE) $(PRIVATE_KERNEL_ARGS) menuconfig
-
-clean clobber : clean-kernel
-
-clean-kernel:
-	$(MAKE) $(PRIVATE_KERNEL_ARGS) clean
-endif