Skip to content

Commit 82aee20

Browse files
committed
a3y17lte: Add init
0 parents  commit 82aee20

File tree

13 files changed

+338
-0
lines changed

13 files changed

+338
-0
lines changed

.travis.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
sudo: required
2+
services:
3+
- docker
4+
before_install:
5+
- docker pull yshalsager/cyanogenmod:latest
6+
before_script:
7+
- cd $HOME && mkdir twrp
8+
- wget -q https://github.com/TwrpBuilder/twrp-sources/releases/download/omni_twrp-5.1.1-20180211/omni_twrp-5.1.1-20180211-norepo.tar.xz
9+
-O $HOME/twrp.tar.xz
10+
- tar -xJf twrp.tar.xz --directory $HOME/twrp/ && rm twrp.tar.xz
11+
script:
12+
- cd $HOME/twrp/ && git clone https://github.com/TwrpBuilder/android_device_a3y17lte.git device/samsung/a3y17lte
13+
- git clone https://github.com/TwrpBuilder/device_generic_twrpbuilder.git device/generic/twrpbuilder
14+
- rm -rf bootable/recovery && git clone https://github.com/omnirom/android_bootable_recovery.git bootable/recovery
15+
- |
16+
docker run --rm -i -e USER_ID=$(id -u) -e GROUP_ID=$(id -g) -v "$(pwd):/home/cmbuild/twrp/:rw,z" yshalsager/cyanogenmod bash << EOF
17+
cd /home/cmbuild/twrp/
18+
source build/envsetup.sh && lunch omni_a3y17lte-userdebug && make -j16 recoveryimage
19+
exit
20+
EOF
21+
after_success:
22+
- export version=$(cat bootable/recovery/variables.h | grep "define TW_MAIN_VERSION_STR" | cut -d '"' -f2)
23+
- cp $HOME/twrp/out/target/product/a3y17lte/recovery.img $HOME/twrp/TWRP-$version-a3y17lte-$(date +"%Y%m%d").img
24+
25+
deploy:
26+
skip_cleanup: true
27+
provider: releases
28+
api_key: "$GIT_OAUTH_TOKEN_TB"
29+
file_glob: true
30+
file: $HOME/twrp/*.img
31+
on:
32+
tags: false
33+
repo: TwrpBuilder/android_device_a3y17lte
34+
branch: master
35+
36+
branches:
37+
except:
38+
- /^(?i:untagged)-.*$/

Android.mk

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#
2+
# Copyright (C) 2018 The TwrpBuilder Open-Source Project
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
ifneq ($(filter a3y17lte,$(TARGET_DEVICE)),)
18+
19+
LOCAL_PATH := device/samsung/a3y17lte
20+
21+
include $(call all-makefiles-under,$(LOCAL_PATH))
22+
23+
endif

AndroidProducts.mk

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#
2+
# Copyright (C) 2018 The TwrpBuilder Open-Source Project
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
LOCAL_PATH := device/samsung/a3y17lte
18+
19+
PRODUCT_MAKEFILES := $(LOCAL_PATH)/omni_a3y17lte.mk

BoardConfig.mk

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#
2+
# Copyright (C) 2018 The TwrpBuilder Open-Source Project
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
LOCAL_PATH := device/samsung/a3y17lte
18+
19+
TARGET_BOARD_PLATFORM := exynos5
20+
TARGET_BOOTLOADER_BOARD_NAME := a3y17lte
21+
22+
# Recovery
23+
TARGET_USERIMAGES_USE_EXT4 := true
24+
BOARD_RECOVERYIMAGE_PARTITION_SIZE := 39845888
25+
BOARD_FLASH_BLOCK_SIZE := 1000000
26+
BOARD_HAS_NO_REAL_SDCARD := true
27+
TW_EXCLUDE_SUPERSU := true
28+
include $(LOCAL_PATH)/kernel.mk
29+
BOARD_CUSTOM_BOOTIMG_MK := device/generic/twrpbuilder/seEnforcing.mk
30+
include device/generic/twrpbuilder/BoardConfig32.mk
31+
32+
# Init
33+
TARGET_INIT_VENDOR_LIB := libinit_sec
34+

dt.img

476 KB
Binary file not shown.

init/Android.mk

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#
2+
# Copyright (C) 2018 The LineageOS Project
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
LOCAL_PATH := $(call my-dir)
18+
19+
include $(CLEAR_VARS)
20+
21+
LOCAL_MODULE_TAGS := optional
22+
LOCAL_C_INCLUDES := \
23+
system/core/base/include \
24+
system/core/init
25+
LOCAL_CFLAGS := -Wall -DANDROID_TARGET=\"$(TARGET_BOARD_PLATFORM)\"
26+
LOCAL_SRC_FILES := init_sec.cpp
27+
LOCAL_MODULE := libinit_sec
28+
LOCAL_STATIC_LIBRARIES += libbase
29+
30+
include $(BUILD_STATIC_LIBRARY)

init/init.cpp

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
2+
/*
3+
Copyright (c) 2018, The Lineage Project. All rights reserved.
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions are
6+
met:
7+
* Redistributions of source code must retain the above copyright
8+
notice, this list of conditions and the following disclaimer.
9+
* Redistributions in binary form must reproduce the above
10+
copyright notice, this list of conditions and the following
11+
disclaimer in the documentation and/or other materials provided
12+
with the distribution.
13+
* Neither the name of The Linux Foundation nor the names of its
14+
contributors may be used to endorse or promote products derived
15+
from this software without specific prior written permission.
16+
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17+
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20+
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23+
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24+
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25+
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26+
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27+
*/
28+
29+
#include <stdlib.h>
30+
#include <string.h>
31+
#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
32+
#include <sys/_system_properties.h>
33+
34+
#include <android-base/file.h>
35+
#include <android-base/logging.h>
36+
#include <android-base/strings.h>
37+
#include <android-base/properties.h>
38+
39+
#include "property_service.h"
40+
#include "vendor_init.h"
41+
42+
using android::base::GetProperty;
43+
using android::base::ReadFileToString;
44+
using android::base::Trim;
45+
46+
void property_override(char const prop[], char const value[])
47+
{
48+
prop_info *pi;
49+
50+
pi = (prop_info*) __system_property_find(prop);
51+
if (pi)
52+
__system_property_update(pi, value, strlen(value));
53+
else
54+
__system_property_add(prop, strlen(prop), value, strlen(value));
55+
}
56+
57+
void property_override_dual(char const system_prop[],
58+
char const vendor_prop[], char const value[])
59+
{
60+
property_override(system_prop, value);
61+
property_override(vendor_prop, value);
62+
}
63+
64+
65+
void vendor_load_properties()
66+
{
67+
std::string platform;
68+
std::string bootloader = GetProperty("ro.bootloader", "");
69+
std::string device;
70+
71+
platform = GetProperty("ro.board.platform", "");
72+
if (platform != ANDROID_TARGET)
73+
return;
74+
75+
if (bootloader.find("A320F") != std::string::npos) {
76+
77+
/* SM-A320F */
78+
property_override_dual("ro.product.model", "ro.vendor.product.model", "SM-A320F");
79+
property_override_dual("ro.product.device", "ro.vendor.product.device", "a3y17ltexx");
80+
81+
} else if (bootloader.find("A320Y") != std::string::npos) {
82+
83+
/* SM-A320Y */
84+
property_override_dual("ro.product.model", "ro.vendor.product.model", "SM-A320Y");
85+
property_override_dual("ro.product.device", "ro.vendor.product.device", "a3y17ltelk");
86+
87+
} else if (bootloader.find("A320FL") != std::string::npos) {
88+
89+
/* SM-A320FL */
90+
property_override_dual("ro.product.model", "ro.vendor.product.model", "SM-A320FL");
91+
property_override_dual("ro.product.device", "ro.vendor.product.device", "a3xeltexc");
92+
93+
94+
}
95+
96+
}

kernel

14.4 MB
Binary file not shown.

kernel.mk

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#
2+
# Copyright (C) 2018 The TwrpBuilder Open-Source Project
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
# Kernel
18+
TARGET_PREBUILT_KERNEL := device/samsung/a3y17lte/kernel
19+
BOARD_KERNEL_CMDLINE := androidboot.selinux=permissive
20+
BOARD_KERNEL_BASE := 0x10000000
21+
BOARD_KERNEL_PAGESIZE := 2048
22+
BOARD_MKBOOTIMG_ARGS := --ramdisk_offset 0x01000000 --tags_offset 0x00000100 --dt device/samsung/a3y17lte/dt.img

omni_a3y17lte.mk

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#
2+
# Copyright (C) 2018 The TwrpBuilder Open-Source Project
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base.mk)
18+
19+
PRODUCT_COPY_FILES += device/samsung/a3y17lte/kernel:kernel
20+
21+
PRODUCT_DEVICE := a3y17lte
22+
PRODUCT_NAME := omni_a3y17lte
23+
PRODUCT_BRAND := samsung
24+
PRODUCT_MODEL := SM-A320FL
25+
PRODUCT_MANUFACTURER := samsung

0 commit comments

Comments
 (0)