summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-10-17 21:19:38 -0400
committerSolomon Peachy <pizza@shaftnet.org>2020-10-17 21:40:40 -0400
commitedbdefa09ab9dfe82f647b48493db91d79c094dd (patch)
treeb392575d39a7dc0941c0c6cc143dca8f2b6cfe85
parent4cdb28c167c028e89be670f54a0108af3416cd1f (diff)
downloadrockbox-edbdefa09ab9dfe82f647b48493db91d79c094dd.tar.gz
rockbox-edbdefa09ab9dfe82f647b48493db91d79c094dd.zip
hosted: Drop a bootloader version string in /etc, and report it in debug menu
Change-Id: I4d72d7800dbff56619898b6bc9d0f81a6c561598
-rw-r--r--firmware/target/hosted/agptek/debug-agptek.c21
-rwxr-xr-xtools/hiby_patcher.pl7
2 files changed, 28 insertions, 0 deletions
diff --git a/firmware/target/hosted/agptek/debug-agptek.c b/firmware/target/hosted/agptek/debug-agptek.c
index 7f794a7073..d0ca613323 100644
--- a/firmware/target/hosted/agptek/debug-agptek.c
+++ b/firmware/target/hosted/agptek/debug-agptek.c
@@ -18,6 +18,13 @@
18 * 18 *
19 ****************************************************************************/ 19 ****************************************************************************/
20 20
21#include <sys/types.h>
22#include <sys/stat.h>
23#include <fcntl.h>
24#include <stdio.h>
25#include <unistd.h>
26#include <string.h>
27
21#include "config.h" 28#include "config.h"
22#include "font.h" 29#include "font.h"
23#include "lcd.h" 30#include "lcd.h"
@@ -34,12 +41,26 @@ bool dbg_hw_info(void)
34{ 41{
35 int btn = 0; 42 int btn = 0;
36 43
44 /* Try to read the bootloader */
45 char verstr[40];
46 memset(verstr, 0, sizeof(verstr));
47 int fd = open("/etc/rockbox-bl-info.txt", O_RDONLY);
48 if(fd >= 0)
49 {
50 read(fd, verstr, sizeof(verstr) -1);
51 close(fd);
52 }
53
37 lcd_setfont(FONT_SYSFIXED); 54 lcd_setfont(FONT_SYSFIXED);
38 55
39 while(btn ^ BUTTON_POWER) { 56 while(btn ^ BUTTON_POWER) {
40 lcd_clear_display(); 57 lcd_clear_display();
41 line = 0; 58 line = 0;
42 59
60 if (verstr[0]) {
61 lcd_putsf(0, line++, "Boot ver: %s", verstr);
62 }
63
43 lcd_putsf(0, line++, "pcm srate: %d", pcm_alsa_get_rate()); 64 lcd_putsf(0, line++, "pcm srate: %d", pcm_alsa_get_rate());
44#ifdef HAVE_HEADPHONE_DETECTION 65#ifdef HAVE_HEADPHONE_DETECTION
45 lcd_putsf(0, line++, "hp: %d", headphones_inserted()); 66 lcd_putsf(0, line++, "hp: %d", headphones_inserted());
diff --git a/tools/hiby_patcher.pl b/tools/hiby_patcher.pl
index b03f2343dd..cff029e03b 100755
--- a/tools/hiby_patcher.pl
+++ b/tools/hiby_patcher.pl
@@ -135,6 +135,13 @@ system(@sysargs);
135my $rbbasename = basename($rbbname); 135my $rbbasename = basename($rbbname);
136 136
137#### Mangle RootFS 137#### Mangle RootFS
138
139# Save version into rootfs
140my $version = `cat rockbox-info.txt | grep Version | cut -f2 -d' '`;
141open FILE, ">$rootfsdir/etc/rockbox-bl-info.txt" || die ("can't write version txt");
142print FILE $version;
143close FILE;
144
138if ($hiby) { 145if ($hiby) {
139 my $bootloader_sh = 146 my $bootloader_sh =
140 "#!/bin/sh 147 "#!/bin/sh