diff options
-rw-r--r-- | firmware/target/hosted/agptek/debug-agptek.c | 21 | ||||
-rwxr-xr-x | tools/hiby_patcher.pl | 7 |
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); | |||
135 | my $rbbasename = basename($rbbname); | 135 | my $rbbasename = basename($rbbname); |
136 | 136 | ||
137 | #### Mangle RootFS | 137 | #### Mangle RootFS |
138 | |||
139 | # Save version into rootfs | ||
140 | my $version = `cat rockbox-info.txt | grep Version | cut -f2 -d' '`; | ||
141 | open FILE, ">$rootfsdir/etc/rockbox-bl-info.txt" || die ("can't write version txt"); | ||
142 | print FILE $version; | ||
143 | close FILE; | ||
144 | |||
138 | if ($hiby) { | 145 | if ($hiby) { |
139 | my $bootloader_sh = | 146 | my $bootloader_sh = |
140 | "#!/bin/sh | 147 | "#!/bin/sh |