Revert "nx: Flash dummy super on clean install"
This reverts commit c5b488c9de.
Change-Id: I8ce38f3546ed094707637d5f4d2f6dfed11d8f7b
This commit is contained in:
1 parent
f86793bea9
commit
f3adc1169d
5 files changed
-97
No files matched your search
@@ -35,16 +35,3 @@ $(CEC_XML_SYMLINK): $(LOCAL_INSTALLED_MODULE)
|
||||
$(hide) ln -sf /data/vendor/permissions/android.hardware.hdmi.cec.xml $@
|
||||
|
||||
ALL_DEFAULT_INSTALLED_MODULES += $(CEC_XML_SYMLINK)
|
||||
|
||||
LPFLASH := $(HOST_OUT_EXECUTABLES)/lpflash$(HOST_EXECUTABLE_SUFFIX)
|
||||
INSTALLED_SUPERIMAGE_DUMMY_TARGET := $(PRODUCT_OUT)/super_dummy.img
|
||||
|
||||
$(INSTALLED_SUPERIMAGE_DUMMY_TARGET): $(PRODUCT_OUT)/super_empty.img $(LPFLASH)
|
||||
$(call pretty,"Target dummy super image: $@")
|
||||
$(hide) touch $@
|
||||
$(hide) $(LPFLASH) $@ $(PRODUCT_OUT)/super_empty.img
|
||||
|
||||
.PHONY: super_dummyimage
|
||||
super_dummyimage: $(INSTALLED_SUPERIMAGE_DUMMY_TARGET)
|
||||
|
||||
INSTALLED_RADIOIMAGE_TARGET += $(INSTALLED_SUPERIMAGE_DUMMY_TARGET)
|
||||
@@ -86,7 +86,6 @@ TARGET_RECOVERY_PIXEL_FORMAT := BGRA_8888
|
||||
|
||||
# Releasetools
|
||||
TARGET_RELEASETOOLS_EXTENSIONS := device/nintendo/nx/releasetools
|
||||
TARGET_RECOVERY_UPDATER_LIBS += librecovery_updater_nx
|
||||
|
||||
# Security Patch Level
|
||||
VENDOR_SECURITY_PATCH := 2022-04-05
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2024 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)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := librecovery_updater_nx
|
||||
LOCAL_SRC_FILES := recovery_updater.cpp
|
||||
LOCAL_STATIC_LIBRARIES += libedify libotautil libbase
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
@@ -1,47 +0,0 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
/**
|
||||
* @name recovery_updater.cpp
|
||||
* @author Thomas Makin
|
||||
* @brief NX-specific edify updater command additions.
|
||||
* @copyright 2024 The LineageOS Project
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <android-base/logging.h>
|
||||
|
||||
#include "edify/expr.h"
|
||||
#include "otautil/error_code.h"
|
||||
|
||||
#define MAGIC_OFFSET 4096
|
||||
#define MAGIC_SZ 4
|
||||
#define MAGIC "gDla" // 67446c61
|
||||
|
||||
Value *CheckSuperFn(const char *name, State *state,
|
||||
[[maybe_unused]] const std::vector<std::unique_ptr<Expr>> &argv)
|
||||
{
|
||||
FILE *fd = fopen("/dev/block/by-name/super", "r");
|
||||
char read_magic[MAGIC_SZ+1];
|
||||
|
||||
if(!fd)
|
||||
return ErrorAbort(state, kArgsParsingFailure, "%s(): Failed to get file", name);
|
||||
|
||||
fseek(fd, MAGIC_OFFSET, SEEK_SET);
|
||||
fgets(read_magic, (MAGIC_SZ + 1), fd);
|
||||
|
||||
LOG(INFO) << name << ": magic read from file: " << read_magic;
|
||||
|
||||
fclose(fd);
|
||||
|
||||
if(!strcmp(read_magic, MAGIC))
|
||||
return StringValue("SUCCESS");
|
||||
|
||||
return StringValue("");
|
||||
}
|
||||
|
||||
void Register_librecovery_updater_nx()
|
||||
{
|
||||
RegisterFunction("nx.check_super", CheckSuperFn);
|
||||
}
|
||||
@@ -20,7 +20,6 @@ import re
|
||||
import os
|
||||
|
||||
DTB_PART = '/dev/block/by-name/dtb'
|
||||
SUPER_PART = '/dev/block/by-name/super'
|
||||
NX_FILES = '/mnt/vendor/hos_data'
|
||||
|
||||
NX_BL_VERSION = '2022.10-g4f111ee6dc'
|
||||
@@ -83,18 +82,6 @@ def AddBootloaderFlash(info, input_zip):
|
||||
info.script.AppendExtra(' package_extract_file("firmware-update/bootlogo_android.bmp", "' + NX_FILES + '/switchroot/android/bootlogo_android.bmp");')
|
||||
info.script.AppendExtra(' package_extract_file("firmware-update/icon_android_hue.bmp", "' + NX_FILES + '/switchroot/android/icon_android_hue.bmp");')
|
||||
info.script.AppendExtra(' run_program("/system/bin/umount", "' + NX_FILES + '");')
|
||||
|
||||
""" flash super_empty if needed """
|
||||
info.script.AppendExtra(' ifelse(')
|
||||
info.script.AppendExtra(' nx.check_super() == "",')
|
||||
info.script.AppendExtra(' (')
|
||||
info.script.AppendExtra(' ui_print("Super partition not set up--flashing super_empty");')
|
||||
info.script.AppendExtra(' package_extract_file("firmware-update/super_dummy.img", "' + SUPER_PART + '");')
|
||||
info.script.AppendExtra(' ),')
|
||||
info.script.AppendExtra(' (')
|
||||
info.script.AppendExtra(' ui_print("Super partition already present");')
|
||||
info.script.AppendExtra(' )')
|
||||
info.script.AppendExtra(' );')
|
||||
info.script.AppendExtra(' )')
|
||||
info.script.AppendExtra(' );')
|
||||
|
||||
|
||||
Reference in new issue
Block a user