summaryrefslogtreecommitdiffstats
path: root/tools/agptek_rocker/README
blob: b08d067a7dbb089885b0e2df7f9bdff872dfacb0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
Update file with .upt extension is actually ISO9660 image. Inside
there are:
1) uboot.bin   - uBoot image
2) uimage.bin  - linux kernel image packed in legacy uboot format
3) system.ubi  - UBIFS rootfs image
4) update.txt  - text file describing update image content
5) version.txt - text file describing version of update image

Steps needed to patch update.upt with rockbox bootloader are explained in
below. Process is quite involved and some custom tools are needed.
bootloader_install.sh scipt is design to automate the process.

1) First content of ISO9660 .upt file needs to be unpacked
2) system.ubi UBIFS image needs to be unpacked
3) Rockbox bootloader is copied to unpacked rootfs
4) Recreate UBIFS with altered content
5) Update update.txt file with correct CRC of altered system.ubi
6) Recreate ISO9660 .upt file


For convenience Dockerfile is provided which prepares custom image based
on debian 9 which has all the tools needed to work with Agptek Rocker update
images.

Basically image extends standard debian image by:
1) Installing developer packages from stock debian
2) Cloning rockbox repository http://gerrit.rockbox.org/p/rockbox
3) Building custom cross toolchain
4) Cloning and installing tools to work with UBIFS

You first need to build image with:
docker build . -t "agptek-dev"

Then you can start container and work with update.upt.
If you want to generate patched update image in automatic way:
docker run --rm -it -v /path/to/dir/with/update.upt:/upt \
-e UPT_DIR=/upt agptek-dev bootloader_install.sh

Patched update.upt with rockbox bootloader and rockbox.zip should end up in
specified directory.

If you want to play around, hack something etc. you can run container in
interactive mode:
docker run -it -v /path/to/dir/with/update.upt:/upt \
-e UPT_DIR=/upt agptek-dev bash


Files in this directory:
README                - this file

bootloader_install.sh - shell script documenting process of patching
                        agptek rocker update images

update_update.py      - little helper utility to patch update.txt
                        controll file

hiby_player.sh        - shell script called on player boot which
                        originally started music player application
                        and now it starts bootloader

Dockerfile            - file to build docker image with all needed
                        tools to play with agptek rocker files