diff options
author | Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> | 2021-09-20 22:10:56 +0200 |
---|---|---|
committer | Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> | 2021-09-27 18:58:12 +0200 |
commit | a57758f8cac5a2fb86d192e9dc23cd1428df259a (patch) | |
tree | f375108bd9f9cfd4c69d4eee3d4d398d00205f00 | |
parent | 2cf5cf6bd4969df6def4d6775a15cda5e51d84b3 (diff) | |
download | device_samsung_i9100-a57758f8cac5a2fb86d192e9dc23cd1428df259a.tar.gz device_samsung_i9100-a57758f8cac5a2fb86d192e9dc23cd1428df259a.tar.bz2 device_samsung_i9100-a57758f8cac5a2fb86d192e9dc23cd1428df259a.zip |
Fix RECOVERY partition size
According to the PIT that we have in the
vendor/replicant-data repository[1], the RECOVERY
partition size is 8M:
$ heimdall print-pit --file 16G.pit
Heimdall v1.4.2
[...]
--- Entry #12 ---
Binary Type: 0 (AP)
Device Type: 2 (MMC)
Identifier: 9
Attributes: 5 (Read/Write)
Update Attributes: 1 (FOTA)
Partition Block Size/Offset: 122880
Partition Block Count: 16384
File Offset (Obsolete): 0
File Size (Obsolete): 0
Partition Name: RECOVERY
Flash Filename: recovery.img
FOTA Filename:
[...]
Here the blocks size is 512 bytes, so that makes 8MiB.
Without that patch, Replicant can build recoveries bigger
than 8MiB, and when installing them with heimdall, they work
fine[2] and nothing looks wrong.
The issue is that when the image is bigger than the
partition size, the part of the recovery image that is
bigger than the recovery partition will be written on the
next partition(s) and overwrite their content.
In the case of the GT-I9305, the next partition is the
RADIO partition, which contains the modem firmware.
So if users built Replicant 11 themselves and followed
the Replicant 11 official installation instructions which
instruct users to install the recovery, and didn't make
any backup of the RADIO partition, their modem will probably
not work anymore.
And since the modem of the GT-I9305 isn't supported in
Replicant 6, users migth not notice the issue at all until
someone manages to make it work with Replicant.
As the modem firmware is nonfree and not redistributable,
fixing that without any backup is not trivial:
- We don't know the situation with repair shops, some
might have agreements with Samsung for being able to
restore original operating systems. Though if the
reparation costs more than buying a new phone it doesn't
help here.
- Some shops might not have agreements with Samsung, and
modem firmwares can also be found on the Internet, and
in both cases we don't know the legal situation (which
also depends on the countries) with various right to
repair legislation or the lack thereof.
If the law doesn't permit reparation, users that don't
have any backup will face a dylema between repairing the
phone themselves and respecting the copyright laws.
- As the code is nonfree we also don't have much
documentation on the side effects of installing a
different modem firmware than the one originally on the
device.
- Replicant obviously cannot redistribute such nonfree
firmwares and probably cannot have instructions to
find such firmwares.
In addition since users might not be aware at all of the
problem, the more they wait for fixing it, the harder it
will be because shops might stop fixing GT-I9305 at some
point if they are too old or images and knowledge might
also disapear from the Internet, etc.
[1]https://git.replicant.us/replicant/vendor_replicant-data/tree/devices/PIT/GT-I9105G/stock/16G.pit
[2]https://github.com/Benjamin-Dobell/Heimdall/issues/494
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
-rw-r--r-- | BoardConfig.mk | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/BoardConfig.mk b/BoardConfig.mk index 8bb6dec..ec211c2 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -23,7 +23,7 @@ BOARD_DTB_IMAGE_NAME := exynos4412-i9300.dtb TARGET_RECOVERY_FSTAB := device/samsung/i9305/fstab.smdk4x12 TARGET_RECOVERY_PIXEL_FORMAT := ABGR_8888 -BOARD_RECOVERYIMAGE_PARTITION_SIZE := 13685312 +BOARD_RECOVERYIMAGE_PARTITION_SIZE := 8388608 BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1610612736 # TODO: figure out if it is possible to increase USERDATA partition size BOARD_USERDATAIMAGE_PARTITION_SIZE := 11378320 |