Tizen Porting Guide on QRD8916

From Tizen Wiki
Jump to: navigation, search

Contents

About QRD8916

QRD8916 is a reference design for Qualcomm® Snapdragon™ 410 processor.

The Qualcomm® Snapdragon™ 410 processor, 32-bit and 64-bit capable, support CAT4 4G LTE.

Key Features

CPU Quad-core ARM® Cortex™ A53 at up to 1.4 GHz per core
GPU Adreno 306 GPU
DSP Hexagon™ V50 DSP (up to 700MHz) Shared Modem & App DSP
Modem Integrated 4G LTE World Mode, supporting LTE FDD, LTE TDD, WCDMA (DC-HSPA+, DC-HSUPA), CDMA1x, EV-DO Rev. B, TD- SCDMA and GSM/EDGECAT4 speeds of up to 150 Mbps

3rd Generation integrated LTE modem, with support for LTE-Broadcast and LTE multimode multi-SIM (TSTS, DSDA and DSDS)

RF 3rd gen power efficient LTE multimode transceiver with Qualcomm RF360 Front End solution for world mode bands, lower power and PCB reduction
USB USB 2.0
Bluetooth BT4.0 Integrated digital core
WiFi 1-stream 802.11n Integrated digital core
GPS Qualcomm® IZat™ Gen8C
Video/Audio 1080p HD video playback and capture with H.264 (AVC)

720p playback with H.265 (HEVC)

DASH is supported

Camera Up to 13.5MP
Display WUXGA (1920x1200) + 720p external display
Memory/ Storage LPDDR2/3 533MHz Single-channel 32-bit (4.2GBps) non-POP/ eMMC 4.51 SD 3.0 (UHS-I)
Process Technology 28nm LP

Hardware

Target device: QRD8916 reference design

Development Machine: PC with Ubuntu 12.04 LTS

Software

Development Environment: Ubuntu 12.04 LTS (AMD64)

Development Environment: Ubuntu 12.04 LTS (AMD64)Please install the following packages:android-tools-fastbootandroid-tools-adb

sudo apt-get install android-tools-fastboot

sudo apt-get install android-tools-adb

Add SDB udev rules on Ubuntu 12.04

Edit file /etc/udev/rules.d/51-android.rules

Add the following line:

SUBSYSTEM=="usb" ATTR{idVendor}=="04e8", MODE="0666", GROUP="plugdev"

Source code

QRD8916 Android source code:

https://www.codeaurora.org/xwiki/bin/QAEP/release


QRD8916 Modem source code:

https://chipcode.qti.qualcomm.com/


Tizen version 2.2 source code:

https://review.tizen.org/git/


Note: To build QRD8916 Android image from source, you should get three parts of code from Qualcomm.

  1. Android open source code which can be downloaded from https://www.codeaurora.org/xwiki/bin/QAEP/release
  1. Qualcomm’s proprietary source code which can be downloaded from https://chipcode.qti.qualcomm.com/. You should get license from Qualcomm.
  2. Qualcomm’s None High Level OS source code which can be downloaded from https://chipcode.qti.qualcomm.com/. You should get license from Qualcomm.

The following are the versions of source code in this porting case:


Date Tag/Build ID Chipset Manifest Android Version
July 31, 2014 LNX.LA.3.7.2-01110-8x16.0 msm8916_32 LNX.LA.3.7.2-01110-8x16.0.xml 04.04.04

All patches and binaries are available on website:

https://github.com/qrd8916tizen

https://github.com/bulaimey/QRD8916-Tizen/tree/master/Image0325 (latest binaries)

Download

Download Tizen ver2.2 source code:

$ repo init -u ssh://<Gerrit_Username>@review.tizen.org:29418/scm/manifest -b tizen_2.2

$ repo sync


Download QRD8916 Android source code:

$ repo init -u git://codeaurora.org/platform/manifest.git -b release -m LNX.LA.3.7.2-01110-8x16.0.xml --repo-url=git://codeaurora.org/tools/repo.git --repo-branch=caf-stable

$ repo sync

Reuse QRD8916 Android code

To keep Qualcomm QRD8916’s subsystem such as modem, wcnss, rpm, trustzone works normally, you should not change these subsystems’ code and you should keep these partitions as they used to be. So we reused most of these components:

Reused QRD8916 android BSP include boot loader, kernel, modem BSP.

Reused lk as bootloader.

Reused Android’s boot.img as Tizen’s kernel image

Reused Qualcomm's QRD8916's official linux kernel as Tizen linux kernel.

Keep Qualcomm's modem BSP as it is. We do not modify any modem code.


Replace android system image with tizen platform image.

Replace android userdata image with tizen data image.

Replace android cache image with tizen ums image.


Partition overview


Block device Mount point Tizen image Partition name
mmcblk0p23 / platform.simg system
mmcblk0p27 /opt data.simg userdata
mmcblk0p25 /opt/usr ums.simg cache
mmcblk0p22 N/A boot.img boot

Note: Because the QUALCOMM tool (QPST) is mandatory to change partition size, external developer might not use the media app.

Prepare Android image

Modify Android source code

Modify kernel command line

File: android/device/qcom/msm8916_32/BoardConfig.mk

Form

BOARD_KERNEL_CMDLINE := console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3 androidboot.bootdevice=7824900.sdhci

To:

BOARD_KERNEL_CMDLINE := console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3 androidboot.bootdevice=7824900.sdhci debug root=/dev/mmcblk0p23 rootfstype=ext4 rw


Note: We use /dev/mmcblk0p23 as root device of tizen.


Modify Linux kernel configuration

Please apply the following patch

