summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Bukat <marcin.bukat@gmail.com>2018-06-13 13:28:38 +0200
committerMarcin Bukat <marcin.bukat@gmail.com>2018-06-13 13:30:34 +0200
commit419219e06d86c4c2fe64da35872f5a5c833f2419 (patch)
treeccc55d1d119815ec4ecc530ca033b2bb4bf0ba4a
parentf727b0787acc270fa7d0c9ebef6c853d08270005 (diff)
downloadrockbox-419219e06d86c4c2fe64da35872f5a5c833f2419.tar.gz
rockbox-419219e06d86c4c2fe64da35872f5a5c833f2419.zip
Agptek Rocker: Update tools to alter .upt update images
Change all references to official rockbox repository Change-Id: I22d305bc6c6f89b8737b2bc15378bfd7fe10621e
-rw-r--r--tools/agptek_rocker/Dockerfile7
-rw-r--r--tools/agptek_rocker/README24
-rw-r--r--tools/agptek_rocker/bootloader_install.sh47
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
34RUN cd /home/rb && \ 34RUN 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)
38RUN cd /home/rb/rockbox-wodz && \ 38RUN 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
49RUN cp /home/rb/rockbox-wodz/tools/agptek_rocker/bootloader_install.sh /usr/local/bin && \ 48RUN 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 @@
1Update file with .upt extension is actually ISO9660 image. Inside
2there are:
31) uboot.bin - uBoot image
42) uimage.bin - linux kernel image packed in legacy uboot format
53) system.ubi - UBIFS rootfs image
64) update.txt - text file describing update image content
75) version.txt - text file describing version of update image
8
1Steps needed to patch update.upt with rockbox bootloader are explained in 9Steps needed to patch update.upt with rockbox bootloader are explained in
2bootloader_install.sh shell script. Process is quite involved and some 10below. Process is quite involved and some custom tools are needed.
3custom tools are needed. 11bootloader_install.sh scipt is design to automate the process.
12
131) First content of ISO9660 .upt file needs to be unpacked
142) system.ubi UBIFS image needs to be unpacked
153) Rockbox bootloader is copied to unpacked rootfs
164) Recreate UBIFS with altered content
175) Update update.txt file with correct CRC of altered system.ubi
186) Recreate ISO9660 .upt file
4 19
5 20
6For convenience Dockerfile is provided which prepares custom image based 21For convenience Dockerfile is provided which prepares custom image based
@@ -9,7 +24,7 @@ images.
9 24
10Basically image extends standard debian image by: 25Basically image extends standard debian image by:
111) Installing developer packages from stock debian 261) Installing developer packages from stock debian
122) Cloning https://github.com/wodz/rockbox-wodz.git 272) Cloning rockbox repository http://gerrit.rockbox.org/p/rockbox
133) Building custom cross toolchain 283) Building custom cross toolchain
144) Cloning and installing tools to work with UBIFS 294) 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
33Files in this directory: 48Files in this directory:
34README - this file 49README - this file
50
35bootloader_install.sh - shell script documenting process of patching 51bootloader_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
2ROCKBOX_SRC=$HOME/rockbox
3BUILD=$ROCKBOX_SRC/build
4ISO=$HOME/iso
5ROOTFS=$HOME/rootfs
2 6
3[ -z "$UPT_DIR" ] && UPT_DIR=`pwd` 7[ -z "$UPT_DIR" ] && UPT_DIR=`pwd`
4cd $HOME 8cd $HOME
@@ -9,9 +13,9 @@ echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!"
9echo "!!! STEP 0: Get sources !!!" 13echo "!!! STEP 0: Get sources !!!"
10echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!" 14echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!"
11echo 15echo
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
14cd $HOME/rockbox-wodz 18cd $ROCKBOX_SRC
15 19
16# build bootloader 20# build bootloader
17echo 21echo
@@ -20,10 +24,9 @@ echo "!!! STEP 1: Build bootloader !!!"
20echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" 24echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
21echo 25echo
22 26
23[ -d "$HOME/rockbox-wodz/build" ] && rm -rf $HOME/rockbox-wodz/build 27[ -d "$BUILD" ] && rm -rf $BUILD
24git checkout agptek-rocker && \
25git pull && \ 28git pull && \
26mkdir $HOME/rockbox-wodz/build && cd $HOME/rockbox-wodz/build && \ 29mkdir $BUILD && cd $BUILD && \
27../tools/configure --target=240 --type=b && \ 30../tools/configure --target=240 --type=b && \
28make clean && \ 31make clean && \
29make && \ 32make && \
@@ -38,9 +41,9 @@ echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
38echo "!!! STEP 2: Extract upt file !!!" 41echo "!!! STEP 2: Extract upt file !!!"
39echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" 42echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
40echo 43echo
41[ -d "$HOME/iso" ] && rm -rf $HOME/iso 44[ -d "$ISO" ] && rm -rf $ISO
42mkdir $HOME/iso && \ 45mkdir $ISO && \
43xorriso -osirrox on -ecma119_map lowercase -indev $UPT_DIR/update.upt -extract / $HOME/iso 46xorriso -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!)
46echo 49echo
@@ -48,7 +51,7 @@ echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
48echo "!!! STEP 3: Extract system.ubi !!!" 51echo "!!! STEP 3: Extract system.ubi !!!"
49echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" 52echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
50echo 53echo
51ubireader_extract_files -k -o $HOME/rootfs $HOME/iso/system.ubi 54ubireader_extract_files -k -o $ROOTFS $ISO/system.ubi
52 55
53# Copy rockbox bootloader 56# Copy rockbox bootloader
54echo 57echo
@@ -56,8 +59,8 @@ echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
56echo "!!! STEP 4: Copy bootloader !!!" 59echo "!!! STEP 4: Copy bootloader !!!"
57echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" 60echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
58echo 61echo
59cp $HOME/rockbox-wodz/build/bootloader.elf $HOME/rootfs/usr/bin/rb_bootloader && \ 62cp $BUILD/bootloader.elf $ROOTFS/usr/bin/rb_bootloader && \
60mipsel-rockbox-linux-gnu-strip --strip-unneeded $HOME/rootfs/usr/bin/rb_bootloader 63mipsel-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
63echo 66echo
@@ -65,8 +68,8 @@ echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
65echo "!!! STEP 5: Modify startup script !!!" 68echo "!!! STEP 5: Modify startup script !!!"
66echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" 69echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
67echo 70echo
68cp $HOME/rockbox-wodz/tools/agptek_rocker//hiby_player.sh $HOME/rootfs/usr/bin/hiby_player.sh && \ 71cp $ROCKBOX_SRC/tools/agptek_rocker//hiby_player.sh $ROOTFS/usr/bin/hiby_player.sh && \
69chmod 755 $HOME/rootfs/usr/bin/hiby_player.sh 72chmod 755 $ROOTFS/usr/bin/hiby_player.sh
70 73
71# Rebuild ubifs 74# Rebuild ubifs
72echo 75echo
@@ -74,8 +77,8 @@ echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
74echo "!!! STEP 6: Rebuild system.ubi !!!" 77echo "!!! STEP 6: Rebuild system.ubi !!!"
75echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" 78echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
76echo 79echo
77mkfs.ubifs --min-io-size=2048 --leb-size=126976 --max-leb-cnt=1024 -o $HOME/system_rb.ubi -r $HOME/rootfs && \ 80mkfs.ubifs --min-io-size=2048 --leb-size=126976 --max-leb-cnt=1024 -o $HOME/system_rb.ubi -r $ROOTFS && \
78mv $HOME/system_rb.ubi $HOME/iso/system.ubi 81mv $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
81echo 84echo
@@ -83,7 +86,7 @@ echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
83echo "!!! STEP 7: Fixup update.txt !!!" 86echo "!!! STEP 7: Fixup update.txt !!!"
84echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" 87echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
85echo 88echo
86python $HOME/rockbox-wodz/tools/agptek_rocker/update_update.py $HOME/iso/update.txt 89python $ROCKBOX_SRC/tools/agptek_rocker/update_update.py $ISO/update.txt
87 90
88# Rebuild .upt file 91# Rebuild .upt file
89echo 92echo
@@ -91,7 +94,7 @@ echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
91echo "!!! STEP 8: Rebuild upt file !!!" 94echo "!!! STEP 8: Rebuild upt file !!!"
92echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" 95echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
93echo 96echo
94xorriso -as mkisofs -volid 'CDROM' --norock -output $UPT_DIR/update_rb.upt $HOME/iso 97xorriso -as mkisofs -volid 'CDROM' --norock -output $UPT_DIR/update_rb.upt $ISO
95 98
96# Build rockbox.zip 99# Build rockbox.zip
97echo 100echo
@@ -99,7 +102,7 @@ echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
99echo "!!! STEP 9: Build rockbox application !!!" 102echo "!!! STEP 9: Build rockbox application !!!"
100echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" 103echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
101echo 104echo
102cd $HOME/rockbox-wodz/build && \ 105cd $BUILD && \
103../tools/configure --target=240 --type=n && \ 106../tools/configure --target=240 --type=n && \
104make clean && \ 107make clean && \
105make && \ 108make && \
@@ -112,9 +115,9 @@ echo "!!!!!!!!!!!!!!!!!!!!!!!!"
112echo "!!! STEP 10: Cleanup !!!" 115echo "!!! STEP 10: Cleanup !!!"
113echo "!!!!!!!!!!!!!!!!!!!!!!!!" 116echo "!!!!!!!!!!!!!!!!!!!!!!!!"
114echo 117echo
115rm -rf $HOME/rockbox-wodz/build 118rm -rf $BUILD
116rm -rf $HOME/iso 119rm -rf $ISO
117rm -rf $HOME/rootfs 120rm -rf $ROOTFS
118 121
119echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" 122echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
120echo "! Building finished !" 123echo "! Building finished !"
@@ -126,4 +129,4 @@ echo "1) Unzip rockbox.zip file in the root directory of SD card"
126echo "2) Copy update_rb.upt to the root directory of SD card" 129echo "2) Copy update_rb.upt to the root directory of SD card"
127echo "3) Rename update_rb.upt to update.upt in SD card" 130echo "3) Rename update_rb.upt to update.upt in SD card"
128echo "4) Select update firmware on device" 131echo "4) Select update firmware on device"
129echo 132 echo