forked from len0rd/rockbox
hosted: Drop a bootloader version string in /etc, and report it in debug menu
Change-Id: I4d72d7800dbff56619898b6bc9d0f81a6c561598
This commit is contained in:
parent
4cdb28c167
commit
edbdefa09a
2 changed files with 28 additions and 0 deletions
|
|
@ -18,6 +18,13 @@
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "font.h"
|
#include "font.h"
|
||||||
#include "lcd.h"
|
#include "lcd.h"
|
||||||
|
|
@ -34,12 +41,26 @@ bool dbg_hw_info(void)
|
||||||
{
|
{
|
||||||
int btn = 0;
|
int btn = 0;
|
||||||
|
|
||||||
|
/* Try to read the bootloader */
|
||||||
|
char verstr[40];
|
||||||
|
memset(verstr, 0, sizeof(verstr));
|
||||||
|
int fd = open("/etc/rockbox-bl-info.txt", O_RDONLY);
|
||||||
|
if(fd >= 0)
|
||||||
|
{
|
||||||
|
read(fd, verstr, sizeof(verstr) -1);
|
||||||
|
close(fd);
|
||||||
|
}
|
||||||
|
|
||||||
lcd_setfont(FONT_SYSFIXED);
|
lcd_setfont(FONT_SYSFIXED);
|
||||||
|
|
||||||
while(btn ^ BUTTON_POWER) {
|
while(btn ^ BUTTON_POWER) {
|
||||||
lcd_clear_display();
|
lcd_clear_display();
|
||||||
line = 0;
|
line = 0;
|
||||||
|
|
||||||
|
if (verstr[0]) {
|
||||||
|
lcd_putsf(0, line++, "Boot ver: %s", verstr);
|
||||||
|
}
|
||||||
|
|
||||||
lcd_putsf(0, line++, "pcm srate: %d", pcm_alsa_get_rate());
|
lcd_putsf(0, line++, "pcm srate: %d", pcm_alsa_get_rate());
|
||||||
#ifdef HAVE_HEADPHONE_DETECTION
|
#ifdef HAVE_HEADPHONE_DETECTION
|
||||||
lcd_putsf(0, line++, "hp: %d", headphones_inserted());
|
lcd_putsf(0, line++, "hp: %d", headphones_inserted());
|
||||||
|
|
|
||||||
|
|
@ -135,6 +135,13 @@ system(@sysargs);
|
||||||
my $rbbasename = basename($rbbname);
|
my $rbbasename = basename($rbbname);
|
||||||
|
|
||||||
#### Mangle RootFS
|
#### Mangle RootFS
|
||||||
|
|
||||||
|
# Save version into rootfs
|
||||||
|
my $version = `cat rockbox-info.txt | grep Version | cut -f2 -d' '`;
|
||||||
|
open FILE, ">$rootfsdir/etc/rockbox-bl-info.txt" || die ("can't write version txt");
|
||||||
|
print FILE $version;
|
||||||
|
close FILE;
|
||||||
|
|
||||||
if ($hiby) {
|
if ($hiby) {
|
||||||
my $bootloader_sh =
|
my $bootloader_sh =
|
||||||
"#!/bin/sh
|
"#!/bin/sh
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue