2
0
mirror of https://gitlab.com/Nanolx/NanoDroid synced 2024-10-31 09:20:23 +00:00

CommonInstaller: improve NanoDroid-Font and A/B partition scheme handling

This commit is contained in:
Christopher Roy Bratusek 2018-03-18 21:33:11 +01:00
parent bd4f6eaba3
commit 353eae0aaa
2 changed files with 11 additions and 10 deletions

View File

@ -4,6 +4,8 @@
### Bug Fixes
* CommonInstaller
* on devices with A/B partition scheme System Mode installation did not mount /system read-write in all cases
* SetupWizard
* fix creating setup value for location backend

View File

@ -187,11 +187,11 @@ mount_partitions () {
${BOOTMODE} || mount -o bind /dev/urandom /dev/random
[ ! -f /system/build.prop ] && mount -o ro /system 2>/dev/null
[ ! -f /system/build.prop ] && mount -o rw /system 2>/dev/null
if [ ! -f /system/build.prop ]; then
SYSTEMBLOCK=$(find /dev/block -iname system${SLOT} | head -n 1)
mount -t ext4 -o ro $SYSTEMBLOCK /system
mount -t ext4 -o rw $SYSTEMBLOCK /system
fi
if [ -f /system/init.rc ]; then
@ -232,9 +232,11 @@ detect_mode () {
[ "${MODE}" = "MAGISK" ] && magisk_install_setup
if test -h ${MODPATH}/system/fonts/Roboto-Regular.ttf; then
CUSTOM_FONT="$(basename $(readlink ${MODPATH}/system/fonts/Roboto-Regular.ttf) .ttf)"
ui_print " << Detected NanoDroid-Font (${CUSTOM_FONT})"
if [ "${nanodroid_fonts}" -eq 1 ]; then
if test -h ${MODPATH}/system/fonts/Roboto-Regular.ttf; then
CUSTOM_FONT="$(basename $(readlink ${MODPATH}/system/fonts/Roboto-Regular.ttf) .ttf)"
ui_print " << Detected NanoDroid-Font (${CUSTOM_FONT})"
fi
fi
if [ "${MODE}" = "MAGISK" ]; then
@ -243,10 +245,7 @@ detect_mode () {
magisk_install_preinst
;;
esac
else
mount -orw,remount /system 2>/dev/null || \
error " !! failed to re-mount /system read-write"
unset MODPATH
else unset MODPATH
fi
}
@ -539,7 +538,7 @@ magisk_install_finish () {
;;
esac
if [ ! -z ${CUSTOM_FONT} -a -f ${MODPATH}/system/bin/nanodroid-font ]; then
if [ ! -z ${CUSTOM_FONT} -a ${nanodroid_fonts} -eq 1 ]; then
ui_print " << Restore NanoDroid-Font (${CUSTOM_FONT})"
${MODPATH}/system/bin/nanodroid-font -s "${CUSTOM_FONT}"
fi