device_lenovo_sdm710-common/configs/flash_super_dummy.sh
Tim Zimmermann 59eb184cd4
sdm710-common: Flash dummy super image if needed
* Needed because stock does not use dynamic partitions so
  there's no existing metadata that could be used

Change-Id: Icbc828389465f3d4681ca8e4c3adec782540752e
2023-10-27 22:30:20 +03:00

20 lines
399 B
Bash

#!/system/bin/sh
#
# Copyright (C) 2021 The LineageOS Project
#
# SPDX-License-Identifier: Apache-2.0
#
SUPER="/dev/block/by-name/system"
mkdir /tmp/super-mnt
mount $SUPER /tmp/super-mnt 2>/dev/null
if [ "$?" = "0" ]; then
echo "Detected stock /system in super partition, flashing super_dummy.img!"
umount /tmp/super-mnt
dd if=/tmp/super_dummy.img of=$SUPER
fi
rmdir /tmp/super-mnt