View Single Post
Old 10-12-2024, 06:36 AM   #11
Renate
Onyx-maniac
Renate ought to be getting tired of karma fortunes by now.Renate ought to be getting tired of karma fortunes by now.Renate ought to be getting tired of karma fortunes by now.Renate ought to be getting tired of karma fortunes by now.Renate ought to be getting tired of karma fortunes by now.Renate ought to be getting tired of karma fortunes by now.Renate ought to be getting tired of karma fortunes by now.Renate ought to be getting tired of karma fortunes by now.Renate ought to be getting tired of karma fortunes by now.Renate ought to be getting tired of karma fortunes by now.Renate ought to be getting tired of karma fortunes by now.
 
Posts: 3,974
Karma: 18026955
Join Date: Feb 2012
Device: Nook NST, Glow2, 3, 4, '21, Kobo Aura2, Poke3, Poke5, Go6
If you're doing your desktop work on a Windows platform there is something to make life easier.

If you want to manipulate super.img you'll need two different things:
Something to extract the logical partitions.
Something to manipulate the ext4 logical partitions.

Extracting logical partitions is simple, for Windows just use my lputil.exe

Modifying ext4 logical partitons is another thing. For just extracting, 7zip can do that.
But to modify an ext4 partition that is using shared blocks requires Linux. You can send your system partition over to a Linux system (like a Raspberry Pi) and manipulate it there. But that gets tedious transfering 2 GB files back and forth.

(I actually did something similar once with a Linux desktop and a Windows auxilliary system using a USB flash drive that was switched between the two systems.)

Windows has WSL, Windows subsystem for Linux. You can run a regular distribution of Debian or even a desktop Ubuntu. And the good thing is, you can mix all your Windows command and your Linux commands in one makefile (or batch file).

Code:
doitall:
# extract
	lputil super.img /x /s0 /psystem sys.img
# mount
	wsl -- e2fsck -f -y sys.img
	wsl -- resize2fs sys.img 550000
	wsl -- e2fsck -E unshare_blocks -y sys.img
	wsl -- e2fsck -f -y sys.img
	wsl -- sudo mount -t ext4 -o loop sys.img mnt
# do your changes here
	wsl -- sudo cp fonts.xml mnt/system/etc/fonts.xml
# unmount
	wsl -- sudo umount mnt
	wsl -- e2fsck -f -y sys.img
	wsl -- resize2fs sys.img 524113
	wsl -- e2fsck -f -y sys.img
# replace
	lputil super.img /r /s0 /psystem sys.img
(550000 and 524113 are numbers specific to my Go6.)

Ok, that seems a bit complicated, but the good part is that you just need to run it. When you find something else to modify, just add another line and rerun it. It beats the heck out of typing individual commands.

In actual use, once you have your system image extracted, unshared and resized you can just mount/mod/umount without going through as many steps. Of course if you screw up you'll need to redo everything. It's mostly the unshare operation that takes the most time.
Renate is offline   Reply With Quote