mirror of
https://github.com/chararomandroid/android_device_samsung_a20
synced 2026-08-22 20:15:32 -04:00
universal7885: Inital port to A20/A20e
Addtitionally, Add device-specific trees as well Change-Id: Icbbc31c063b18bce3702d0b208a0aee78148a7c0 Signed-off-by: roynatech2544 <whiteshell2544@naver.com>
This commit is contained in:
parent
601b5ef5aa
commit
f8eb3e1258
169 changed files with 2440 additions and 62 deletions
28
universal7885-common/recovery/Android.bp
Normal file
28
universal7885-common/recovery/Android.bp
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
//
|
||||
// Copyright (C) 2021 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.
|
||||
//
|
||||
|
||||
cc_library_static {
|
||||
name: "librecovery_updater_universal7884B",
|
||||
srcs: [
|
||||
"recovery_updater.cpp",
|
||||
],
|
||||
include_dirs: [
|
||||
"system/core/base/include",
|
||||
"bootable/recovery",
|
||||
"bootable/recovery/edify/include",
|
||||
"bootable/recovery/otautil/include"
|
||||
],
|
||||
}
|
||||
9
universal7885-common/recovery/Android.mk
Normal file
9
universal7885-common/recovery/Android.mk
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := init.recovery.exynos7884B.rc
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
LOCAL_MODULE_CLASS := ETC
|
||||
LOCAL_SRC_FILES := init.recovery.exynos7884B.rc
|
||||
LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)
|
||||
include $(BUILD_PREBUILT)
|
||||
11
universal7885-common/recovery/init.recovery.exynos7884B.rc
Normal file
11
universal7885-common/recovery/init.recovery.exynos7884B.rc
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
on init
|
||||
setprop sys.usb.configfs 1
|
||||
|
||||
on fs
|
||||
wait /dev/block/platform/13500000.dwmmc0
|
||||
symlink /dev/block/platform/13500000.dwmmc0 /dev/block/bootdevice
|
||||
|
||||
symlink /dev/block/bootdevice/by-name/BOOT /dev/block/bootdevice/by-name/boot
|
||||
symlink /dev/block/bootdevice/by-name/SYSTEM /dev/block/bootdevice/by-name/system
|
||||
symlink /dev/block/bootdevice/by-name/VENDOR /dev/block/bootdevice/by-name/vendor
|
||||
symlink /dev/block/bootdevice/by-name/CACHE /dev/block/bootdevice/by-name/cache
|
||||
51
universal7885-common/recovery/recovery_updater.cpp
Normal file
51
universal7885-common/recovery/recovery_updater.cpp
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
* Copyright (C) 2021, 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.
|
||||
*/
|
||||
|
||||
#include <android-base/properties.h>
|
||||
|
||||
#include "edify/expr.h"
|
||||
#include "otautil/error_code.h"
|
||||
|
||||
Value *VerifyBootloader(const char *name, State *state,
|
||||
const std::vector<std::unique_ptr<Expr>> &argv) {
|
||||
int ret = 0;
|
||||
std::string bootloader = android::base::GetProperty("ro.boot.bootloader", "");
|
||||
if (bootloader.empty()) {
|
||||
return ErrorAbort(state, kFileGetPropFailure,
|
||||
"%s() failed to read current bootloader version", name);
|
||||
}
|
||||
|
||||
std::string min_supported_bootloader_arg;
|
||||
if (argv.empty() || !Evaluate(state, argv[0], &min_supported_bootloader_arg)) {
|
||||
return ErrorAbort(state, kArgsParsingFailure,
|
||||
"%s() error parsing arguments", name);
|
||||
}
|
||||
int min_supported_bootloader = int(min_supported_bootloader_arg[0]);
|
||||
|
||||
int version = 0;
|
||||
if (bootloader.length() >= 4)
|
||||
version = int(bootloader[bootloader.length() - 4]);
|
||||
|
||||
if (version >= min_supported_bootloader) {
|
||||
ret = 1;
|
||||
}
|
||||
|
||||
return StringValue(std::to_string(ret));
|
||||
}
|
||||
|
||||
void Register_librecovery_updater_universal7884B() {
|
||||
RegisterFunction("universal7884B.verify_bootloader_min", VerifyBootloader);
|
||||
}
|
||||
Loading…
Reference in a new issue