mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 23:42:58 +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:
@@ -360,9 +360,9 @@ bool CFlashUpdate::selectHttpImage(void)
|
||||
#endif
|
||||
|
||||
#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';
|
||||
}
|
||||
#endif
|
||||
@@ -441,7 +441,12 @@ bool CFlashUpdate::checkVersion4Update()
|
||||
|
||||
CFileFilter UpdatesFilter;
|
||||
if (allow_flash)
|
||||
{
|
||||
UpdatesFilter.addFilter(FILEBROWSER_UPDATE_FILTER);
|
||||
#if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE
|
||||
UpdatesFilter.addFilter("zip");
|
||||
#endif
|
||||
}
|
||||
|
||||
std::string filters[] = {"bin", "txt", "opk", "ipk"};
|
||||
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);
|
||||
hide();
|
||||
|
||||
const char ofgwrite_tgz[] = "/bin/ofgwrite_tgz";
|
||||
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());
|
||||
const char ofgwrite_caller[] = "/usr/bin/ofgwrite_caller";
|
||||
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
|
||||
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
|
||||
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)
|
||||
CNeutrinoApp::getInstance()->exec(NULL, "reboot");
|
||||
|
Reference in New Issue
Block a user