Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to root secondary rom ? #16

Open
wants to merge 65 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
dfb1a29
Add 'System Partition Mode' (hybrid) ROMs
nkk71 Aug 18, 2017
dc0719c
encmnt: Build required libs
nkk71 Aug 30, 2017
ad33909
Fixup installer/uninstaller mk file
nkk71 Aug 30, 2017
87f97da
encmnt: Use linker[64] from /mrom_enc directory
nkk71 Aug 30, 2017
dd1918f
Don't build MultiROM when building TWRP
nkk71 Sep 8, 2017
da0485c
rom_quirks: Add Android 8.0 plat_file_contexts exclusions
nkk71 Sep 15, 2017
d2e61ff
For Android ROMs use default icon if no custom icon is set
nkk71 Sep 28, 2017
6e70bea
Update default android rom icon
nkk71 Oct 3, 2017
5326d91
rom_quirks: Separate file_contexts injection code
nkk71 Oct 7, 2017
67c144e
All MultiROM tags should be optional
nkk71 Oct 7, 2017
b85bb36
inject_file_contexts: Remove lib/util dependency and make buildable i…
nkk71 Oct 9, 2017
e1d6742
inject_file_contexts: Check all injections are successful
nkk71 Oct 16, 2017
8c43dc0
Block sdcardfs uid/gid/mode derivation on MultiROM
nkk71 Oct 15, 2017
c210177
trampoline: Rearrange the code a bit
nkk71 Oct 28, 2017
64a4ac6
multirom: trampoline: Preserve /firmware in encryption.c
nkk71 Nov 12, 2017
2894780
Update multirom path to account for the new dir
nkk71 Nov 14, 2017
0507c11
Use lstat instead of access to check file existence
vasishath Mar 13, 2018
55c2d86
Allow users to manually add a firmware scan directory
vasishath Mar 13, 2018
e7cf49f
Add support for treble and GSI (Generic System Image) oreo roms
vasishath Mar 27, 2018
4535404
Remove old adbd
vasishath Mar 14, 2018
482c76c
klog_init has been removed in android 8.x
vasishath Mar 14, 2018
4e3bab9
Fix compile error on android 8.x
vasishath Mar 14, 2018
a41d886
Switch to getpwuname from pwd.h
vasishath Mar 14, 2018
023b773
Fix signed zip generation
vasishath Mar 14, 2018
6578356
Remove old adbd
vasishath Mar 14, 2018
98ebf5c
Add updated adbd for android-8.1
vasishath Mar 14, 2018
fc85b99
Create own kernel logger
vasishath Mar 28, 2018
2fab8c3
Fix compile with 8.0
vasishath Oct 15, 2018
1fcf3f7
Fix data mount as read only for roms with vendor
vasishath Mar 30, 2018
2e5e8e9
Add support for android P
vasishath Jul 28, 2018
57795df
Fix usage of getpwnam and switch to _NR_REBOOT syscalls
vasishath Oct 27, 2018
b306607
trampoline_encmt: Convert to cpp to support HIDL architecture
vasishath Oct 27, 2018
6d54bbf
Actually fix data partition being mounted readonly
vasishath Oct 27, 2018
6811aac
Use do_reboot functionality from lib
Oct 27, 2018
23a6b5e
Add hwservice selinux contexts
Oct 27, 2018
0830f5f
devices: Add support for drm devices
vasishath Nov 1, 2018
f77dc98
Add support for DRM graphics
vasishath Nov 3, 2018
f03df6b
Fixes to get magisk root working on secondary rom
vasishath Nov 3, 2018
fd84b40
Add fake property_set function
vasishath Nov 4, 2018
d39ae6e
Dont make permanent injection to secondary boot image
vasishath Nov 4, 2018
8589905
Use scaled brightness
Nov 8, 2018
820621a
Use existing loop nodes if kernel can't create new
vasishath Nov 13, 2018
8ba28ad
Add custom firmware mount point
Nov 13, 2018
72c747b
Fix compile error
vasishath Dec 5, 2018
035ab95
drm: Remove screen blanking code
vasishath Dec 5, 2018
49d010e
Add support for flashing older version secondary ROM
vasishath Dec 11, 2018
41e8156
Fix derp that caused bootloops
vasishath Dec 11, 2018
1bd7f33
Add a couple of new features:-
vasishath May 5, 2019
b2d560f
Add support for booting google's android P GSI
vasishath May 16, 2019
193d39b
Fix derp where whole system dir was being copied
shahan-mik3 Jul 20, 2019
271667d
Patch init to support selinux enforcing on android Q
vasishath Jul 20, 2019
dc2f2ef
Allow mix and match of security patch and os version
shahan-mik3 Jul 20, 2019
53201f0
Fix no multirom menu on arter kernel
shahan-mik3 Jul 20, 2019
0c11f75
Update to support android 10
vasishath Sep 28, 2019
659604d
Fix bugs in parsing cmdline
vasishath Nov 9, 2019
2abe345
Fix storage access on Q
vasishath Jan 1, 2020
6a979cd
Support FBE. Android cannot boot this way though.
vasishath Aug 22, 2020
08526d2
Attempt android 11 support
vasishath Oct 25, 2020
65b1dd1
Reboot to primary again if on FBE
vasishath Oct 25, 2020
4a4c3c7
Rename fstab to fsbat to skip magisk fstab detection
vasishath Oct 25, 2020
b50be13
Add fake logger library
vasishath Oct 25, 2020
67410b4
Fix unknown android version on 11
vasishath Dec 6, 2020
cb751b8
Fix fde booting
vasishath Dec 6, 2020
350f3ed
Switch multirom directory to /data/media/MultiROM
vasishath Jan 2, 2021
7e04c91
Fix android 10+ support
vasishath May 9, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
url = https://github.com/Tasssadar/kexec-tools
[submodule "adbd"]
path = adbd
url = https://github.com/multirom-dev/multirom_adbd.git
url = https://github.com/vasishath/adbd
12 changes: 10 additions & 2 deletions Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ LOCAL_C_INCLUDES += $(multirom_local_path) \
external/libpng \
external/zlib \
external/freetype/include \
external/selinux/libselinux/include \
$(multirom_local_path)/lib

