diff options
Diffstat (limited to 'tools/agptek_rocker')
-rw-r--r-- | tools/agptek_rocker/Dockerfile | 7 | ||||
-rw-r--r-- | tools/agptek_rocker/README | 24 | ||||
-rw-r--r-- | tools/agptek_rocker/bootloader_install.sh | 47 |
3 files changed, 48 insertions, 30 deletions
diff --git a/tools/agptek_rocker/Dockerfile b/tools/agptek_rocker/Dockerfile index de6a234474..d83e5e905f 100644 --- a/tools/agptek_rocker/Dockerfile +++ b/tools/agptek_rocker/Dockerfile | |||
@@ -32,11 +32,10 @@ RUN apt-get update && \ | |||
32 | 32 | ||
33 | # Clone rockbox repository | 33 | # Clone rockbox repository |
34 | RUN cd /home/rb && \ | 34 | RUN cd /home/rb && \ |
35 | git clone https://github.com/wodz/rockbox-wodz.git | 35 | git clone http://gerrit.rockbox.org/p/rockbox |
36 | 36 | ||
37 | # Build cross toolchain (It takes quite long) | 37 | # Build cross toolchain (It takes quite long) |
38 | RUN cd /home/rb/rockbox-wodz && \ | 38 | RUN cd /home/rb/rockbox && \ |
39 | git checkout agptek-rocker && \ | ||
40 | ./tools/rockboxdev.sh --target=y | 39 | ./tools/rockboxdev.sh --target=y |
41 | 40 | ||
42 | # Install tools for unpacking ubifs | 41 | # Install tools for unpacking ubifs |
@@ -46,5 +45,5 @@ RUN cd /home/rb && \ | |||
46 | python setup.py install | 45 | python setup.py install |
47 | 46 | ||
48 | # Copy build script | 47 | # Copy build script |
49 | RUN cp /home/rb/rockbox-wodz/tools/agptek_rocker/bootloader_install.sh /usr/local/bin && \ | 48 | RUN cp /home/rb/rockbox/tools/agptek_rocker/bootloader_install.sh /usr/local/bin && \ |
50 | chmod 755 /usr/local/bin/bootloader_install.sh | 49 | chmod 755 /usr/local/bin/bootloader_install.sh |
diff --git a/tools/agptek_rocker/README b/tools/agptek_rocker/README index 6b627698e5..b08d067a7d 100644 --- a/tools/agptek_rocker/README +++ b/tools/agptek_rocker/README | |||
@@ -1,6 +1,21 @@ | |||
1 | Update file with .upt extension is actually ISO9660 image. Inside | ||
2 | there are: | ||
3 | 1) uboot.bin - uBoot image | ||
4 | 2) uimage.bin - linux kernel image packed in legacy uboot format | ||
5 | 3) system.ubi - UBIFS rootfs image | ||
6 | 4) update.txt - text file describing update image content | ||
7 | 5) version.txt - text file describing version of update image | ||
8 | |||
1 | Steps needed to patch update.upt with rockbox bootloader are explained in | 9 | Steps needed to patch update.upt with rockbox bootloader are explained in |
2 | bootloader_install.sh shell script. Process is quite involved and some | 10 | below. Process is quite involved and some custom tools are needed. |
3 | custom tools are needed. | 11 | bootloader_install.sh scipt is design to automate the process. |
12 | |||
13 | 1) First content of ISO9660 .upt file needs to be unpacked | ||
14 | 2) system.ubi UBIFS image needs to be unpacked | ||
15 | 3) Rockbox bootloader is copied to unpacked rootfs | ||
16 | 4) Recreate UBIFS with altered content | ||
17 | 5) Update update.txt file with correct CRC of altered system.ubi | ||
18 | 6) Recreate ISO9660 .upt file | ||
4 | 19 | ||
5 | 20 | ||
6 | For convenience Dockerfile is provided which prepares custom image based | 21 | For convenience Dockerfile is provided which prepares custom image based |
@@ -9,7 +24,7 @@ images. | |||
9 | 24 | ||
10 | Basically image extends standard debian image by: | 25 | Basically image extends standard debian image by: |
11 | 1) Installing developer packages from stock debian | 26 | 1) Installing developer packages from stock debian |
12 | 2) Cloning https://github.com/wodz/rockbox-wodz.git | 27 | 2) Cloning rockbox repository http://gerrit.rockbox.org/p/rockbox |
13 | 3) Building custom cross toolchain | 28 | 3) Building custom cross toolchain |
14 | 4) Cloning and installing tools to work with UBIFS | 29 | 4) Cloning and installing tools to work with UBIFS |
15 | 30 | ||
@@ -31,7 +46,8 @@ docker run -it -v /path/to/dir/with/update.upt:/upt \ | |||
31 | 46 | ||
32 | 47 | ||
33 | Files in this directory: | 48 | Files in this directory: |
34 | README - this file | 49 | README - this file |
50 | |||
35 | bootloader_install.sh - shell script documenting process of patching | 51 | bootloader_install.sh - shell script documenting process of patching |
36 | agptek rocker update images | 52 | agptek rocker update images |
37 | 53 | ||
diff --git a/tools/agptek_rocker/bootloader_install.sh b/tools/agptek_rocker/bootloader_install.sh index 487b8870ea..d647c6c59b 100644 --- a/tools/agptek_rocker/bootloader_install.sh +++ b/tools/agptek_rocker/bootloader_install.sh | |||
@@ -1,4 +1,8 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | ROCKBOX_SRC=$HOME/rockbox | ||
3 | BUILD=$ROCKBOX_SRC/build | ||
4 | ISO=$HOME/iso | ||
5 | ROOTFS=$HOME/rootfs | ||
2 | 6 | ||
3 | [ -z "$UPT_DIR" ] && UPT_DIR=`pwd` | 7 | [ -z "$UPT_DIR" ] && UPT_DIR=`pwd` |
4 | cd $HOME | 8 | cd $HOME |
@@ -9,9 +13,9 @@ echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!" | |||
9 | echo "!!! STEP 0: Get sources !!!" | 13 | echo "!!! STEP 0: Get sources !!!" |
10 | echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!" | 14 | echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!" |
11 | echo | 15 | echo |
12 | [ -d "$HOME/rockbox-wodz" ] || git clone https://github.com/wodz/rockbox-wodz.git | 16 | [ -d "$ROCKBOX_SRC" ] || git clone ttp://gerrit.rockbox.org/p/rockbox |
13 | 17 | ||
14 | cd $HOME/rockbox-wodz | 18 | cd $ROCKBOX_SRC |
15 | 19 | ||
16 | # build bootloader | 20 | # build bootloader |
17 | echo | 21 | echo |
@@ -20,10 +24,9 @@ echo "!!! STEP 1: Build bootloader !!!" | |||
20 | echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" | 24 | echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" |
21 | echo | 25 | echo |
22 | 26 | ||
23 | [ -d "$HOME/rockbox-wodz/build" ] && rm -rf $HOME/rockbox-wodz/build | 27 | [ -d "$BUILD" ] && rm -rf $BUILD |
24 | git checkout agptek-rocker && \ | ||
25 | git pull && \ | 28 | git pull && \ |
26 | mkdir $HOME/rockbox-wodz/build && cd $HOME/rockbox-wodz/build && \ | 29 | mkdir $BUILD && cd $BUILD && \ |
27 | ../tools/configure --target=240 --type=b && \ | 30 | ../tools/configure --target=240 --type=b && \ |
28 | make clean && \ | 31 | make clean && \ |
29 | make && \ | 32 | make && \ |
@@ -38,9 +41,9 @@ echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" | |||
38 | echo "!!! STEP 2: Extract upt file !!!" | 41 | echo "!!! STEP 2: Extract upt file !!!" |
39 | echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" | 42 | echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" |
40 | echo | 43 | echo |
41 | [ -d "$HOME/iso" ] && rm -rf $HOME/iso | 44 | [ -d "$ISO" ] && rm -rf $ISO |
42 | mkdir $HOME/iso && \ | 45 | mkdir $ISO && \ |
43 | xorriso -osirrox on -ecma119_map lowercase -indev $UPT_DIR/update.upt -extract / $HOME/iso | 46 | xorriso -osirrox on -ecma119_map lowercase -indev $UPT_DIR/update.upt -extract / $ISO |
44 | 47 | ||
45 | # Extract rootfs files. Preserve permissions (although this are wrong!) | 48 | # Extract rootfs files. Preserve permissions (although this are wrong!) |
46 | echo | 49 | echo |
@@ -48,7 +51,7 @@ echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" | |||
48 | echo "!!! STEP 3: Extract system.ubi !!!" | 51 | echo "!!! STEP 3: Extract system.ubi !!!" |
49 | echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" | 52 | echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" |
50 | echo | 53 | echo |
51 | ubireader_extract_files -k -o $HOME/rootfs $HOME/iso/system.ubi | 54 | ubireader_extract_files -k -o $ROOTFS $ISO/system.ubi |
52 | 55 | ||
53 | # Copy rockbox bootloader | 56 | # Copy rockbox bootloader |
54 | echo | 57 | echo |
@@ -56,8 +59,8 @@ echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" | |||
56 | echo "!!! STEP 4: Copy bootloader !!!" | 59 | echo "!!! STEP 4: Copy bootloader !!!" |
57 | echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" | 60 | echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" |
58 | echo | 61 | echo |
59 | cp $HOME/rockbox-wodz/build/bootloader.elf $HOME/rootfs/usr/bin/rb_bootloader && \ | 62 | cp $BUILD/bootloader.elf $ROOTFS/usr/bin/rb_bootloader && \ |
60 | mipsel-rockbox-linux-gnu-strip --strip-unneeded $HOME/rootfs/usr/bin/rb_bootloader | 63 | mipsel-rockbox-linux-gnu-strip --strip-unneeded $ROOTFS/usr/bin/rb_bootloader |
61 | 64 | ||
62 | # Overwrite default player starting script with one running our bootloader | 65 | # Overwrite default player starting script with one running our bootloader |
63 | echo | 66 | echo |
@@ -65,8 +68,8 @@ echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" | |||
65 | echo "!!! STEP 5: Modify startup script !!!" | 68 | echo "!!! STEP 5: Modify startup script !!!" |
66 | echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" | 69 | echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" |
67 | echo | 70 | echo |
68 | cp $HOME/rockbox-wodz/tools/agptek_rocker//hiby_player.sh $HOME/rootfs/usr/bin/hiby_player.sh && \ | 71 | cp $ROCKBOX_SRC/tools/agptek_rocker//hiby_player.sh $ROOTFS/usr/bin/hiby_player.sh && \ |
69 | chmod 755 $HOME/rootfs/usr/bin/hiby_player.sh | 72 | chmod 755 $ROOTFS/usr/bin/hiby_player.sh |
70 | 73 | ||
71 | # Rebuild ubifs | 74 | # Rebuild ubifs |
72 | echo | 75 | echo |
@@ -74,8 +77,8 @@ echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" | |||
74 | echo "!!! STEP 6: Rebuild system.ubi !!!" | 77 | echo "!!! STEP 6: Rebuild system.ubi !!!" |
75 | echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" | 78 | echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" |
76 | echo | 79 | echo |
77 | mkfs.ubifs --min-io-size=2048 --leb-size=126976 --max-leb-cnt=1024 -o $HOME/system_rb.ubi -r $HOME/rootfs && \ | 80 | mkfs.ubifs --min-io-size=2048 --leb-size=126976 --max-leb-cnt=1024 -o $HOME/system_rb.ubi -r $ROOTFS && \ |
78 | mv $HOME/system_rb.ubi $HOME/iso/system.ubi | 81 | mv $HOME/system_rb.ubi $ISO/system.ubi |
79 | 82 | ||
80 | # Fixup update.txt file with correct md5 | 83 | # Fixup update.txt file with correct md5 |
81 | echo | 84 | echo |
@@ -83,7 +86,7 @@ echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" | |||
83 | echo "!!! STEP 7: Fixup update.txt !!!" | 86 | echo "!!! STEP 7: Fixup update.txt !!!" |
84 | echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" | 87 | echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" |
85 | echo | 88 | echo |
86 | python $HOME/rockbox-wodz/tools/agptek_rocker/update_update.py $HOME/iso/update.txt | 89 | python $ROCKBOX_SRC/tools/agptek_rocker/update_update.py $ISO/update.txt |
87 | 90 | ||
88 | # Rebuild .upt file | 91 | # Rebuild .upt file |
89 | echo | 92 | echo |
@@ -91,7 +94,7 @@ echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" | |||
91 | echo "!!! STEP 8: Rebuild upt file !!!" | 94 | echo "!!! STEP 8: Rebuild upt file !!!" |
92 | echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" | 95 | echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" |
93 | echo | 96 | echo |
94 | xorriso -as mkisofs -volid 'CDROM' --norock -output $UPT_DIR/update_rb.upt $HOME/iso | 97 | xorriso -as mkisofs -volid 'CDROM' --norock -output $UPT_DIR/update_rb.upt $ISO |
95 | 98 | ||
96 | # Build rockbox.zip | 99 | # Build rockbox.zip |
97 | echo | 100 | echo |
@@ -99,7 +102,7 @@ echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" | |||
99 | echo "!!! STEP 9: Build rockbox application !!!" | 102 | echo "!!! STEP 9: Build rockbox application !!!" |
100 | echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" | 103 | echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" |
101 | echo | 104 | echo |
102 | cd $HOME/rockbox-wodz/build && \ | 105 | cd $BUILD && \ |
103 | ../tools/configure --target=240 --type=n && \ | 106 | ../tools/configure --target=240 --type=n && \ |
104 | make clean && \ | 107 | make clean && \ |
105 | make && \ | 108 | make && \ |
@@ -112,9 +115,9 @@ echo "!!!!!!!!!!!!!!!!!!!!!!!!" | |||
112 | echo "!!! STEP 10: Cleanup !!!" | 115 | echo "!!! STEP 10: Cleanup !!!" |
113 | echo "!!!!!!!!!!!!!!!!!!!!!!!!" | 116 | echo "!!!!!!!!!!!!!!!!!!!!!!!!" |
114 | echo | 117 | echo |
115 | rm -rf $HOME/rockbox-wodz/build | 118 | rm -rf $BUILD |
116 | rm -rf $HOME/iso | 119 | rm -rf $ISO |
117 | rm -rf $HOME/rootfs | 120 | rm -rf $ROOTFS |
118 | 121 | ||
119 | echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" | 122 | echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" |
120 | echo "! Building finished !" | 123 | echo "! Building finished !" |
@@ -126,4 +129,4 @@ echo "1) Unzip rockbox.zip file in the root directory of SD card" | |||
126 | echo "2) Copy update_rb.upt to the root directory of SD card" | 129 | echo "2) Copy update_rb.upt to the root directory of SD card" |
127 | echo "3) Rename update_rb.upt to update.upt in SD card" | 130 | echo "3) Rename update_rb.upt to update.upt in SD card" |
128 | echo "4) Select update firmware on device" | 131 | echo "4) Select update firmware on device" |
129 | echo | 132 | echo |