[#_Kernel_configuration_patch Kernel configuration patch]

https://github.com/qrd8916tizen/TizenQRD8916/blob/master/android/kernel/kernel.patch

We do not use ramdisk as root device on QRD8916 Tizen. So the following kernel configuration should be commented.

# CONFIG_BLK_DEV_INITRD is not set

# CONFIG_BLK_DEV_RAM is not set

Tizen's udevd is different from android's ueventd. To enable udev feature on Tizen, we must enable the following kernel configuration:

CONFIG_DEVTMPFS=y

CONFIG_DEVTMPFS_MOUNT=y

CONFIG_AUTOFS4_FS=y

The above kernel configurations on QRD8916 Android are not set by default. So we must enable them on Tizen.

To enable SMACK in kernel space, the following kernel configurations should be enabled:

CONFIG_TMPFS_XATTR=y

CONFIG_NETLABEL=y

CONFIG_SECURITY_SMACK=y


Enable virtual key of QRD8916

QRD8916 has tree virtual keys at the bottom of the touch screen: menu key, home key, back key from left to right. We map these keys to phone key, menu(home) key, back key on Tizen.

In QRD8916 Android, virtual keys are recognized by Android HAL layer. But in Tizen, kernel driver has the responsibility to report virtual key events to input event interface.

To enable virtual key on Tizen, please apply the following patch:

[#_Touchscreen_patch Touchscreen kernel patch]

https://github.com/qrd8916tizen/TizenQRD8916/blob/master/android/kernel/kernel.patch

Known issue: “Menu” and “Back” keys are not responding in some applications.

Fix eMMC driver bug

You may get eMMC error information on RPMB partition like this on Tizen:


mmc0: Got data interrupt 0x00000002 even though no data operation was in progress.

mmcblk0rpmb: error -110 transferring data, sector 8064, nr 8, cmd response 0x900, card status 0xb00

mmcblk0rpmb: retrying using single block read

mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900

mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900

mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900

mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900

mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900

mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900

end_request: I/O error, dev mmcblk0rpmb, sector 8064

Buffer I/O error on device mmcblk0rpmb, logical block 1008

Please apply the following patch to fix the bug:

[#_eMMC_kernel_patch eMMC kernel patch]

https://github.com/qrd8916tizen/TizenQRD8916/blob/master/android/kernel/kernel.patch

Note:

This error is caused by the following fact:

Newer eMMC flash devices have a small partition (several megabytes) that is used to store OEM security keys (for things like DRM or encrypting private app data under something like Android). Linux implements support for the Replay Protected Memory Block partition in the form of ioctls. It's a pretty raw access layer, most of the implementation on these devices rightfully lives in userland instead of the kernel.


Enable sdb support in kernel space

Android Linux kernel does not support sdb. So we should add sdb kernel driver in kernel space.

Please apply the following patch:

[#_SDB_kernel_patch SDB kernel patch]

https://github.com/qrd8916tizen/TizenQRD8916/blob/master/android/kernel/kernel.patch

Enable Frame buffer support

QRD8916 android official code does not use /dev/graphics/fb0 as frame buffer anymore. It now uses ION device as frame buffer. So applications such as X11 which is based on traditional Linux frame buffer(/dev/fb0) does work on QRD8916. So we must revert QRD8916's driver from ION to traditional frame buffer(/dev/fb0).

Please apply the following patch.

[#_Framebuffer_kernel_patch Framebuffer kernel patch]

https://github.com/qrd8916tizen/TizenQRD8916/blob/master/android/kernel/kernel.patch

Modify android's make_ext4fs

We use android's make_ext4fs to make tizen's platform image, data image and ums image.

So we can easily flash Tizen images by executing:

fastboot flash system platform.simg

fastboot flash usedata data.simg

fastboot flash cache ums.simg

(Note: platform.simg means tizen's platform ext4 sparse image)

But Android's make_ext4fs does not support char device file node and block device file node.

Also, Android's make_ext4fs will change file's user id and group id to 0(root) by default. This will cause file access permission error on Tizen.

So please apply the following patch to android/system/extras

[#_Android_make_ext4fs_patch Android make_ext4fs patch]

https://github.com/qrd8916tizen/TizenQRD8916/blob/master/android/system/extras/extras.patch

Build QRD8916 android image

source build/envsetup.sh

choosecombo


Build type choices are:

1. release

2. debug


Which would you like? [1]

please select release.

Which product would you like? [full]msm8916_32

please input your product's real type and press enter key.(Let's use msm8916_32 for example)


Variant choices are:

1. user

2. userdebug

3. eng

Which would you like? [eng]

please select eng.

The following is android build configuration

============================================


PLATFORM_VERSION_CODENAME=REL

PLATFORM_VERSION=4.4.4

TARGET_PRODUCT=msm8916_32

TARGET_BUILD_VARIANT=eng

TARGET_BUILD_TYPE=release

TARGET_BUILD_APPS=

TARGET_ARCH=arm

TARGET_ARCH_VARIANT=armv7-a-neon

TARGET_CPU_VARIANT=cortex-a53

HOST_ARCH=x86

HOST_OS=linux

HOST_OS_EXTRA=Linux-xxx-generic-x86_64-with-Ubuntu-12.04-xxx

HOST_BUILD_TYPE=release

BUILD_ID=KTU84P

OUT_DIR=out

============================================

Then execute the follow command:

make bootimage

make make_ext4fs

Note:To bring up modem subsystem, you should build more targets than bootimage.


Prepare Tizen image

Modify Tizen source code

Add xorg-x11-drv-fbdev package

Download xorg-x11-drv-fbdev source code from the following URL:

https://review.tizen.org/git/?p=adaptation/xorg-x11-drv-fbdev.git;a=snapshot;h=058339261bffc3be6ddd65fae5cbb98d92e52f1a;sf=tgz


Extract it in tizen/adaptation/xorg/driver directory.

Please apply the following patch:

[#_Tizen_xorg-x11-drv-fbdev_patch Tizen xorg-x11-drv-fbdev patch]

https://github.com/qrd8916tizen/TizenQRD8916/blob/master/tizen/adaptation/xorg/driver/xorg-x11-drv-fbdev/xorg-x11-drv-fbdev.patch

To build xorg-x11-drv-fbdev:

cd tizen/adaptation/xorg/driver/xorg-x11-drv-fbdev

gbs build -A armv7l


Test step:

1) launch the setting app,

2) exit by back key,

3) launch the setting app again


Known issue: “Setting” app will be black screen when you second launch it.


Modify xserver-xorg-input-evdev

Modify xserver-xorg-input-evdev code to fix null point error.

Please apply the following patch:

[#_Tizen_xserver-xorg-input-evdev_patc Tizen xserver-xorg-input-evdev patch]

https://github.com/qrd8916tizen/TizenQRD8916/blob/master/tizen/adaptation/xorg/driver/xserver-xorg-input-evdev/xserver-xorg-input-evdev.patch

Modify tizen/external/systemd/packaging/systemd.spec

Modify tizen/external/systemd/packaging/systemd.spec to support console-ttyHSL0

Please apply the following patch:

[#_Tizen_systemd_patch Tizen systemd patch]

https://github.com/qrd8916tizen/TizenQRD8916/blob/master/tizen/external/systemd/systemd.patch

Note: QRD8916 android uses /dev/ttyHSL0 as serial console.


Modify tizen/framework/uifw/xorg/server/xorg-server/hw/xfree86/common/Makefile.am

Modify tizen/framework/uifw/xorg/server/xorg-server/hw/xfree86/common/Makefile.am to fix build error.

Please apply the following patch:

[#_X11_Tizen_xorg-server_hw_xfree86_co Tizen xorg-server patch]

https://github.com/qrd8916tizen/TizenQRD8916/blob/master/tizen/framework/uifw/xorg/server/xorg-server/xorg-server.patch

Modify tizen/toolchains/build/init_buildsystem

Please apply the following patch:

[#_Tizen_toolchains_build Tizen toolchains build patch]

https://github.com/qrd8916tizen/TizenQRD8916/blob/master/tizen/toolchains/build/build.patch

Add tizen/adaptation/alsa-scenario-scn-data-0-msm8x16-skui-snd-card

Make directory /tizen/adapatation/alsa-scenario-scn-data-0-msm8x16-skui-snd-card firtly,then apply the following patch:

alsa-scenario-scn-data-0-msm8x16-skui-snd-card.patch

https://github.com/qrd8916tizen/TizenQRD8916/blob/master/tizen/adaptation/alsa-scenario-scn-data-0-msm8x16-skui-snd-card/alsa-scenario-scn-data-0-msm8x16-skui-snd-card.patch

Modify tizen/framework/multimedia/pulseaudio

Remove cpu optimization,it will cause pulseaudio crash.

Please apply the following patch:

Pulseaudio.patchhttps://github.com/qrd8916tizen/TizenQRD8916/blob/master/tizen/framework/multimedia/pulseaudio/pulseaudio.patch

Modify tizen/framework/multimedia/mmfw-sysconf

Modify asound.conf,add for Qualcomm sound card.

Please apply the following patch:

Asound.patch

https://github.com/qrd8916tizen/TizenQRD8916/blob/master/tizen/framework/multimedia/mmfw-sysconf/asound.patch


Add Accelerometer sensor bma2x2

Mkdir -p adaptation/msm8916/sensor-plugins/msm-plugin-accel

Apply the following packet:

https://github.com/qrd8916tizen/TizenQRD8916/blob/master/accel-sensor/accel-sensor-bma2x2.tar.gz


Add the processor plugin, the filter plugin,and the sensor plugin

Apply the following patch:

https://github.com/qrd8916tizen/TizenQRD8916/blob/master/accel-sensor/accel-sensor-bma2x2


Add the sensor in msm8916_32.ks


+ sf-plugin-accel-bam2x2


Build Tizen Image

Install development tools

Add reposity in /etc/apt/sources.list

deb http://download.tizen.org/tools/latest-release/Ubuntu_12.04 /

gbs build –A armv7l

Install tools

sudo apt-get update

sudo apt-get install gbs mic

sudo apt-get install bmap-tools

Build Tizen source

Build all packages

cd <Tizen_Project>

Configure the default “.gbs.conf” like this:

[general]

tmpdir=/var/tmp/

profile = profile.tizen2.2

work_dir=.


[repo.tizen2.2_arm]

url=${work_dir}/pre-built/toolchain-arm/


[repo.tizen2.2_x86]

url=${work_dir}/pre-built/toolchain-x86/


[profile.tizen2.2]

repos=repo.tizen2.2_arm, repo.tizen2.2_x86

buildconf=${work_dir}/scm/meta/build-config/build.conf


exclude_packages=bash,bzip2-libs,c-ares,cmake,coreutils,diffutils,eglibc,elfutils-libelf,elfutils-libs,elfutils,fdupes,file,findutils,gawk,gmp,gzip,libacl,libattr,libcap,libcurl,libfile,libgcc,liblua,libstdc++,make,mpc,mpfr,ncurses-libs,nodejs,nspr,nss-softokn-freebl,nss,openssl,patch,popt,rpm-build,rpm-libs,rpm,sed,sqlite,tar,xz-libs,zlib,binutils,gcc

User should modify his own exclude_packages if there are some package dependent errors.

gbs build -A armv7l

Build specified package

cd <Specific_Project>

gbs build -A armv7l


Create Tizen Image

Create a ks file named msm8916_32.ks

You can also download a RD-210.ks file from tizen.org and modify it as you wish.

Please refer to [#_QRD8916_32.ks msm8916_32.ks]


Create loop format Tizen image

sudo mic create loop msm8916_32.ks

There will be three images created:

platform.img

data.img

ums.img

mount these three images in /media/platform /media/data /media/ums directories.

sudo mount -o loop ~/mic-output/platform.img /media/platform

sudo mount -o loop ~/mic-output/data.img /media/data

sudo mount -o loop ~/mic-output/ums.img /media/ums


make ext4 sparse images

sudo android/out/host/linux-x86/bin/make_ext4fs -s -l 838860800 platform.simg /media/platform

sudo android/out/host/linux-x86/bin/make_ext4fs -s -l 800000000 data.simg /media/data

sudo android/out/host/linux-x86/bin/make_ext4fs -s -l 40000000 ums.simg /media/ums

Please make sure that make_ext4fs must be the modified version which is applied with [#_Android_make_ext4fs_patch Android make_ext4fs patch]

Also, you should not use “-a” option to make Tizen images. Option “-a” will make Android’s image not Tizen’s image. The meta data of file(file owner and file mode) in Android image is controlled by

android/system/core/include/private/android_filesystem_config.h

Flash Tizen image to QRD8916

Make QRD8916 boot into fastboot mode.

Press volume down key and hold, press power key, after the vibrator vibrates, please release power key.

QRD8916 will boot into fastboot mode.

Plug a USB cable to connect QRD8916 and PC.

To make sure that QRD8916 is in fastboot mode, please execute:

$sudo fastboot devices

95575067 fastboot

If there is no device listed, QRD8916 is not in fastboot mode.

Execute the following commands when QRD8916 is in fastboot mode.

sudo fastboot flash boot boot.img

sudo fastboot erase system

sudo fastboot flash system platform.simg

sudo fastboot erase userdata

sudo fastboot flash userdata data.simg

sudo fastboot erase cache

sudo fastboot flash cache ums.simg

Please note that we must also flash boot image to Tizen, because we changed kernel code.

Before flashing platform, data, ums image to system, userdata, cache partition, please erase them first.


Reboot QRD8916 into Tizen system

sudo fastboot reboot

After QRD8916 reboots, Tizen will bring up on QRD8916

How to check kernel log and application log on Tizen

If you have an FPC(Flexible Printed Circuit board) which can be connect to QRD8916's debug port, you can use minicom or kermit as a uart console.

The debug port is on the back of QRD8916. It lies under the plastic. You have to cut some edge of plastic to make the debug port show out.

Furthermore, you need a PCB board that can trans debug port to RS232. It looks like that:

20141121 102034.jpg

QRD8916 debug port

Actually, most of developers have no these tools. For these developers, please execute sdb command to check log.

Please make sure that sdb is enabled in kernel space and user space first.

Please refer to:

Enable sdb support in kernel space

Add sdbd service

Please execute following command to check kernel log.

sdb shell

su

dmesg

Please execute following command to check application log.

sdb shell

su

dlogutil


Create kickstart file

Add platform, data, ums partitions

Three images should be created: platform, data and ums image.

So the following lines are recommended.

# ROOT fs partition

part / --size=3000 --ondisk mmcblk0p --fstype=ext4 --label=platform

# DATA partition

part /opt/ --size=3000 --ondisk mmcblk0p --fstype=ext4 --label=data

# UMS partition

part /opt/usr/ --size=3000 --ondisk mmcblk0p --fstype=ext4 --label=ums


Add repo

local repo’s priority should be higher than Tizen-main and Tizen-base’s priority.

Tizen-main and Tizen-base should be use version 2.2 repo.

repo --name=Tizen-main --baseurl=http://download.tizen.org/releases/2.2/tizen-2.2/repos/tizen-main/armv7l/packages/ --save --ssl_verify=no --priority=99

repo --name=Tizen-base --baseurl=http://download.tizen.org/releases/2.2/tizen-2.2/repos/tizen-base/armv7l/packages/ --save --ssl_verify=no --priority=99

repo --name=local --baseurl=file:///home/user/GBS-ROOT/local/repos/tizen2.2/armv7l --priority=1


Add xorg-x11-drv-fbdev package

xorg-x11-drv-fbdev should be added in %packages section.


Change /etc/fstab

Add /etc/fstab in ks file.

cat > /etc/fstab << EOF

#<file system><mount point><type><options><dump><pass>

none/procprocdefaults0 0

tmpfs /tmp tmpfs defaults 0 0

/opt/var/var bindbind0 0

none/syssysfs defaults0 0

# For new partition - 2012/08

/dev/mmcblk0p27/optext4defaults0 2

/dev/mmcblk0p25/opt/usr ext4defaults0 2

EOF


Note that mmcblk0p27’s mount point is /opt and mmcblk0p25’s mount point is /opt/usr

Change block devices in opt.mount, opt-usr.mount, -.mount

Note that block devices in these services should be changed as they really are.

In our case, opt.mount’s block device is /dev/mmcblk0p27

opt-usr.mount’s block device is /dev/mmcblk0p25

-.mount’s block device is /dev/mmcblk0p23

cat > /usr/lib/systemd/system/opt.mount << EOF

# Automaticall generated by mount-generator.pl


[Unit]

# FIXME: Is this required?

#SourcePath=/home/abuild/rpmbuild/BUILD/system-plugin-slp-0.0.1/etc/fstab

DefaultDependencies=no

Before=local-fs.target

Requires=fsck@dev-mmcblk0p27.service

After=local-fs-pre.target fsck@dev-mmcblk0p27.service resize2fs@dev-mmcblk0p27.service

Wants=resize2fs@dev-mmcblk0p27.service


[Mount]

What=/dev/mmcblk0p27

Where=/opt

Type=ext4

Options=defaults

EOF


cat > /usr/lib/systemd/system/opt-usr.mount << EOF

# Automaticall generated by mount-generator.pl


[Unit]

# FIXME: Is this required?

#SourcePath=/home/abuild/rpmbuild/BUILD/system-plugin-slp-0.0.1/etc/fstab

DefaultDependencies=no

Before=local-fs.target

Requires=fsck@dev-mmcblk0p25.service

After=local-fs-pre.target fsck@dev-mmcblk0p25.service resize2fs@dev-mmcblk0p25.service

Wants=resize2fs@dev-mmcblk0p25.service


[Mount]

What=/dev/mmcblk0p25

Where=/opt/usr

Type=ext4

Options=defaults

EOF


cat > /usr/lib/systemd/system/-.mount << EOF

# Automaticall generated by mount-generator.pl


[Unit]

# FIXME: Is this required?

#SourcePath=/home/abuild/rpmbuild/BUILD/system-plugin-slp-0.0.1/etc/fstab

DefaultDependencies=no

Before=local-fs.target

Requires=fsck-root.service

After=local-fs-pre.target fsck-root.service resize2fs-root.service

Wants=resize2fs-root.service


[Mount]

What=/dev/mmcblk0p23

Where=/

Type=ext4

Options=defaults

EOF


Change xresources.service

Note that two lines in Unit section should be commented. Because if we do not comment this two lines, xresouces.service will start up failed.

#After=tizen-runtime.target

#Requires=tizen-runtime.target


cat > /usr/lib/systemd/system/xresources.service << EOF

[Unit]

Description=Xresources

#After=tizen-runtime.target

#Requires=tizen-runtime.target


[Service]

Type=forking

#EnvironmentFile=/run/tizen-mobile-env

ExecStart=/etc/rc.d/init.d/xresources start

ExecStop=/etc/rc.d/init.d/xresources stop


[Install]

WantedBy=multi-user.target

EOF


Change /etc/X11/xorg.conf.d/display.conf

Make sure that Driver should be fbdev “Device” section

Section "Device"

Identifier "Card0"

Driver "fbdev"

Option "fbdev" "/dev/fb0"

EndSection


Change /etc/X11/xorg.conf.d/input.conf

Make sure that Option “MultiTouch” should be “5”

Section "InputClass"

Identifier "evdev touchscreen catchall"

MatchIsTouchScreen "on"

MatchDevicePath "/dev/input/event*"

Driver "evdevmultitouch"

Option "MultiTouch" "5"

EndSection


Add /usr/lib/systemd/sdbd.service

To enable sdb in user space, we should start up sdbd.service.

cat > /usr/lib/systemd/system/sdbd.service << EOF

[Unit]

Description=sdbd

After=default.target


[Service]

Type=forking

Environment=DISPLAY=:0

PIDFile=/tmp/.sdbd.pid

RemainAfterExit=yes

ExecStart=/bin/sh -c '/usr/sbin/sdbd; chmod 666 /dev/samsung_sdb; echo 0 > /sys/class/android_usb/android0/enable; echo 04E8 > /sys/class/android_usb/android0/idVendor; echo 2d00 > /sys/class/android_usb/android0/idProduct; echo sdb > /sys/class/android_usb/android0/functions; echo 1 > /sys/class/android_usb/android0/enable'

EOF

Add a symbol link to make sdbd.service start up automatically when booting.

ln -s /usr/lib/systemd/system/sdbd.service /usr/lib/systemd/system/multi-user.target.wants/sdbd.service


To enable sdb in user space, please execute the following commands

/usr/sbin/sdbd

chmod 666 /dev/samsung_sdb

echo 0 > /sys/class/android_usb/android0/enable

echo 04E8 > /sys/class/android_usb/android0/idVendor

echo 2d00 > /sys/class/android_usb/android0/idProduct

echo sdb > /sys/class/android_usb/android0/functions

echo 1 > /sys/class/android_usb/android0/enable


Add wakelock.service

This service is optional. This service can keep tizen awake all the time for demo purperse.

cat > /usr/lib/systemd/system/wakelock.service << EOF

[Unit]

Description=wakelock

After=default.target


[Service]

Type=forking

RemainAfterExit=yes

ExecStart=/bin/sh -c 'echo tizen_wakelock > /sys/power/wake_lock; echo 255 > /sys/devices/soc.0/gpio-leds.66/leds/button-backlight/brightness'

EOF


Add a symbol link to make wakelock.service start up automatically when booting.

ln -s /usr/lib/systemd/system/wakelock.service /usr/lib/systemd/system/multi-user.target.wants/wakelock.service


Disable some services when booting

There are some services which should not be startup. So we changed the service name in order to disable them simply.

mv /usr/lib/systemd/system/boot.mount /usr/lib/systemd/system/boot.mount.disable

mv /usr/lib/systemd/system/smack.mount /usr/lib/systemd/system/smack.mount.disable

mv /usr/lib/systemd/system/csa.mount /usr/lib/systemd/system/csa.mount.disable

mv /usr/lib/systemd/system/mnt-csc.mount /usr/lib/systemd/system/mnt-csc.mount.disable

mv /usr/lib/systemd/system/smack-default-labeling.service /usr/lib/systemd/system/smack-default-labeling.service.disable

mv /usr/lib/systemd/system/smack.service /usr/lib/systemd/system/smack.service.disable

mv /usr/lib/systemd/system/smack-rules.service /usr/lib/systemd/smack-rules.service.disable


Play wave file and record wave file on QRD8916

How to bring up QRD8916’s modem subsystem

To enable modem subsystem, some services must be started up first:

rmt_storage service

ueventd service

These two services are started by executing /system/bin/init.

These two services will trigger system to load firmware and bring up modem from user space.

To execute these two Android service on Tizen, we must emulte Android executing environment.

/system/bin/linker and /system/bin/init and other binaries or scripts provide Android run time executing environment.

Please apply the following patches:

[#_Android_common_patch Android common patch]

[#_Android_msm8916_32_patch Android msm8916_32 patch]

[#_Android_core_patch Android core patch]

https://github.com/qrd8916tizen/TizenQRD8916/blob/master/android/device/qcom/common/common.patch

https://github.com/qrd8916tizen/TizenQRD8916/blob/master/android/device/qcom/msm8916_32/msm8916_32.patch

https://github.com/qrd8916tizen/TizenQRD8916/blob/master/android/system/core/core.patch

Modules need to be built

Build the following android modules:

make rmt_storage

make mm-audio-ftm

make ftm_test_config

make linker

make qmi_fw.conf

make libNimsWrap

make tinymix

make tinyplay

make tinycap

Then upload boot.img to QRD8916.

sudo fastboot flash boot boot.img

Reboot QRD8916

sudo fastboot reboot

Comment the following line in /usr/lib/udev/rules.d/80-drivers.rules on Tizen

#SUBSYSTEM=="firmware", RUN+="firmware.agent"

Excute the following commands from PC side:

sdb root on

cd android/out/target/product/msm8916_32


#! /bin/sh

platform=/media/’user name’/platform


sudo mkdir -p ${platform}/system/property

sudo mkdir -p ${platform}/system/bin

sudo mkdir -p ${platform}/system/lib

sudo mkdir -p ${platform}/vendor/lib

sync


#/

sudo cp -f root/init.rc ${platform}/init.rc

sudo cp -f root/init.qcom.rc ${platform}/init.qcom.rc

sudo cp -f root/init.target.rc ${platform}/init.target.rc

sudo cp -f root/init.environ.rc ${platform}/init.environ.rc


#/bin

sudo cp -f system/bin/rmt_storage ${platform}/bin/


#/system/bin

sudo cp -f system/bin/mm-audio-ftm ${platform}/system/bin/

sudo cp -f root/init ${platform}/system/bin/

sudo cp -f root/sbin/ueventd ${platform}/system/bin/

sudo cp -f system/bin/linker ${platform}/system/bin/

sudo cp -f system/bin/tinymix ${platform}/system/bin/

sudo cp -f system/bin/tinyplay ${platform}/system/bin/


#/etc

sudo cp -f system/etc/ftm_test_config ${platform}/etc/

sudo cp -f system/etc/qmi_fw.conf ${platform}/etc/


#/vendor/lib

sudo cp -f system/vendor/lib/libdiag.so ${platform}/vendor/lib/

sudo cp -f system/vendor/lib/libNimsWrap.so ${platform}/vendor/lib/

sudo cp -f system/vendor/lib/libqmi_csi.so ${platform}/vendor/lib/

sudo cp -f system/vendor/lib/libqmi_common_so.so ${platform}/vendor/lib/

sudo cp -f system/vendor/lib/libqmi_encdec.so ${platform}/vendor/lib/


#/system/lib

sudo cp -f system/lib/libcutils.so ${platform}/system/lib/

sudo cp -f system/lib/libtinyalsa.so ${platform}/system/lib/

sudo cp -f system/lib/libdl.so ${platform}/system/lib/

sudo cp -f system/lib/libc.so ${platform}/system/lib/

sudo cp -f system/lib/libm.so ${platform}/system/lib/

sudo cp -f system/lib/liblog.so ${platform}/system/lib/

sudo cp -f system/lib/libutils.so ${platform}/system/lib/

sudo cp -f system/lib/libcorkscrew.so ${platform}/system/lib/

sudo cp -f system/lib/libgccdemangle.so ${platform}/system/lib/

sudo cp -f system/lib/libstdc++.so ${platform}/system/lib/

sudo cp -f system/lib/libselinux.so ${platform}/system/lib/


sudo chmod go-w ${platform}/init.rc

sudo chmod go-w ${platform}/init.qcom.rc

sudo chmod go-w ${platform}/init.target.rc

sudo chmod go-w ${platform}/init.environ.rc


sync

Audio testing

Start android service and bring up QRD8916’s modem:

To bring up modem, you should do some check:

  1. Make sure Android’s executable /system/bin/init starts up successfully in background.
  2. Make sure that /init.rc /init.qcom.rc /init.target.rc /init.environ.rc /system/build.prop’s file mode have no group and other writable.
  3. Make sure /system/bin/init loaded and executed /init.rc succefully.
  4. Make sure that there is a partition named “modem”(/dev/mmcblk0p1) which is mounted at /firmware as vfat format. This partition contains Qualcomm’s None High Level OS binary image files
  5. Make sure that Android’s service /system/bin/ueventd and /bin/rmt_storage are loader and start up successfully.

After the modem start up,you can use music application or command on shell to playback music.

Avsys_audio_test -c /opt/media/Sounds/Record_test

About audio record,you can only use command on shell to test it,the command is as the blow.

1. Run mm_camcorder_testsuite.

  --> you can see

 =======================================    MM_CAMCORDER_TESTSUIT =======================================    '1' Video Capture - Front Camera    '2' Video Capture - Rear Camera    '3' Audio Recording    'q' Exit =======================================

2. Press keyboard '3' for audio record

---> you can see 

 =======================================    Audio Recording =======================================    '1' Start Recording    'b' back =======================================

 

3. Press keyboard '1' for recording

--> you can see some logs about pa with this script

 

    Audio Recording =======================================    'p' Pause Recording    'c' Cancel    's' Save =======================================

4. Press keyboard 's' for saving

--> you can get the file "test_rec_audio.amr"


Enable WiFi

How to bring up WCNSS subsystem

To enable WCNSS subsystem, some services must be started up first:

rmt_storage service

ueventd service

wcnss_service

rmt_storage and ueventd service are started by executing /system/bin/init.

wcnss_service is manually started in console in this porting case.

wcnss_service will trigger system to load firmware and bring up WCNSS from user space.

To execute these two Android service on Tizen, we must emulte Android executing environment.

/system/bin/linker and /system/bin/init and other binaries or scripts provide Android run time executing environment.

Please apply the following patches:

[#_Android_common_patch Android common patch]

[#_Android_msm8916_32_patch Android msm8916_32 patch]

[#_Android_core_patch Android core patch]

[#_Android_wlan_patch Android wlan patch]

https://github.com/qrd8916tizen/TizenQRD8916/blob/master/android/device/qcom/common/common.patch

https://github.com/qrd8916tizen/TizenQRD8916/blob/master/android/device/qcom/msm8916_32/msm8916_32.patch

https://github.com/qrd8916tizen/TizenQRD8916/blob/master/android/system/core/core.patch

https://github.com/qrd8916tizen/TizenQRD8916/blob/master/android/hardware/qcom/wlan/wlan.patch


Modules need to be build

It is hard to build single target one by one because WiFi module depends on too many other modules.

The easest method is to build all Android image. Please execute the following command to build Android.

make

Then upload boot.img to QRD8916.

sudo fastboot flash boot boot.img

Reboot QRD8916

sudo fastboot reboot

Comment the following line in /usr/lib/udev/rules.d/80-drivers.rules on Tizen

#SUBSYSTEM=="firmware", RUN+="firmware.agent"

Create a file named wlan.sh.

Excute the following commands from PC side:

cat > ~/wlan.sh <<EOF

#!/bin/sh


case $1 in

"start")

echo "start wifi"

insmod /system/lib/modules/wlan.ko

;;

"stop")

echo "stop wifi"

rmmod /system/lib/modules/wlan.ko

;;

"status")

echo "show status"

;;

*)

exit 1

;;

esac

EOF


Push wlan.sh to Tizen’s /usr/bin/ directory.

sdb root on

sdb push ~/wlan.sh /usr/bin/

sdb shell chmod a+rwx /usr/bin/wlan.sh


Push other files onto Tizen.

Please execute the following command on PC side:

sdb root on

cd android/out/target/product/msm8916_32

sdb shell mkdir -p /system/property

sdb shell mkdir -p /system/bin

sdb shell mkdir -p /system/etc

sdb shell mkdir -p /vendor/lib

sdb shell mkdir -p /etc/wifi


sdb push root/init.rc /init.rc

sdb push root/init.qcom.rc /init.qcom.rc

sdb push root/init.target.rc /init.target.rc

sdb push root/init.environ.rc /init.environ.rc

sdb push root/init.qcom.sh /

sdb push root/ueventd.qcom.rc /

sdb push root/ueventd.rc /


sdb push system/bin/rmt_storage /bin/


sdb push system/etc/init.qcom.sdio.sh /system/etc

sdb push system/etc/init.qcom.post_boot.sh /system/etc

sdb push system/etc/init.crda.sh /system/etc


sdb push system/etc/init.qcom.wifi.sh /system/etc/

sdb shell chmod 0777 /system/etc/init.qcom.wifi.sh


sdb push system/lib/modules/pronto/pronto_wlan.ko /system/lib/modules/wlan.ko


sdb push system/bin/mm-audio-ftm /system/bin/

sdb push root/init /system/bin/

sdb push root/sbin/ueventd /system/bin/

sdb push system/bin/linker /system/bin/

sdb push system/bin/getprop /system/bin/

sdb push system/bin/sh /system/bin/

sdb push system/bin/wpa_cli /system/bin/

sdb push system/bin/wcnss_service /system/bin/

sdb push system/bin/qmuxd /system/bin/

sdb push system/bin/wcnss_filter /system/bin/


sdb push system/etc/ftm_test_config /etc/

sdb push system/etc/qmi_fw.conf /etc/

sdb push system/etc/wifi/wpa_supplicant_overlay.conf /etc/wifi/

sdb push system/etc/wifi/wpa_supplicant.conf /etc/wifi/


sdb push system/vendor/lib/libdiag.so /vendor/lib/

sdb push system/vendor/lib/libNimsWrap.so /vendor/lib/

sdb push system/vendor/lib/libqmi_csi.so /vendor/lib/

sdb push system/vendor/lib/libqmi_common_so.so /vendor/lib/

sdb push system/vendor/lib/libqmi_encdec.so /vendor/lib/

sdb push system/vendor/lib/libqmiservices.so /vendor/lib/

sdb push system/vendor/lib/libidl.so /vendor/lib/

sdb push system/vendor/lib/libqmi.so /vendor/lib/

sdb push system/vendor/lib/libqmi_client_qmux.so /vendor/lib/

sdb push system/vendor/lib/libdsutils.so /vendor/lib/

sdb push system/vendor/lib/libmdmdetect.so /vendor/lib/

sdb push system/vendor/lib/libqcci_legacy.so /vendor/lib/

sdb push system/vendor/lib/libconfigdb.so /vendor/lib/

sdb push system/vendor/lib/libxml.so /vendor/lib/


sdb push system/lib/libcutils.so /system/lib/

sdb push system/lib/libtinyalsa.so /system/lib/

sdb push system/lib/libdl.so /system/lib/

sdb push system/lib/libc.so /system/lib/

sdb push system/lib/libm.so /system/lib/

sdb push system/lib/liblog.so /system/lib/

sdb push system/lib/libutils.so /system/lib/

sdb push system/lib/libcorkscrew.so /system/lib/

sdb push system/lib/libgccdemangle.so /system/lib/

sdb push system/lib/libstdc++.so /system/lib/

sdb push system/lib/libselinux.so /system/lib/

sdb push system/lib/libusbhost.so /system/lib/


sdb shell mkdir -p /lib/firmware/wlan/prima/

sdb push persist/WCNSS_qcom_wlan_nv.bin /lib/firmware/wlan/prima/

sdb push system/etc/wifi/WCNSS_qcom_cfg.ini /lib/firmware/wlan/prima/

sdb push system/etc/wifi/WCNSS_qcom_cfg.ini /system/etc/wifi/

sdb push system/etc/firmware/wlan/prima/WCNSS_cfg.dat /lib/firmware/wlan/prima/


sdb shell chmod go-w /ueventd.rc

sdb shell chmod go-w /ueventd.qcom.rc

sdb shell chmod go-w /init.rc

sdb shell chmod go-w /init.qcom.rc

sdb shell chmod go-w /init.target.rc

sdb shell chmod go-w /init.environ.rc


sdb shell sync


WiFi testing

/system/bin/init &

Wait about 10 seconds for modem to bring up successfully./system/bin/wcnss_service &

Wait about 2 seconds for wcnss to bring up successfully.

Insert wlan kernel module.insmod /system/lib/modules/wlan.ko

Then enter Tizen’s Setting UI, turn on WiFi. AP will be scaned. Connect to an AP without MAC address binded.

Ping internet hosts in console. For example:

ping www.baidu.com

If it can ping the internet hosts, it means that the WiFi and internet is OK.

Play MP4 Video clips

Play MP4 Video clips by sdb shell gst-launch

Unlock Tizen lock screen.

Execute the following command in Tizen console:

sdb shell

#gst-launch filesrc location=/opt/usr/240.mp4 ! ffdemux_mov_mp4_m4a_3gp_3g2_mj2 ! ffdec_h264 ! ffmpegcolorspace ! queue ! videoflip method=1 ! queue ! autovideoconvert ! Ximagesink

After performs the command, sound and video is ok.

Play MP4 Video clips via tizen application use xvimagesink

The application "Gallery" and "My file" can list the video file,video player can demux the audio and vide,and audio is ok,we can hear the sound,but there is no picture,because we don’t support xvimagesink,we don’t port xv driver.

Why we don’t support xv dirver?

Xv driver depends on Qualcomm C2D2 library. Since the C2D library is not open-source on Qualcomm android platform,  we have not the proper C2D library for Tizen platform.so we can do nothing for it.

As the detailed, you need refer to the below information.

BTW, MSM8916’s MDP version is 5.x,  So it can not support XV mode with MDP.

 Link:

https://www.codeaurora.org/cgit/quic/xwin/xf86-video-msm/

 Source code:

 src/msm_driver.c

 

static void

MSMSetXvMode(ScrnInfoPtr pScrn, const char *str)

{

    MSMPtr pMsm = MSMPTR(pScrn);

 

    pMsm->xvMode = XV_MODE_NONE;

 

    if (!str) {

        if (pMsm->chipID == MSM_MDP_VERSION_31)

            pMsm->xvMode = XV_MODE_MDP;

#if USEC2D2

        else if (pMsm->chipID == MSM_MDP_VERSION_40)

            pMsm->xvMode = XV_MODE_C2D;

#endif

        else

            xf86DrvMsg(pScrn->scrnIndex, X_ERROR,

                                    "Cannot do accelerated XV\n");

 

        return;

    }

 

    if (!stricmp(str, "MDP")) {

        if (pMsm->chipID == MSM_MDP_VERSION_31)

            pMsm->xvMode = XV_MODE_MDP;

        else

            xf86DrvMsg(pScrn->scrnIndex, X_ERROR,

                                    "MDP XV mode is only valid for MDP 3.1\n");

    }

#if USEC2D2

    else if (!stricmp(str, "C2D"))

        pMsm->xvMode = XV_MODE_C2D;

#endif

    else {

        xf86DrvMsg(pScrn->scrnIndex, X_ERROR,

                                "Unknown or unsupported XV mode %s\n", str);

        pMsm->xvMode = XV_MODE_NONE;

    }

}

 

configure.ac

<~snip~>

if test "$C2D2" = yes; then

 

   AC_MSG_CHECKING([for C2D2])

   if test -f "${c2dprefix}/include/C2D/c2d2.h"; then

        AC_MSG_RESULT([yes])

        AC_DEFINE(USEC2D2,1,[Enable C2D 2.0 library support])

        CFLAGS="$CFLAGS -I${c2dprefix}/include"

        LDFLAGS="$LDFLAGS -L${c2dprefix}/lib"

        LIBS="$LIBS -lc2d2 -lEGL"

        C2D2=yes

   elif test -f "${c2dprefix}/include/private/C2D/c2d2.h"; then

        AC_MSG_RESULT([yes])

        AC_DEFINE(USEC2D2,1,[Enable C2D 2.0 library support])

        CFLAGS="$CFLAGS -I${c2dprefix}/include/private"

        CFLAGS="$CFLAGS -I${c2dprefix}/include/public"

        LDFLAGS="$LDFLAGS -L${c2dprefix}"

        LIBS="$LIBS -lc2d2 -lEGL"

        C2D2=yes

   else

        AC_MSG_RESULT([no])

        C2D2=no

   fi

fi

<~snip~>

Play MP4 Video clips via tizen application use ximagesink

We change xvimagesink to ximagesink,the application "Gallery" and "My file" can list the video file,video playback can work,but the video is discontinuous,and it will stop at 8th second,unless we drag the progress bar.

The below is our change.

framework\multimedia\mmfw-sysconf\mmfw-sysconf-cleansdk-target\usr\etc\mmfw_player.ini

-videosink element x = xvimagesink

+videosink element x = ximagesink

-element exclude keyword = asteriskh263

+element exclude keyword = asteriskh263,omx_


framework\multimedia\libmm-player\src\mm_player_priv.c

static int

__mmplayer_gst_create_video_pipeline(mm_player_t* player, GstCaps* caps, MMDisplaySurfaceType surface_type)

{


<~snip~>

if( player->use_video_stream ) // video stream callback, so send raw video data to application

{

<~snip~>

}

else // render video data using sink plugin like xvimagesink

{

debug_log("using videosink");


/* set video converter */

if (strlen(PLAYER_INI()->name_of_video_converter) > 0)

{

vconv_factory = PLAYER_INI()->name_of_video_converter;


if ( (player->is_nv12_tiled && (surface_type == MM_DISPLAY_SURFACE_EVAS) &&

!strcmp(PLAYER_INI()->videosink_element_evas, "evasimagesink") ) )

{

vconv_factory = "fimcconvert";

}

else if (player->is_nv12_tiled)

{

vconv_factory = NULL;

}


if (vconv_factory)

{

MMPLAYER_CREATE_ELEMENT(videobin, MMPLAYER_V_CONV, vconv_factory, "video converter", TRUE);

debug_log("using video converter: %s", vconv_factory);

}

}

+ if (strncmp(PLAYER_INI()->videosink_element_x,"ximagesink", strlen("ximagesink"))){

+ MMPLAYER_CREATE_ELEMENT(videobin, MMPLAYER_V_CONV_S, "autovideoconverter", "video converter s", TRUE);

+}

if (strncmp(PLAYER_INI()->videosink_element_x,"vaapisink", strlen("vaapisink"))){

<~snip~>

}

Framework\multimedia\libmm-player\src\include\mm_player_priv.h

enum VideoElementID

{

MMPLAYER_V_BIN = 0, /* NOTE : MMPLAYER_V_BIN should be zero */

MMPLAYER_V_FLIP,

MMPLAYER_V_CONV,

+ MMPLAYER_V_CONV_S,

MMPLAYER_V_SCALE,

MMPLAYER_V_CAPS,

MMPLAYER_V_SINK,

MMPLAYER_V_NUM

};


Patch files and script files

Kernel configuration patch

Directory: android/kernel/

diff --git a/arch/arm/configs/msm8916_defconfig b/arch/arm/configs/msm8916_defconfig

index e37223c..03e29b1 100644

--- a/arch/arm/configs/msm8916_defconfig

+++ b/arch/arm/configs/msm8916_defconfig

@@ -18,7 +18,7 @@ CONFIG_NAMESPACES=y

# CONFIG_IPC_NS is not set

# CONFIG_PID_NS is not set

CONFIG_RELAY=y

-CONFIG_BLK_DEV_INITRD=y

+# CONFIG_BLK_DEV_INITRD is not set

CONFIG_RD_BZIP2=y

CONFIG_RD_LZMA=y

CONFIG_CC_OPTIMIZE_FOR_SIZE=y

@@ -212,7 +212,7 @@ CONFIG_IPC_ROUTER_SECURITY=y

CONFIG_CMA=y

CONFIG_CMA_SIZE_MBYTES=8

CONFIG_BLK_DEV_LOOP=y

-CONFIG_BLK_DEV_RAM=y

+# CONFIG_BLK_DEV_RAM is not set

CONFIG_APDS9930=y

CONFIG_QSEECOM=y

CONFIG_SCSI=y

@@ -465,6 +465,9 @@ CONFIG_MSM_PIL_SSR_GENERIC=y

CONFIG_MSM_PIL_MSS_QDSP6V5=y

CONFIG_MSM_SCM=y

CONFIG_MEM_SHARE_QMI_SERVICE=y

+CONFIG_DEVTMPFS=y

+CONFIG_DEVTMPFS_MOUNT=y

+CONFIG_AUTOFS4_FS=y

CONFIG_EXT2_FS=y

CONFIG_EXT2_FS_XATTR=y

CONFIG_EXT3_FS=y

@@ -475,6 +478,7 @@ CONFIG_EXT4_FS_SECURITY=y

CONFIG_FUSE_FS=y

CONFIG_VFAT_FS=y

CONFIG_TMPFS=y

+CONFIG_TMPFS_XATTR=y

CONFIG_NLS_CODEPAGE_437=y

CONFIG_NLS_ASCII=y

CONFIG_NLS_ISO8859_1=y

@@ -509,8 +513,10 @@ CONFIG_DEBUG_SET_MODULE_RONX=y

CONFIG_KEYS=y

CONFIG_SECURITY=y

CONFIG_SECURITY_NETWORK=y

+CONFIG_NETLABEL=y

CONFIG_LSM_MMAP_MIN_ADDR=4096

CONFIG_SECURITY_SELINUX=y

+CONFIG_SECURITY_SMACK=y

CONFIG_CRYPTO_MD4=y

CONFIG_CRYPTO_ARC4=y

CONFIG_CRYPTO_TWOFISH=y


Touchscreen kernel patch

Directory: android/kernel/

diff --git a/drivers/input/touchscreen/ft5x06_ts.c b/drivers/input/touchscreen/ft5x06_ts.c

index b188f20..c821068 100644

--- a/drivers/input/touchscreen/ft5x06_ts.c

+++ b/drivers/input/touchscreen/ft5x06_ts.c

@@ -31,6 +31,9 @@

#include <linux/debugfs.h>

#include <linux/input/ft5x06_ts.h>


+#define FT5X06_VIRTUAL_KEY

+

+static struct input_dev *input_key_dev=NULL;

#if defined(CONFIG_FB)

#include <linux/notifier.h>

#include <linux/fb.h>

@@ -347,6 +350,11 @@ static irqreturn_t ft5x06_ts_interrupt(int irq, void *dev_id)

u8 reg = 0x00, *buf;

bool update_input = false;


+bool update_key_input = false;

+static int menudown = 0;

+static int homedown = 0;

+static int backdown = 0;

+

if (!data) {

pr_err("%s: Invalid data\n", __func__);

return IRQ_HANDLED;

@@ -382,6 +390,46 @@ static irqreturn_t ft5x06_ts_interrupt(int irq, void *dev_id)

if (!num_touches && !status && !id)

break;


+#ifdef FT5X06_VIRTUAL_KEY

+if (status == FT_TOUCH_DOWN || status == FT_TOUCH_CONTACT) {

+if ((x == 0x78) && (y == 0x384) && (menudown == 0)) {

+menudown = 1;

+input_report_key(input_key_dev, KEY_PHONE, 1);

+update_key_input=true;

+}

+if ((x == 0xf0) && (y == 0x384) && (homedown == 0)) {

+homedown = 1;

+input_report_key(input_key_dev, KEY_MENU, 1);

+update_key_input=true;

+}

+if ((x == 0x168) && (y == 0x384) && (backdown == 0 )) {

+backdown = 1;

+input_report_key(input_key_dev, KEY_BACK, 1);

+update_key_input=true;

+}

+} else {

+if ((x == 0x78) && (y == 0x384) && (menudown == 1)) {

+menudown = 0;

+input_report_key(input_key_dev, KEY_PHONE, 0);

+update_key_input=true;

+}

+ if ((x == 0xf0) && (y == 0x384) && (homedown == 1)) {

+homedown = 0;

+input_report_key(input_key_dev, KEY_MENU, 0);

+update_key_input=true;

+}

+ if ((x == 0x168) && (y == 0x384) && (backdown == 1 )) {

+backdown = 0;

+input_report_key(input_key_dev, KEY_BACK, 0);

+update_key_input=true;

+}

+}

+

+if(update_key_input)

+{

+input_sync(input_key_dev);

+}

+#endif

input_mt_slot(ip_dev, id);

if (status == FT_TOUCH_DOWN || status == FT_TOUCH_CONTACT) {

input_mt_report_slot_state(ip_dev, MT_TOOL_FINGER, 1);

@@ -1571,6 +1619,9 @@ static int ft5x06_ts_probe(struct i2c_client *client,

__set_bit(BTN_TOUCH, input_dev->keybit);

__set_bit(INPUT_PROP_DIRECT, input_dev->propbit);


+__set_bit(ABS_X, input_dev->absbit);

+__set_bit(ABS_Y, input_dev->absbit);

+

input_mt_init_slots(input_dev, pdata->num_max_touches, 0);

input_set_abs_params(input_dev, ABS_MT_POSITION_X, pdata->x_min,

pdata->x_max, 0, 0);

@@ -1583,6 +1634,29 @@ static int ft5x06_ts_probe(struct i2c_client *client,

goto free_inputdev;

}


+#ifdef FT5X06_VIRTUAL_KEY

+ input_key_dev = input_allocate_device();

+ if (!input_key_dev) {

+ dev_err(&client->dev, "failed to allocate input key device\n");

+ return -ENOMEM;

+ }

+

+ input_key_dev->name = "ft5x06_ts_kbd";

+ input_key_dev->id.bustype = BUS_I2C;

+ input_key_dev->dev.parent = &client->dev;

+

+ __set_bit(EV_KEY, input_key_dev->evbit);

+ __set_bit(BTN_TOUCH, input_key_dev->keybit);

+ __set_bit(KEY_MENU, input_key_dev->keybit);

+ __set_bit(KEY_PHONE, input_key_dev->keybit);

+ __set_bit(KEY_BACK, input_key_dev->keybit);

+ err = input_register_device(input_key_dev);

+ if (err) {

+ dev_err(&client->dev, "Input key device registration failed\n");

+ goto free_inputdev;

+ }

+

+#endif

if (pdata->power_init) {

err = pdata->power_init(true);

if (err) {

eMMC kernel patch

Directory: android/kernel/

diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c

index 6afcfca..e16ca98 100644

--- a/drivers/mmc/card/block.c

+++ b/drivers/mmc/card/block.c

@@ -3046,7 +3046,7 @@ static int mmc_blk_alloc_parts(struct mmc_card *card, struct mmc_blk_data *md)

return 0;


for (idx = 0; idx < card->nr_parts; idx++) {

-if (card->part[idx].size) {

+if (card->part[idx].size && !(card->part[idx].area_type & MMC_BLK_DATA_AREA_RPMB)) {

ret = mmc_blk_alloc_part(card, md,

card->part[idx].part_cfg,

card->part[idx].size >> 9,


SDB kernel patch

Directory: android/kernel/

diff --git a/drivers/usb/gadget/android.c b/drivers/usb/gadget/android.c

index 5f3f5af..f9f3306 100644

--- a/drivers/usb/gadget/android.c

+++ b/drivers/usb/gadget/android.c

@@ -425,7 +425,33 @@ struct functionfs_config {

struct ffs_data *data;

struct android_dev *dev;

};

+#if 1//sdb

+#include "f_sdb.c"

+static int sdb_function_init(struct android_usb_function *f,

+ struct usb_composite_dev *cdev)

+{

+ return sdb_setup(cdev);

+}

+

+static void sdb_function_cleanup(struct android_usb_function *f)

+{

+ sdb_cleanup();

+}


+static int sdb_function_bind_config(struct android_usb_function *f,

+ struct usb_configuration *c)

+{

+ return sdb_bind_config(c);

+}

+

+static struct android_usb_function sdb_function = {

+ .name = "sdb",

+ .init = sdb_function_init,

+ .cleanup = sdb_function_cleanup,

+ .bind_config = sdb_function_bind_config,

+};

+

+#endif

static int ffs_function_init(struct android_usb_function *f,

struct usb_composite_dev *cdev)

{

@@ -2571,6 +2597,7 @@ static struct android_usb_function uasp_function = {

};


static struct android_usb_function *supported_functions[] = {

+&sdb_function,

&ffs_function,

&mbim_function,

&ecm_qc_function,

diff --git a/drivers/usb/gadget/config_slp.c b/drivers/usb/gadget/config_slp.c

new file mode 100644

index 0000000..4bed0d9

--- /dev/null

+++ b/drivers/usb/gadget/config_slp.c

@@ -0,0 +1,52 @@

+/*

+ * usb/gadget/config.c -- simplify building config descriptors

+ *

+ * Copyright (C) 2003 David Brownell

+ *

+ * This program is free software; you can redistribute it and/or modify

+ * it under the terms of the GNU General Public License as published by

+ * the Free Software Foundation; either version 2 of the License, or

+ * (at your option) any later version.

+ */

+#ifndef TIZEN_USB_CONFIG_C

+#define TIZEN_USB_CONFIG_C

+#include <linux/errno.h>

+#include <linux/slab.h>

+#include <linux/kernel.h>

+#include <linux/module.h>

+#include <linux/list.h>

+#include <linux/string.h>

+#include <linux/device.h>

+

+#include <linux/usb/ch9.h>

+#include <linux/usb/gadget.h>

+#include <linux/usb/composite.h>

+

+/**

+ * usb_find_endpoint - find a copy of an endpoint descriptor

+ * @src: original vector of descriptors

+ * @copy: copy of @src

+ * @match: endpoint descriptor found in @src

+ *

+ * This returns the copy of the @match descriptor made for @copy. Its

+ * intended use is to help remembering the endpoint descriptor to use

+ * when enabling a given endpoint.

+ */

+struct usb_endpoint_descriptor *

+usb_find_endpoint(

+struct usb_descriptor_header **src,

+struct usb_descriptor_header **copy,

+struct usb_endpoint_descriptor *match

+)

+{

+while (*src) {

+if (*src == (void *) match)

+return (void *)*copy;

+src++;

+copy++;

+}

+return NULL;

+}

+EXPORT_SYMBOL_GPL(usb_find_endpoint);

+

+#endif //TIZEN_USB_CONFIG_C

diff --git a/drivers/usb/gadget/f_sdb.c b/drivers/usb/gadget/f_sdb.c

new file mode 100644

index 0000000..0c0d873

--- /dev/null

+++ b/drivers/usb/gadget/f_sdb.c

@@ -0,0 +1,768 @@

+/*

+ * Gadget Driver for Samsung SDB (based on Android ADB)

+ *

+ * Copyright (C) 2008 Google, Inc.

+ * Author: Mike Lockwood <lockwood@android.com>

+ *

+ * This software is licensed under the terms of the GNU General Public

+ * License version 2, as published by the Free Software Foundation, and

+ * may be copied, distributed, and modified under those terms.

+ *

+ * This program is distributed in the hope that it will be useful,

+ * but WITHOUT ANY WARRANTY; without even the implied warranty of

+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

+ * GNU General Public License for more details.

+ *

+ */

+

+/* #define DEBUG */

+/* #define VERBOSE_DEBUG */

+

+#include <linux/module.h>

+#include <linux/init.h>

+#include <linux/poll.h>

+#include <linux/delay.h>

+#include <linux/sched.h>

+#include <linux/wait.h>

+#include <linux/err.h>

+#include <linux/interrupt.h>

+

+#include <linux/types.h>

+#include <linux/device.h>

+#include <linux/miscdevice.h>

+

+#define SDB_BULK_BUFFER_SIZE 4096

+#include "config_slp.c"

+/* number of tx requests to allocate */

+#define SDB_TX_REQ_MAX 4

+

+static const char sdb_shortname[] = "samsung_sdb";

+static DEFINE_MUTEX(sdb_lock);

+

+struct sdb_ep_descs {

+struct usb_endpoint_descriptor*in;

+struct usb_endpoint_descriptor*out;

+};

+

+struct f_sdb {

+struct usb_function function;

+u8inf_id;

+

+struct sdb_ep_descsfs;

+struct sdb_ep_descs hs;

+

+struct usb_ep *ep_in;

+struct usb_ep *ep_out;

+

+struct list_head bulk_in_q;

+};

+

+struct sdb_dev {

+struct f_sdb *sdb_func;

+spinlock_t lock;

+

+int online;

+int error;

+

+atomic_t read_excl;

+atomic_t write_excl;

+atomic_t open_excl;

+

+struct list_head *tx_idle;

+

+wait_queue_head_t read_wq;

+wait_queue_head_t write_wq;

+

+struct usb_request *rx_req;

+int rx_done;

+};

+

+static struct usb_interface_descriptor sdb_interface_desc = {

+.bLength = USB_DT_INTERFACE_SIZE,

+.bDescriptorType = USB_DT_INTERFACE,

+/* .bInterfaceNumber= DYNAMIC */

+.bNumEndpoints = 2,

+.bInterfaceClass = 0xFF,

+.bInterfaceSubClass = 0x20,

+.bInterfaceProtocol = 0x02,

+/* .iInterface= DYNAMIC */

+};

+

+static struct usb_endpoint_descriptor sdb_fullspeed_in_desc = {

+.bLength = USB_DT_ENDPOINT_SIZE,

+.bDescriptorType = USB_DT_ENDPOINT,

+.bEndpointAddress = USB_DIR_IN,

+.bmAttributes = USB_ENDPOINT_XFER_BULK,

+/* .wMaxPacketSize set by autoconfiguration */

+};

+

+static struct usb_endpoint_descriptor sdb_fullspeed_out_desc = {

+.bLength = USB_DT_ENDPOINT_SIZE,

+.bDescriptorType = USB_DT_ENDPOINT,

+.bEndpointAddress = USB_DIR_OUT,

+.bmAttributes = USB_ENDPOINT_XFER_BULK,

+/* .wMaxPacketSize set by autoconfiguration */

+};

+

+static struct usb_descriptor_header *fs_sdb_descs[] = {

+(struct usb_descriptor_header *) &sdb_interface_desc,

+(struct usb_descriptor_header *) &sdb_fullspeed_in_desc,

+(struct usb_descriptor_header *) &sdb_fullspeed_out_desc,

+NULL,

+};

+

+static struct usb_endpoint_descriptor sdb_highspeed_in_desc = {

+.bLength = USB_DT_ENDPOINT_SIZE,

+.bDescriptorType = USB_DT_ENDPOINT,

+/* bEndpointAddress copied from sdb_fullspeed_in_desc

+during sdb_function_bind() */

+.bmAttributes = USB_ENDPOINT_XFER_BULK,

+.wMaxPacketSize = __constant_cpu_to_le16(512),

+};

+

+static struct usb_endpoint_descriptor sdb_highspeed_out_desc = {

+.bLength = USB_DT_ENDPOINT_SIZE,

+.bDescriptorType = USB_DT_ENDPOINT,

+/* bEndpointAddress copied from sdb_fullspeed_in_desc

+during sdb_function_bind() */

+.bmAttributes = USB_ENDPOINT_XFER_BULK,

+.wMaxPacketSize = __constant_cpu_to_le16(512),

+};

+

+static struct usb_descriptor_header *hs_sdb_descs[] = {

+(struct usb_descriptor_header *) &sdb_interface_desc,

+(struct usb_descriptor_header *) &sdb_highspeed_in_desc,

+(struct usb_descriptor_header *) &sdb_highspeed_out_desc,

+NULL,

+};

+

+/* string descriptors: */

+

+#define F_SDB_IDX0

+

+/* static strings, in UTF-8 */

+static struct usb_string sdb_string_defs[] = {

+[F_SDB_IDX].s = "Samsung SDB",

+{ /* ZEROES END LIST */ },

+};

+

+static struct usb_gadget_strings sdb_string_table = {

+.language =0x0409,/* en-us */

+.strings =sdb_string_defs,

+};

+

+static struct usb_gadget_strings *sdb_strings[] = {

+&sdb_string_table,

+NULL,

+};

+

+/* temporary variable used between sdb_open() and sdb_gadget_bind() */

+static struct sdb_dev *_sdb_dev;

+

+

+static inline struct f_sdb *func_to_sdb(struct usb_function *f)

+{

+return container_of(f, struct f_sdb, function);

+}

+

+

+static struct usb_request *sdb_request_new(struct usb_ep *ep, int buffer_size)

+{

+struct usb_request *req = usb_ep_alloc_request(ep, GFP_KERNEL);

+if (!req)

+return NULL;

+

+/* now allocate buffers for the requests */

+req->buf = kmalloc(buffer_size, GFP_KERNEL);

+if (!req->buf) {

+usb_ep_free_request(ep, req);

+return NULL;

+}

+

+return req;

+}

+

+static void sdb_request_free(struct usb_request *req, struct usb_ep *ep)

+{

+if (req) {

+kfree(req->buf);

+usb_ep_free_request(ep, req);

+}

+}

+

+static inline int _sdb_lock(atomic_t *excl)

+{

+if (atomic_inc_return(excl) == 1) {

+return 0;

+} else {

+atomic_dec(excl);

+return -1;

+}

+}

+

+static inline void _sdb_unlock(atomic_t *excl)

+{

+atomic_dec(excl);

+}

+

+/* add a request to the tail of a list */

+static void sdb_req_put(struct sdb_dev *dev, struct list_head *head,

+struct usb_request *req)

+{

+unsigned long flags;

+

+if (!dev || !req)

+return;

+

+spin_lock_irqsave(&dev->lock, flags);

+if (head)

+list_add_tail(&req->list, head);

+spin_unlock_irqrestore(&dev->lock, flags);

+}

+

+/* remove a request from the head of a list */

+static struct usb_request *sdb_req_get(struct sdb_dev *dev,

+struct list_head *head)

+{

+unsigned long flags;

+struct usb_request *req;

+

+if (!dev)

+return NULL;

+

+spin_lock_irqsave(&dev->lock, flags);

+if (!head)

+req = NULL;

+else {

+if (list_empty(head)) {

+req = NULL;

+} else {

+req = list_first_entry(head, struct usb_request, list);

+list_del(&req->list);

+}

+}

+spin_unlock_irqrestore(&dev->lock, flags);

+return req;

+}

+

+static void sdb_complete_in(struct usb_ep *ep, struct usb_request *req)

+{

+struct sdb_dev *dev = _sdb_dev;

+struct f_sdb *sdb_func = ep->driver_data;

+

+if (req->status != 0)

+dev->error = 1;

+

+sdb_req_put(dev, &sdb_func->bulk_in_q, req);

+wake_up(&dev->write_wq);

+}

+

+static void sdb_complete_out(struct usb_ep *ep, struct usb_request *req)

+{

+struct sdb_dev *dev = _sdb_dev;

+

+dev->rx_done = 1;

+if (req->status != 0)

+dev->error = 1;

+

+wake_up(&dev->read_wq);

+}

+

+static int sdb_create_bulk_endpoints(struct f_sdb *sdb_func,

+struct usb_endpoint_descriptor *in_desc,

+struct usb_endpoint_descriptor *out_desc)

+{

+struct usb_composite_dev *cdev = sdb_func->function.config->cdev;

+struct usb_request *req;

+struct sdb_dev *dev = _sdb_dev;

+struct usb_ep *ep;

+int i;

+

+DBG(cdev, "sdb_create_bulk_endpoints dev: %p\n", dev);

+ep = usb_ep_autoconfig(cdev->gadget, in_desc);

+if (!ep) {

+ERROR(cdev, "usb_ep_autoconfig for ep_in failed\n");

+return -ENODEV;

+}

+DBG(cdev, "usb_ep_autoconfig for ep_in got %s\n", ep->name);

+ep->driver_data = cdev;/* claim the endpoint */

+sdb_func->ep_in = ep;

+

+ep = usb_ep_autoconfig(cdev->gadget, out_desc);

+if (!ep) {

+ERROR(cdev, "usb_ep_autoconfig for ep_out failed\n");

+return -ENODEV;

+}

+DBG(cdev, "usb_ep_autoconfig for sdb ep_out got %s\n", ep->name);

+ep->driver_data = cdev;/* claim the endpoint */

+sdb_func->ep_out = ep;

+

+/* now allocate requests for our endpoints */

+req = sdb_request_new(sdb_func->ep_out, SDB_BULK_BUFFER_SIZE);

+if (!req)

+return -ENOMEM;

+req->complete = sdb_complete_out;

+dev->rx_req = req;

+

+for (i = 0; i < SDB_TX_REQ_MAX; i++) {

+req = sdb_request_new(sdb_func->ep_in, SDB_BULK_BUFFER_SIZE);

+if (!req)

+goto fail;

+req->complete = sdb_complete_in;

+sdb_req_put(dev, &sdb_func->bulk_in_q, req);

+}

+

+return 0;

+

+fail:

+while (!!(req = sdb_req_get(dev, &sdb_func->bulk_in_q)))

+sdb_request_free(req, sdb_func->ep_in);

+

+sdb_request_free(dev->rx_req, sdb_func->ep_out);

+dev->rx_req = NULL;

+

+if (sdb_func->ep_in)

+sdb_func->ep_in->driver_data = NULL;

+if (sdb_func->ep_out)

+sdb_func->ep_out->driver_data = NULL;

+

+printk(KERN_ERR "sdb_bind() could not allocate requests\n");

+return -ENOMEM;

+}

+

+static ssize_t sdb_read(struct file *fp, char __user *buf,

+size_t count, loff_t *pos)

+{

+struct sdb_dev *dev = fp->private_data;

+int r = count, xfer;

+int ret;

+

+if (count > SDB_BULK_BUFFER_SIZE)

+return -EINVAL;

+

+if (_sdb_lock(&dev->read_excl))

+return -EBUSY;

+

+/* we will block until we're online */

+while (!(dev->online || dev->error)) {

+ret = wait_event_interruptible(dev->read_wq,

+(dev->online || dev->error));

+if (ret < 0) {

+_sdb_unlock(&dev->read_excl);

+return ret;

+}

+}

+if (dev->error) {

+r = -EIO;

+goto done;

+}

+

+requeue_req:

+/* queue a request */

+mutex_lock(&sdb_lock);

+if (!dev->sdb_func || !dev->rx_req)

+ret = -ENODEV;

+else {

+dev->rx_req->length = count;

+dev->rx_done = 0;

+ret = usb_ep_queue(dev->sdb_func->ep_out,

+dev->rx_req, GFP_ATOMIC);

+}

+mutex_unlock(&sdb_lock);

+

+if (ret < 0) {

+r = -EIO;

+dev->error = 1;

+goto done;

+}

+

+/* wait for a request to complete */

+ret = wait_event_interruptible(dev->read_wq, dev->rx_done);

+if (ret < 0) {

+dev->error = 1;

+r = ret;

+goto done;

+}

+if (!dev->error) {

+/* If we got a 0-len packet, throw it back and try again. */

+if (dev->rx_req->actual == 0)

+goto requeue_req;

+

+mutex_lock(&sdb_lock);

+if (!dev->sdb_func || !dev->rx_req)

+r = -ENODEV;

+else {

+xfer = (dev->rx_req->actual < count)

+? dev->rx_req->actual : count;

+if (copy_to_user(buf, dev->rx_req->buf, xfer))

+r = -EFAULT;

+}

+mutex_unlock(&sdb_lock);

+} else

+r = -EIO;

+

+done:

+_sdb_unlock(&dev->read_excl);

+return r;

+}

+

+static ssize_t sdb_write(struct file *fp, const char __user *buf,

+ size_t count, loff_t *pos)

+{

+struct sdb_dev *dev = fp->private_data;

+struct usb_request *req = 0;

+int r = count, xfer;

+int ret;

+

+if (_sdb_lock(&dev->write_excl))

+return -EBUSY;

+

+while (count > 0) {

+if (dev->error) {

+r = -EIO;

+break;

+}

+

+/* get an idle tx request to use */

+req = 0;

+ret = wait_event_interruptible(dev->write_wq,

+(!!(req = sdb_req_get(dev, dev->tx_idle))

+ || dev->error));

+

+if (ret < 0) {

+r = ret;

+break;

+}

+

+if (req != 0) {

+if (count > SDB_BULK_BUFFER_SIZE)

+xfer = SDB_BULK_BUFFER_SIZE;

+else

+xfer = count;

+

+mutex_lock(&sdb_lock);

+if (!dev->sdb_func) {

+mutex_unlock(&sdb_lock);

+r = -ENODEV;

+break;

+} else if (copy_from_user(req->buf, buf, xfer)) {

+mutex_unlock(&sdb_lock);

+r = -EFAULT;

+break;

+}

+

+req->length = xfer;

+ret = usb_ep_queue(dev->sdb_func->ep_in,

+req, GFP_ATOMIC);

+mutex_unlock(&sdb_lock);

+

+if (ret < 0) {

+dev->error = 1;

+r = -EIO;

+break;

+}

+

+buf += xfer;

+count -= xfer;

+

+/* zero this so we don't try to free it on error exit */

+req = 0;

+}

+}

+

+if (req)

+sdb_req_put(dev, dev->tx_idle, req);

+

+_sdb_unlock(&dev->write_excl);

+return r;

+}

+

+static int sdb_open(struct inode *ip, struct file *fp)

+{

+printk(KERN_INFO "sdb_open\n");

+

+if (_sdb_lock(&_sdb_dev->open_excl))

+return -EBUSY;

+

+fp->private_data = _sdb_dev;

+

+/* clear the error latch */

+_sdb_dev->error = 0;

+

+return 0;

+}

+

+static int sdb_release(struct inode *ip, struct file *fp)

+{

+printk(KERN_INFO "sdb_release\n");

+

+if (_sdb_dev != NULL)

+_sdb_unlock(&_sdb_dev->open_excl);

+

+return 0;

+}

+

+/* file operations for SDB device /dev/samsung_sdb */

+static const struct file_operations sdb_fops = {

+.owner = THIS_MODULE,

+.read = sdb_read,

+.write = sdb_write,

+.open = sdb_open,

+.release = sdb_release,

+};

+

+static struct miscdevice sdb_device = {

+.minor = MISC_DYNAMIC_MINOR,

+.name = sdb_shortname,

+.fops = &sdb_fops,

+};

+

+static int

+sdb_function_bind(struct usb_configuration *c, struct usb_function *f)

+{

+struct usb_composite_dev *cdev = c->cdev;

+struct f_sdb *sdb_func = func_to_sdb(f);

+intid;

+intret;

+

+DBG(cdev, "sdb_function_bind sdb_func: %p\n", sdb_func);

+

+/* allocate interface ID(s) */

+id = usb_interface_id(c, f);

+if (id < 0)

+return id;

+

+sdb_func->inf_id = id;

+sdb_interface_desc.bInterfaceNumber = id;

+

+/* allocate endpoints */

+ret = sdb_create_bulk_endpoints(sdb_func, &sdb_fullspeed_in_desc,

+&sdb_fullspeed_out_desc);

+if (ret)

+return ret;

+

+f->fs_descriptors = usb_copy_descriptors(fs_sdb_descs);

+if (!f->fs_descriptors)

+goto desc_alloc_fail;

+

+sdb_func->fs.in = usb_find_endpoint(fs_sdb_descs, f->fs_descriptors,

+&sdb_fullspeed_in_desc);

+sdb_func->fs.out = usb_find_endpoint(fs_sdb_descs, f->fs_descriptors,

+&sdb_fullspeed_out_desc);

+

+/* support high speed hardware */

+if (gadget_is_dualspeed(cdev->gadget)) {

+sdb_highspeed_in_desc.bEndpointAddress =

+sdb_fullspeed_in_desc.bEndpointAddress;

+sdb_highspeed_out_desc.bEndpointAddress =

+sdb_fullspeed_out_desc.bEndpointAddress;

+

+f->hs_descriptors = usb_copy_descriptors(hs_sdb_descs);

+if (!f->hs_descriptors)

+goto desc_alloc_fail;

+

+sdb_func->hs.in = usb_find_endpoint(hs_sdb_descs,

+f->hs_descriptors, &sdb_highspeed_in_desc);

+sdb_func->hs.out = usb_find_endpoint(hs_sdb_descs,

+f->hs_descriptors, &sdb_highspeed_out_desc);

+}

+

+return 0;

+

+desc_alloc_fail:

+if (f->fs_descriptors)

+usb_free_descriptors(f->fs_descriptors);

+

+return -ENOMEM;

+}

+

+static void

+sdb_function_unbind(struct usb_configuration *c, struct usb_function *f)

+{

+struct sdb_dev *dev = _sdb_dev;

+struct f_sdb *sdb_func = func_to_sdb(f);

+struct usb_request *req;

+

+dev->online = 0;

+dev->error = 1;

+

+if (gadget_is_dualspeed(c->cdev->gadget))

+usb_free_descriptors(f->hs_descriptors);

+usb_free_descriptors(f->fs_descriptors);

+

+mutex_lock(&sdb_lock);

+

+while (!!(req = sdb_req_get(dev, &sdb_func->bulk_in_q)))

+sdb_request_free(req, sdb_func->ep_in);

+

+sdb_request_free(dev->rx_req, sdb_func->ep_out);

+

+kfree(sdb_func);

+dev->sdb_func = NULL;

+dev->rx_req = NULL;

+

+mutex_unlock(&sdb_lock);

+

+wake_up(&dev->read_wq);

+wake_up(&dev->write_wq);

+}

+

+static int sdb_function_set_alt(struct usb_function *f,

+unsigned intf, unsigned alt)

+{

+struct f_sdb *sdb_func = func_to_sdb(f);

+struct usb_composite_dev *cdev = f->config->cdev;

+struct sdb_dev *dev = _sdb_dev;

+int ret;

+

+if (sdb_func->inf_id != intf) {

+printk(KERN_ERR "sdb_function_set_alt error wrong intf:%d alt:%d\n",

+intf, alt);

+return -EINVAL;

+}

+

+if (sdb_func->ep_in->driver_data)

+usb_ep_disable(sdb_func->ep_in);

+ret = tizen_usb_ep_enable(sdb_func->ep_in,

+ep_choose(cdev->gadget,

+sdb_func->hs.in, sdb_func->fs.in));

+if (ret) {

+printk(KERN_ERR "error, usb_ep_enable for sdb ep_in\n");

+return ret;

+}

+sdb_func->ep_in->driver_data = sdb_func;

+

+if (sdb_func->ep_out->driver_data)

+usb_ep_disable(sdb_func->ep_out);

+ret = tizen_usb_ep_enable(sdb_func->ep_out,

+ep_choose(cdev->gadget,

+sdb_func->hs.out, sdb_func->fs.out));

+if (ret) {

+usb_ep_disable(sdb_func->ep_in);

+sdb_func->ep_in->driver_data = NULL;

+printk(KERN_ERR "error, usb_ep_enable for sdb ep_out\n");

+return ret;

+}

+sdb_func->ep_out->driver_data = sdb_func;

+

+dev->tx_idle = &sdb_func->bulk_in_q;

+dev->sdb_func = sdb_func;

+dev->online = 1;

+

+/* readers may be blocked waiting for us to go online */

+wake_up(&dev->read_wq);

+return 0;

+}

+

+static void sdb_function_disable(struct usb_function *f)

+{

+struct sdb_dev *dev = _sdb_dev;

+struct f_sdb *sdb_func = func_to_sdb(f);

+

+dev->online = 0;

+dev->error = 1;

+

+spin_lock(&dev->lock);

+dev->tx_idle = NULL;

+spin_unlock(&dev->lock);

+

+usb_ep_disable(sdb_func->ep_in);

+sdb_func->ep_in->driver_data = NULL;

+

+usb_ep_disable(sdb_func->ep_out);

+sdb_func->ep_out->driver_data = NULL;

+

+/* readers may be blocked waiting for us to go online */

+wake_up(&dev->read_wq);

+wake_up(&dev->write_wq);

+}

+

+static int sdb_setup(struct usb_composite_dev *cdev)

+{

+struct sdb_dev *dev;

+int ret;

+

+printk(KERN_INFO "sdb_bind_config\n");

+dev = kzalloc(sizeof(*dev), GFP_KERNEL);

+if (!dev)

+return -ENOMEM;

+

+if (sdb_string_defs[F_SDB_IDX].id == 0) {

+ret = usb_string_id(cdev);

+if (ret < 0) {

+kfree(dev);

+return ret;

+}

+sdb_string_defs[F_SDB_IDX].id = ret;

+sdb_interface_desc.iInterface = ret;

+}

+

+spin_lock_init(&dev->lock);

+

+init_waitqueue_head(&dev->read_wq);

+init_waitqueue_head(&dev->write_wq);

+

+atomic_set(&dev->open_excl, 0);

+atomic_set(&dev->read_excl, 0);

+atomic_set(&dev->write_excl, 0);

+

+

+/* _sdb_dev must be set before calling usb_gadget_register_driver */

+_sdb_dev = dev;

+

+ret = misc_register(&sdb_device);

+if (ret)

+goto err1;

+printk(".....make /dev/samsung_sdb ....minor=%d.\n",sdb_device.minor);

+return 0;

+

+err1:

+kfree(dev);

+_sdb_dev = NULL;

+printk(KERN_ERR "sdb gadget driver failed to initialize\n");

+return ret;

+}

+

+static int sdb_bind_config(struct usb_configuration *c)

+{

+int ret;

+struct f_sdb *sdb_func;

+

+if (!_sdb_dev) {

+printk(KERN_ERR "Error There is no _sdb_dev!!\n");

+return -ENODEV;

+}

+

+sdb_func = kzalloc(sizeof(*sdb_func), GFP_KERNEL);

+if (!sdb_func) {

+printk(KERN_ERR "sdb_func memory alloc failed !!!\n");

+return -ENOMEM;

+}

+

+INIT_LIST_HEAD(&sdb_func->bulk_in_q);

+

+sdb_func->function.name = "sdb";

+sdb_func->function.strings = sdb_strings;

+sdb_func->function.bind = sdb_function_bind;

+sdb_func->function.unbind = sdb_function_unbind;

+sdb_func->function.set_alt = sdb_function_set_alt;

+sdb_func->function.disable = sdb_function_disable;

+

+ret = usb_add_function(c, &sdb_func->function);

+if (ret)

+printk(KERN_ERR "Error in usb_add_function failed for sdb\n");

+

+return ret;

+}

+

+static void sdb_cleanup(void)

+{

+struct sdb_dev*dev = _sdb_dev;

+

+misc_deregister(&sdb_device);

+

+if (!dev)

+return;

+_sdb_dev = NULL;

+kfree(dev);

+}

diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h

index 210da33..2b09c8c 100644

--- a/include/linux/usb/composite.h

+++ b/include/linux/usb/composite.h

@@ -172,6 +172,20 @@ int usb_function_activate(struct usb_function *);


int usb_interface_id(struct usb_configuration *, struct usb_function *);


+/**

+ * ep_choose - select descriptor endpoint at current device speed

+ * @g: gadget, connected and running at some speed

+ * @hs: descriptor to use for high speed operation

+ * @fs: descriptor to use for full or low speed operation

+ */

+static inline struct usb_endpoint_descriptor *

+ep_choose(struct usb_gadget *g, struct usb_endpoint_descriptor *hs,

+struct usb_endpoint_descriptor *fs)

+{

+if (gadget_is_dualspeed(g) && g->speed == USB_SPEED_HIGH)

+return hs;

+return fs;

+}

int config_ep_by_speed(struct usb_gadget *g, struct usb_function *f,

struct usb_ep *_ep);


diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h

index e65cad5..d8fd2bb 100644

--- a/include/linux/usb/gadget.h

+++ b/include/linux/usb/gadget.h

@@ -210,6 +210,13 @@ static inline int usb_ep_enable(struct usb_ep *ep)

return ep->ops->enable(ep, ep->desc);

}


+static inline int tizen_usb_ep_enable(struct usb_ep *ep,

+ const struct usb_endpoint_descriptor *desc)

+{

+ return ep->ops->enable(ep, desc);

+}

+

+

/**

* usb_ep_disable - endpoint is no longer usable

* @ep:the endpoint being unconfigured. may not be the endpoint named "ep0".

@@ -963,6 +970,12 @@ int usb_gadget_config_buf(const struct usb_config_descriptor *config,

struct usb_descriptor_header **usb_copy_descriptors(

struct usb_descriptor_header **);


+/* return copy of endpoint descriptor given original descriptor set */

+struct usb_endpoint_descriptor *usb_find_endpoint(

+struct usb_descriptor_header **src,

+struct usb_descriptor_header **copy,

+struct usb_endpoint_descriptor *match);

+

/**

* usb_free_descriptors - free descriptors returned by usb_copy_descriptors()

* @v: vector of descriptors

Framebuffer kernel patch

Directory: android/kernel/

diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c

index f7ca022..4541bf8 100644

--- a/drivers/video/fbmem.c

+++ b/drivers/video/fbmem.c

@@ -1192,7 +1192,9 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd,

return -ENODEV;

console_lock();

info->flags |= FBINFO_MISC_USEREVENT;

-ret = fb_blank(info, arg);

+/*FIXME for debug*/

+/*ret = fb_blank(info, arg);*/

+ret = 0;

info->flags &= ~FBINFO_MISC_USEREVENT;

console_unlock();

unlock_fb_info(info);

diff --git a/drivers/video/msm/mdss/mdss_fb.c b/drivers/video/msm/mdss/mdss_fb.c

index d740d8f..be6ac69 100644

--- a/drivers/video/msm/mdss/mdss_fb.c

+++ b/drivers/video/msm/mdss/mdss_fb.c

@@ -1121,6 +1121,8 @@ int mdss_fb_alloc_fb_ion_memory(struct msm_fb_data_type *mfd)

unsigned long buf_size;

int rc;

void *vaddr;

+ion_phys_addr_t phys_addr;

+size_t phys_len;


if (!mfd) {

pr_err("Invalid input param - no mfd");

@@ -1139,7 +1141,7 @@ int mdss_fb_alloc_fb_ion_memory(struct msm_fb_data_type *mfd)

pr_debug("size for mmap = %d", (int) size);


mfd->fb_ion_handle = ion_alloc(mfd->fb_ion_client, size, SZ_4K,

-ION_HEAP(ION_SYSTEM_HEAP_ID), 0);

+ION_HEAP(ION_SYSTEM_CONTIG_HEAP_ID), 0);

if (IS_ERR_OR_NULL(mfd->fb_ion_handle)) {

pr_err("unable to alloc fbmem from ion - %ld\n",

PTR_ERR(mfd->fb_ion_handle));

@@ -1171,11 +1173,20 @@ int mdss_fb_alloc_fb_ion_memory(struct msm_fb_data_type *mfd)

goto fb_mmap_failed;

}


+rc = ion_phys(mfd->fb_ion_client, mfd->fb_ion_handle, &phys_addr, &phys_len);

+if (rc) {

+pr_err("%s: Unable to get phys address from ION buffer: %d\n"

+, __func__ , rc);

+goto fb_mmap_failed;

+}

+

+

pr_debug("alloc 0x%xB vaddr = %p (%pa iova) for fb%d\n", size, vaddr,

&mfd->iova, mfd->index);


mfd->fbi->screen_base = (char *) vaddr;

mfd->fbi->fix.smem_len = size;

+mfd->fbi->fix.smem_start = (unsigned long)phys_addr;


return rc;


@@ -1216,11 +1227,12 @@ static int mdss_fb_fbmem_ion_mmap(struct fb_info *info,


req_size = vma->vm_end - vma->vm_start;

fb_size = mfd->fbi->fix.line_length * mfd->fbi->var.yres * MDSS_FB_NUM;

-if (req_size > fb_size) {

-pr_warn("requested map is greater than framebuffer");

-return -EOVERFLOW;

-}


+/*if (req_size > fb_size) {

+ *pr_warn("requested map is greater than framebuffer");

+ *return -EOVERFLOW;

+ *}

+ */

if (!mfd->fbi->screen_base) {

rc = mdss_fb_alloc_fb_ion_memory(mfd);

if (rc < 0) {

@@ -1492,8 +1504,11 @@ static int mdss_fb_register(struct msm_fb_data_type *mfd)


mdss_fb_parse_dt(mfd);


-if (mdss_fb_alloc_fbmem(mfd))

-pr_warn("unable to allocate fb memory in fb register\n");

+if (mdss_fb_alloc_fbmem(mfd)) {

+if (mdss_fb_alloc_fb_ion_memory(mfd))

+pr_warn("unable to allocate fb memory in fb register\n"

+ );

+}


mfd->op_enable = true;


@@ -1704,16 +1719,16 @@ static int mdss_fb_release_all(struct fb_info *info, bool release_all)

kthread_stop(mfd->disp_thread);

mfd->disp_thread = NULL;

}

-

-if (mfd->mdp.release_fnc) {

-ret = mfd->mdp.release_fnc(mfd, true);

-if (ret)

-pr_err("error fb%d release process %s pid=%d\n",

-mfd->index, task->comm, pid);

-}

-

-mdss_fb_free_fb_ion_memory(mfd);

-

+/*

+ *if (mfd->mdp.release_fnc) {

+ *ret = mfd->mdp.release_fnc(mfd, true);

+ *if (ret)

+ *pr_err("error fb%d release process %s pid=%d\n",

+ *mfd->index, task->comm, pid);

+ *}

+ *

+ *mdss_fb_free_fb_ion_memory(mfd);

+ */

ret = mdss_fb_blank_sub(FB_BLANK_POWERDOWN, info,

mfd->op_enable);

if (ret) {


Android make_ext4fs patch

Directory: android/system/extras

diff --git a/ext4_utils/make_ext4fs.c b/ext4_utils/make_ext4fs.c

index c2a2665..6e2fc13 100644

--- a/ext4_utils/make_ext4fs.c

+++ b/ext4_utils/make_ext4fs.c

@@ -164,6 +164,8 @@ static u32 build_directory_structure(const char *full_path, const char *dir_path

dentries[i].size = stat.st_size;

dentries[i].mode = stat.st_mode & (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO);

dentries[i].mtime = stat.st_mtime;

+dentries[i].uid = stat.st_uid;

+dentries[i].gid = stat.st_gid;

uint64_t capabilities;

if (fs_config_func != NULL) {

#ifdef ANDROID

@@ -242,7 +244,9 @@ static u32 build_directory_structure(const char *full_path, const char *dir_path

inode = make_directory(dir_inode, entries, dentries, dirs);


for (i = 0; i < entries; i++) {

-if (dentries[i].file_type == EXT4_FT_REG_FILE) {

+if ((dentries[i].file_type == EXT4_FT_REG_FILE) ||

+ (dentries[i].file_type == EXT4_FT_CHRDEV) ||

+ (dentries[i].file_type == EXT4_FT_BLKDEV)) {

entry_inode = make_file(dentries[i].full_path, dentries[i].size);

} else if (dentries[i].file_type == EXT4_FT_DIR) {

char *subdir_full_path = NULL;


Android common patch

Directory: android/device/qcom/common

diff --git a/rootdir/etc/init.qcom.rc b/rootdir/etc/init.qcom.rc

index b19481d..a8f53d6 100644

--- a/rootdir/etc/init.qcom.rc

+++ b/rootdir/etc/init.qcom.rc

@@ -25,8 +25,8 @@

# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#


-import init.qcom.usb.rc

-import init.target.rc

+import /init.qcom.usb.rc

+import /init.target.rc


on early-init

mount debugfs debugfs /sys/kernel/debug

@@ -271,8 +271,8 @@ service usbhub_init /system/bin/usbhub_init

disabled

oneshot


-service qcomsysd /system/bin/qcom-system-daemon

- class main

+#service qcomsysd /system/bin/qcom-system-daemon

+# class main


on property:sys.boot_completed=1

write /dev/kmsg "Boot completed "

@@ -332,15 +332,15 @@ on property:bluetooth.startbtsnoop=true

on property:bluetooth.startbtsnoop=false

stop btsnoop


-service qcom-c_core-sh /system/bin/sh /init.qcom.class_core.sh

- class core

- user root

- oneshot

+#service qcom-c_core-sh /system/bin/sh /init.qcom.class_core.sh

+# class core

+# user root

+# oneshot


-service qcom-c_main-sh /system/bin/sh /init.class_main.sh

- class main

- user root

- oneshot

+#service qcom-c_main-sh /system/bin/sh /init.class_main.sh

+# class main

+# user root

+# oneshot


on property:vold.decrypt=trigger_restart_framework

start qcom-c_main-sh

@@ -349,20 +349,20 @@ on property:vold.decrypt=trigger_restart_framework

on property:persist.env.fastdorm.enabled=true

setprop persist.radio.data_no_toggle 1


-service cnd /system/bin/cnd

- class late_start

- socket cnd stream 660 root inet

+#service cnd /system/bin/cnd

+# class late_start

+# socket cnd stream 660 root inet


-service dpmd /system/bin/dpmd

- class late_start

- socket dpmd stream 660 root system

+#service dpmd /system/bin/dpmd

+# class late_start

+# socket dpmd stream 660 root system


-service irsc_util /system/bin/logwrapper /system/bin/irsc_util "/etc/sec_config"

- class main

- user root

- oneshot

+#service irsc_util /system/bin/logwrapper /system/bin/irsc_util "/etc/sec_config"

+# class main

+# user root

+# oneshot


-service rmt_storage /system/bin/rmt_storage

+service rmt_storage /bin/rmt_storage

class core

user root

disabled

@@ -370,10 +370,10 @@ service rmt_storage /system/bin/rmt_storage

on property:ro.boot.emmc=true

start rmt_storage


-service rfs_access /system/bin/rfs_access

- class core

- user system

- group system net_raw

+#service rfs_access /system/bin/rfs_access

+# class core

+# user system

+# group system net_raw


on property:ro.boot.emmc=true

start rfs_access

@@ -384,23 +384,23 @@ on property:wc_transport.start_hci=true

on property:wc_transport.start_hci=false

stop start_hci_filter


-service start_hci_filter /system/bin/wcnss_filter

- class late_start

- user bluetooth

- group bluetooth qcom_diag

- disabled

+#service start_hci_filter /system/bin/wcnss_filter

+# class late_start

+# user bluetooth

+# group bluetooth qcom_diag

+# disabled


-service config_bluetooth /system/bin/sh /system/etc/init.qcom.bt.sh "onboot"

- class core

- user root

- oneshot

+#service config_bluetooth /system/bin/sh /system/etc/init.qcom.bt.sh "onboot"

+# class core

+# user root

+# oneshot


-service hciattach /system/bin/sh /system/etc/init.qcom.bt.sh

- class late_start

- user bluetooth

- group bluetooth net_bt_admin

- disabled

- oneshot

+#service hciattach /system/bin/sh /system/etc/init.qcom.bt.sh

+# class late_start

+# user bluetooth

+# group bluetooth net_bt_admin

+# disabled

+# oneshot


on property:bluetooth.hciattach=true

start hciattach

@@ -408,58 +408,58 @@ on property:bluetooth.hciattach=true

on property:bluetooth.hciattach=false

setprop bluetooth.status off


-service hciattach_ath3k /system/bin/sh /system/etc/init.ath3k.bt.sh

- class late_start

- user bluetooth

- group system bluetooth net_bt_admin misc

- disabled

- oneshot

-

-service bt-dun /system/bin/dun-server /dev/smd7 /dev/rfcomm0

- class late_start

- user bluetooth

- group bluetooth net_bt_admin inet

- disabled

- oneshot

-

-service bt-sap /system/bin/sapd 15

- user bluetooth

- group bluetooth net_bt_admin

- class late_start

- disabled

- oneshot

-

-service btsnoop /system/bin/btsnoop

- user bluetooth

- group bluetooth net_bt_admin sdcard_rw sdcard_r

- class late_start

- disabled

- oneshot

-

-service ftmd /system/bin/logwrapper /system/bin/ftmdaemon

- class late_start

- user root

- group bluetooth net_bt_admin misc net_bt_stack qcom_diag

- disabled

- oneshot

-

-service bridgemgrd /system/bin/bridgemgrd

- class late_start

- user radio

- group radio qcom_diag

- disabled

-

-service port-bridge /system/bin/port-bridge /dev/mhi_pipe_32 /dev/ttyGS0

- class main

- user radio system

- group radio system inet

- disabled

-

-service qmiproxy /system/bin/qmiproxy

- class main

- user radio

- group radio qcom_diag

- disabled

+#service hciattach_ath3k /system/bin/sh /system/etc/init.ath3k.bt.sh

+# class late_start

+# user bluetooth

+# group system bluetooth net_bt_admin misc

+# disabled

+# oneshot

+

+#service bt-dun /system/bin/dun-server /dev/smd7 /dev/rfcomm0

+# class late_start

+# user bluetooth

+# group bluetooth net_bt_admin inet

+# disabled

+# oneshot

+

+#service bt-sap /system/bin/sapd 15

+# user bluetooth

+# group bluetooth net_bt_admin

+# class late_start

+# disabled

+# oneshot

+

+#service btsnoop /system/bin/btsnoop

+# user bluetooth

+# group bluetooth net_bt_admin sdcard_rw sdcard_r

+# class late_start

+# disabled

+# oneshot

+

+#service ftmd /system/bin/logwrapper /system/bin/ftmdaemon

+# class late_start

+# user root

+# group bluetooth net_bt_admin misc net_bt_stack qcom_diag

+# disabled

+# oneshot

+

+#service bridgemgrd /system/bin/bridgemgrd

+# class late_start

+# user radio

+# group radio qcom_diag

+# disabled

+

+#service port-bridge /system/bin/port-bridge /dev/mhi_pipe_32 /dev/ttyGS0

+# class main

+# user radio system

+# group radio system inet

+# disabled

+

+#service qmiproxy /system/bin/qmiproxy

+# class main

+# user radio

+# group radio qcom_diag

+# disabled


# QMUX must be in multiple groups to support external process connections

service qmuxd /system/bin/qmuxd

@@ -468,19 +468,19 @@ service qmuxd /system/bin/qmuxd

group radio audio bluetooth gps qcom_diag

disabled


-service netmgrd /system/bin/netmgrd

- class main

- disabled

+#service netmgrd /system/bin/netmgrd

+# class main

+# disabled


-service qti /system/vendor/bin/qti

- class main

- disabled

+#service qti /system/vendor/bin/qti

+# class main

+# disabled


-service sensors /system/bin/sensors.qcom

- class late_start

- user root

- group root

- disabled

+#service sensors /system/bin/sensors.qcom

+# class late_start

+# user root

+# group root

+# disabled


on property:ro.use_data_netmgrd=false

# netmgr not supported on specific target

@@ -491,12 +491,12 @@ on property:ro.use_data_netmgrd=false

on property:ro.data.large_tcp_window_size=true

write /proc/sys/net/ipv4/tcp_adv_win_scale 2


-service btwlancoex /system/bin/sh /system/etc/init.qcom.coex.sh

- class late_start

- user bluetooth

- group bluetooth net_bt_admin inet net_admin net_raw

- disabled

- oneshot

+#service btwlancoex /system/bin/sh /system/etc/init.qcom.coex.sh

+# class late_start

+# user bluetooth

+# group bluetooth net_bt_admin inet net_admin net_raw

+# disabled

+# oneshot


service amp_init /system/bin/amploader -i

class late_start

@@ -516,125 +516,125 @@ service amp_unload /system/bin/amploader -u

disabled

oneshot


-service p2p_supplicant /system/bin/wpa_supplicant \

- -ip2p0 -Dnl80211 -c/data/misc/wifi/p2p_supplicant.conf \

- -I/system/etc/wifi/p2p_supplicant_overlay.conf -N \

- -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \

- -I/system/etc/wifi/wpa_supplicant_overlay.conf \

- -O/data/misc/wifi/sockets -puse_p2p_group_interface=1 -dd \

- -e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0

-# we will start as root and wpa_supplicant will switch to user wifi

-# after setting up the capabilities required for WEXT

-# user wifi

-# group wifi inet keystore

- class main

- socket wpa_wlan0 dgram 660 wifi wifi

- disabled

- oneshot

-

-service wpa_supplicant /system/bin/wpa_supplicant \

- -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \

- -I/system/etc/wifi/wpa_supplicant_overlay.conf \

- -O/data/misc/wifi/sockets -dd \

- -e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0

- # we will start as root and wpa_supplicant will switch to user wifi

- # after setting up the capabilities required for WEXT

- # user wifi

- # group wifi inet keystore

- class main

- socket wpa_wlan0 dgram 660 wifi wifi

- disabled

- oneshot

-

-service dhcpcd_wlan0 /system/bin/dhcpcd -ABKLG

- class late_start

- disabled

- oneshot

-

-service dhcpcd_p2p /system/bin/dhcpcd -ABKLG

- class late_start

- disabled

- oneshot

-

-service iprenew_wlan0 /system/bin/dhcpcd -n

- class late_start

- disabled

- oneshot

-

-service iprenew_p2p /system/bin/dhcpcd -n

- class late_start

- disabled

- oneshot

-

-service ptt_socket_app /system/bin/ptt_socket_app -d

- class main

- user root

- group root

- oneshot

-

-service ptt_ffbm /system/bin/ptt_socket_app -f -d

- user root

- group root

- disabled

- oneshot

-

-service ftm_ffbm /system/bin/ftmdaemon

- user root

- group root

- disabled

- oneshot

-

-service dhcpcd_bt-pan /system/bin/dhcpcd -BKLG

- class late_start

- disabled

- oneshot

-

-service iprenew_bt-pan /system/bin/dhcpcd -n

- class late_start

- disabled

- oneshot

-

-service dhcpcd_bnep0 /system/bin/dhcpcd -BKLG

- disabled

- oneshot

-

-service dhcpcd_bnep1 /system/bin/dhcpcd -BKLG

- disabled

- oneshot

-

-service dhcpcd_bnep2 /system/bin/dhcpcd -BKLG

- disabled

- oneshot

-

-service dhcpcd_bnep3 /system/bin/dhcpcd -BKLG

- disabled

- oneshot

-

-service dhcpcd_bnep4 /system/bin/dhcpcd -BKLG

- disabled

- oneshot

-

-service loc_launcher /system/bin/loc_launcher

- #loc_launcher will start as root and set its uid to gps

- class late_start

- group gps inet net_raw qcom_diag net_admin wifi

-

-service fm_dl /system/bin/sh /system/etc/init.qcom.fm.sh

- class late_start

- user root

- group system

- disabled

- oneshot

+#service p2p_supplicant /system/bin/wpa_supplicant \

+# -ip2p0 -Dnl80211 -c/data/misc/wifi/p2p_supplicant.conf \

+# -I/system/etc/wifi/p2p_supplicant_overlay.conf -N \

+# -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \

+# -I/system/etc/wifi/wpa_supplicant_overlay.conf \

+# -O/data/misc/wifi/sockets -puse_p2p_group_interface=1 -dd \

+# -e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0

+## we will start as root and wpa_supplicant will switch to user wifi

+## after setting up the capabilities required for WEXT

+## user wifi

+## group wifi inet keystore

+# class main

+# socket wpa_wlan0 dgram 660 wifi wifi

+# disabled

+# oneshot

+

+#service wpa_supplicant /system/bin/wpa_supplicant \

+# -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \

+# -I/system/etc/wifi/wpa_supplicant_overlay.conf \

+# -O/data/misc/wifi/sockets -dd \

+# -e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0

+# # we will start as root and wpa_supplicant will switch to user wifi

+# # after setting up the capabilities required for WEXT

+# # user wifi

+# # group wifi inet keystore

+# class main

+# socket wpa_wlan0 dgram 660 wifi wifi

+# disabled

+# oneshot

+

+#service dhcpcd_wlan0 /system/bin/dhcpcd -ABKLG

+# class late_start

+# disabled

+# oneshot

+

+#service dhcpcd_p2p /system/bin/dhcpcd -ABKLG

+# class late_start

+# disabled

+# oneshot

+

+#service iprenew_wlan0 /system/bin/dhcpcd -n

+# class late_start

+# disabled

+# oneshot

+

+#service iprenew_p2p /system/bin/dhcpcd -n

+# class late_start

+# disabled

+# oneshot

+

+#service ptt_socket_app /system/bin/ptt_socket_app -d

+# class main

+# user root

+# group root

+# oneshot

+

+#service ptt_ffbm /system/bin/ptt_socket_app -f -d

+# user root

+# group root

+# disabled

+# oneshot

+

+#service ftm_ffbm /system/bin/ftmdaemon

+# user root

+# group root

+# disabled

+# oneshot

+

+#service dhcpcd_bt-pan /system/bin/dhcpcd -BKLG

+# class late_start

+# disabled

+# oneshot

+

+#service iprenew_bt-pan /system/bin/dhcpcd -n

+# class late_start

+# disabled

+# oneshot

+

+#service dhcpcd_bnep0 /system/bin/dhcpcd -BKLG

+# disabled

+# oneshot

+

+#service dhcpcd_bnep1 /system/bin/dhcpcd -BKLG

+# disabled

+# oneshot

+

+#service dhcpcd_bnep2 /system/bin/dhcpcd -BKLG

+# disabled

+# oneshot

+

+#service dhcpcd_bnep3 /system/bin/dhcpcd -BKLG

+# disabled

+# oneshot

+

+#service dhcpcd_bnep4 /system/bin/dhcpcd -BKLG

+# disabled

+# oneshot

+

+#service loc_launcher /system/bin/loc_launcher

+# #loc_launcher will start as root and set its uid to gps

+# class late_start

+# group gps inet net_raw qcom_diag net_admin wifi

+

+#service fm_dl /system/bin/sh /system/etc/init.qcom.fm.sh

+# class late_start

+# user root

+# group system

+# disabled

+# oneshot


on property:crypto.driver.load=1

insmod /system/lib/modules/qce.ko

insmod /system/lib/modules/qcedev.ko


-service drmdiag /system/bin/drmdiagapp

- class late_start

- user root

- disabled

- oneshot

+#service drmdiag /system/bin/drmdiagapp

+# class late_start

+# user root

+# disabled

+# oneshot


on property:drmdiag.load=1

start drmdiag

@@ -642,58 +642,58 @@ on property:drmdiag.load=1

on property:drmdiag.load=0

stop drmdiag


-service qcom-sh /system/bin/sh /init.qcom.sh

- class late_start

- user root

- oneshot

+#service qcom-sh /system/bin/sh /init.qcom.sh

+# class late_start

+# user root

+# oneshot


-service qcom-post-boot /system/bin/sh /system/etc/init.qcom.post_boot.sh

- class late_start

- user root

- disabled

- oneshot

+#service qcom-post-boot /system/bin/sh /system/etc/init.qcom.post_boot.sh

+# class late_start

+# user root

+# disabled

+# oneshot


-service wifi-sdio-on /system/bin/sh /system/etc/init.qcom.sdio.sh

- class late_start

- group wifi inet

- disabled

- oneshot

+#service wifi-sdio-on /system/bin/sh /system/etc/init.qcom.sdio.sh

+# class late_start

+# group wifi inet

+# disabled

+# oneshot


-service wifi-crda /system/bin/sh /system/etc/init.crda.sh

- class late_start

- user root

- disabled

- oneshot

+#service wifi-crda /system/bin/sh /system/etc/init.crda.sh

+# class late_start

+# user root

+# disabled

+# oneshot


on property:sys.boot_completed=1

start qcom-post-boot


-service atfwd /system/bin/ATFWD-daemon

- class late_start

- user system

- group system radio

+#service atfwd /system/bin/ATFWD-daemon

+# class late_start

+# user system

+# group system radio


-service hostapd /system/bin/hostapd -dd /data/hostapd/hostapd.conf

- class late_start

- user root

- group root

- oneshot

- disabled

+#service hostapd /system/bin/hostapd -dd /data/hostapd/hostapd.conf

+# class late_start

+# user root

+# group root

+# oneshot

+# disabled


-service ds_fmc_appd /system/bin/ds_fmc_appd -p "rmnet0" -D

- class late_start

- group radio wifi inet

- disabled

- oneshot

+#service ds_fmc_appd /system/bin/ds_fmc_appd -p "rmnet0" -D

+# class late_start

+# group radio wifi inet

+# disabled

+# oneshot


on property:persist.data.ds_fmc_app.mode=1

start ds_fmc_appd


-service ims_regmanager /system/bin/exe-ims-regmanagerprocessnative

- class late_start

- group net_bt_admin inet radio wifi

- disabled

+#service ims_regmanager /system/bin/exe-ims-regmanagerprocessnative

+# class late_start

+# group net_bt_admin inet radio wifi

+# disabled


on property:persist.ims.regmanager.mode=1

start ims_regmanager

@@ -702,38 +702,38 @@ on property:ro.data.large_tcp_window_size=true

# Adjust socket buffer to enlarge TCP receive window for high bandwidth (e.g. DO-RevB)

write /proc/sys/net/ipv4/tcp_adv_win_scale 2


-service battery_monitor /system/bin/battery_monitor

- user system

- group system

- disabled

-

-service ril-daemon1 /system/bin/rild -c 1

- class main

- socket rild1 stream 660 root radio

- socket rild-debug1 stream 660 radio system

- user root

- disabled

- group radio cache inet misc audio sdcard_r sdcard_rw diag qcom_diag log

-

-service ril-daemon2 /system/bin/rild -c 2

- class main

- socket rild2 stream 660 root radio

- socket rild-debug2 stream 660 radio system

- user root

- disabled

- group radio cache inet misc audio sdcard_r sdcard_rw diag qcom_diag log

-

-service usb_uicc_enable /system/bin/sh /system/etc/init.qcom.uicc.sh

- class late_start

- user root

- disabled

- oneshot

-

-service usb_uicc_daemon /system/bin/usb_uicc_client

- class main

- user system

- group system log net_raw

- oneshot

+#service battery_monitor /system/bin/battery_monitor

+# user system

+# group system

+# disabled

+

+#service ril-daemon1 /system/bin/rild -c 1

+# class main

+# socket rild1 stream 660 root radio

+# socket rild-debug1 stream 660 radio system

+# user root

+# disabled

+# group radio cache inet misc audio sdcard_r sdcard_rw diag qcom_diag log

+

+#service ril-daemon2 /system/bin/rild -c 2

+# class main

+# socket rild2 stream 660 root radio

+# socket rild-debug2 stream 660 radio system

+# user root

+# disabled

+# group radio cache inet misc audio sdcard_r sdcard_rw diag qcom_diag log

+

+#service usb_uicc_enable /system/bin/sh /system/etc/init.qcom.uicc.sh

+# class late_start

+# user root

+# disabled

+# oneshot

+

+#service usb_uicc_daemon /system/bin/usb_uicc_client

+# class main

+# user system

+# group system log net_raw

+# oneshot


on property:usb_uicc.enabled=1

start usb_uicc_enable

@@ -741,61 +741,61 @@ on property:usb_uicc.enabled=1

on property:usb_uicc.enabled=0

start usb_uicc_enable


-service profiler_daemon /system/bin/profiler_daemon

- class late_start

- user root

- group root

- disabled

+#service profiler_daemon /system/bin/profiler_daemon

+# class late_start

+# user root

+# group root

+# disabled


-service sdcard /system/bin/sdcard /data/media /mnt/shell/emulated 1023 1023

- class late_start

+#service sdcard /system/bin/sdcard /data/media /mnt/shell/emulated 1023 1023

+# class late_start


-service fuse_sdcard1 /system/bin/sdcard -u 1023 -g 1023 -d /mnt/media_rw/sdcard1 /storage/sdcard1

- class late_start

+#service fuse_sdcard1 /system/bin/sdcard -u 1023 -g 1023 -d /mnt/media_rw/sdcard1 /storage/sdcard1

+# class late_start


-service fuse_uicc0 /system/bin/sdcard -u 1023 -g 1023 -w 1023 -d /mnt/media_rw/uicc0 /storage/uicc0

- class late_start

+#service fuse_uicc0 /system/bin/sdcard -u 1023 -g 1023 -w 1023 -d /mnt/media_rw/uicc0 /storage/uicc0

+# class late_start


-service fuse_usbotg /system/bin/sdcard -u 1023 -g 1023 -w 1023 -d /mnt/media_rw/usbotg /storage/usbotg

- class late_start

+#service fuse_usbotg /system/bin/sdcard -u 1023 -g 1023 -w 1023 -d /mnt/media_rw/usbotg /storage/usbotg

+# class late_start


# Binding fuse mount point to /storage/emulated/legacy

on property:init.svc.sdcard=running

wait /mnt/shell/emulated/0

mount none /mnt/shell/emulated/0 /storage/emulated/legacy bind


-service hcidump /system/bin/sh /system/etc/hcidump.sh

- user bluetooth

- group bluetooth system net_bt_admin net_admin

- disabled

- oneshot

+#service hcidump /system/bin/sh /system/etc/hcidump.sh

+# user bluetooth

+# group bluetooth system net_bt_admin net_admin

+# disabled

+# oneshot


-service charger /charger

- class charger

+#service charger /charger

+# class charger


-service ssr_diag /system/bin/ssr_diag

- class late_start

- user system

- group system

+#service ssr_diag /system/bin/ssr_diag

+# class late_start

+# user system

+# group system


# Define fastmmi

-service fastmmi /system/bin/mmi

- user root

- group root

- disabled

+#service fastmmi /system/bin/mmi

+# user root

+# group root

+# disabled


-service fastmmisrv /system/bin/sh /init.qcom.factory.sh

- user root

- disabled

- oneshot

+#service fastmmisrv /system/bin/sh /init.qcom.factory.sh

+# user root

+# disabled

+# oneshot


on ffbm

start fastmmisrv


-service hvdcp /system/bin/hvdcp

- class core

- user root

- disabled

+#service hvdcp /system/bin/hvdcp

+# class core

+# user root

+# disabled


on property:persist.usb.hvdcp.detect=true

start hvdcp

@@ -803,14 +803,14 @@ on property:persist.usb.hvdcp.detect=true

on property:persist.usb.hvdcp.detect=false

stop hvdcp


-service charger_monitor /system/bin/charger_monitor

- user root

- group root

- disabled

+#service charger_monitor /system/bin/charger_monitor

+# user root

+# group root

+# disabled


-service qbcharger /charger -m 1

- disabled

- oneshot

+#service qbcharger /charger -m 1

+# disabled

+# oneshot


on property:sys.qbcharger.enable=true

start qbcharger

@@ -818,37 +818,37 @@ on property:sys.qbcharger.enable=true

on property:sys.qbcharger.enable=false

stop qbcharger


-service diag_mdlog_start /system/bin/diag_mdlog

- class late_start

- user sdcard_rw

- group system qcom_diag sdcard_rw sdcard_r media_rw

- disabled

- oneshot

-

-service diag_mdlog_stop /system/bin/diag_mdlog -k

- class late_start

- user sdcard_rw

- group system qcom_diag sdcard_rw sdcard_r media_rw

- disabled

- oneshot

-

-service qlogd /system/xbin/qlogd

- class main

- disabled

+#service diag_mdlog_start /system/bin/diag_mdlog

+# class late_start

+# user sdcard_rw

+# group system qcom_diag sdcard_rw sdcard_r media_rw

+# disabled

+# oneshot

+

+#service diag_mdlog_stop /system/bin/diag_mdlog -k

+# class late_start

+# user sdcard_rw

+# group system qcom_diag sdcard_rw sdcard_r media_rw

+# disabled

+# oneshot

+

+#service qlogd /system/xbin/qlogd

+# class main

+# disabled

on property:persist.sys.qlogd=1

start qlogd

on property:persist.sys.qlogd=0

stop qlogd


-service rootagent /system/bin/sh /system/etc/init.qcom.rootagent.sh

- disabled

- oneshot

+#service rootagent /system/bin/sh /system/etc/init.qcom.rootagent.sh

+# disabled

+# oneshot

on property:persist.sys.rootagent=1

start rootagent

on property:persist.sys.rootagent=0

stop rootagent


-service vm_bms /system/bin/vm_bms

- user root

- group root

- disabled

+#service vm_bms /system/bin/vm_bms

+# user root

+# group root

+# disabled


Android msm8916_32 patch

Directory: android/device/qcom/msm8916_32

diff --git a/BoardConfig.mk b/BoardConfig.mk

index 192cc54..00ddc08 100644

--- a/BoardConfig.mk

+++ b/BoardConfig.mk

@@ -74,7 +74,7 @@ TARGET_USERIMAGES_USE_EXT4 := true

BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4

BOARD_PERSISTIMAGE_FILE_SYSTEM_TYPE := ext4


-BOARD_KERNEL_CMDLINE := console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3 androidboot.bootdevice=7824900.sdhci

+BOARD_KERNEL_CMDLINE := console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3 androidboot.bootdevice=7824900.sdhci debug root=/dev/mmcblk0p23 rootfstype=ext4 rw

BOARD_KERNEL_SEPARATED_DT := true


BOARD_EGL_CFG := device/qcom/msm8916_32/egl.cfg

diff --git a/init.target.rc b/init.target.rc

index 2af2e4e..43cbcca 100644

--- a/init.target.rc

+++ b/init.target.rc

@@ -29,7 +29,7 @@


on early-init

mkdir /firmware 0771 system system

- mkdir /system 0777 root root

+ #mkdir /system 0777 root root

symlink /data/tombstones /tombstones


# import cne init file

@@ -37,20 +37,23 @@ on post-fs

export LD_PRELOAD /vendor/lib/libNimsWrap.so


on fs

- mount_all fstab.qcom

+ #mount_all fstab.qcom


# Keeping following partitions outside fstab file. As user may not have

# these partition flashed on the device. Failure to mount any partition in fstab file

# results in failure to launch late-start class.


- wait /dev/block/bootdevice/by-name/cache

- mount ext4 /dev/block/bootdevice/by-name/cache /cache nosuid nodev barrier=1

+ #wait /dev/block/bootdevice/by-name/cache

+ #mount ext4 /dev/block/bootdevice/by-name/cache /cache nosuid nodev barrier=1


- wait /dev/block/bootdevice/by-name/persist

- mount ext4 /dev/block/bootdevice/by-name/persist /persist nosuid nodev barrier=1

+ #wait /dev/block/bootdevice/by-name/persist

+ #mount ext4 /dev/block/bootdevice/by-name/persist /persist nosuid nodev barrier=1

+ mount ext4 /dev/mmcblk0p24 /persist nosuid nodev barrier=1


- wait /dev/block/bootdevice/by-name/modem

- mount vfat /dev/block/bootdevice/by-name/modem /firmware ro shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337

+ #wait /dev/block/bootdevice/by-name/modem

+ #mount vfat /dev/block/bootdevice/by-name/modem /firmware ro shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337

+ mount vfat /dev/mmcblk0p1 /firmware ro shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337

+ #mount vfat /dev/mmcblk0p1 /firmware

#write /sys/kernel/boot_adsp/boot 1


on post-fs-data


Android core patch

diff --git a/init/devices.c b/init/devices.c

index f96bccb..9783baf 100644

--- a/init/devices.c

+++ b/init/devices.c

@@ -978,9 +978,12 @@ void device_init(void)


if (stat(coldboot_done, &info) < 0) {

t0 = get_usecs();

- coldboot("/sys/class");

- coldboot("/sys/block");

- coldboot("/sys/devices");

+/*

+ * coldboot("/sys/class");

+ * coldboot("/sys/block");

+ * coldboot("/sys/devices");

+ */

+coldboot("/sys/devices/soc.0/7824900.sdhci");

t1 = get_usecs();

fd = open(coldboot_done, O_WRONLY|O_CREAT, 0000);

close(fd);

diff --git a/init/init.c b/init/init.c

index 5d68d74..7ae1964 100644

--- a/init/init.c

+++ b/init/init.c

@@ -985,19 +985,19 @@ int main(int argc, char **argv)

* together in the initramdisk on / and then we'll

* let the rc file figure out the rest.

*/

- mkdir("/dev", 0755);

- mkdir("/proc", 0755);

- mkdir("/sys", 0755);

+// mkdir("/dev", 0755);

+// mkdir("/proc", 0755);

+// mkdir("/sys", 0755);


- mount("tmpfs", "/dev", "tmpfs", MS_NOSUID, "mode=0755");

- mkdir("/dev/pts", 0755);

+// mount("tmpfs", "/dev", "tmpfs", MS_NOSUID, "mode=0755");

+// mkdir("/dev/pts", 0755);

mkdir("/dev/socket", 0755);

- mount("devpts", "/dev/pts", "devpts", 0, NULL);

- mount("proc", "/proc", "proc", 0, NULL);

- mount("sysfs", "/sys", "sysfs", 0, NULL);

+// mount("devpts", "/dev/pts", "devpts", 0, NULL);

+// mount("proc", "/proc", "proc", 0, NULL);

+// mount("sysfs", "/sys", "sysfs", 0, NULL);


/* indicate that booting is in progress to background fw loaders, etc */

- close(open("/dev/.booting", O_WRONLY | O_CREAT, 0000));

+// close(open("/dev/.booting", O_WRONLY | O_CREAT, 0000));


/* We must have some place other than / to create the

* device nodes for kmsg and null, otherwise we won't

@@ -1005,7 +1005,7 @@ int main(int argc, char **argv)

* Now that tmpfs is mounted on /dev, we can actually

* talk to the outside world.

*/

- open_devnull_stdio();

+ /*open_devnull_stdio();*/

klog_init();

property_init();


@@ -1013,14 +1013,14 @@ int main(int argc, char **argv)


process_kernel_cmdline();


- union selinux_callback cb;

- cb.func_log = klog_write;

- selinux_set_callback(SELINUX_CB_LOG, cb);

+// union selinux_callback cb;

+// cb.func_log = klog_write;

+// selinux_set_callback(SELINUX_CB_LOG, cb);


- cb.func_audit = audit_callback;

- selinux_set_callback(SELINUX_CB_AUDIT, cb);

+// cb.func_audit = audit_callback;

+// selinux_set_callback(SELINUX_CB_AUDIT, cb);


- selinux_initialize();

+// selinux_initialize();

/* These directories were necessarily created before initial policy load

* and therefore need their security context restored to the proper value.

* This must happen before /dev is populated by ueventd.

@@ -1033,7 +1033,7 @@ int main(int argc, char **argv)

is_ffbm = !strncmp(bootmode, "ffbm", 4);

if (!is_ffbm)

is_charger = !strcmp(bootmode, "charger");

-

+ is_charger = false;

INFO("property init\n");

if (!is_charger)

property_load_boot_defaults();

diff --git a/init/property_service.c b/init/property_service.c

index 1f5b1f9..f5f9838 100644

--- a/init/property_service.c

+++ b/init/property_service.c

@@ -69,7 +69,7 @@

#include "log.h"

#include "vendor_init.h"


-#define PERSISTENT_PROPERTY_DIR "/data/property"

+#define PERSISTENT_PROPERTY_DIR "/system/property"


static int persistent_properties_loaded = 0;

static int property_area_inited = 0;

diff --git a/init/ueventd.c b/init/ueventd.c

index 53cc9ac..e3c4c2c 100644

--- a/init/ueventd.c

+++ b/init/ueventd.c

@@ -72,7 +72,7 @@ int ueventd_main(int argc, char **argv)

*/

signal(SIGCHLD, SIG_IGN);


- open_devnull_stdio();

+ /*open_devnull_stdio();*/

klog_init();


INFO("starting ueventd\n");

diff --git a/rootdir/init.rc b/rootdir/init.rc

index 322985e..c0a968a 100644

--- a/rootdir/init.rc

+++ b/rootdir/init.rc

@@ -9,7 +9,7 @@


import /init.environ.rc

import /init.usb.rc

-import /init.${ro.hardware}.rc

+import /init.qcom.rc

import /init.trace.rc


on early-init

@@ -23,7 +23,7 @@ on early-init

start ueventd


# create mountpoints

- mkdir /mnt 0775 root system

+ #mkdir /mnt 0775 root system


on init


@@ -32,12 +32,12 @@ sysclktz 0

loglevel 3


# Backward compatibility

- symlink /system/etc /etc

+ #symlink /system/etc /etc

symlink /sys/kernel/debug /d


# Right now vendor lives on the same filesystem as system,

# but someday that may change.

- symlink /system/vendor /vendor

+ #symlink /system/vendor /vendor


# Create cgroup mount point for cpu accounting

mkdir /acct

@@ -57,9 +57,9 @@ loglevel 3

chown root system /sys/fs/cgroup/memory/sw/tasks

chmod 0660 /sys/fs/cgroup/memory/sw/tasks


- mkdir /system

- mkdir /data 0771 system system

- mkdir /cache 0770 system cache

+ #mkdir /system

+ #mkdir /data 0771 system system

+ #mkdir /cache 0770 system cache

mkdir /config 0500 root root


# See storage config details at http://source.android.com/tech/storage/

@@ -146,21 +146,21 @@ loglevel 3


on post-fs

# once everything is setup, no need to modify /

- mount rootfs rootfs / ro remount

+ #mount rootfs rootfs / ro remount

# mount shared so changes propagate into child namespaces

- mount rootfs rootfs / shared rec

+ #mount rootfs rootfs / shared rec


# We chown/chmod /cache again so because mount is run as root + defaults

- chown system cache /cache

- chmod 0770 /cache

+ #chown system cache /cache

+ #chmod 0770 /cache

# We restorecon /cache in case the cache partition has been reset.

- restorecon /cache

+ #restorecon /cache


# This may have been created by the recovery system with odd permissions

- chown system cache /cache/recovery

- chmod 0770 /cache/recovery

+ #chown system cache /cache/recovery

+ #chmod 0770 /cache/recovery

# This may have been created by the recovery system with the wrong context.

- restorecon /cache/recovery

+ #restorecon /cache/recovery


#change permissions on vmallocinfo so we can grab it from bugreports

chown root log /proc/vmallocinfo

@@ -178,12 +178,12 @@ on post-fs

chmod 0440 /proc/last_kmsg


# create the lost+found directories, so as to enforce our permissions

- mkdir /cache/lost+found 0770 root root

+ #mkdir /cache/lost+found 0770 root root


on post-fs-data

# We chown/chmod /data again so because mount is run as root + defaults

- chown system system /data

- chmod 0771 /data

+ #chown system system /data

+ #chmod 0771 /data

# We restorecon /data in case the userdata partition has been reset.

restorecon /data


@@ -420,20 +420,20 @@ on property:sys.sysctl.tcp_def_init_rwnd=*


## Daemon processes to be run by init.

##

-service ueventd /sbin/ueventd

+service ueventd /system/bin/ueventd

class core

critical

seclabel u:r:ueventd:s0


-service healthd /sbin/healthd

- class core

- critical

- seclabel u:r:healthd:s0

+#service healthd /sbin/healthd

+# class core

+# critical

+# seclabel u:r:healthd:s0


-service healthd-charger /sbin/healthd -n

- class charger

- critical

- seclabel u:r:healthd:s0

+#service healthd-charger /sbin/healthd -n

+# class charger

+# critical

+# seclabel u:r:healthd:s0


on property:selinux.reload_policy=1

restart ueventd

@@ -460,113 +460,113 @@ service adbd /sbin/adbd

on property:ro.kernel.qemu=1

start adbd


-service servicemanager /system/bin/servicemanager

- class core

- user system

- group system

- critical

- onrestart restart healthd

- onrestart restart zygote

- onrestart restart media

- onrestart restart surfaceflinger

- onrestart restart drm

-

-service vold /system/bin/vold

- class core

- socket vold stream 0660 root mount

- ioprio be 2

-

-service netd /system/bin/netd

- class main

- socket netd stream 0660 root system

- socket dnsproxyd stream 0660 root inet

- socket mdns stream 0660 root system

-

-service debuggerd /system/bin/debuggerd

- class main

-

-service ril-daemon /system/bin/rild

- class main

- socket rild stream 660 root radio

- socket rild-debug stream 660 radio system

- user root

- group radio cache inet misc audio log qcom_diag sdcard_r sdcard_rw

-

-service surfaceflinger /system/bin/surfaceflinger

- class main

- user system

- group graphics drmrpc

- onrestart restart zygote

-

-service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-system-server

- class main

- socket zygote stream 660 root system

- onrestart write /sys/android_power/request_state wake

- onrestart write /sys/power/state on

- onrestart restart media

- onrestart restart netd

-

-service drm /system/bin/drmserver

- class main

- user drm

- group drm system inet drmrpc

-

-service media /system/bin/mediaserver

- class main

- user media

- group audio camera inet net_bt net_bt_admin net_bw_acct drmrpc mediadrm qcom_diag

- ioprio rt 4

-

-service bootanim /system/bin/bootanimation

- class main

- user media

- group graphics audio

- disabled

- oneshot

-

-service installd /system/bin/installd

- class main

- socket installd stream 600 system system

-

-service flash_recovery /system/etc/install-recovery.sh

- class main

- oneshot

-

-service racoon /system/bin/racoon

- class main

- socket racoon stream 600 system system

- # IKE uses UDP port 500. Racoon will setuid to vpn after binding the port.

- group vpn net_admin inet

- disabled

- oneshot

-

-service mtpd /system/bin/mtpd

- class main

- socket mtpd stream 600 system system

- user vpn

- group vpn net_admin inet net_raw

- disabled

- oneshot

-

-service keystore /system/bin/keystore /data/misc/keystore

- class main

- user keystore

- group keystore drmrpc

-

-service dumpstate /system/bin/dumpstate -s

- class main

- socket dumpstate stream 0660 shell log

- disabled

- oneshot

-

-service sshd /system/bin/start-ssh

- class main

- disabled

-

-service mdnsd /system/bin/mdnsd

- class main

- user mdnsr

- group inet net_raw

- socket mdnsd stream 0660 mdnsr inet

- disabled

- oneshot

+#service servicemanager /system/bin/servicemanager

+# class core

+# user system

+# group system

+# critical

+# onrestart restart healthd

+# onrestart restart zygote

+# onrestart restart media

+# onrestart restart surfaceflinger

+# onrestart restart drm

+

+#service vold /system/bin/vold

+# class core

+# socket vold stream 0660 root mount

+# ioprio be 2

+

+#service netd /system/bin/netd

+# class main

+# socket netd stream 0660 root system

+# socket dnsproxyd stream 0660 root inet

+# socket mdns stream 0660 root system

+

+#service debuggerd /system/bin/debuggerd

+# class main

+

+#service ril-daemon /system/bin/rild

+# class main

+# socket rild stream 660 root radio

+# socket rild-debug stream 660 radio system

+# user root

+# group radio cache inet misc audio log qcom_diag sdcard_r sdcard_rw

+

+#service surfaceflinger /system/bin/surfaceflinger

+# class main

+# user system

+# group graphics drmrpc

+# onrestart restart zygote

+

+#service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-system-server

+# class main

+# socket zygote stream 660 root system

+# onrestart write /sys/android_power/request_state wake

+# onrestart write /sys/power/state on

+# onrestart restart media

+# onrestart restart netd

+

+#service drm /system/bin/drmserver

+# class main

+# user drm

+# group drm system inet drmrpc

+

+#service media /system/bin/mediaserver

+# class main

+# user media

+# group audio camera inet net_bt net_bt_admin net_bw_acct drmrpc mediadrm qcom_diag

+# ioprio rt 4

+

+#service bootanim /system/bin/bootanimation

+# class main

+# user media

+# group graphics audio

+# disabled

+# oneshot

+

+#service installd /system/bin/installd

+# class main

+# socket installd stream 600 system system

+

+#service flash_recovery /system/etc/install-recovery.sh

+# class main

+# oneshot

+

+#service racoon /system/bin/racoon

+# class main

+# socket racoon stream 600 system system

+# # IKE uses UDP port 500. Racoon will setuid to vpn after binding the port.

+# group vpn net_admin inet

+# disabled

+# oneshot

+

+#service mtpd /system/bin/mtpd

+# class main

+# socket mtpd stream 600 system system

+# user vpn

+# group vpn net_admin inet net_raw

+# disabled

+# oneshot

+

+#service keystore /system/bin/keystore /data/misc/keystore

+# class main

+# user keystore

+# group keystore drmrpc

+

+#service dumpstate /system/bin/dumpstate -s

+# class main

+# socket dumpstate stream 0660 shell log

+# disabled

+# oneshot

+

+#service sshd /system/bin/start-ssh

+# class main

+# disabled

+

+#service mdnsd /system/bin/mdnsd

+# class main

+# user mdnsr

+# group inet net_raw

+# socket mdnsd stream 0660 mdnsr inet

+# disabled

+# oneshot

Android wlan patch

diff --git a/wcnss-service/wcnss_service.c b/wcnss-service/wcnss_service.c

index c42856a..94ccb91 100644

--- a/wcnss-service/wcnss_service.c

+++ b/wcnss-service/wcnss_service.c

@@ -446,7 +446,8 @@ int main(int argc, char *argv[])


setup_wlan_config_file();


-#ifdef WCNSS_QMI

+/*#ifdef WCNSS_QMI*/

+#if 0

/* initialize the DMS client and request the wlan mac address */


if (SUCCESS == wcnss_init_qmi()) {

Tizen xorg-x11-drv-fbdev patch

Directory: tizen/adaptation/xorg/driver/xorg-x11-drv-fbdev

diff -aurp a/packaging/xorg-x11-drv-fbdev.spec b/packaging/xorg-x11-drv-fbdev.spec

--- a/packaging/xorg-x11-drv-fbdev.spec2014-11-12 18:25:49.000000000 +0800

+++ b/packaging/xorg-x11-drv-fbdev.spec2014-10-01 23:54:11.525882702 +0800

@@ -10,7 +10,6 @@ Source0: %{name}-%{version}.tar.bz2

Source1001: packaging/xorg-x11-drv-fbdev.manifest

# >> gbp-patch-tags # auto-added by gbp

# << gbp-patch-tags # auto-added by gbp

-Requires: xorg-server

BuildRequires: pkgconfig(xorg-server) >= 1.0.99.901

BuildRequires: pkgconfig(xproto)

BuildRequires: pkgconfig(fontsproto)

@@ -19,7 +18,7 @@ BuildRequires: pkgconfig(renderproto)

BuildRequires: pkgconfig(xextproto)

BuildRequires: pkgconfig(inputproto)

BuildRequires: pkgconfig(videoproto)

-

+BuildRequires: pkgconfig(resourceproto)


%description

Xorg X11 fbdev video driver.

diff -aurp a/src/fbdev.c b/src/fbdev.c

--- a/src/fbdev.c2014-11-12 18:25:49.000000000 +0800

+++ b/src/fbdev.c2014-09-26 14:21:34.113973515 +0800

@@ -2,7 +2,6 @@

* Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>

* Michel Dänzer, <michel@tungstengraphics.com>

*/

-

#ifdef HAVE_CONFIG_H

#include "config.h"

#endif

@@ -40,7 +39,7 @@

static Bool debug = 0;


#define TRACE_ENTER(str) \

- do { if (debug) ErrorF("fbdev: " str " %d\n",pScrn->scrnIndex); } while (0)

+ do { if (debug) ErrorF("fbdev: " str " %d\n"); } while (0)

#define TRACE_EXIT(str) \

do { if (debug) ErrorF("fbdev: " str " done\n"); } while (0)

#define TRACE(str) \

@@ -57,7 +56,7 @@ static BoolFBDevPciProbe(DriverPtr drv,

struct pci_device *dev, intptr_t match_data);

#endif

static BoolFBDevPreInit(ScrnInfoPtr pScrn, int flags);

-static BoolFBDevScreenInit(int Index, ScreenPtr pScreen, int argc,

+static BoolFBDevScreenInit(ScreenPtr pScreen, int argc,

char **argv);

static BoolFBDevCloseScreen(int scrnIndex, ScreenPtr pScreen);

static void *FBDevWindowLinear(ScreenPtr pScreen, CARD32 row, CARD32 offset, int mode,

@@ -401,7 +400,6 @@ FBDevPreInit(ScrnInfoPtr pScrn, int flag

/* Check the number of entities, and fail if it isn't one. */

if (pScrn->numEntities != 1)

return FALSE;

-

pScrn->monitor = pScrn->confScreen->monitor;


FBDevGetRec(pScrn);

@@ -649,7 +647,7 @@ FBDevShadowInit(ScreenPtr pScreen)


static Bool

-FBDevScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)

+FBDevScreenInit(ScreenPtr pScreen, int argc, char **argv)

{

ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];

FBDevPtr fPtr = FBDEVPTR(pScrn);

@@ -671,7 +669,7 @@ FBDevScreenInit(int scrnIndex, ScreenPtr

#endif


if (NULL == (fPtr->fbmem = fbdevHWMapVidmem(pScrn))) {

- xf86DrvMsg(scrnIndex,X_ERROR,"mapping of video memory"

+ xf86DrvMsg(pScrn->scrnIndex,X_ERROR,"mapping of video memory"

" failed\n");

return FALSE;

}

@@ -680,17 +678,17 @@ FBDevScreenInit(int scrnIndex, ScreenPtr

fbdevHWSave(pScrn);


if (!fbdevHWModeInit(pScrn, pScrn->currentMode)) {

-xf86DrvMsg(scrnIndex,X_ERROR,"mode initialization failed\n");

+xf86DrvMsg(pScrn->scrnIndex,X_ERROR,"mode initialization failed\n");

return FALSE;

}

fbdevHWSaveScreen(pScreen, SCREEN_SAVER_ON);

-fbdevHWAdjustFrame(scrnIndex,0,0,0);

+fbdevHWAdjustFrame(pScrn,0,0);


/* mi layer */

miClearVisualTypes();

if (pScrn->bitsPerPixel > 8) {

if (!miSetVisualTypes(pScrn->depth, TrueColorMask, pScrn->rgbBits, TrueColor)) {

-xf86DrvMsg(scrnIndex,X_ERROR,"visual type setup failed"

+xf86DrvMsg(pScrn->scrnIndex,X_ERROR,"visual type setup failed"

" for %d bits per pixel [1]\n",
pScrn->bitsPerPixel);

return FALSE;

@@ -699,14 +697,14 @@ FBDevScreenInit(int scrnIndex, ScreenPtr

if (!miSetVisualTypes(pScrn->depth,

miGetDefaultVisualMask(pScrn->depth),
pScrn->rgbBits, pScrn->defaultVisual)) {

-xf86DrvMsg(scrnIndex,X_ERROR,"visual type setup failed"

+xf86DrvMsg(pScrn->scrnIndex,X_ERROR,"visual type setup failed"

" for %d bits per pixel [2]\n",
pScrn->bitsPerPixel);

return FALSE;

}

}

if (!miSetPixmapDepths()) {

- xf86DrvMsg(scrnIndex,X_ERROR,"pixmap depth setup failed\n");

+ xf86DrvMsg(pScrn->scrnIndex,X_ERROR,"pixmap depth setup failed\n");

return FALSE;

}


@@ -722,7 +720,7 @@ FBDevScreenInit(int scrnIndex, ScreenPtr

(pScrn->bitsPerPixel / 8);


if (pScrn->displayWidth != pScrn->virtualX) {

-xf86DrvMsg(scrnIndex, X_INFO,

+xf86DrvMsg(pScrn->scrnIndex, X_INFO,

"Pitch updated to %d after ModeInit\n",
pScrn->displayWidth);

}

@@ -762,7 +760,7 @@ FBDevScreenInit(int scrnIndex, ScreenPtr

init_picture = 1;

break;

default:

-xf86DrvMsg(scrnIndex, X_ERROR,

+xf86DrvMsg(pScrn->scrnIndex, X_ERROR,

"internal error: invalid number of bits per"
" pixel (%d) encountered in"
" FBDevScreenInit()\n", pScrn->bitsPerPixel);

@@ -773,7 +771,7 @@ FBDevScreenInit(int scrnIndex, ScreenPtr

case FBDEVHW_INTERLEAVED_PLANES:

/* This should never happen ...

* we should check for this much much earlier ... */

-xf86DrvMsg(scrnIndex, X_ERROR,

+xf86DrvMsg(pScrn->scrnIndex, X_ERROR,

"internal error: interleaved planes are not yet "
"supported by the fbdev driver\n");

ret = FALSE;

@@ -781,20 +779,20 @@ FBDevScreenInit(int scrnIndex, ScreenPtr

case FBDEVHW_TEXT:

/* This should never happen ...

* we should check for this much much earlier ... */

-xf86DrvMsg(scrnIndex, X_ERROR,

+xf86DrvMsg(pScrn->scrnIndex, X_ERROR,

"internal error: text mode is not supported by the "
"fbdev driver\n");

ret = FALSE;

break;

case FBDEVHW_VGA_PLANES:

/* Not supported yet */

-xf86DrvMsg(scrnIndex, X_ERROR,

+xf86DrvMsg(pScrn->scrnIndex, X_ERROR,

"internal error: EGA/VGA Planes are not yet "
"supported by the fbdev driver\n");

ret = FALSE;

break;

default:

-xf86DrvMsg(scrnIndex, X_ERROR,

+xf86DrvMsg(pScrn->scrnIndex, X_ERROR,

"internal error: unrecognised hardware type (%d) "
"encountered in FBDevScreenInit()\n", type);

ret = FALSE;

@@ -824,7 +822,7 @@ FBDevScreenInit(int scrnIndex, ScreenPtr

"Render extension initialisation failed\n");


if (fPtr->shadowFB && !FBDevShadowInit(pScreen)) {

- xf86DrvMsg(scrnIndex, X_ERROR,

+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,

"shadow framebuffer initialization failed\n");
return FALSE;

}

@@ -832,12 +830,12 @@ FBDevScreenInit(int scrnIndex, ScreenPtr

if (!fPtr->rotate)

FBDevDGAInit(pScrn, pScreen);

else {

- xf86DrvMsg(scrnIndex, X_INFO, "display rotated; disabling DGA\n");

- xf86DrvMsg(scrnIndex, X_INFO, "using driver rotation; disabling "

+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "display rotated; disabling DGA\n");

+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "using driver rotation; disabling "

"XRandR\n");
xf86DisableRandR();
if (pScrn->bitsPerPixel == 24)

- xf86DrvMsg(scrnIndex, X_WARNING, "rotation might be broken at 24 "

+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "rotation might be broken at 24 "

"bits per pixel\n");

}


@@ -854,29 +852,29 @@ FBDevScreenInit(int scrnIndex, ScreenPtr

/* XXX It would be simpler to use miCreateDefColormap() in all cases. */

case FBDEVHW_PACKED_PIXELS:

if (!miCreateDefColormap(pScreen)) {

-xf86DrvMsg(scrnIndex, X_ERROR,

+xf86DrvMsg(pScrn->scrnIndex, X_ERROR,

"internal error: miCreateDefColormap failed "

"in FBDevScreenInit()\n");

return FALSE;

}

break;

case FBDEVHW_INTERLEAVED_PLANES:

-xf86DrvMsg(scrnIndex, X_ERROR,

+xf86DrvMsg(pScrn->scrnIndex, X_ERROR,

"internal error: interleaved planes are not yet "
"supported by the fbdev driver\n");

return FALSE;

case FBDEVHW_TEXT:

-xf86DrvMsg(scrnIndex, X_ERROR,

+xf86DrvMsg(pScrn->scrnIndex, X_ERROR,

"internal error: text mode is not supported by "
"the fbdev driver\n");

return FALSE;

case FBDEVHW_VGA_PLANES:

-xf86DrvMsg(scrnIndex, X_ERROR,

+xf86DrvMsg(pScrn->scrnIndex, X_ERROR,

"internal error: EGA/VGA planes are not yet "
"supported by the fbdev driver\n");

return FALSE;

default:

-xf86DrvMsg(scrnIndex, X_ERROR,

+xf86DrvMsg(pScrn->scrnIndex, X_ERROR,

"internal error: unrecognised fbdev hardware type "
"(%d) encountered in FBDevScreenInit()\n", type);

return FALSE;

@@ -930,7 +928,7 @@ FBDevCloseScreen(int scrnIndex, ScreenPt


pScreen->CreateScreenResources = fPtr->CreateScreenResources;

pScreen->CloseScreen = fPtr->CloseScreen;

-return (*pScreen->CloseScreen)(scrnIndex, pScreen);

+return (*pScreen->CloseScreen)(pScreen);

}


@@ -1039,9 +1037,9 @@ FBDevDGASetMode(ScrnInfoPtr pScrn, DGAMo

frameY0 = pScrn->frameY0;

}


- if (!(*pScrn->SwitchMode)(scrnIdx, pMode, 0))

+ if (!(*pScrn->SwitchMode)(pScrn, pMode))

return FALSE;

- (*pScrn->AdjustFrame)(scrnIdx, frameX0, frameY0, 0);

+ (*pScrn->AdjustFrame)(pScrn, frameX0, frameY0);


return TRUE;

}

@@ -1049,7 +1047,7 @@ FBDevDGASetMode(ScrnInfoPtr pScrn, DGAMo

static void

FBDevDGASetViewport(ScrnInfoPtr pScrn, int x, int y, int flags)

{

- (*pScrn->AdjustFrame)(pScrn->pScreen->myNum, x, y, flags);

+ (*pScrn->AdjustFrame)(pScrn, x, y);

}


static int


Tizen xserver-xorg-input-evdev patch

Directory: tizen/adaptation/xorg/driver/xserver-xorg-input-evdev

diff --git a/src/evdev.c b/src/evdev.c

index 29e67e8..1039ab8 100755

--- a/src/evdev.c

+++ b/src/evdev.c

@@ -1556,7 +1556,7 @@ EvdevAddAbsValuatorClass(DeviceIntPtr device)

int mode = pEvdev->flags & EVDEV_TOUCHPAD ?

XIDependentTouch : XIDirectTouch;


- if (pEvdev->mtdev->caps.slot.maximum > 0)

+ if (pEvdev->mtdev && (pEvdev->mtdev->caps.slot.maximum > 0))

num_touches = pEvdev->mtdev->caps.slot.maximum;


if (!InitTouchClassDeviceStruct(device, num_touches, mode,

@@ -2541,7 +2541,8 @@ EvdevOpenDevice(InputInfoPtr pInfo)

xf86IDrvMsg(pInfo, X_WARNING, "device file is duplicate. Ignoring.\n");

close(pInfo->fd);

#ifdef MULTITOUCH

- mtdev_close_delete(pEvdev->mtdev);

+if(pEvdev->mtdev)

+ mtdev_close_delete(pEvdev->mtdev);

pEvdev->mtdev = NULL;

#endif

return BadMatch;

Tizen systemd patch

Directory: tizen/external/systemd

diff --git a/packaging/add-tmp.mount-as-tmpfs.patch b/packaging/add-tmp.mount-as-tmpfs.patch

index 9932966..a37f174 100644

--- a/packaging/add-tmp.mount-as-tmpfs.patch

+++ b/packaging/add-tmp.mount-as-tmpfs.patch

@@ -49,7 +49,7 @@ index 0000000..7c3e98c

+What=tmpfs

+Where=/tmp

+Type=tmpfs

-+Options=relatime,nodev,nosuid,noexec,size=128M,smackfsroot=*

++Options=relatime,nodev,nosuid,noexec,size=128M

--

1.7.10


diff --git a/packaging/default_oom_score.patch b/packaging/default_oom_score.patch

index 3e877c9..2ad92cc 100644

--- a/packaging/default_oom_score.patch

+++ b/packaging/default_oom_score.patch

@@ -32,27 +32,3 @@ index ed317b4..6b56a86 100644


if (arg_running_as == MANAGER_SYSTEM)

if (parse_proc_cmdline() < 0)

-diff --git a/src/system.conf b/src/system.conf

-index 33d09bc..c24a606 100644

---- a/src/system.conf

-+++ b/src/system.conf

-@@ -18,6 +18,7 @@

- #SysVConsole=yes

- #CrashChVT=1

- #CPUAffinity=1 2

-+DefaultOOMScoreAdj=-1000

- #MountAuto=yes

- #SwapAuto=yes

- #DefaultControllers=cpu

-diff --git a/src/user.conf b/src/user.conf

-index 9508a02..70c5540 100644

---- a/src/user.conf

-+++ b/src/user.conf

-@@ -8,6 +8,7 @@

- # See systemd.conf(5) for details

-

- [Manager]

-+DefaultOOMScoreAdj=-1000

- #LogLevel=info

- #LogTarget=console

- #LogColor=yes

diff --git a/packaging/enable-core-dumps-globally.patch b/packaging/enable-core-dumps-globally.patch

deleted file mode 100644

index ea60d97..0000000

--- a/packaging/enable-core-dumps-globally.patch

+++ /dev/null

@@ -1,17 +0,0 @@

-From 4e97690abedeb48640f07b9312c0fd3c1d7f3059 Mon Sep 17 00:00:00 2001

-From: Karol Lewandowski <k.lewandowsk@samsung.com>

-Date: Mon, 31 Dec 2012 14:35:36 +0100

-Subject: [PATCH] Enable core dumps globally

-

-diff --git a/src/system.conf b/src/system.conf

-index 33d09bc..6c6b7f5 100644

---- a/src/system.conf

-+++ b/src/system.conf

-@@ -24,3 +24,4 @@

- #DefaultStandardOutput=journal

- #DefaultStandardError=inherit

- #JoinControllers=cpu,cpuacct

-+DefaultLimitCORE=infinity

---

-1.7.10.4

-

diff --git a/packaging/systemd.spec b/packaging/systemd.spec

index b84044c..7e7856a 100644

--- a/packaging/systemd.spec

+++ b/packaging/systemd.spec

@@ -19,12 +19,11 @@ Patch6: tizen-preserve-hostname.patch

Patch7: util-never-follow-symlinks-in-rm_rf_children.patch

Patch8: util-introduce-memdup.patch

Patch9: main-allow-system-wide-limits-for-services.patch

-Patch10: enable-core-dumps-globally.patch

-Patch11: SMACK-Add-configuration-options.-v3.patch

-Patch12: reboot_syscall_param.patch

-Patch13: default_oom_score.patch

-Patch14: fix-syscall-NR_fanotify_mark-on-arm.patch

-Patch15: reboot-delay.patch

+Patch10: SMACK-Add-configuration-options.-v3.patch

+Patch11: reboot_syscall_param.patch

+Patch12: default_oom_score.patch

+Patch13: fix-syscall-NR_fanotify_mark-on-arm.patch

+Patch14: reboot-delay.patch


BuildRequires: pkgconfig(dbus-1) >= 1.4.0

BuildRequires: pkgconfig(dbus-glib-1)

@@ -52,16 +51,16 @@ implements an elaborate transactional dependency-based service

control logic. It can work as a drop-in replacement for sysvinit.


# tools package dislabled because of pycairo package dependency

-# %package tools

-# Summary: Analyze systemd startup timing

-# Group: Development/Tools

-# Requires: pycairo

-# Requires: python-xml

-# Requires: %{name} = %{version}-%{release}

+%package tools

+Summary: Analyze systemd startup timing

+Group: Development/Tools

+Requires: pycairo

+Requires: python-xml

+Requires: %{name} = %{version}-%{release}


-# %description tools

-# This package installs the systemd-analyze tool, which allows one to

-# inspect and graph service startup timing in table or graph format.

+%description tools

+This package installs the systemd-analyze tool, which allows one to

+inspect and graph service startup timing in table or graph format.


%package devel

Summary: Development tools for systemd

@@ -181,7 +180,6 @@ This package includes the man pages for systemd.

%patch12 -p1

%patch13 -p1

%patch14 -p1

-%patch15 -p1


%build

cp %{SOURCE1001} .

@@ -245,6 +243,9 @@ ln -s ../serial-getty@.service %{buildroot}%{_libdir}/systemd/system/getty.targe

#console-ttySAC2

ln -s ../serial-getty@.service %{buildroot}%{_libdir}/systemd/system/getty.target.wants/serial-getty@ttySAC2.service


+#console-ttyHSL0

+ln -s ../serial-getty@.service %{buildroot}%{_libdir}/systemd/system/getty.target.wants/serial-getty@ttyHSL0.service

+

#console-ttyS0

ln -s ../serial-getty@.service %{buildroot}%{_libdir}/systemd/system/getty.target.wants/serial-getty@ttyS0.service


@@ -356,10 +357,10 @@ ln -sf /proc/self/mounts /etc/mtab


# tools package dislabled because of pycairo package dependency

-# %files tools

-# %defattr(-,root,root,-)

-# %manifest systemd.manifest

-# %{_bindir}/systemd-analyze

+%files tools

+%defattr(-,root,root,-)

+%manifest systemd.manifest

+%{_bindir}/systemd-analyze


%files devel

%defattr(-,root,root,-)

diff --git a/src/system.conf b/src/system.conf

index 33d09bc..a6c8ce7 100644

--- a/src/system.conf

+++ b/src/system.conf

@@ -10,7 +10,10 @@

[Manager]

#LogLevel=info

#LogTarget=journal-or-kmsg

+#LogTarget=console

#LogColor=yes

+DefaultOOMScoreAdj=-1000

+DefaultLimitCORE=infinity

#LogLocation=no

#DumpCore=yes

#CrashShell=no

diff --git a/src/user.conf b/src/user.conf

index 9508a02..c166bdf 100644

--- a/src/user.conf

+++ b/src/user.conf

@@ -10,7 +10,8 @@

[Manager]

#LogLevel=info

#LogTarget=console

-#LogColor=yes

+LogColor=yes

+DefaultOOMScoreAdj=-1000

#LogLocation=no

#DefaultControllers=cpu

#DefaultStandardOutput=inherit

Tizen xorg-server patch

Directory: tizen/framework/uifw/xorg/server/xorg-server

diff --git a/hw/xfree86/common/Makefile.am b/hw/xfree86/common/Makefile.am

index f8fcde9..e1a3bad 100644

--- a/hw/xfree86/common/Makefile.am

+++ b/hw/xfree86/common/Makefile.am

@@ -63,7 +63,7 @@ sdk_HEADERS = compiler.h fourcc.h xf86.h xf86Module.h xf86Opt.h \

xf86cmap.h xf86fbman.h xf86str.h xf86Xinput.h xisb.h \

$(XVSDKINCS) $(XF86VMODE_SDK) $(DGA_SDK) xorgVersion.h \

xf86sbusBus.h xf86VGAarbiter.h xf86Optionstr.h xf86platformBus.h \

- xaarop.h

+ xaarop.h dgaproc.h


DISTCLEANFILES = xf86Build.h

CLEANFILES = $(BUILT_SOURCES)


Tizen toolchains build patch

Directory: tizen/toolchains/build

diff --git a/init_buildsystem b/init_buildsystem

index 44da2f0..1a83bbe 100755

--- a/init_buildsystem

+++ b/init_buildsystem

@@ -262,6 +262,7 @@ create_devs()

mknod loop1 640 b 7 1

mknod loop2 640 b 7 2

mknod loop3 640 b 7 3

+mknod kmsg 644 c 1 11

ln fd 777 /proc/self/fd

ln stdin 777 fd/0

ln stdout 777 fd/1

msm8916_32.ks

# -*-mic2-options-*- -f loop --pack-to=@NAME@.tar.gz -*-mic2-options-*-


#

# Do not Edit! Generated by:

# kickstarter.py

#


lang en_US.UTF-8

keyboard us

timezone --utc America/Los_Angeles

# ROOT fs partition

part / --size=3000 --ondisk mmcblk0p --fstype=ext4 --label=platform

# DATA partition

part /opt/ --size=3000 --ondisk mmcblk0p --fstype=ext4 --label=data

# UMS partition

part /opt/usr/ --size=3000 --ondisk mmcblk0p --fstype=ext4 --label=ums


rootpw tizen

bootloader --timeout=0 --append="rootdelay=5"


desktop --autologinuser=root

user --name root --groups audio,video --password


#repo --name=Tizen-main --baseurl=https://download.tizendev.org/snapshots/trunk/common/@BUILD_ID@/repos/tizen-main/armv7l/packages/ --save --ssl_verify=no

#repo --name=Tizen-base --baseurl=https://download.tizendev.org/snapshots/trunk/common/@BUILD_ID@/repos/tizen-base/armv7l/packages/ --ssl_verify=no

repo --name=Tizen-main --baseurl=http://download.tizen.org/releases/2.2/tizen-2.2/repos/tizen-main/armv7l/packages/ --save --ssl_verify=no --priority=99

repo --name=Tizen-base --baseurl=http://download.tizen.org/releases/2.2/tizen-2.2/repos/tizen-base/armv7l/packages/ --save --ssl_verify=no --priority=99

repo --name=local --baseurl=file:///home/t/GBS-ROOT/local/repos/tizen2.2/armv7l --priority=1


%packages --ignoremissing


@common

@apps-common

@apps-core

@osp

@development

@target-common

@target-rd-210


xorg-x11-drv-fbdev

alsa-scenario-scn-data-0-msm8x16-skui-snd-card

%end


%prepackages

eglibc

systemd

busybox

libacl

libcap

dbus-libs

libgcc

libudev

libattr

default-files-tizen

libprivilege-control-conf

security-server

libdlog

libsecurity-server-client

sqlite

tzdata-slp

vconf

tizen-coreutils

rpm-security-plugin

%end


%post

echo 'kickstart post script start'

if [ -d /etc/init.d ]; then

cp /etc/init.d/* /etc/rc.d/init.d/ -rdf

fi

rm -rf /etc/init.d*

ln -sf /etc/rc.d/init.d /etc/init.d


rm -rf /etc/localtime

ln -sf /opt/etc/localtime /etc/localtime

#rm -rf /usr/share/zoneinfo

#ln -sf /opt/share/zoneinfo /usr/share/zoneinfo


ssh-keygen -t rsa1 -f /etc/ssh/ssh_host_key -N ""

ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ""

ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ""


pkg_initdb


INITDB=1 ail_initdb


# ims-service domain setting

RESULT=`grep "192.168.0.163 config.45001.rcse" /etc/hosts`

if [ -z "$RESULT" ]; then

echo "Set domain for auto configuration"

echo "192.168.0.163 config.45001.rcse" >> /etc/hosts

else

echo "Already setted domain for test auto configuration"

fi

# ims-service domain setting


cat > /etc/fstab << EOF

#<file system><mount point><type><options><dump><pass>

none/procprocdefaults0 0

tmpfs /tmp tmpfs defaults 0 0

/opt/var/var bindbind0 0

none/syssysfs defaults0 0

# For new partition - 2012/08

/dev/mmcblk0p27/optext4defaults0 2

/dev/mmcblk0p25/opt/usr ext4defaults0 2

EOF


cat > /usr/lib/systemd/system/opt.mount << EOF

# Automaticall generated by mount-generator.pl


[Unit]

# FIXME: Is this required?

#SourcePath=/home/abuild/rpmbuild/BUILD/system-plugin-slp-0.0.1/etc/fstab

DefaultDependencies=no

Before=local-fs.target

Requires=fsck@dev-mmcblk0p27.service

After=local-fs-pre.target fsck@dev-mmcblk0p27.service resize2fs@dev-mmcblk0p27.service

Wants=resize2fs@dev-mmcblk0p27.service


[Mount]

What=/dev/mmcblk0p27

Where=/opt

Type=ext4

Options=defaults

EOF


cat > /usr/lib/systemd/system/opt-usr.mount << EOF

# Automaticall generated by mount-generator.pl


[Unit]

# FIXME: Is this required?

#SourcePath=/home/abuild/rpmbuild/BUILD/system-plugin-slp-0.0.1/etc/fstab

DefaultDependencies=no

Before=local-fs.target

Requires=fsck@dev-mmcblk0p25.service

After=local-fs-pre.target fsck@dev-mmcblk0p25.service resize2fs@dev-mmcblk0p25.service

Wants=resize2fs@dev-mmcblk0p25.service


[Mount]

What=/dev/mmcblk0p25

Where=/opt/usr

Type=ext4

Options=defaults

EOF


cat > /usr/lib/systemd/system/-.mount << EOF

# Automaticall generated by mount-generator.pl


[Unit]

# FIXME: Is this required?

#SourcePath=/home/abuild/rpmbuild/BUILD/system-plugin-slp-0.0.1/etc/fstab

DefaultDependencies=no

Before=local-fs.target

Requires=fsck-root.service

After=local-fs-pre.target fsck-root.service resize2fs-root.service

Wants=resize2fs-root.service


[Mount]

What=/dev/mmcblk0p23

Where=/

Type=ext4

Options=defaults

EOF


cat > /usr/lib/systemd/system/xresources.service << EOF

[Unit]

Description=Xresources

#After=tizen-runtime.target

#Requires=tizen-runtime.target


[Service]

Type=forking

#EnvironmentFile=/run/tizen-mobile-env

ExecStart=/etc/rc.d/init.d/xresources start

ExecStop=/etc/rc.d/init.d/xresources stop


[Install]

WantedBy=multi-user.target

EOF


cat > /etc/X11/xorg.conf.d/display.conf << EOF

Section "ServerLayout"

Identifier "Test Layout"

Screen 0 "Screen0" 0 0

#InputDevice"Gesture"

EndSection


Section "Screen"

Identifier "Screen0"

Device "Card0"

Monitor "Monitor0"

# SubSection "Display"

# Modes "320x480"

# EndSubSection

EndSection


Section "Monitor"

Identifier "Monitor0"

Option "DPMS" "true"

# DisplaySize 46 76

EndSection


Section "Device"

Identifier "Card0"

Driver "fbdev"

Option "fbdev" "/dev/fb0"

# Option "exa" "true"

# Option "dri2" "true"

# Option "sw_exa" "true"

# Option "tfb" "true"

# Option "cachable" "false"

EndSection

EOF


cat > /etc/X11/xorg.conf.d/input.conf << EOF

Section "ServerFlags"

Option "AllowEmptyInput" "true"

Option "AutoAddDevices" "true"

Option "AutoEnableDevices" "true"

EndSection


Section "InputClass"

Identifier "evdev touchscreen catchall"

MatchIsTouchScreen "on"

MatchDevicePath "/dev/input/event*"

Driver "evdevmultitouch"

Option "MultiTouch" "5"

EndSection


Section "InputClass"

Identifier "evdev pointer catchall"

MatchIsPointer "on"

MatchDevicePath "/dev/input/event*"

Driver "evdev"

EndSection


Section "InputClass"

Identifier "evdev keyboard catchall"

MatchIsKeyboard "on"

MatchDevicePath "/dev/input/event*"

Driver "evdev"

EndSection


Section "InputDevice"

Identifier "Gesture"

Driver "gesture"

Option "Device" "/dev/null"

EndSection

EOF


cat > /usr/lib/systemd/system/sdbd.service << EOF

[Unit]

Description=sdbd

After=default.target


[Service]

Type=forking

Environment=DISPLAY=:0

PIDFile=/tmp/.sdbd.pid

RemainAfterExit=yes

ExecStart=/bin/sh -c '/usr/sbin/sdbd; chmod 666 /dev/samsung_sdb; echo 0 > /sys/class/android_usb/android0/enable; echo 04E8 > /sys/class/android_usb/android0/idVendor; echo 2d00 > /sys/class/android_usb/android0/idProduct; echo sdb > /sys/class/android_usb/android0/functions; echo 1 > /sys/class/android_usb/android0/enable'

EOF


cat > /usr/lib/systemd/system/wakelock.service << EOF

[Unit]

Description=wakelock

After=default.target


[Service]

Type=forking

RemainAfterExit=yes

ExecStart=/bin/sh -c 'echo tizen_wakelock > /sys/power/wake_lock; echo 255 > /sys/devices/soc.0/gpio-leds.66/leds/button-backlight/brightness'

EOF


cat > /usr/lib/udev/rules.d/80-drivers.rules << EOF

# do not edit this file, it will be overwritten on update


ACTION=="remove", GOTO="drivers_end"


DRIVER!="?*", ENV{MODALIAS}=="?*", IMPORT{builtin}="kmod load $env{MODALIAS}"

SUBSYSTEM=="tifm", ENV{TIFM_CARD_TYPE}=="SD", IMPORT{builtin}="kmod load tifm_sd"

SUBSYSTEM=="tifm", ENV{TIFM_CARD_TYPE}=="MS", IMPORT{builtin}="kmod load tifm_ms"

SUBSYSTEM=="memstick", IMPORT{builtin}="kmod load ms_block mspro_block"

SUBSYSTEM=="i2o", IMPORT{builtin}="kmod load i2o_block"

SUBSYSTEM=="module", KERNEL=="parport_pc", IMPORT{builtin}="kmod load ppdev"


# From here on follows the hotplug agents which do not load modules

LABEL="hotplug_driver_loaded"


#SUBSYSTEM=="firmware",RUN+="firmware.agent"


LABEL="drivers_end"

EOF


cat > /usr/bin/wlan.sh << EOF

#!/bin/sh


case $1 in

"start")

echo "start wifi"

#insmod /system/lib/modules/wlan.ko

;;

"stop")

echo "stop wifi"

#rmmod /system/lib/modules/wlan.ko

;;

"status")

echo "show status"

;;

*)

exit 1

;;

esac

EOF

chmod +x /usr/bin/wlan.sh


cat > /usr/lib/systemd/system/run_modem.service << EOF

[Unit]

Description=qualcom modem

After=media-server.service


[Service]

Type=oneshot

ExecStart=-/bin/bash -c "sleep 15; exec /bin/run_init.sh"


[Install]

WantedBy=multi-user.target

EOF

ln -s /usr/lib/systemd/system/run_modem.service /usr/lib/systemd/system/multi-user.target.wants/run_modem.service


cat > /bin/run_init.sh << EOF

#!/bin/sh

rm -f /dev/__properties__

sync

/system/bin/init &

sleep 5

/system/bin/tinymix "PRI_MI2S_RX Audio Mixer MultiMedia1" 1

/system/bin/tinymix "MultiMedia1 Mixer TERT_MI2S_TX" 1

/system/bin/tinymix "RX3 MIX1 INP1" "RX1"

/system/bin/tinymix "SPK DAC Switch" 1

/system/bin/tinymix "DEC1 MUX" "ADC1"

/system/bin/tinymix "MICBIAS CAPLESS Switch" 1

sleep 1

/usr/bin/sound_server -S &

sleep 2

/usr/bin/sound_initializer -i

sleep 2

/usr/bin/pulseaudio --log-level=4 --system -D

EOF

chmod +x /bin/run_init.sh


mv /usr/lib/systemd/system/boot.mount /usr/lib/systemd/system/boot.mount.disable

mv /usr/lib/systemd/system/smack.mount /usr/lib/systemd/system/smack.mount.disable

mv /usr/lib/systemd/system/csa.mount /usr/lib/systemd/system/csa.mount.disable

mv /usr/lib/systemd/system/mnt-csc.mount /usr/lib/systemd/system/mnt-csc.mount.disable

mv /usr/lib/systemd/system/smack-default-labeling.service /usr/lib/systemd/system/smack-default-labeling.service.disable

mv /usr/lib/systemd/system/smack.service /usr/lib/systemd/system/smack.service.disable

mv /usr/lib/systemd/system/smack-rules.service /usr/lib/systemd/smack-rules.service.disable

ln -s /usr/lib/systemd/system/sdbd.service /usr/lib/systemd/system/multi-user.target.wants/sdbd.service

ln -s /usr/lib/systemd/system/wakelock.service /usr/lib/systemd/system/multi-user.target.wants/wakelock.service


cat > /usr/bin/press << EOF

#!/bin/sh


JUNK="SLP"


[ "\$1" ] && TIMEOUT="\$1" || TIMEOUT="1"


echo "Press return key to stop scripts"

read -t \$TIMEOUT JUNK

exit \$?

EOF

chmod +x /usr/bin/press


# [systemd] we need suid-root X for it to work from user-session

# Xorg will move to system, so this is temporary

chmod 4755 /usr/bin/Xorg


ln -s /opt/etc/X11/xkb /usr/share/X11


echo "UDEV_PERSISTENT_STORAGE=no" >> /etc/sysconfig/udev


# for QA

mv /usr/include/python2.7/pyconfig.h /usr/pyconfig.h

rm -rf /usr/include/*

mkdir -p /usr/include/python2.7

mv /usr/pyconfig.h /usr/include/python2.7/pyconfig.h

#rm -rf /usr/include

rm -rf /usr/share/man

rm -rf /usr/share/doc


ldconfig


mkdir -p /opt/var/lib/dbus


# read-writeable /var will be bind-mounted to /opt/var leaving rootfs read-only

# below script more generic


rm -f /var/lib/rpm/__db*

rpm --rebuilddb

cp -a /var /opt/

rm -rf /var

mkdir /var


# [systemd] some firstboot script like kbd could be done to image-creatation stage

# this patch is for it.

for i in /etc/preconf.d/*; do

$i

done


if [ -e /usr/bin/build-backup-data.sh ]; then

/usr/bin/build-backup-data.sh

fi


ln -sf /etc/info.ini /opt/etc/info.ini

ln -sf /etc/info.ini /usr/etc/info.ini


# Without this line the rpm don't get the architecture right.

echo -n 'armv7l-tizen-linux' > /etc/rpm/platform


/etc/make_info_file.sh Ref.Device-210 Tizen_Ref.Device-210_`date +%Y%m%d.%H%M`


%end


%post --nochroot

if [ -f /etc/device-sec-policy ]; then

cp -fp /etc/device-sec-policy $INSTALL_ROOT/etc/

fi


if [ -d /etc/smack/accesses.d ]; then

mkdir -p $INSTALL_ROOT/opt/etc/smack/accesses.d

cp -rfp /etc/smack/accesses.d/* $INSTALL_ROOT/opt/etc/smack/accesses.d/

fi


%end


Resources