mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +02:00
- update: allow to flash zipped archives
Conflicts: src/gui/update.cpp Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
@@ -84,7 +84,8 @@ static const file_ext_s file_ext[] =
|
|||||||
{ "url", CFile::STREAM_AUDIO },
|
{ "url", CFile::STREAM_AUDIO },
|
||||||
{ "vob", CFile::FILE_VOB },
|
{ "vob", CFile::FILE_VOB },
|
||||||
{ "wav", CFile::FILE_WAV },
|
{ "wav", CFile::FILE_WAV },
|
||||||
{ "xml", CFile::FILE_XML }
|
{ "xml", CFile::FILE_XML },
|
||||||
|
{ "zip", CFile::FILE_ZIP_PACKAGE }
|
||||||
};
|
};
|
||||||
|
|
||||||
int mycasecmp(const void * a, const void * b)
|
int mycasecmp(const void * a, const void * b)
|
||||||
|
@@ -78,6 +78,7 @@ class CFile
|
|||||||
FILE_VOB,
|
FILE_VOB,
|
||||||
FILE_WAV,
|
FILE_WAV,
|
||||||
FILE_XML,
|
FILE_XML,
|
||||||
|
FILE_ZIP_PACKAGE,
|
||||||
STREAM_AUDIO,
|
STREAM_AUDIO,
|
||||||
STREAM_PICTURE
|
STREAM_PICTURE
|
||||||
};
|
};
|
||||||
|
@@ -360,9 +360,9 @@ bool CFlashUpdate::selectHttpImage(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE
|
#if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE
|
||||||
if (gotImage && (filename.substr(filename.find_last_of(".") + 1) == "tgz"))
|
if (gotImage && (filename.substr(filename.find_last_of(".") + 1) == "tgz" || filename.substr(filename.find_last_of(".") + 1) == "zip"))
|
||||||
{
|
{
|
||||||
// manipulate fileType for tgz-packages
|
// manipulate fileType for tgz- or zip-packages
|
||||||
fileType = 'Z';
|
fileType = 'Z';
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -441,7 +441,12 @@ bool CFlashUpdate::checkVersion4Update()
|
|||||||
|
|
||||||
CFileFilter UpdatesFilter;
|
CFileFilter UpdatesFilter;
|
||||||
if (allow_flash)
|
if (allow_flash)
|
||||||
|
{
|
||||||
UpdatesFilter.addFilter(FILEBROWSER_UPDATE_FILTER);
|
UpdatesFilter.addFilter(FILEBROWSER_UPDATE_FILTER);
|
||||||
|
#if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE
|
||||||
|
UpdatesFilter.addFilter("zip");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
std::string filters[] = {"bin", "txt", "opk", "ipk"};
|
std::string filters[] = {"bin", "txt", "opk", "ipk"};
|
||||||
for(size_t i=0; i<sizeof(filters)/sizeof(filters[0]) ;i++)
|
for(size_t i=0; i<sizeof(filters)/sizeof(filters[0]) ;i++)
|
||||||
@@ -735,18 +740,18 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
ShowHint(LOCALE_MESSAGEBOX_INFO, LOCALE_FLASHUPDATE_START_OFGWRITE);
|
ShowHint(LOCALE_MESSAGEBOX_INFO, LOCALE_FLASHUPDATE_START_OFGWRITE);
|
||||||
hide();
|
hide();
|
||||||
|
|
||||||
const char ofgwrite_tgz[] = "/bin/ofgwrite_tgz";
|
const char ofgwrite_caller[] = "/usr/bin/ofgwrite_caller";
|
||||||
dprintf(DEBUG_NORMAL, "[update] calling %s %s %s %s\n", ofgwrite_tgz, g_settings.update_dir.c_str(), filename.c_str(), ofgwrite_options.c_str());
|
dprintf(DEBUG_NORMAL, "[update] calling %s %s %s %s\n", ofgwrite_caller, g_settings.update_dir.c_str(), filename.c_str(), ofgwrite_options.c_str());
|
||||||
#ifndef DRYRUN
|
#ifndef DRYRUN
|
||||||
if (flashing)
|
if (flashing)
|
||||||
my_system(4, ofgwrite_tgz, g_settings.update_dir.c_str(), filename.c_str(), ofgwrite_options.c_str());
|
my_system(4, ofgwrite_caller, g_settings.update_dir.c_str(), filename.c_str(), ofgwrite_options.c_str());
|
||||||
|
|
||||||
/*
|
/*
|
||||||
TODO: fix osd-flickering
|
TODO: fix osd-flickering
|
||||||
Neutrino is clearing framebuffer, so ofgwrite's gui is cleared too.
|
Neutrino is clearing framebuffer, so ofgwrite's gui is cleared too.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
dprintf(DEBUG_NORMAL, "[update] %s done\n", ofgwrite_tgz);
|
dprintf(DEBUG_NORMAL, "[update] %s done\n", ofgwrite_caller);
|
||||||
|
|
||||||
if (restart == CMsgBox::mbrYes)
|
if (restart == CMsgBox::mbrYes)
|
||||||
CNeutrinoApp::getInstance()->exec(NULL, "reboot");
|
CNeutrinoApp::getInstance()->exec(NULL, "reboot");
|
||||||
|
Reference in New Issue
Block a user