mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 16:31:05 +02:00
update: fix commit 19108de408
Origin commit data ------------------ Commit:409381fc5c
Author: vanhofen <vanhofen@gmx.de> Date: 2018-11-30 (Fri, 30 Nov 2018) Origin message was: ------------------ - update: fix commit19108de408
This commit is contained in:
@@ -582,9 +582,9 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
showGlobalStatus(60);
|
showGlobalStatus(60);
|
||||||
|
|
||||||
dprintf(DEBUG_NORMAL, "[update] flash/install filename %s type %c\n", filename.c_str(), fileType);
|
dprintf(DEBUG_NORMAL, "[update] flash/install filename %s type %c\n", filename.c_str(), fileType);
|
||||||
if (gotImage)
|
|
||||||
|
if (gotImage && (fileType <= '9')) // flashing image
|
||||||
{
|
{
|
||||||
//flash it...
|
|
||||||
#if ENABLE_EXTUPDATE
|
#if ENABLE_EXTUPDATE
|
||||||
#ifndef BOXMODEL_CS_HD2
|
#ifndef BOXMODEL_CS_HD2
|
||||||
if (g_settings.apply_settings) {
|
if (g_settings.apply_settings) {
|
||||||
@@ -616,23 +616,8 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
sleep(2);
|
sleep(2);
|
||||||
ft.reboot();
|
ft.reboot();
|
||||||
}
|
}
|
||||||
else if(fileType == 'T') // display file contents
|
|
||||||
{
|
|
||||||
FILE* fd = fopen(filename.c_str(), "r");
|
|
||||||
if(fd) {
|
|
||||||
char * buffer;
|
|
||||||
off_t filesize = lseek(fileno(fd), 0, SEEK_END);
|
|
||||||
lseek(fileno(fd), 0, SEEK_SET);
|
|
||||||
buffer =(char *) malloc((uint32_t)filesize+1);
|
|
||||||
fread(buffer, (uint32_t)filesize, 1, fd);
|
|
||||||
fclose(fd);
|
|
||||||
buffer[filesize] = 0;
|
|
||||||
ShowMsg(LOCALE_MESSAGEBOX_INFO, buffer, CMsgBox::mbrBack, CMsgBox::mbBack);
|
|
||||||
free(buffer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#if HAVE_ARM_HARDWARE
|
#if HAVE_ARM_HARDWARE
|
||||||
else if (fileType == 'Z')
|
else if (gotImage && (fileType == 'Z')) // flashing image with ofgwrite
|
||||||
{
|
{
|
||||||
showGlobalStatus(100);
|
showGlobalStatus(100);
|
||||||
|
|
||||||
@@ -733,6 +718,21 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
return menu_return::RETURN_EXIT_ALL;
|
return menu_return::RETURN_EXIT_ALL;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
else if (fileType == 'T') // not image, display file contents
|
||||||
|
{
|
||||||
|
FILE* fd = fopen(filename.c_str(), "r");
|
||||||
|
if(fd) {
|
||||||
|
char * buffer;
|
||||||
|
off_t filesize = lseek(fileno(fd), 0, SEEK_END);
|
||||||
|
lseek(fileno(fd), 0, SEEK_SET);
|
||||||
|
buffer = (char *) malloc((uint32_t)filesize+1);
|
||||||
|
fread(buffer, (uint32_t)filesize, 1, fd);
|
||||||
|
fclose(fd);
|
||||||
|
buffer[filesize] = 0;
|
||||||
|
ShowMsg(LOCALE_MESSAGEBOX_INFO, buffer, CMsgBox::mbrBack, CMsgBox::mbBack);
|
||||||
|
free(buffer);
|
||||||
|
}
|
||||||
|
}
|
||||||
else // not image, install
|
else // not image, install
|
||||||
{
|
{
|
||||||
const char install_sh[] = TARGET_PREFIX "/bin/install.sh";
|
const char install_sh[] = TARGET_PREFIX "/bin/install.sh";
|
||||||
|
Reference in New Issue
Block a user