[Android Software/Hacking General [Developers Only]] Talyrius:
@osm0sis

I initially attempted to use your 00-resizesystem.sh addon.d script with LineageOS 17.1 on my Google PIxel XL 128GB to install a larger selection of Open GApps, but I quickly realized it doesn't support devices with A/B partitions. Therefore, I took inspiration from both, it and 99-personal.sh, to create the device specific script below. I've increased the size of the system partitions (both, A/B) and everything works just fine at the start. However, I can't get the changes to persist through OTA updates.

Do you see anything obvious that I'm doing wrong? I think it's worth pointing out that the repartitioning itself isn't to blame as OTA updates work just fine as long as the contents of /system don't exceed its original size. Oh, and—yes, chmod 755 was used on the script.

Script:

#!/sbin/sh
#
# ADDOND_VERSION=2
#
# /system/addon.d/00-personal.sh
# During a LineageOS upgrade, this script resizes the system partition to
# re-accomodate a larger GApps installation, deletes an inapplicable device
# specific file, and survives by restoring itself.
#
# For future reference, the script originally used to repartition this device
# is embedded below:
#
<<'repartition-ogpixel-128gb.sh'
#!/sbin/sh

echo "Repartitioning device: Pixel (128gb)"

sgdisk --delete=33 /dev/block/sda
sgdisk --delete=34 /dev/block/sda
sgdisk --delete=35 /dev/block/sda

sgdisk --new=33:227142:3897157 --change-name=33:system_a --typecode=33:77036CD4-03D5-42BB-8ED1-37E5A88BAA34 /dev/block/sda
sgdisk --new=34:3897158:7567173 --change-name=34:system_b --typecode=34:EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 /dev/block/sda
sgdisk --new=35:7567174:31215429 --change-name=35:userdata --typecode=35:EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 /dev/block/sda

echo "Done!"
repartition-ogpixel-128gb.sh

. /tmp/backuptool.functions

save_files() {
cat <<EOF
addon.d/00-personal.sh
EOF
}

delete_files() {
cat <<EOF
etc/sysconfig/pixel_2018_exclusive.xml
EOF
}

case "$1" in
backup)
save_files | while read FILE DUMMY; do
backup_file $S/"$FILE"
done
;;
restore)
save_files | while read FILE REPLACEMENT; do
R=""
[ -n "$REPLACEMENT" ] && R="$S/$REPLACEMENT"
[ -f "$C/$S/$FILE" ] && restore_file $S/"$FILE" "$R"
done
;;
pre-backup)
# Stub
;;
post-backup)
# Stub
;;
pre-restore)
# Force a check and resize of the file system on the /system partitions.
umount /system;
e2fsck -yf /dev/block/sda33;
resize2fs /dev/block/sda33;
e2fsck -yf /dev/block/sda34;
resize2fs /dev/block/sda34;
mount /system;
;;
post-restore)
delete_files | while read FILE DUMMY; do
[ -e "$S/$FILE" ] && rm $S/"$FILE"
done
;;
esac

Partition Table:

label: gpt
label-id: 98101B32-BBE2-4BF2-A06E-2BB33D000C20
device: /dev/block/sda
unit: sectors
first-lba: 6
last-lba: 31216634
table-length: 36
sector-size: 4096

/dev/block/sda1 : start= 6, size= 128, type=4A20058D-2D54-0D80-E6CC-4ADDDA723C2A, uuid=00000001-0000-0000-0000-000000000000, name="bootlocker_a", attrs="GUID:50"
/dev/block/sda2 : start= 134, size= 128, type=77036CD4-03D5-42BB-8ED1-37E5A88BAA34, uuid=00000002-0000-0000-0000-000000000000, name="bootlocker_b"
/dev/block/sda3 : start= 262, size= 128, type=4F772165-0F3C-4BA3-BBCB-A829E9C969F9, uuid=00000003-0000-0000-0000-000000000000, name="keymaster_a", attrs="GUID:48,49,50,51,52,53"
/dev/block/sda4 : start= 390, size= 128, type=77036CD4-03D5-42BB-8ED1-37E5A88BAA34, uuid=00000004-0000-0000-0000-000000000000, name="keymaster_b", attrs="GUID:48,49,51,52,53,54"
/dev/block/sda5 : start= 518, size= 512, type=A053AA7F-40B8-4B1C-BA08-2F68AC71A4F4, uuid=00000005-0000-0000-0000-000000000000, name="tz_a", attrs="GUID:48,49,50,51,52,53"
/dev/block/sda6 : start= 1030, size= 512, type=77036CD4-03D5-42BB-8ED1-37E5A88BAA34, uuid=00000006-0000-0000-0000-000000000000, name="tz_b", attrs="GUID:48,49,51,52,53,54"
/dev/block/sda7 : start= 1542, size= 128, type=098DF793-D712-413D-9D4E-89D711772228, uuid=00000007-0000-0000-0000-000000000000, name="rpm_a", attrs="GUID:48,49,50,51,52,53"
/dev/block/sda8 : start= 1670, size= 128, type=77036CD4-03D5-42BB-8ED1-37E5A88BAA34, uuid=00000008-0000-0000-0000-000000000000, name="rpm_b", attrs="GUID:48,49,51,52,53,54"
/dev/block/sda9 : start= 1798, size= 128, type=C00EEF24-7709-43D6-9799-DD2B411E7A3C, uuid=00000009-0000-0000-0000-000000000000, name="pmic_a", attrs="GUID:48,49,50,51,52,53"
/dev/block/sda10 : start= 1926, size= 128, type=77036CD4-03D5-42BB-8ED1-37E5A88BAA34, uuid=0000000A-0000-0000-0000-000000000000, name="pmic_b", attrs="GUID:48,49,51,52,53,54"
/dev/block/sda11 : start= 2054, size= 128, type=E1A6A689-0C8D-4CC6-B4E8-55A4320FBD8A, uuid=0000000B-0000-0000-0000-000000000000, name="hyp_a", attrs="GUID:48,49,50,51,52,53"
/dev/block/sda12 : start= 2182, size= 128, type=77036CD4-03D5-42BB-8ED1-37E5A88BAA34, uuid=0000000C-0000-0000-0000-000000000000, name="hyp_b", attrs="GUID:48,49,51,52,53,54"
/dev/block/sda13 : start= 2310, size= 64, type=73471795-AB54-43F9-A847-4F72EA5CBEF5, uuid=0000000D-0000-0000-0000-000000000000, name="cmnlib32_a", attrs="GUID:48,49,50,51,52,53"
/dev/block/sda14 : start= 2374, size= 64, type=77036CD4-03D5-42BB-8ED1-37E5A88BAA34, uuid=0000000E-0000-0000-0000-000000000000, name="cmnlib32_b", attrs="GUID:48,49,51,52,53,54"
/dev/block/sda15 : start= 2438, size= 64, type=8EA64893-1267-4A1B-947C-7C362ACAAD2C, uuid=0000000F-0000-0000-0000-000000000000, name="cmnlib64_a", attrs="GUID:48,49,50,51,52,53"
/dev/block/sda16 : start= 2502, size= 64, type=77036CD4-03D5-42BB-8ED1-37E5A88BAA34, uuid=00000010-0000-0000-0000-000000000000, name="cmnlib64_b", attrs="GUID:48,49,51,52,53,54"
/dev/block/sda17 : start= 2566, size= 1024, type=400FFDCD-22E0-47E7-9A23-F16ED9382388, uuid=00000011-0000-0000-0000-000000000000, name="aboot_a", attrs="GUID:48,49,50,51,52,53"
/dev/block/sda18 : start= 3590, size= 1024, type=77036CD4-03D5-42BB-8ED1-37E5A88BAA34, uuid=00000012-0000-0000-0000-000000000000, name="aboot_b", attrs="GUID:48,49,51,52,53,54"
/dev/block/sda19 : start= 4614, size= 8192, type=20117F86-E985-4357-B9EE-374BC1D8487D, uuid=00000013-0000-0000-0000-000000000000, name="boot_a", attrs="GUID:48,49,50,51,52,53"
/dev/block/sda20 : start= 12806, size= 8192, type=77036CD4-03D5-42BB-8ED1-37E5A88BAA34, uuid=00000014-0000-0000-0000-000000000000, name="boot_b", attrs="GUID:48,49,52,53,54"
/dev/block/sda21 : start= 20998, size= 8192, type=20117F86-E985-4357-B9EE-374BC1D8487D, uuid=00000015-0000-0000-0000-000000000000, name="hosd_a", attrs="GUID:48,49,50,51,52,53"
/dev/block/sda22 : start= 29190, size= 8192, type=77036CD4-03D5-42BB-8ED1-37E5A88BAA34, uuid=00000016-0000-0000-0000-000000000000, name="hosd_b", attrs="GUID:48,49,51,52,53,54"
/dev/block/sda23 : start= 37382, size= 32, type=F65D4B16-343D-4E25-AAFC-BE99B6556A6D, uuid=00000017-0000-0000-0000-000000000000, name="devcfg_a", attrs="GUID:48,49,50,51,52,53"
/dev/block/sda24 : start= 37414, size= 32, type=77036CD4-03D5-42BB-8ED1-37E5A88BAA34, uuid=00000018-0000-0000-0000-000000000000, name="devcfg_b", attrs="GUID:48,49,51,52,53,54"
/dev/block/sda25 : start= 37446, size= 17920, type=EBD0A0A2-B9E5-4433-87C0-68B6B72699C7, uuid=00000019-0000-0000-0000-000000000000, name="modem_a", attrs="GUID:48,49,50,51,52,53"
/dev/block/sda26 : start= 55366, size= 17920, type=77036CD4-03D5-42BB-8ED1-37E5A88BAA34, uuid=0000001A-0000-0000-0000-000000000000, name="modem_b", attrs="GUID:48,49,51,52,53,54"
/dev/block/sda27 : start= 73286, size= 64, type=ED9E8101-05FA-46B7-82AA-8D58770D200B, uuid=0000001B-0000-0000-0000-000000000000, name="msadp_a", attrs="GUID:48,49,50,51,52,53"
/dev/block/sda28 : start= 73350, size= 64, type=77036CD4-03D5-42BB-8ED1-37E5A88BAA34, uuid=0000001C-0000-0000-0000-000000000000, name="msadp_b", attrs="GUID:48,49,51,52,53,54"
/dev/block/sda29 : start= 73414, size= 64, type=E6E98DA2-E22A-4D12-AB33-169E7DEAA507, uuid=0000001D-0000-0000-0000-000000000000, name="apdp_a", attrs="GUID:48,49,50,51,52,53"
/dev/block/sda30 : start= 73478, size= 64, type=77036CD4-03D5-42BB-8ED1-37E5A88BAA34, uuid=0000001E-0000-0000-0000-000000000000, name="apdp_b", attrs="GUID:48,49,51,52,53,54"
/dev/block/sda31 : start= 73542, size= 76800, type=EBD0A0A2-B9E5-4433-87C0-68B6B72699C7, uuid=0000001F-0000-0000-0000-000000000000, name="vendor_a", attrs="GUID:48,49,50,51,52,53"
/dev/block/sda32 : start= 150342, size= 76800, type=77036CD4-03D5-42BB-8ED1-37E5A88BAA34, uuid=00000020-0000-0000-0000-000000000000, name="vendor_b", attrs="GUID:48,49,51,52,53,54"
/dev/block/sda33 : start= 227142, size= 3670016, type=77036CD4-03D5-42BB-8ED1-37E5A88BAA34, uuid=E2C95265-2054-4FBA-A736-38925CA349F8, name="system_a"
/dev/block/sda34 : start= 3897158, size= 3670016, type=EBD0A0A2-B9E5-4433-87C0-68B6B72699C7, uuid=DD0CD384-960C-486F-8A9A-326EB4C57E5D, name="system_b"
/dev/block/sda35 : start= 7567174, size= 23648256, type=EBD0A0A2-B9E5-4433-87C0-68B6B72699C7, uuid=964F3152-BDE2-41F3-8D1A-08CF45F9820E, name="userdata"
/dev/block/sda36 : start= 31215430, size= 1205, type=EBD0A0A2-B9E5-4433-87C0-68B6B72699C7, uuid=00000024-0000-0000-0000-000000000000, name="reserve0"

Thanks in advance for any help you can offer,

Talyrius