Is your feature request related to a problem?/你的请求是否与某个问题相关?
No.
Describe the solution you'd like/描述你想要的解决方案
Reproducibly produce patched raw ext2 images. (product.img, system_ext.img, etc.)
Additional context/其他信息
e2fsprogs provided environment variable E2FSPROGS_FAKE_TIME to produce reproducible ext2 images. Also, with environment variable E2FSCK_TIME, we can shrink the size of ext2 images while keep reproducibility.
Here is an example. I use debugfs to delete (inodes of) preinstalled amazon and shrink the fs. The hash of modified modified system_ext.img is always 6cfa7fb0805c69d6af2949eab4356ac9c06e8c36c0304e344a2ce420580ba85a. (original ebcc4c707ba97ea8855064231bbe045bcc6023a3f18aa9c024f6c334d0635ab2, from MicrosoftCorporationII.WindowsSubsystemForAndroid_2211.40000.11.0_neutral_~_8wekyb3d8bbwe.msixbundle)
Note that the major version should be greater than 2211, otherwise replace system_ext.img with product.img
As far as I know, in MagiskOnWSALocal/scripts/build.sh#L739, you use find . -exec touch -hamt <timestamp> {} ';' to set every timestamp to 200901010000, but there are {a,c,m}time for each file, so just use -ht <timestamp> instead of -hamt <timestamp>.
Another important thing is that the timestamp is localized, so in China, timestamp 200901010000 would be shown as 200901010800, but when setting it to 200901010000, it would be shown as 200901010000, not 200901010800.
p.s. We may need e2fsprogs>=1.46.6-rc1 to do so. However, e2fsprogs=1.46.5 works fine for the example.
Is your feature request related to a problem?/你的请求是否与某个问题相关?
No.
Describe the solution you'd like/描述你想要的解决方案
Reproducibly produce patched raw ext2 images. (
product.img
,system_ext.img
, etc.)Additional context/其他信息
e2fsprogs provided environment variable E2FSPROGS_FAKE_TIME to produce reproducible ext2 images. Also, with environment variable E2FSCK_TIME, we can shrink the size of ext2 images while keep reproducibility.
Here is an example. I use debugfs to delete (inodes of) preinstalled amazon and shrink the fs. The hash of modified modified system_ext.img is always
6cfa7fb0805c69d6af2949eab4356ac9c06e8c36c0304e344a2ce420580ba85a
. (originalebcc4c707ba97ea8855064231bbe045bcc6023a3f18aa9c024f6c334d0635ab2
, fromMicrosoftCorporationII.WindowsSubsystemForAndroid_2211.40000.11.0_neutral_~_8wekyb3d8bbwe.msixbundle
)Note that the major version should be greater than 2211, otherwise replace
system_ext.img
withproduct.img
Note that time_t 1230768000 is equivalent to timestamp 200901010000 (UTC).
Here's
system_ext.txt
.As far as I know, in MagiskOnWSALocal/scripts/build.sh#L739, you use
find . -exec touch -hamt <timestamp> {} ';'
to set every timestamp to 200901010000, but there are{a,c,m}time
for each file, so just use-ht <timestamp>
instead of-hamt <timestamp>
.Another important thing is that the timestamp is localized, so in China, timestamp
200901010000
would be shown as200901010800
, but when setting it to200901010000
, it would be shown as200901010000
, not200901010800
.p.s. We may need
e2fsprogs>=1.46.6-rc1
to do so. However,e2fsprogs=1.46.5
works fine for the example.