LOCAL_SRC_FILES:= \
Expand All @@ -22,6 +23,7 @@ LOCAL_SRC_FILES:= \
pong.c \
rcadditions.c \
rom_quirks.c \
rq_inject_file_contexts.c \

# With these, GCC optimizes aggressively enough so full-screen alpha blending
# is quick enough to be done in an animation
Expand All @@ -30,15 +32,21 @@ LOCAL_CFLAGS += -O3 -funsafe-math-optimizations
#LOCAL_CFLAGS += -D_FORTIFY_SOURCE=2 -fstack-protector-all -O0 -g -fno-omit-frame-pointer -Wall

LOCAL_MODULE:= multirom
LOCAL_MODULE_TAGS := eng
LOCAL_MODULE_TAGS := optional

LOCAL_FORCE_STATIC_EXECUTABLE := true
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_UNSTRIPPED)

LOCAL_STATIC_LIBRARIES := libcutils libc libmultirom_static
LOCAL_STATIC_LIBRARIES := libcutils libc libmultirom_static libselinux
LOCAL_WHOLE_STATIC_LIBRARIES := libm libcutils libpng libz libft2_mrom_static

ifeq ($(MR_FIRMWARE_DIR),)
LOCAL_CFLAGS += -DMR_FIRMWARE_DIR="/firmware"
else
LOCAL_CFLAGS += -DMR_FIRMWARE_DIR="\"$(MR_FIRMWARE_DIR)\""
endif

# clone libbootimg to /system/extras/ from
# https://github.com/Tasssadar/libbootimg.git
LOCAL_STATIC_LIBRARIES += libbootimg
Expand Down
2 changes: 1 addition & 1 deletion adbd
Submodule adbd updated from 9c8425 to 402203
6 changes: 6 additions & 0 deletions device_defines.mk
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ else
LOCAL_CFLAGS += -DMULTIROM_DEFAULT_BRIGHTNESS=40
endif

