summaryrefslogtreecommitdiff
path: root/utils/ypr0tools/patch-firmware.sh
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2011-12-24 11:56:46 +0000
committerThomas Martitz <kugel@rockbox.org>2011-12-24 11:56:46 +0000
commit249bba03f1051f4984538f66b9e7d36674c61e5c (patch)
treeb9a0d78e05269ed2043521ab0dfdad83aeaf2aff /utils/ypr0tools/patch-firmware.sh
parent567e0ad93ef3048f2266932b10dcdb309b1a77c9 (diff)
downloadrockbox-249bba03f1051f4984538f66b9e7d36674c61e5c.tar.gz
rockbox-249bba03f1051f4984538f66b9e7d36674c61e5c.zip
Initial commit of the Samsung YP-R0 port.
This port is a hybrid native/RaaA port. It runs on a embedded linux system, but is the only application. It therefore can implement lots of stuff that native targets also implement, while leveraging the underlying linux kernel. The port is quite advanced. User interface, audio playback, plugins work mostly fine. Missing is e.g. power mangement and USB (see SamsungYPR0 wiki page). Included in utils/ypr0tools are scripts and programs required to generate a patched firmware. The patched firmware has the rootfs modified to load Rockbox. It includes a early/safe USB mode. This port needs a new toolchain, one that includes glibc headers and libraries. rockboxdev.sh can generate it, but e.g. codesourcey and distro packages may also work. Most of the initial effort is done by Lorenzo Miori and others (on ABI), including reverse engineering and patching of the original firmware, initial drivers, and more. Big thanks to you. Flyspray: FS#12348 Author: Lorenzo Miori, myself Merry christmas to ypr0 owners! :) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31415 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/ypr0tools/patch-firmware.sh')
-rwxr-xr-xutils/ypr0tools/patch-firmware.sh67
1 files changed, 67 insertions, 0 deletions
diff --git a/utils/ypr0tools/patch-firmware.sh b/utils/ypr0tools/patch-firmware.sh
new file mode 100755
index 0000000000..879b3f879d
--- /dev/null
+++ b/utils/ypr0tools/patch-firmware.sh
@@ -0,0 +1,67 @@
1#!/bin/sh
2
3
4######################################################################
5# __________ __ ___.
6# Open \______ \ ____ ____ | | _\_ |__ _______ ___
7# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
8# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
9# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10# \/ \/ \/ \/ \/
11#
12# * Script to patch an unpacked Samsung YP-R0 firmware file */
13# Copyright (C) 2011 Thomas Martitz
14######################################################################
15# bail out early
16set -e
17
18if [ $# -lt 1 ] || [ $# -gt 2 ]; then
19 echo "Usage: $0 <files path> [path to unpacked rom]"
20 echo "\t<files path> is expected to have a rootfs layout and to contain"
21 echo "\tonly the files to overwrite (plain cp -r is used)"
22 exit 1
23fi
24
25FILES=${1%/}
26FILES=${FILES:-"/"}
27DIR=${2:-"."}
28DIR=${DIR%/}
29ROOTFS=$DIR/rootfs
30CRAMFS=$DIR/cramfs-fsl.rom
31
32# sanity checks
33
34# this needs to be run as root!
35if [ $(whoami) != "root" ]
36then
37 echo "This needs to be run as root"
38 exit 1
39fi
40
41if [ ! -e $1 ] || [ ! -e $2 ]; then
42 echo "$1 or $2 does not exist"
43 exit 1
44fi
45
46if [ -z $ROOTFS ] || [ -z $FILES ]; then
47 echo "Invalid input directories"
48 exit 1
49fi
50
51if [ ! -e $CRAMFS ]; then
52 echo "Cramfs image not found (did you extract the firmware?)"
53 exit 1
54fi
55
56echo "Extracting cramfs image"
57
58[ ! -e $ROOTFS ] || rmdir -p $ROOTFS
59cramfs-1.1/cramfsck -x $ROOTFS $CRAMFS
60
61echo "Patching rootfs"
62echo "cp -r $FILES/* $ROOTFS/"
63cp -r $FILES/.rockbox $ROOTFS/
64cp -r $FILES/* $ROOTFS/
65
66echo "Packing new cramfs image"
67cramfs-1.1/mkcramfs $ROOTFS $CRAMFS