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:
roynatech2544 2021-10-21 22:38:36 +09:00
commit f8eb3e1258
No known key found for this signature in database
GPG key ID: 9675C32163D88D30
169 changed files with 2440 additions and 62 deletions

View 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"
],
}

View 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)

View 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

View 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);
}