最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

dynamic - PR-10 The flash partitioning MUST allow later addition of new partitions (prplfoundation) - Stack Overflow

programmeradmin4浏览0评论

To support the above feature I found out a way to update GPT via approach mentioned by me in the code section. But in the approach if there is any power failure during sgdisk command execution then paritition table may be corrupted. And I dont have external storage where i can connect the device. And also I am using update.zip which i need to download on userdata partition and later i can trigger the OTA. Now is there any other solution which prpl community is using to support above PR? I mean some solution must be there to support above PR. You can find this PR on prplfoundation.

#!/bin/sh 
set -e # Exit on error 
# Variables 
USERDATA_PART="/dev/mmcblk0p3" # Adjust based on your partition layout 
NEW_PART_SIZE="4G" # Size of the new partition 
USERDATA_NEW_SIZE="8G" # New size of userdata after shrinking 

echo "Starting partition resizing..." 
# Step 1: Unmount userdata echo "Unmounting userdata..." 
umount /data || echo "Userdata not mounted" 
# Step 2: Check and resize filesystem echo "Checking and resizing userdata filesystem..." 
e2fsck -f $USERDATA_PART 
resize2fs $USERDATA_PART $USERDATA_NEW_SIZE 
# Step 3: Modify GPT Partition Table 
echo "Updating GPT partition table..." 
sgdisk --delete=3 /dev/mmcblk0 
sgdisk --new=3:0:+$USERDATA_NEW_SIZE --typecode=3:8300 /dev/mmcblk0 
sgdisk --new=4:0:+$NEW_PART_SIZE --typecode=4:8300 /dev/mmcblk0 
partprobe
# Step 4: Format the partitions echo "Formatting partitions..." 
mkfs.ext4 /dev/mmcblk0p3 
mkfs.ext4 /dev/mmcblk0p4 
# Step 5: Mount and update fstab 
echo "Mounting new partition..." 
mkdir -p /new_partition mount /dev/mmcblk0p4 /new_partition 
echo "/dev/mmcblk0p4 /new_partition ext4 defaults 0 2" >> /etc/fstab 
echo "Partition resizing completed successfully!" 
reboot

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论