Skip to content

Commit

Permalink
Merge pull request #2 from goldfish07/android-9.0
Browse files Browse the repository at this point in the history
Common changes from branch android-9.0
  • Loading branch information
goldfish07 committed Aug 18, 2022
2 parents 18cdb67 + 4f31401 commit 226708d
Show file tree
Hide file tree
Showing 25 changed files with 233 additions and 6,390 deletions.
15 changes: 15 additions & 0 deletions Android.mk
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# Copyright (C) 2017-2020 The LineageOS Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


LOCAL_PATH := $(call my-dir)

ifeq ($(TARGET_DEVICE),j8y18lte)
Expand Down
8 changes: 0 additions & 8 deletions AndroidBoard.mk

This file was deleted.

15 changes: 15 additions & 0 deletions AndroidProducts.mk
Original file line number Diff line number Diff line change
@@ -1,2 +1,17 @@
# Copyright (C) 2017-2020 The LineageOS Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


PRODUCT_MAKEFILES := \
$(LOCAL_DIR)/lineage_j8y18lte.mk
56 changes: 24 additions & 32 deletions BoardConfig.mk
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
USE_CAMERA_STUB := true
LOCAL_PATH := $(call my-dir)
DEVICE_PATH := device/samsung/j8y18lte
# Copyright (C) 2017-2020 The LineageOS Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

LOCAL_PATH := device/samsung/j8y18lte
# inherit from the proprietary version
-include vendor/samsung/j8y18lte/BoardConfigVendor.mk

OLD_PLATFORM := \
8.0.0 \
8.1.0 \

ifeq ($(strip OLD_PLATFORM,$(PLATFORM_VERSION)),)

TARGET_ARCH := arm
TARGET_ARCH_VARIANT := armv7-a-neon
TARGET_CPU_ABI := armeabi-v7a
TARGET_CPU_ABI2 := armeabi
TARGET_CPU_VARIANT := cortex-a53

else

TARGET_ARCH := arm64
TARGET_CPU_ABI := arm64-v8a
TARGET_CPU_ABI2 :=
Expand All @@ -28,7 +27,7 @@ TARGET_2ND_CPU_ABI := armeabi-v7a
TARGET_2ND_CPU_ABI2 := armeabi
TARGET_2ND_ARCH_VARIANT := armv8-a
TARGET_2ND_CPU_VARIANT := cortex-a53
endif

TARGET_CPU_CORTEX_A53 := true

TARGET_NO_BOOTLOADER := true
Expand All @@ -43,31 +42,20 @@ TARGET_BOOTLOADER_BOARD_NAME := MSM8953
TARGET_BOARD_SUFFIX := _64
TARGET_USES_64_BIT_BINDER := true

BUILD_PREBUILT_KERNEL:= false

# Kernel
TARGET_KERNEL_ARCH := arm64
BOARD_KERNEL_BASE := 0x80000000
BOARD_RAMDISK_OFFSET := 0x02000000
BOARD_TAGS_OFFSET := 0x01e00000
BOARD_KERNEL_PAGESIZE := 2048
ifeq ($(BUILD_PREBUILT_KERNEL),true)
$(warning BUILD_PREBUILT_KERNEL is enabled, will use prebuilt kernel)
TARGET_PREBUILT_KERNEL := $(DEVICE_PATH)/prebuilt/Image.gz-dtb
else
#TARGET_PREBUILT_KERNEL := $(LOCAL_PATH)/prebuilt/Image.gz-dtb
TARGET_KERNEL_SOURCE := kernel/samsung/j8y18lte
TARGET_KERNEL_CONFIG := j8y18lte_defconfig
endif
BOARD_KERNEL_IMAGE_NAME := Image.gz-dtb
BOARD_KERNEL_CMDLINE := console=null androidboot.hardware=qcom msm_rtb.filter=0x237 ehci-hcd.park=3 androidboot.bootdevice=7824900.sdhci lpm_levels.sleep_disabled=1 androidboot.selinux=permissive androidboot.usbcontroller=7000000.dwc3

BOARD_MKBOOTIMG_ARGS := --ramdisk_offset $(BOARD_RAMDISK_OFFSET) --tags_offset $(BOARD_TAGS_OFFSET)

ifeq ($(strip OLD_PLATFORM,$(PLATFORM_VERSION)),)
# Kernel toolchains
TARGET_KERNEL_CROSS_COMPILE_PREFIX := aarch64-linux-android-
KERNEL_TOOLCHAIN := prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin
endif
# Partitions
BOARD_BOOTIMAGE_PARTITION_SIZE := 33554432 #25
BOARD_RECOVERYIMAGE_PARTITION_SIZE := 33554432 #26
Expand All @@ -78,6 +66,10 @@ BOARD_VENDORIMAGE_PARTITION_SIZE := 503316480 #41
BOARD_PERSISTIMAGE_PARTITION_SIZE := 1048576 #31
BOARD_FLASH_BLOCK_SIZE := 131072