ifneq ($(TW_MAX_BRIGHTNESS),)
LOCAL_CFLAGS += -DTW_MAX_BRIGHTNESS=\"$(TW_MAX_BRIGHTNESS)\"
else
LOCAL_CFLAGS += -DTW_MAX_BRIGHTNESS=255
endif

ifneq ($(MR_INPUT_ROTATION),)
LOCAL_CFLAGS += -DMR_INPUT_ROTATION=$(MR_INPUT_ROTATION)
endif
Expand Down
127 changes: 81 additions & 46 deletions install_zip/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,27 @@ multirom_extra_dep :=
ifeq ($(MR_ENCRYPTION),true)
multirom_extra_dep += trampoline_encmnt linker

multirom_cp_enc_libs := \
libcryptfslollipop.so libcrypto.so libext4_utils.so libsparse.so libext2_uuid.so libe4crypt.so libc.so libcutils.so \
libdl.so libhardware.so liblog.so libm.so libstdc++.so \
libc++.so libwifikeystorehal.so libsoftkeymasterdevice.so [email protected] [email protected]

ifeq ($(TARGET_HW_DISK_ENCRYPTION),true)
multirom_cp_enc_libs += \
libunwind.so libbase.so libbacktrace.so \
libutils.so libcryptfs_hw.so
endif

ifeq ($(MR_ENCRYPTION_FAKE_PROPERTIES),true)
multirom_extra_dep += libmultirom_fake_properties
else
MR_ENCRYPTION_FAKE_PROPERTIES := false
multirom_cp_enc_libs += libmultirom_fake_properties.so
multirom_extra_dep += libmultirom_fake_propertywait
multirom_cp_enc_libs += libmultirom_fake_propertywait.so
multirom_extra_dep += libmultirom_fake_logger
multirom_cp_enc_libs += libmultirom_fake_logger.so
endif
else
MR_ENCRYPTION := false
MR_ENCRYPTION_FAKE_PROPERTIES := false
endif

MR_DEVICES := $(TARGET_DEVICE)
Expand All @@ -42,46 +55,65 @@ $(MULTIROM_ZIP_TARGET): multirom trampoline signapk bbootimg mrom_kexec_static m
@echo

@echo ----- Making MultiROM ZIP installer ------
rm -rf $(MULTIROM_INST_DIR)
mkdir -p $(MULTIROM_INST_DIR)
cp -a $(install_zip_path)/prebuilt-installer/* $(MULTIROM_INST_DIR)/
cp -a $(TARGET_ROOT_OUT)/multirom $(MULTIROM_INST_DIR)/multirom/
cp -a $(TARGET_ROOT_OUT)/trampoline $(MULTIROM_INST_DIR)/multirom/
cp -a $(TARGET_OUT_OPTIONAL_EXECUTABLES)/mrom_kexec_static $(MULTIROM_INST_DIR)/multirom/kexec
cp -a $(TARGET_OUT_OPTIONAL_EXECUTABLES)/mrom_adbd $(MULTIROM_INST_DIR)/multirom/adbd

if $(MR_ENCRYPTION); then \
@rm -rf $(MULTIROM_INST_DIR)
@mkdir -p $(MULTIROM_INST_DIR)
@echo Copying primary files
@cp -a $(install_zip_path)/prebuilt-installer/* $(MULTIROM_INST_DIR)/
@cp -a $(TARGET_ROOT_OUT)/multirom $(MULTIROM_INST_DIR)/multirom/
@cp -a $(TARGET_ROOT_OUT)/trampoline $(MULTIROM_INST_DIR)/multirom/
@cp -a $(TARGET_OUT_OPTIONAL_EXECUTABLES)/mrom_kexec_static $(MULTIROM_INST_DIR)/multirom/kexec
@cp -a $(TARGET_OUT_OPTIONAL_EXECUTABLES)/mrom_adbd $(MULTIROM_INST_DIR)/multirom/adbd

@if $(MR_ENCRYPTION); then \
echo "Copying decryption files"; \
mkdir -p $(MULTIROM_INST_DIR)/multirom/enc/res; \
cp -a $(TARGET_ROOT_OUT)/trampoline_encmnt $(MULTIROM_INST_DIR)/multirom/enc/; \
cp -a $(TARGET_OUT_EXECUTABLES)/linker $(MULTIROM_INST_DIR)/multirom/enc/; \
\
cp -a $(install_zip_path)/prebuilt-installer/multirom/res/Roboto-Regular.ttf $(MULTIROM_INST_DIR)/multirom/enc/res/; \
\
cp -a $(TARGET_OUT_SHARED_LIBRARIES)/libcryptfslollipop.so $(MULTIROM_INST_DIR)/multirom/enc/; \
cp -a $(TARGET_OUT_SHARED_LIBRARIES)/libcrypto.so $(MULTIROM_INST_DIR)/multirom/enc/; \
cp -a $(TARGET_OUT_SHARED_LIBRARIES)/libc.so $(MULTIROM_INST_DIR)/multirom/enc/; \
cp -a $(TARGET_OUT_SHARED_LIBRARIES)/libcutils.so $(MULTIROM_INST_DIR)/multirom/enc/; \
cp -a $(TARGET_OUT_SHARED_LIBRARIES)/libdl.so $(MULTIROM_INST_DIR)/multirom/enc/; \
cp -a $(TARGET_OUT_SHARED_LIBRARIES)/libhardware.so $(MULTIROM_INST_DIR)/multirom/enc/; \
cp -a $(TARGET_OUT_SHARED_LIBRARIES)/liblog.so $(MULTIROM_INST_DIR)/multirom/enc/; \
cp -a $(TARGET_OUT_SHARED_LIBRARIES)/libm.so $(MULTIROM_INST_DIR)/multirom/enc/; \
cp -a $(TARGET_OUT_SHARED_LIBRARIES)/libstdc++.so $(MULTIROM_INST_DIR)/multirom/enc/; \
cp -a $(TARGET_OUT_SHARED_LIBRARIES)/libc++.so $(MULTIROM_INST_DIR)/multirom/enc/; \
if $(MR_ENCRYPTION_FAKE_PROPERTIES); then \
cp -a $(TARGET_OUT_SHARED_LIBRARIES)/libmultirom_fake_properties.so $(MULTIROM_INST_DIR)/multirom/enc/; \
fi; \
for f in $(multirom_cp_enc_libs); do \
if [ -f "$(TARGET_OUT_VENDOR_SHARED_LIBRARIES)/$$f" ]; then \
cp -a $(TARGET_OUT_VENDOR_SHARED_LIBRARIES)/$$f $(MULTIROM_INST_DIR)/multirom/enc/; \
else \
cp -a $(TARGET_OUT_SHARED_LIBRARIES)/$$f $(MULTIROM_INST_DIR)/multirom/enc/; \
fi; \
done; \
if [ -n "$(MR_ENCRYPTION_SETUP_SCRIPT)" ]; then sh "$(ANDROID_BUILD_TOP)/$(MR_ENCRYPTION_SETUP_SCRIPT)" "$(ANDROID_BUILD_TOP)" "$(MULTIROM_INST_DIR)/multirom/enc"; fi; \
\
if [ "$(TARGET_IS_64_BIT)" == "true" ]; then \
cp -a $(TARGET_OUT_EXECUTABLES)/linker64 $(MULTIROM_INST_DIR)/multirom/enc/; \
echo "Relinking trampoline_encmnt /system/bin/linker64 to /mrom_enc/linker64"; \
sed -i "s|/system/bin/linker64\x0|/mrom_enc/linker64\x0\x0\x0|g" $(MULTIROM_INST_DIR)/multirom/enc/trampoline_encmnt; \
if [ -f "$(MULTIROM_INST_DIR)/multirom/enc/qseecomd" ]; then \
echo "Relinking qseecomd /system/bin/linker64 to /mrom_enc/linker64"; \
sed -i "s|/system/bin/linker64\x0|/mrom_enc/linker64\x0\x0\x0|g" $(MULTIROM_INST_DIR)/multirom/enc/qseecomd; \
fi; \
else \
cp -a $(TARGET_OUT_EXECUTABLES)/linker $(MULTIROM_INST_DIR)/multirom/enc/; \
echo "Relinking trampoline_encmnt /system/bin/linker to /mrom_enc/linker"; \
sed -i "s|/system/bin/linker\x0|/mrom_enc/linker\x0\x0\x0|g" $(MULTIROM_INST_DIR)/multirom/enc/trampoline_encmnt; \
if [ -f "$(MULTIROM_INST_DIR)/multirom/enc/qseecomd" ]; then \
echo "Relinking qseecomd /system/bin/linker to /mrom_enc/linker"; \
sed -i "s|/system/bin/linker\x0|/mrom_enc/linker\x0\x0\x0|g" $(MULTIROM_INST_DIR)/multirom/enc/qseecomd; \
fi; \
fi; \
\
fi

mkdir $(MULTIROM_INST_DIR)/multirom/infos
if [ -n "$(MR_INFOS)" ]; then cp -r $(PWD)/$(MR_INFOS)/* $(MULTIROM_INST_DIR)/multirom/infos/; fi
cp -a $(TARGET_OUT_OPTIONAL_EXECUTABLES)/bbootimg $(MULTIROM_INST_DIR)/scripts/
cp $(PWD)/$(MR_FSTAB) $(MULTIROM_INST_DIR)/multirom/mrom.fstab
$(install_zip_path)/extract_boot_dev.sh $(PWD)/$(MR_FSTAB) $(MULTIROM_INST_DIR)/scripts/bootdev
$(install_zip_path)/make_updater_script.sh "$(MR_DEVICES)" $(MULTIROM_INST_DIR)/META-INF/com/google/android "Installing MultiROM for"
rm -f $(MULTIROM_ZIP_TARGET).zip $(MULTIROM_ZIP_TARGET)-unsigned.zip
cd $(MULTIROM_INST_DIR) && zip -qr ../$(notdir $@)-unsigned.zip *
java -Djava.library.path=$(SIGNAPK_JNI_LIBRARY_PATH) -jar $(HOST_OUT_JAVA_LIBRARIES)/signapk.jar $(DEFAULT_SYSTEM_DEV_CERTIFICATE).x509.pem $(DEFAULT_SYSTEM_DEV_CERTIFICATE).pk8 $(MULTIROM_ZIP_TARGET)-unsigned.zip $(MULTIROM_ZIP_TARGET).zip
$(install_zip_path)/rename_zip.sh $(MULTIROM_ZIP_TARGET) $(TARGET_DEVICE) $(PWD)/$(multirom_local_path)/version.h $(MR_DEVICE_SPECIFIC_VERSION)
@echo Copying info files
@mkdir $(MULTIROM_INST_DIR)/multirom/infos
@if [ -n "$(MR_INFOS)" ]; then cp -vr $(PWD)/$(MR_INFOS)/* $(MULTIROM_INST_DIR)/multirom/infos/; fi
@echo Copying scripts
@cp -a $(TARGET_OUT_OPTIONAL_EXECUTABLES)/bbootimg $(MULTIROM_INST_DIR)/scripts/
@cp $(PWD)/$(MR_FSTAB) $(MULTIROM_INST_DIR)/multirom/mrom_fsbat
@echo Preparing installer script
@$(install_zip_path)/extract_boot_dev.sh $(PWD)/$(MR_FSTAB) $(MULTIROM_INST_DIR)/scripts/bootdev
@$(install_zip_path)/make_updater_script.sh "$(MR_DEVICES)" $(MULTIROM_INST_DIR)/META-INF/com/google/android "Installing MultiROM for"
@echo Signing flashable zip
@rm -f $(MULTIROM_ZIP_TARGET).zip $(MULTIROM_ZIP_TARGET)-unsigned.zip
@cd $(MULTIROM_INST_DIR) && zip -qr ../$(notdir $@)-unsigned.zip *
@java -Djava.library.path=$(SIGNAPK_JNI_LIBRARY_PATH) -jar $(HOST_OUT_JAVA_LIBRARIES)/signapk.jar --min-sdk-version 26 $(DEFAULT_SYSTEM_DEV_CERTIFICATE).x509.pem $(DEFAULT_SYSTEM_DEV_CERTIFICATE).pk8 $(MULTIROM_ZIP_TARGET)-unsigned.zip $(MULTIROM_ZIP_TARGET).zip
@$(install_zip_path)/rename_zip.sh $(MULTIROM_ZIP_TARGET) $(TARGET_DEVICE) $(PWD)/$(multirom_local_path)/version.h $(MR_DEVICE_SPECIFIC_VERSION)
@echo ----- Made MultiROM ZIP installer -------- [email protected]

.PHONY: multirom_zip
Expand All @@ -94,16 +126,19 @@ MULTIROM_UNINST_DIR := $(PRODUCT_OUT)/multirom_uninstaller

$(MULTIROM_UNINST_TARGET): signapk bbootimg
@echo ----- Making MultiROM uninstaller ------
rm -rf $(MULTIROM_UNINST_DIR)
mkdir -p $(MULTIROM_UNINST_DIR)
cp -a $(install_zip_path)/prebuilt-uninstaller/* $(MULTIROM_UNINST_DIR)/
cp -a $(TARGET_OUT_OPTIONAL_EXECUTABLES)/bbootimg $(MULTIROM_UNINST_DIR)/scripts/
$(install_zip_path)/extract_boot_dev.sh $(PWD)/$(MR_FSTAB) $(MULTIROM_UNINST_DIR)/scripts/bootdev
echo $(MR_RD_ADDR) > $(MULTIROM_UNINST_DIR)/scripts/rd_addr
$(install_zip_path)/make_updater_script.sh "$(MR_DEVICES)" $(MULTIROM_UNINST_DIR)/META-INF/com/google/android "MultiROM uninstaller -"
rm -f $(MULTIROM_UNINST_TARGET).zip $(MULTIROM_UNINST_TARGET)-unsigned.zip
cd $(MULTIROM_UNINST_DIR) && zip -qr ../$(notdir $@)-unsigned.zip *
java -Djava.library.path=$(SIGNAPK_JNI_LIBRARY_PATH) -jar $(HOST_OUT_JAVA_LIBRARIES)/signapk.jar $(DEFAULT_SYSTEM_DEV_CERTIFICATE).x509.pem $(DEFAULT_SYSTEM_DEV_CERTIFICATE).pk8 $(MULTIROM_UNINST_TARGET)-unsigned.zip $(MULTIROM_UNINST_TARGET).zip
@rm -rf $(MULTIROM_UNINST_DIR)
@mkdir -p $(MULTIROM_UNINST_DIR)
@echo Copying files
@cp -a $(install_zip_path)/prebuilt-uninstaller/* $(MULTIROM_UNINST_DIR)/
@cp -a $(TARGET_OUT_OPTIONAL_EXECUTABLES)/bbootimg $(MULTIROM_UNINST_DIR)/scripts/
@echo Preparing installer script
@$(install_zip_path)/extract_boot_dev.sh $(PWD)/$(MR_FSTAB) $(MULTIROM_UNINST_DIR)/scripts/bootdev
@echo $(MR_RD_ADDR) > $(MULTIROM_UNINST_DIR)/scripts/rd_addr
@$(install_zip_path)/make_updater_script.sh "$(MR_DEVICES)" $(MULTIROM_UNINST_DIR)/META-INF/com/google/android "MultiROM uninstaller -"
@echo Signing flashable zip
@rm -f $(MULTIROM_UNINST_TARGET).zip $(MULTIROM_UNINST_TARGET)-unsigned.zip
@cd $(MULTIROM_UNINST_DIR) && zip -qr ../$(notdir $@)-unsigned.zip *
@java -Djava.library.path=$(SIGNAPK_JNI_LIBRARY_PATH) -jar $(HOST_OUT_JAVA_LIBRARIES)/signapk.jar --min-sdk-version 26 $(DEFAULT_SYSTEM_DEV_CERTIFICATE).x509.pem $(DEFAULT_SYSTEM_DEV_CERTIFICATE).pk8 $(MULTIROM_UNINST_TARGET)-unsigned.zip $(MULTIROM_UNINST_TARGET).zip
@echo ----- Made MultiROM uninstaller -------- [email protected]

.PHONY: multirom_uninstaller
Expand Down
Binary file modified install_zip/prebuilt-installer/multirom/icons/romic_android.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 41 additions & 12 deletions install_zip/prebuilt-installer/scripts/extract_multirom.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,33 @@
#!/sbin/sh
cont=""
base=""
if [ -d "/data/media/multirom" ] ; then
base="/data/media/multirom"
elif [ -d "/data/media/0/multirom" ] ; then
base="/data/media/0/multirom"

# Move old installation of multirom to MultiROM/multirom
if [ -d "/data/media/multirom" ] && [ ! -d "/data/media/MultiROM/multirom" ]; then
mkdir "/data/media/MultiROM"
mv "/data/media/multirom" "/data/media/MultiROM/multirom"
elif [ -d "/data/media/0/multirom" ] && [ ! -d "/data/media/0/MultiROM/multirom" ]; then
mkdir "/data/media/0/MultiROM"
mv "/data/media/0/multirom" "/data/media/0/MultiROM/multirom"
elif [ -d "/data/media/0/MultiROM/multirom" ] && [ ! -d "/data/media/MultiROM/multirom" ]; then
mkdir "/data/media/MultiROM"
mv "/data/media/0/MultiROM/multirom" "/data/media/MultiROM/multirom"
fi

# Check for existing dirs otherwise create them
if [ -d "/data/media/MultiROM/multirom" ] ; then
cont="/data/media/MultiROM"
base="/data/media/MultiROM/multirom"
elif [ -d "/data/media/0/MultiROM/multirom" ] ; then
cont="/data/media/0/MultiROM"
base="/data/media/0/MultiROM/multirom"
else
if [ -d "/data/media/0" ] ; then
base="/data/media/0/multirom"
else
base="/data/media/multirom"
fi
cont="/data/media/MultiROM"
base="/data/media/MultiROM/multirom"

mkdir "$cont"
chown root:root "$cont"
chmod 770 "$cont"

mkdir "$base"
chown root:root "$base"
Expand All @@ -18,11 +36,9 @@ else
mkdir "$base/roms"
chown media_rw:media_rw "$base/roms"
chmod 777 "$base/roms"

touch "$base/.nomedia"
chown media_rw:media_rw "$base/.nomedia"
fi

# Main installation
rm "$base/boot.img-ubuntu"*
rm "$base/infos/"*
rm "$base/res/"*
Expand All @@ -41,7 +57,20 @@ chmod 644 "$base/ubuntu-touch-init/scripts/touch"
chmod 755 "$base/ubuntu-touch-sysimage-init/init"
chmod 644 "$base/ubuntu-touch-sysimage-init/scripts/touch"

# Remove immutable flag so we can chmod and chown
chattr -i "$cont"

# This makes does not allows access for media scanner on android, but
# still is enough for ubuntu
chmod 770 "$cont"
chown root:root "$cont"
touch "$cont/.nomedia"
chown media_rw:media_rw "$cont/.nomedia"

chmod 770 "$base"
chown root:root "$base"
touch "$base/.nomedia"
chown media_rw:media_rw "$base/.nomedia"

# Make the parent/container folder immutable to prevent sdcardfs uid/gid derivation
chattr +i "$cont"
4 changes: 2 additions & 2 deletions install_zip/prebuilt-uninstaller/scripts/clear_boot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ if [ -L /tmp/boot/sbin/watchdogd ] ; then
ln -sf ../init /tmp/boot/sbin/watchdogd
fi

if [ -e /tmp/boot/mrom.fstab ] ; then
rm /tmp/boot/mrom.fstab
if [ -e /tmp/boot/mrom_fsbat ] ; then
rm /tmp/boot/mrom_fsbat
fi

# Remove encryption files
Expand Down
6 changes: 5 additions & 1 deletion install_zip/prebuilt-uninstaller/scripts/erase_multirom.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#!/sbin/sh
base=""
if [ -d "/data/media/multirom" ] ; then
if [ -d "/data/media/MultiROM" ] ; then
base="/data/media/MultiROM"
elif [ -d "/data/media/0/MultiROM" ] ; then
base="/data/media/0/MultiROM"
elif [ -d "/data/media/multirom" ] ; then
base="/data/media/multirom"
elif [ -d "/data/media/0/multirom" ] ; then
base="/data/media/0/multirom"
Expand Down
2 changes: 1 addition & 1 deletion kernel_inject/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ LOCAL_SRC_FILES:= \
kernel_inject.c \

LOCAL_MODULE:= kernel_inject
LOCAL_MODULE_TAGS := eng
LOCAL_MODULE_TAGS := optional

LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_UNSTRIPPED)
Expand Down
29 changes: 27 additions & 2 deletions lib/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ common_SRC_FILES := \
touch_tracker.c \
util.c \
workers.c \
klog.c \

common_C_INCLUDES := $(multirom_local_path)/lib \
external/libpng \
external/zlib \
external/freetype/include \
external/selinux/libselinux/include \
system/extras/libbootimg/include \

# With these, GCC optimizes aggressively enough so full-screen alpha blending
Expand Down Expand Up @@ -54,15 +56,26 @@ endif
endif


ifeq ($(MR_DEVICE_HAS_DRM_GRAPHICS),true)
common_C_FLAGS += -DMR_DEVICE_HAS_DRM_GRAPHICS
common_C_INCLUDES += \
external/libdrm \
external/libdrm/include/drm
common_SRC_FILES += \
drm.c
endif

include $(CLEAR_VARS)

LOCAL_MODULE := libmultirom_static
LOCAL_MODULE_TAGS := eng
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_UNSTRIPPED)
LOCAL_CFLAGS += $(common_C_FLAGS)
LOCAL_C_INCLUDES += $(common_C_INCLUDES)
ifeq ($(MR_DEVICE_HAS_DRM_GRAPHICS),true)
LOCAL_WHOLE_STATIC_LIBRARIES := libdrm_platform
endif
LOCAL_SRC_FILES := $(common_SRC_FILES)

MR_NO_KEXEC_MK_OPTIONS := true 1 allowed 2 enabled 3 ui_confirm 4 ui_choice 5 forced
Expand All @@ -78,13 +91,25 @@ include $(multirom_local_path)/device_defines.mk

include $(BUILD_STATIC_LIBRARY)

include $(CLEAR_VARS)

LOCAL_MODULE := libmultirom_fake_logger
LOCAL_MODULE_TAGS := optional

LOCAL_SRC_FILES := fake_logger.c
LOCAL_SRC_FILES += klog.c


include $(BUILD_SHARED_LIBRARY)

include $(CLEAR_VARS)

LOCAL_MODULE := libmultirom
LOCAL_MODULE_TAGS := eng
LOCAL_MODULE_TAGS := optional
LOCAL_SHARED_LIBRARIES := libcutils libc libm libpng libz libft2
ifeq ($(MR_DEVICE_HAS_DRM_GRAPHICS),true)
LOCAL_WHOLE_STATIC_LIBRARIES := libdrm_platform
endif
LOCAL_CFLAGS += $(common_C_FLAGS)
LOCAL_SRC_FILES := $(common_SRC_FILES)
LOCAL_C_INCLUDES += $(common_C_INCLUDES)
Expand Down
Loading