A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita
audio
rust
zig
deno
mpris
rockbox
mpd
1#!/bin/sh
2
3######################################################################
4# __________ __ ___.
5# Open \______ \ ____ ____ | | _\_ |__ _______ ___
6# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
7# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
8# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
9# \/ \/ \/ \/ \/
10#
11# Script to test packer and unpacker
12# Copyright (C) 2013 Lorenzo Miori
13######################################################################
14
15ROM_FILE="$1"
16TMP_FOLDER=""
17
18goto_temp()
19{
20 if [ -n "$TMP_FOLDER" ]
21 then
22 cd $TMP_FOLDER
23 fi
24}
25
26cleanup()
27{
28 echo "$1"
29 OLD_DIR=`pwd`
30 goto_temp
31 rm -f "$ROM_FILE"_TEST_CRYPT "MBoot.bin" "zImage" "cramfs-fsl.rom" "SYSDATA.bin" "TEST_MD5SUMS" "RevisionInfo.txt" > /dev/null
32 cd $OLD_DIR
33 if [ -n "$TMP_FOLDER" ]
34 then
35 rmdir $TMP_FOLDER
36 fi
37 make clean
38 exit $2
39}
40
41if [ $# -lt 1 ]
42then
43 cleanup "FAIL: Missing parameter! Run with: test.sh <path to working rom to test> <optional: destination to temporary files>" 1
44fi
45
46if [ $# -eq 2 ]
47then
48 TMP_FOLDER="$2/"
49 mkdir $TMP_FOLDER
50 if [ $? -ne 0 ]
51 then
52 echo "FAIL: temporary directory exists!"
53 fi
54fi
55
56# be sure we have the executables up-to-date
57make clean
58make
59
60./fwdecrypt $1 $TMP_FOLDER
61if [ $? -ne 0 ]
62then
63 cleanup "FAIL: Error while decrypting ROM file" 1
64fi
65
66./fwcrypt $TMP_FOLDER$1_TEST_CRYPT $TMP_FOLDER
67if [ $? -ne 0 ]
68then
69 cleanup "FAIL: Error while decrypting ROM file" 1
70fi
71
72OLD_DIR=`pwd`
73goto_temp
74
75md5sum MBoot.bin zImage cramfs-fsl.rom SYSDATA.bin RevisionInfo.txt > "TEST_MD5SUMS"
76
77md5sum --strict -c "TEST_MD5SUMS"
78if [ $? -ne 0 ]
79then
80 cleanup "FAIL: MD5SUM mismatch!" 1
81fi
82
83cd $OLD_DIR
84
85cleanup "OK: test completed without errors." 0