mirror of
https://gitlab.com/Nanolx/NanoDroid
synced 2024-10-31 09:20:23 +00:00
when searching system/vendor partitions look for app/vnr aswell
This commit is contained in:
parent
9dcde11d37
commit
082486d6fa
@ -236,14 +236,18 @@ toupper() {
|
||||
find_block () {
|
||||
local block partname devname device
|
||||
|
||||
block=${1}${SLOT}
|
||||
for block in "${@}"; do
|
||||
block=${block}${SLOT}
|
||||
device=$(find /dev/block \( -type b -o -type c -o -type l \) -name ${block} | head -n 1)
|
||||
|
||||
if [ -n "$device" ]; then
|
||||
readlink -f "$device"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
|
||||
for block in "${@}"; do
|
||||
block=${block}${SLOT}
|
||||
for uevent in /sys/dev/block/*/uevent; do
|
||||
partname=$(awk -F= '/PARTNAME/{print $2}' ${uevent})
|
||||
devname=$(awk -F= '/DEVNAME/{print $2}' ${uevent})
|
||||
@ -252,15 +256,18 @@ find_block () {
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
for block in "${@}"; do
|
||||
block=${block}${SLOT}
|
||||
device=$(find /dev \( -type b -o -type c -o -type l \) -maxdepth 1 -iname ${block} | head -n 1)
|
||||
if [ -n "$device" ]; then
|
||||
readlink -f "$device"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
|
||||
return 1
|
||||
|
||||
}
|
||||
|
||||
mount_partitions () {
|
||||
@ -280,7 +287,7 @@ mount_partitions () {
|
||||
|
||||
mount -o bind /dev/urandom /dev/random
|
||||
|
||||
SYSTEM_BLOCK=$(find_block system)
|
||||
SYSTEM_BLOCK=$(find_block system app)
|
||||
decho " INFO: #5 [SYSTEM_BLOCK] ${SYSTEM_BLOCK}"
|
||||
|
||||
[ -z "${SYSTEM_BLOCK}" ] && error "failed to detect block device for /system"
|
||||
@ -306,7 +313,7 @@ mount_partitions () {
|
||||
mount -o bind /system_root/system /system
|
||||
fi
|
||||
|
||||
VENDOR_BLOCK=$(find_block vendor)
|
||||
VENDOR_BLOCK=$(find_block vendor vnr)
|
||||
decho " INFO: #7 [VENDOR_BLOCK] ${VENDOR_BLOCK}"
|
||||
|
||||
[ -z "${VENDOR_BLOCK}" ] && error "failed to detect block device for /vendor"
|
||||
|
@ -101,16 +101,20 @@ toupper() {
|
||||
}
|
||||
|
||||
find_block () {
|
||||
local block tmp partname devname device
|
||||
local block partname devname device
|
||||
|
||||
block=${1}${SLOT}
|
||||
for block in "${@}"; do
|
||||
block=${block}${SLOT}
|
||||
device=$(find /dev/block \( -type b -o -type c -o -type l \) -name ${block} | head -n 1)
|
||||
|
||||
if [ ! -z ${device} ]; then
|
||||
readlink -f ${device}
|
||||
if [ -n "$device" ]; then
|
||||
readlink -f "$device"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
|
||||
for block in "${@}"; do
|
||||
block=${block}${SLOT}
|
||||
for uevent in /sys/dev/block/*/uevent; do
|
||||
partname=$(awk -F= '/PARTNAME/{print $2}' ${uevent})
|
||||
devname=$(awk -F= '/DEVNAME/{print $2}' ${uevent})
|
||||
@ -119,15 +123,18 @@ find_block () {
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
for block in "${@}"; do
|
||||
block=${block}${SLOT}
|
||||
device=$(find /dev \( -type b -o -type c -o -type l \) -maxdepth 1 -iname ${block} | head -n 1)
|
||||
if [ ! -z ${device} ]; then
|
||||
readlink -f ${device}
|
||||
if [ -n "$device" ]; then
|
||||
readlink -f "$device"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
|
||||
return 1
|
||||
|
||||
}
|
||||
|
||||
mount_partitions () {
|
||||
@ -147,7 +154,7 @@ mount_partitions () {
|
||||
|
||||
mount -o bind /dev/urandom /dev/random
|
||||
|
||||
SYSTEM_BLOCK=$(find_block system)
|
||||
SYSTEM_BLOCK=$(find_block system app)
|
||||
echo " INFO: #5 [SYSTEM_BLOCK] ${SYSTEM_BLOCK}"
|
||||
|
||||
if is_mounted /system_root; then
|
||||
@ -171,7 +178,7 @@ mount_partitions () {
|
||||
mount -o bind /system_root/system /system
|
||||
fi
|
||||
|
||||
VENDOR_BLOCK=$(find_block vendor)
|
||||
VENDOR_BLOCK=$(find_block vendor vnr)
|
||||
echo " INFO: #7 [VENDOR_BLOCK] ${VENDOR_BLOCK}"
|
||||
|
||||
! is_mounted /vendor && mount -o ro /vendor
|
||||
|
@ -91,16 +91,20 @@ toupper() {
|
||||
}
|
||||
|
||||
find_block () {
|
||||
local block tmp partname devname device
|
||||
local block partname devname device
|
||||
|
||||
block=${1}${SLOT}
|
||||
for block in "${@}"; do
|
||||
block=${block}${SLOT}
|
||||
device=$(find /dev/block \( -type b -o -type c -o -type l \) -name ${block} | head -n 1)
|
||||
|
||||
if [ ! -z ${device} ]; then
|
||||
readlink -f ${device}
|
||||
if [ -n "$device" ]; then
|
||||
readlink -f "$device"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
|
||||
for block in "${@}"; do
|
||||
block=${block}${SLOT}
|
||||
for uevent in /sys/dev/block/*/uevent; do
|
||||
partname=$(awk -F= '/PARTNAME/{print $2}' ${uevent})
|
||||
devname=$(awk -F= '/DEVNAME/{print $2}' ${uevent})
|
||||
@ -109,15 +113,18 @@ find_block () {
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
for block in "${@}"; do
|
||||
block=${block}${SLOT}
|
||||
device=$(find /dev \( -type b -o -type c -o -type l \) -maxdepth 1 -iname ${block} | head -n 1)
|
||||
if [ ! -z ${device} ]; then
|
||||
readlink -f ${device}
|
||||
if [ -n "$device" ]; then
|
||||
readlink -f "$device"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
|
||||
return 1
|
||||
|
||||
}
|
||||
|
||||
mount_partitions () {
|
||||
@ -132,8 +139,8 @@ mount_partitions () {
|
||||
fi
|
||||
[ -z ${SLOT} ] && DEVICE_AB=FALSE || DEVICE_AB=TR
|
||||
|
||||
SYSTEM_BLOCK=$(find_block system)
|
||||
VENDOR_BLOCK=$(find_block vendor)
|
||||
SYSTEM_BLOCK=$(find_block system app)
|
||||
VENDOR_BLOCK=$(find_block vendor vnr)
|
||||
|
||||
if ${BOOTMODE}; then
|
||||
build_props=$(find /system /system_root /vendor -type f -name build.prop)
|
||||
|
@ -104,14 +104,18 @@ toupper() {
|
||||
find_block () {
|
||||
local block partname devname device
|
||||
|
||||
block=${1}${SLOT}
|
||||
for block in "${@}"; do
|
||||
block=${block}${SLOT}
|
||||
device=$(find /dev/block \( -type b -o -type c -o -type l \) -name ${block} | head -n 1)
|
||||
|
||||
if [ -n "$device" ]; then
|
||||
readlink -f "$device"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
|
||||
for block in "${@}"; do
|
||||
block=${block}${SLOT}
|
||||
for uevent in /sys/dev/block/*/uevent; do
|
||||
partname=$(awk -F= '/PARTNAME/{print $2}' ${uevent})
|
||||
devname=$(awk -F= '/DEVNAME/{print $2}' ${uevent})
|
||||
@ -120,15 +124,18 @@ find_block () {
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
for block in "${@}"; do
|
||||
block=${block}${SLOT}
|
||||
device=$(find /dev \( -type b -o -type c -o -type l \) -maxdepth 1 -iname ${block} | head -n 1)
|
||||
if [ -n "$device" ]; then
|
||||
readlink -f "$device"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
|
||||
return 1
|
||||
|
||||
}
|
||||
|
||||
mount_partitions () {
|
||||
@ -148,7 +155,7 @@ mount_partitions () {
|
||||
|
||||
mount -o bind /dev/urandom /dev/random
|
||||
|
||||
SYSTEM_BLOCK=$(find_block system)
|
||||
SYSTEM_BLOCK=$(find_block system app)
|
||||
echo " INFO: #5 [SYSTEM_BLOCK] ${SYSTEM_BLOCK}"
|
||||
|
||||
if is_mounted /system_root; then
|
||||
@ -172,7 +179,7 @@ mount_partitions () {
|
||||
mount -o bind /system_root/system /system
|
||||
fi
|
||||
|
||||
VENDOR_BLOCK=$(find_block vendor)
|
||||
VENDOR_BLOCK=$(find_block vendor vnr)
|
||||
echo " INFO: #7 [VENDOR_BLOCK] ${VENDOR_BLOCK}"
|
||||
|
||||
! is_mounted /vendor && mount -o ro /vendor
|
||||
|
Loading…
Reference in New Issue
Block a user