#Init
TARGET_INIT_VENDOR_LIB := libinit_j8y18lte
TARGET_RECOVERY_DEVICE_MODULES := libinit_j8y18lte
TARGET_PLATFORM_DEVICE_BASE := /devices/soc/

# Recovery
BOARD_HAS_NO_SELECT_BUTTON := true
Expand All @@ -87,8 +79,8 @@ BOARD_SUPPRESS_SECURE_ERASE := true
BOARD_HAS_DOWNLOAD_MODE := true
TARGET_USERIMAGES_USE_EXT4 := true
BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4
TARGET_RECOVERY_FSTAB := $(DEVICE_PATH)/recovery.fstab
TARGET_RECOVERY_FSTAB := $(LOCAL_PATH)/recovery.fstab

# filesystem
TARGET_USES_MKE2FS:=true
include $(DEVICE_PATH)/twrp.mk
include $(LOCAL_PATH)/twrp.mk
31 changes: 16 additions & 15 deletions device_j8y18lte.mk
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
# Copyright (C) 2017-2020 The LineageOS Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


$(call inherit-product, $(SRC_TARGET_DIR)/product/languages_full.mk)


$(call inherit-product-if-exists, vendor/samsung/j8y18lte/j8y18lte-vendor.mk)

DEVICE_PACKAGE_OVERLAYS += device/samsung/j8y18lte/overlay

# Screen density
PRODUCT_AAPT_CONFIG := normal
Expand All @@ -13,26 +27,13 @@ PRODUCT_AAPT_PREF_CONFIG := xhdpi
TARGET_SCREEN_HEIGHT := 1480
TARGET_SCREEN_WIDTH := 720

# Ramdisk
PRODUCT_PACKAGES += \
fstab.qcom \
init.j8y18lte \
init.msm.usb.configfs.rc \
init.qcom.factory.rc \
init.qcom.rc \
init.qcom.usb.rc \
init.samsung.bsp.rc \
init.samsung.rc \
init.target.rc \
ueventd.rc \

PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \
ro.treble.enabled=true \
sys.usb.controller=7000000.dwc3

# Time Zone Data
PRODUCT_COPY_FILES += \
system/timezone/output_data/iana/tzdata:recovery/root/system/usr/share/zoneinfo/tzdata
system/timezone/output_data/iana/tzdata:recovery/root/system_root/usr/share/zoneinfo/tzdata


# Disable adb security
Expand Down
14 changes: 14 additions & 0 deletions extract-files.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
#!/bin/bash

# Copyright (C) 2017-2020 The LineageOS Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


if [ $# -eq 0 ]; then
SRC=adb
Expand Down
28 changes: 28 additions & 0 deletions init/Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#
# Copyright (C) 2017-2020 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := optional
LOCAL_C_INCLUDES := \
system/core/base/include \
system/core/init
LOCAL_SRC_FILES := init_j8y18lte.cpp
LOCAL_MODULE := libinit_j8y18lte

include $(BUILD_STATIC_LIBRARY)
60 changes: 60 additions & 0 deletions init/init_j8y18lte.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
Copyright (C) 2017-2020 The Android Open Source Project
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of The Linux Foundation nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <cstdlib>
#include <unistd.h>
#include <fcntl.h>
#include <android-base/logging.h>
#include <android-base/properties.h>

#include "property_service.h"
#include "log.h"

namespace android {
namespace init {

void load_properties(const char *msm) {
property_set("ro.product.board", msm);
}

void vendor_load_properties() {
property_set("ro.build.date", "Wed Jul 8 17:53:40 KST 2020");
property_set("ro.build.date.utc", "1594198420");
property_set("ro.product.carrier", "SAMSUNG-SAMSUNG_J810G");
std::string platform_type = android::base::GetProperty("ro.boot.platformtype", "");
if (platform_type == "msm8953")
{
load_properties("MSM8953");
}
else
{
load_properties("MSM8937");
}
}

} // namespace init
} // namespace android
19 changes: 17 additions & 2 deletions lineage_j8y18lte.mk
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# Copyright (C) 2017-2020 The LineageOS Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


# Inherit from those products. Most specific first.
$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk)
Expand All @@ -20,7 +35,7 @@ PRODUCT_MODEL := j8y18lte
PRODUCT_MANUFACTURER := samsung

PRODUCT_BUILD_PROP_OVERRIDES += \
PRIVATE_BUILD_DESC="j8y18ltedd-user 9 PPR1.180610.011 J810GDDU3BTF1 release-keys"
PRIVATE_BUILD_DESC="j8y18ltedd-user 10 QP1A.190711.020 J810GDDU3CTG3 release-keys"

#BUILD_FINGERPRINT variable to be picked up by both system and vendor build.prop
BUILD_FINGERPRINT := samsung/j8y18ltedd/j8y18lte:9/PPR1.180610.011/J810GDDU3BTF1:user/release-keys
BUILD_FINGERPRINT := samsung/j8y18ltedd/j8y18lte:10/QP1A.190711.020/J810GDDU3CTG3:user/release-keys
Binary file modified prebuilt/Image.gz-dtb
Binary file not shown.
Loading

0 comments on commit 226708d

Please sign in to comment.