release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Wiki > Main > AutomaticChecking (compare)

Difference: AutomaticChecking (r3 vs. r2)

This script will check if dual-booting is correctly set.

Please modify the "h10" variable at the begining of this script to point to your iriver H10 (UMS) mount point. Also, set "h10_20GB" to 1 if it is a 20GB model, or to 0 if not.


#!/bin/bash

h10=/media/H10
h10_20GB=1
#h10_20GB=0

if [[ "${h10_20GB}" == "1" ]]; then
        h10_fw=H10_20GC.mi4
else
        h10_fw=H10.mi4
fi

# Test if mounted
h10_mounted=`mount | grep $h10`
if [[ ! -n $h10_mounted ]]; then
    echo "FAILED - IRiver H10 not mounted as Universal Mass Storage (UMS)"
    echo "Please use the UMS trick to mount device"
    echo "See http://www.rockbox.org/twiki/bin/view/Main/H10InstallationBeta#Installing_the_boot_loader"
    exit
else
    echo "OK - IRiver H10 mounted as UMS..."
fi

# Check the bootloader
cd $h10
if [[ ! -e $h10/System/${h10_fw} ]]; then
    echo "FAILED - Rockbox Bootloader ($h10/System/${h10_fw}) missing"
    echo "See http://www.rockbox.org/twiki/bin/view/Main/H10InstallationBeta#Installing_the_boot_loader"
    exit
else
    rbfw=`grep -i rockbox $h10/System/${h10_fw}`
    if [[ ! -n $rbfw ]]; then
        echo "FAILED - Bootloader $h10/System/${h10_fw} is present but doesn't seems to be Rockbox's"
        echo "Please install the Rockbox bootloader"
        echo "See http://www.rockbox.org/twiki/bin/view/Main/H10InstallationBeta#Installing_the_boot_loader"
        exit
    fi
    echo "OK - Rockbox bootloader is installed"
fi

# Check the firmware
rbpresent=`ls $h10/.rockbox 2>&1 | grep ls`
if [[ "$rbpresent" != "" ]]; then
    echo "FAILED - Rockbox ($h10/.rockbox) missing"
    echo "See http://www.rockbox.org/twiki/bin/view/Main/H10InstallationBeta#Installing_the_firmware"
    exit
fi
if [[ ! -e $h10/rockbox.h10 ]]; then
    echo "FAILED - Rockbox ($h10/rockbox.h10) missing"
    echo "Some daily builds don't include the file rockbox.h10"
    echo "Please download http://build.rockbox.org/dist/build-h10_5gb/rockbox.zip"
    echo "from http://build.rockbox.org/ and unzip to $h10"
    exit
fi
echo "OK - Rockbox firmware is installed"

# Check original firmware for dual-booting (optional)
if [[ ! -e $h10/System/OF.bin ]]; then
    echo "Decrypted original firmware not present ($h10/System/OF.bin)"
    echo "If you want to dualboot (IRiver/Rockbox) you need to install"
    echo "an iriver's decrypted firmware."
    echo "Please see http://www.rockbox.org/twiki/bin/view/Main/H10InstallationBeta#Preparing_for_dual_booting_to_th"
else
    if [[ ! -e /tmp/mi4code/mi4code ]]; then
        mkdir -p /tmp/mi4code
        cd /tmp/mi4code
        if [[ ! -e mi4code.c ]]; then
            wget http://daniel.haxx.se/sansa/mi4code.c
        fi
        gcc -o mi4code mi4code.c -lgcrypt
    fi
    decrypted=`/tmp/mi4code/mi4code verify $h10/System/OF.bin 2>&1 | grep -i invalid`
    if [[ "$decrypted" == "" ]]; then
        echo "FAILED - Your iriver's firmware ($h10/System/OF.bin) is not decrypted!"
        echo "Please decrypt it using mi4code"
        echo "See http://www.rockbox.org/twiki/bin/view/Main/H10InstallationBeta#Preparing_for_dual_booting_to_th"
    fi
    iriver_fw=`grep -i rockbox $h10/System/OF.bin`
    if [[ "$iriver_fw" != "" ]]; then
        echo "FAILED - File $h10/System/OF.bin is present but"
        echo "it is not orignal (decrypted) Iriver firmware!"
        echo "Please put it back to place and decrypt!"
        exit
    fi
fi
echo "OK - Original iriver's firmware is in place and ready to dualboot"



r4 - 07 May 2007 - 20:31:06 - NathanHepting

Revision r3 - 08 Mar 2007 - 22:40 - LinusNielsenFeltzing
Revision r2 - 07 Mar 2007 - 16:56 - NicolasBigaouette?
Copyright by the contributing authors.