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
2011-12-24 11:56:46 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
# __________ __ ___.
|
|
|
|
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
# \/ \/ \/ \/ \/
|
|
|
|
#
|
|
|
|
# * Script to patch an unpacked Samsung YP-R0 firmware file */
|
|
|
|
# Copyright (C) 2011 Thomas Martitz
|
2013-07-23 14:24:19 +00:00
|
|
|
# Copyright (C) 2013 Lorenzo Miori
|
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
2011-12-24 11:56:46 +00:00
|
|
|
######################################################################
|
|
|
|
# bail out early
|
|
|
|
set -e
|
|
|
|
|
|
|
|
if [ $# -lt 1 ] || [ $# -gt 2 ]; then
|
|
|
|
echo "Usage: $0 <files path> [path to unpacked rom]"
|
2013-07-23 14:24:19 +00:00
|
|
|
echo "\t<files path> is expected to have a special resources and rootfs layout"
|
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
2011-12-24 11:56:46 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2013-07-23 14:24:19 +00:00
|
|
|
MODEL="unknown"
|
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
2011-12-24 11:56:46 +00:00
|
|
|
FILES=${1%/}
|
|
|
|
FILES=${FILES:-"/"}
|
2013-07-23 14:24:19 +00:00
|
|
|
COMMON_FILES="$FILES/common"
|
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
2011-12-24 11:56:46 +00:00
|
|
|
DIR=${2:-"."}
|
|
|
|
DIR=${DIR%/}
|
|
|
|
ROOTFS=$DIR/rootfs
|
|
|
|
CRAMFS=$DIR/cramfs-fsl.rom
|
|
|
|
|
|
|
|
# sanity checks
|
|
|
|
|
2013-07-23 14:24:19 +00:00
|
|
|
for subdir in common r0 r1
|
|
|
|
do
|
|
|
|
if [ ! -d "$FILES/$subdir" ]
|
|
|
|
then
|
|
|
|
echo "Missing $FILES/$subdir. Invalid $FILES layout."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ ! -e "$FILES/r1/etc/safemode/cable_detect" ]
|
|
|
|
then
|
|
|
|
echo "Couldn't find cable_detect binary (try 'make' or select a valid layout directory)"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
for image in pre_smode.raw post_smode.raw safemode.raw
|
|
|
|
do
|
|
|
|
if [ ! -e "$FILES/r1/etc/safemode/$image" ]
|
|
|
|
then
|
|
|
|
echo "Missing r1 .raw image file (try 'make'): $image"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
if [ ! -e "$FILES/r0/etc/safemode/$image" ]
|
|
|
|
then
|
|
|
|
echo "Missing r0 .raw image file (try 'make'): $image"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
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
2011-12-24 11:56:46 +00:00
|
|
|
# this needs to be run as root!
|
|
|
|
if [ $(whoami) != "root" ]
|
|
|
|
then
|
|
|
|
echo "This needs to be run as root"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -e $1 ] || [ ! -e $2 ]; then
|
|
|
|
echo "$1 or $2 does not exist"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z $ROOTFS ] || [ -z $FILES ]; then
|
|
|
|
echo "Invalid input directories"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -e $CRAMFS ]; then
|
|
|
|
echo "Cramfs image not found (did you extract the firmware?)"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Extracting cramfs image"
|
|
|
|
|
2013-07-23 14:24:19 +00:00
|
|
|
[ ! -e $ROOTFS ] || rm -R $ROOTFS
|
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
2011-12-24 11:56:46 +00:00
|
|
|
cramfs-1.1/cramfsck -x $ROOTFS $CRAMFS
|
|
|
|
|
2013-07-23 14:24:19 +00:00
|
|
|
# now we can detect player version
|
|
|
|
# NOTE: order is important here, since ironically
|
|
|
|
# r1's ROM contains also r0's executables
|
|
|
|
if [ -e "$ROOTFS/usr/local/bin/r1" ]
|
|
|
|
then
|
|
|
|
MODEL="r1"
|
|
|
|
else
|
|
|
|
if [ -e "$ROOTFS/usr/local/bin/r0" ]
|
|
|
|
then
|
|
|
|
MODEL="r0"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "$MODEL ROM found."
|
|
|
|
|
|
|
|
echo "Patching rootfs (common files)"
|
|
|
|
echo "cp -r $COMMON_FILES/* $ROOTFS/"
|
|
|
|
cp -r $COMMON_FILES/.rockbox $ROOTFS/
|
|
|
|
cp -r $COMMON_FILES/* $ROOTFS/
|
|
|
|
|
|
|
|
echo "Patching rootfs ($MODEL files)"
|
|
|
|
MODEL_FILES="$FILES/$MODEL"
|
|
|
|
echo "cp -r $MODEL_FILES/* $ROOTFS/"
|
|
|
|
cp -r $MODEL_FILES/* $ROOTFS/
|
2014-02-04 21:20:27 +00:00
|
|
|
rm -rf $ROOTFS/dev/ttyGS0
|
|
|
|
mknod $ROOTFS/dev/ttyGS0 c 127 0
|
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
2011-12-24 11:56:46 +00:00
|
|
|
|
|
|
|
echo "Packing new cramfs image"
|
|
|
|
cramfs-1.1/mkcramfs $ROOTFS $CRAMFS
|