mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 07:51:19 +02:00
Merge branch 'uncool/dvbsi++' commit 3bbaddec39
Conflicts: src/driver/framebuffer.cpp
This commit is contained in:
@@ -487,9 +487,11 @@ flashupdate.squashfs.noversion Bei Updates werden Versionsüberprüfungen derzei
|
|||||||
flashupdate.titlereadflash Flash auslesen
|
flashupdate.titlereadflash Flash auslesen
|
||||||
flashupdate.titlewriteflash Flash schreiben
|
flashupdate.titlewriteflash Flash schreiben
|
||||||
flashupdate.update_with_settings_del_skipped Ordner [%s] kann nicht gelöscht werden. Eintrag wird übersprungen.
|
flashupdate.update_with_settings_del_skipped Ordner [%s] kann nicht gelöscht werden. Eintrag wird übersprungen.
|
||||||
|
flashupdate.update_with_settings_error Error Flashspeicher!\n \nIm neuen Image sind nur noch %ld KB (von %ld KB) frei,\ndas ist zu wenig, um einen sicheren Betrieb zu gewährleisten.\n \nDer Vorgang wird abgebrochen!
|
||||||
flashupdate.update_with_settings_processed Image wird bearbeitet...
|
flashupdate.update_with_settings_processed Image wird bearbeitet...
|
||||||
flashupdate.update_with_settings_skipped Ordner [%s] kann nicht gesichert werden. Eintrag wird übersprungen.
|
flashupdate.update_with_settings_skipped Ordner [%s] kann nicht gesichert werden. Eintrag wird übersprungen.
|
||||||
flashupdate.update_with_settings_successfully Settingsübernahme erfolgreich.\nDas Image kann jetzt geflasht werden.
|
flashupdate.update_with_settings_successfully Settingsübernahme erfolgreich.\nDas Image kann jetzt geflasht werden.
|
||||||
|
flashupdate.update_with_settings_warning Warnung Flashspeicher!\n \nIm neuen Image sind nur noch %ld KB (von %ld KB) frei,\ndas ist möglicherweise zu wenig, um einen sicheren Betrieb zu gewährleisten.\n \nSoll der Vorgang trotzdem fortgesetzt werden?
|
||||||
flashupdate.updatemode Updatemodus
|
flashupdate.updatemode Updatemodus
|
||||||
flashupdate.updatemode_internet Internet
|
flashupdate.updatemode_internet Internet
|
||||||
flashupdate.updatemode_manual von lokalem Update-Verzeichnis
|
flashupdate.updatemode_manual von lokalem Update-Verzeichnis
|
||||||
|
@@ -487,9 +487,11 @@ flashupdate.squashfs.noversion SquashFS version checks are currently only suppor
|
|||||||
flashupdate.titlereadflash Reading Flash
|
flashupdate.titlereadflash Reading Flash
|
||||||
flashupdate.titlewriteflash Writing Flash
|
flashupdate.titlewriteflash Writing Flash
|
||||||
flashupdate.update_with_settings_del_skipped Folder [%s] can not be deleted. Entry is skipped.
|
flashupdate.update_with_settings_del_skipped Folder [%s] can not be deleted. Entry is skipped.
|
||||||
|
flashupdate.update_with_settings_error Flash Error!\n \nNew Image only has %ld KB (out of %ld KB) left. Not\nenough space to complete this operation.\n \nCanceling operation!
|
||||||
flashupdate.update_with_settings_processed Image is being processed...
|
flashupdate.update_with_settings_processed Image is being processed...
|
||||||
flashupdate.update_with_settings_skipped Folder [%s] can not be saved. Entry is skipped.
|
flashupdate.update_with_settings_skipped Folder [%s] can not be saved. Entry is skipped.
|
||||||
flashupdate.update_with_settings_successfully Setting takeover successfully.\nThe image can now be flashed.
|
flashupdate.update_with_settings_successfully Setting takeover successfully.\nThe image can now be flashed.
|
||||||
|
flashupdate.update_with_settings_warning Flash Warning!\n \nNew Image only has %ld KB (out of %ld KB) left. Probably not\nenough space to complete this operation...\n \nDo you really want to proceed?
|
||||||
flashupdate.updatemode Updatemode
|
flashupdate.updatemode Updatemode
|
||||||
flashupdate.updatemode_internet internet
|
flashupdate.updatemode_internet internet
|
||||||
flashupdate.updatemode_manual from local update directory
|
flashupdate.updatemode_manual from local update directory
|
||||||
|
@@ -21,7 +21,17 @@
|
|||||||
## Die Verzeichnisse "/", "/dev", "/proc", "/sys", "/mnt", "/tmp" k<>nnen nicht gesichert werden!!
|
## Die Verzeichnisse "/", "/dev", "/proc", "/sys", "/mnt", "/tmp" k<>nnen nicht gesichert werden!!
|
||||||
#------------------------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
## vor der Sicherung aus dem neuen Image zu l<>schende Dateien/Verzeichnisse,
|
||||||
|
## gekennzeichnet durch ein vorangestelltes ~
|
||||||
|
# z.B.
|
||||||
|
# ~/share/tuxbox/neutrino/themes/Classic.theme
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
#-------------
|
||||||
## Sicherungen
|
## Sicherungen
|
||||||
|
#-------------
|
||||||
/etc/hostname
|
/etc/hostname
|
||||||
/etc/hosts
|
/etc/hosts
|
||||||
/etc/network
|
/etc/network
|
||||||
@@ -30,6 +40,7 @@
|
|||||||
/var/etc
|
/var/etc
|
||||||
/var/tuxbox/config
|
/var/tuxbox/config
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------------------------------------------------------------
|
#----------------------------------------------------------------------------------------
|
||||||
## von der Sicherung auszuschlie<69>ende Dateien, gekennzeichnet durch ein vorangestelltes -
|
## von der Sicherung auszuschlie<69>ende Dateien, gekennzeichnet durch ein vorangestelltes -
|
||||||
#----------------------------------------------------------------------------------------
|
#----------------------------------------------------------------------------------------
|
||||||
@@ -41,10 +52,3 @@
|
|||||||
-/var/tuxbox/config/satellites.xml
|
-/var/tuxbox/config/satellites.xml
|
||||||
-/var/tuxbox/config/settingsupdate.conf
|
-/var/tuxbox/config/settingsupdate.conf
|
||||||
-/var/tuxbox/config/tobackup.conf
|
-/var/tuxbox/config/tobackup.conf
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
|
||||||
## nach der Sicherung aus dem neuen Image zu l<>schende Dateien/Verzeichnisse,
|
|
||||||
## gekennzeichnet durch ein vorangestelltes ~
|
|
||||||
# z.B.
|
|
||||||
# ~/share/tuxbox/neutrino/themes/Classic.theme
|
|
||||||
#----------------------------------------------------------------------------
|
|
||||||
|
@@ -774,7 +774,9 @@ void CFrameBuffer::paintBoxRel(const int x, const int y, const int dx, const int
|
|||||||
char *c = (char *)&col;
|
char *c = (char *)&col;
|
||||||
dfbdest->SetColor(dfbdest, c[1], c[2], c[3], c[0]);
|
dfbdest->SetColor(dfbdest, c[1], c[2], c[3], c[0]);
|
||||||
#else
|
#else
|
||||||
#ifndef USE_NEVIS_GXA
|
#ifdef USE_NEVIS_GXA
|
||||||
|
OpenThreads::ScopedLock<OpenThreads::Mutex> m_lock(mutex);
|
||||||
|
#else
|
||||||
int swidth = stride / sizeof(fb_pixel_t);
|
int swidth = stride / sizeof(fb_pixel_t);
|
||||||
fb_pixel_t *fbp = getFrameBufferPointer() + (swidth * y);
|
fb_pixel_t *fbp = getFrameBufferPointer() + (swidth * y);
|
||||||
#endif
|
#endif
|
||||||
@@ -922,6 +924,7 @@ void CFrameBuffer::paintVLine(int x, int ya, int yb, const fb_pixel_t col)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
#ifdef USE_NEVIS_GXA
|
#ifdef USE_NEVIS_GXA
|
||||||
|
OpenThreads::ScopedLock<OpenThreads::Mutex> m_lock(mutex);
|
||||||
/* draw a single vertical line from point x/ya to x/yb */
|
/* draw a single vertical line from point x/ya to x/yb */
|
||||||
unsigned int cmd = GXA_CMD_NOT_TEXT | GXA_SRC_BMP_SEL(2) | GXA_DST_BMP_SEL(2) | GXA_PARAM_COUNT(2) | GXA_CMD_NOT_ALPHA;
|
unsigned int cmd = GXA_CMD_NOT_TEXT | GXA_SRC_BMP_SEL(2) | GXA_DST_BMP_SEL(2) | GXA_PARAM_COUNT(2) | GXA_CMD_NOT_ALPHA;
|
||||||
|
|
||||||
@@ -947,6 +950,7 @@ void CFrameBuffer::paintVLineRel(int x, int y, int dy, const fb_pixel_t col)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
#ifdef USE_NEVIS_GXA
|
#ifdef USE_NEVIS_GXA
|
||||||
|
OpenThreads::ScopedLock<OpenThreads::Mutex> m_lock(mutex);
|
||||||
/* draw a single vertical line from point x/y with hight dx */
|
/* draw a single vertical line from point x/y with hight dx */
|
||||||
unsigned int cmd = GXA_CMD_NOT_TEXT | GXA_SRC_BMP_SEL(2) | GXA_DST_BMP_SEL(2) | GXA_PARAM_COUNT(2) | GXA_CMD_NOT_ALPHA;
|
unsigned int cmd = GXA_CMD_NOT_TEXT | GXA_SRC_BMP_SEL(2) | GXA_DST_BMP_SEL(2) | GXA_PARAM_COUNT(2) | GXA_CMD_NOT_ALPHA;
|
||||||
|
|
||||||
@@ -970,6 +974,7 @@ void CFrameBuffer::paintHLine(int xa, int xb, int y, const fb_pixel_t col)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
#ifdef USE_NEVIS_GXA
|
#ifdef USE_NEVIS_GXA
|
||||||
|
OpenThreads::ScopedLock<OpenThreads::Mutex> m_lock(mutex);
|
||||||
/* draw a single horizontal line from point xa/y to xb/y */
|
/* draw a single horizontal line from point xa/y to xb/y */
|
||||||
unsigned int cmd = GXA_CMD_NOT_TEXT | GXA_SRC_BMP_SEL(2) | GXA_DST_BMP_SEL(2) | GXA_PARAM_COUNT(2) | GXA_CMD_NOT_ALPHA;
|
unsigned int cmd = GXA_CMD_NOT_TEXT | GXA_SRC_BMP_SEL(2) | GXA_DST_BMP_SEL(2) | GXA_PARAM_COUNT(2) | GXA_CMD_NOT_ALPHA;
|
||||||
|
|
||||||
@@ -994,6 +999,7 @@ void CFrameBuffer::paintHLineRel(int x, int dx, int y, const fb_pixel_t col)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
#ifdef USE_NEVIS_GXA
|
#ifdef USE_NEVIS_GXA
|
||||||
|
OpenThreads::ScopedLock<OpenThreads::Mutex> m_lock(mutex);
|
||||||
/* draw a single horizontal line from point x/y with width dx */
|
/* draw a single horizontal line from point x/y with width dx */
|
||||||
unsigned int cmd = GXA_CMD_NOT_TEXT | GXA_SRC_BMP_SEL(2) | GXA_DST_BMP_SEL(2) | GXA_PARAM_COUNT(2) | GXA_CMD_NOT_ALPHA;
|
unsigned int cmd = GXA_CMD_NOT_TEXT | GXA_SRC_BMP_SEL(2) | GXA_DST_BMP_SEL(2) | GXA_PARAM_COUNT(2) | GXA_CMD_NOT_ALPHA;
|
||||||
|
|
||||||
@@ -1906,6 +1912,7 @@ void CFrameBuffer::blit2FB(void *fbbuff, uint32_t width, uint32_t height, uint32
|
|||||||
//printf("CFrameBuffer::blit2FB: data %x Kva %x\n", (int) fbbuff, (int) uKva);
|
//printf("CFrameBuffer::blit2FB: data %x Kva %x\n", (int) fbbuff, (int) uKva);
|
||||||
|
|
||||||
if(uKva != NULL) {
|
if(uKva != NULL) {
|
||||||
|
OpenThreads::ScopedLock<OpenThreads::Mutex> m_lock(mutex);
|
||||||
cmd = GXA_CMD_BLT | GXA_CMD_NOT_TEXT | GXA_SRC_BMP_SEL(1) | GXA_DST_BMP_SEL(2) | GXA_PARAM_COUNT(3);
|
cmd = GXA_CMD_BLT | GXA_CMD_NOT_TEXT | GXA_SRC_BMP_SEL(1) | GXA_DST_BMP_SEL(2) | GXA_PARAM_COUNT(3);
|
||||||
|
|
||||||
_write_gxa(gxa_base, GXA_BMP1_TYPE_REG, (3 << 16) | width);
|
_write_gxa(gxa_base, GXA_BMP1_TYPE_REG, (3 << 16) | width);
|
||||||
|
@@ -34,6 +34,8 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
#include <OpenThreads/Mutex>
|
||||||
|
#include <OpenThreads/ScopedLock>
|
||||||
|
|
||||||
#define fb_pixel_t uint32_t
|
#define fb_pixel_t uint32_t
|
||||||
|
|
||||||
@@ -66,6 +68,7 @@ class CFrameBuffer
|
|||||||
private:
|
private:
|
||||||
|
|
||||||
CFrameBuffer();
|
CFrameBuffer();
|
||||||
|
OpenThreads::Mutex mutex;
|
||||||
|
|
||||||
struct rgbData
|
struct rgbData
|
||||||
{
|
{
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
and some other guys
|
and some other guys
|
||||||
Homepage: http://dbox.cyberphoria.org/
|
Homepage: http://dbox.cyberphoria.org/
|
||||||
|
|
||||||
Copyright (C) 2012 M. Liebmann (micha-bbg)
|
Copyright (C) 2012-2013 M. Liebmann (micha-bbg)
|
||||||
|
|
||||||
License: GPL
|
License: GPL
|
||||||
|
|
||||||
@@ -73,6 +73,10 @@ CExtUpdate::CExtUpdate()
|
|||||||
fLogfile = "/tmp/update.log";
|
fLogfile = "/tmp/update.log";
|
||||||
mountPkt = "/tmp/image_mount";
|
mountPkt = "/tmp/image_mount";
|
||||||
FileHelpers = NULL;
|
FileHelpers = NULL;
|
||||||
|
flashErrorFlag = false;
|
||||||
|
total = bsize = used = 0;
|
||||||
|
free1 = free2 = free3 = 0;
|
||||||
|
|
||||||
copyList.clear();
|
copyList.clear();
|
||||||
blackList.clear();
|
blackList.clear();
|
||||||
deleteList.clear();
|
deleteList.clear();
|
||||||
@@ -130,6 +134,7 @@ bool CExtUpdate::ErrorReset(bool modus, const std::string & msg1, const std::str
|
|||||||
|
|
||||||
bool CExtUpdate::applySettings(const std::string & filename, int mode)
|
bool CExtUpdate::applySettings(const std::string & filename, int mode)
|
||||||
{
|
{
|
||||||
|
#define ORGFILE_EXT ".org"
|
||||||
if(!FileHelpers)
|
if(!FileHelpers)
|
||||||
FileHelpers = new CFileHelpers();
|
FileHelpers = new CFileHelpers();
|
||||||
|
|
||||||
@@ -139,11 +144,19 @@ bool CExtUpdate::applySettings(const std::string & filename, int mode)
|
|||||||
imgFilename = FILESYSTEM_ENCODING_TO_UTF8_STRING(filename);
|
imgFilename = FILESYSTEM_ENCODING_TO_UTF8_STRING(filename);
|
||||||
|
|
||||||
DBG_TIMER_START()
|
DBG_TIMER_START()
|
||||||
|
|
||||||
|
// make backup file
|
||||||
|
FileHelpers->copyFile(imgFilename.c_str(), (imgFilename + ORGFILE_EXT).c_str(), 0644);
|
||||||
|
|
||||||
bool ret = applySettings();
|
bool ret = applySettings();
|
||||||
DBG_TIMER_STOP("Image editing")
|
DBG_TIMER_STOP("Image editing")
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
if (mtdRamError != "")
|
if ((mtdRamError != "") && (!flashErrorFlag))
|
||||||
DisplayErrorMessage(mtdRamError.c_str());
|
DisplayErrorMessage(mtdRamError.c_str());
|
||||||
|
|
||||||
|
// error, restore original file
|
||||||
|
unlink(imgFilename.c_str());
|
||||||
|
rename((imgFilename + ORGFILE_EXT).c_str(), imgFilename.c_str());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (mode == MODE_EXPERT) {
|
if (mode == MODE_EXPERT) {
|
||||||
@@ -300,8 +313,14 @@ bool CExtUpdate::applySettings()
|
|||||||
if (res)
|
if (res)
|
||||||
return ErrorReset(RESET_UNLOAD, "mount error");
|
return ErrorReset(RESET_UNLOAD, "mount error");
|
||||||
|
|
||||||
if (!readBackupList(mountPkt))
|
if (get_fs_usage(mountPkt.c_str(), total, used, &bsize))
|
||||||
|
free1 = (total * bsize) / 1024 - (used * bsize) / 1024;
|
||||||
|
|
||||||
|
if (!readBackupList(mountPkt)) {
|
||||||
|
if (flashErrorFlag)
|
||||||
|
return false;
|
||||||
return ErrorReset(0, "error readBackupList");
|
return ErrorReset(0, "error readBackupList");
|
||||||
|
}
|
||||||
|
|
||||||
res = umount(mountPkt.c_str());
|
res = umount(mountPkt.c_str());
|
||||||
if (res)
|
if (res)
|
||||||
@@ -497,6 +516,7 @@ bool CExtUpdate::readBackupList(const std::string & dstPath)
|
|||||||
{
|
{
|
||||||
char buf[PATH_MAX];
|
char buf[PATH_MAX];
|
||||||
static struct stat FileInfo;
|
static struct stat FileInfo;
|
||||||
|
vector<std::string>::iterator it;
|
||||||
|
|
||||||
f1 = fopen(backupList.c_str(), "r");
|
f1 = fopen(backupList.c_str(), "r");
|
||||||
if (f1 == NULL) {
|
if (f1 == NULL) {
|
||||||
@@ -573,8 +593,33 @@ bool CExtUpdate::readBackupList(const std::string & dstPath)
|
|||||||
}
|
}
|
||||||
fclose(f1);
|
fclose(f1);
|
||||||
|
|
||||||
|
// read DeleteList
|
||||||
|
for(it = deleteList.begin(); it != deleteList.end(); ++it) {
|
||||||
|
line = *it;
|
||||||
|
if (lstat(line.c_str(), &FileInfo) != -1) {
|
||||||
|
if ((line.find("*") != std::string::npos) || (line.find("?") != std::string::npos)) {
|
||||||
|
// Wildcards
|
||||||
|
WRITE_UPDATE_LOG("delete file list: %s\n", line.c_str());
|
||||||
|
deleteFileList(line.c_str());
|
||||||
|
}
|
||||||
|
else if (S_ISREG(FileInfo.st_mode)) {
|
||||||
|
// File
|
||||||
|
WRITE_UPDATE_LOG("delete file: %s\n", line.c_str());
|
||||||
|
unlink(line.c_str());
|
||||||
|
}
|
||||||
|
else if (S_ISDIR(FileInfo.st_mode)){
|
||||||
|
// Directory
|
||||||
|
WRITE_UPDATE_LOG("delete directory: %s\n", line.c_str());
|
||||||
|
FileHelpers->removeDir(line.c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sync();
|
||||||
|
|
||||||
|
if (get_fs_usage(mountPkt.c_str(), total, used, &bsize))
|
||||||
|
free2 = (total * bsize) / 1024 - (used * bsize) / 1024;
|
||||||
|
|
||||||
// read copyList
|
// read copyList
|
||||||
vector<std::string>::iterator it;
|
|
||||||
for(it = copyList.begin(); it != copyList.end(); ++it) {
|
for(it = copyList.begin(); it != copyList.end(); ++it) {
|
||||||
line = *it;
|
line = *it;
|
||||||
line = trim(line);
|
line = trim(line);
|
||||||
@@ -619,29 +664,30 @@ bool CExtUpdate::readBackupList(const std::string & dstPath)
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// read DeleteList
|
|
||||||
for(it = deleteList.begin(); it != deleteList.end(); ++it) {
|
|
||||||
line = *it;
|
|
||||||
if (lstat(line.c_str(), &FileInfo) != -1) {
|
|
||||||
if ((line.find("*") != std::string::npos) || (line.find("?") != std::string::npos)) {
|
|
||||||
// Wildcards
|
|
||||||
WRITE_UPDATE_LOG("delete file list: %s\n", line.c_str());
|
|
||||||
deleteFileList(line.c_str());
|
|
||||||
}
|
|
||||||
else if (S_ISREG(FileInfo.st_mode)) {
|
|
||||||
// File
|
|
||||||
WRITE_UPDATE_LOG("delete file: %s\n", line.c_str());
|
|
||||||
unlink(line.c_str());
|
|
||||||
}
|
|
||||||
else if (S_ISDIR(FileInfo.st_mode)){
|
|
||||||
// Directory
|
|
||||||
WRITE_UPDATE_LOG("delete directory: %s\n", line.c_str());
|
|
||||||
FileHelpers->removeDir(line.c_str());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
sync();
|
sync();
|
||||||
|
|
||||||
|
if (get_fs_usage(mountPkt.c_str(), total, used, &bsize)) {
|
||||||
|
long flashWarning = 1000; // 1MB
|
||||||
|
long flashError = 600; // 600KB
|
||||||
|
char buf1[1024];
|
||||||
|
total = (total * bsize) / 1024;
|
||||||
|
free3 = total - (used * bsize) / 1024;
|
||||||
|
printf("##### [%s] %ld KB free org, %ld KB free after delete, %ld KB free now\n", __FUNCTION__, free1, free2, free3);
|
||||||
|
memset(buf1, '\0', sizeof(buf1));
|
||||||
|
if (free3 <= flashError) {
|
||||||
|
snprintf(buf1, sizeof(buf1)-1, g_Locale->getText(LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_ERROR), free3, total);
|
||||||
|
ShowMsgUTF(LOCALE_MESSAGEBOX_ERROR, buf1, CMessageBox::mbrOk, CMessageBox::mbOk, NEUTRINO_ICON_ERROR);
|
||||||
|
flashErrorFlag = true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else if (free3 <= flashWarning) {
|
||||||
|
snprintf(buf1, sizeof(buf1)-1, g_Locale->getText(LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_WARNING), free3, total);
|
||||||
|
if (ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, buf1, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_INFO) != CMessageBox::mbrYes) {
|
||||||
|
flashErrorFlag = true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
and some other guys
|
and some other guys
|
||||||
Homepage: http://dbox.cyberphoria.org/
|
Homepage: http://dbox.cyberphoria.org/
|
||||||
|
|
||||||
Copyright (C) 2012 M. Liebmann (micha-bbg)
|
Copyright (C) 2012-2013 M. Liebmann (micha-bbg)
|
||||||
|
|
||||||
License: GPL
|
License: GPL
|
||||||
|
|
||||||
@@ -56,6 +56,10 @@ class CExtUpdate
|
|||||||
CFileHelpers* FileHelpers;
|
CFileHelpers* FileHelpers;
|
||||||
std::vector<std::string> copyList, blackList, deleteList;
|
std::vector<std::string> copyList, blackList, deleteList;
|
||||||
|
|
||||||
|
bool flashErrorFlag;
|
||||||
|
long total, bsize, used;
|
||||||
|
long free1, free2, free3;
|
||||||
|
|
||||||
bool applySettings(void);
|
bool applySettings(void);
|
||||||
bool readBackupList(const std::string & dstPath);
|
bool readBackupList(const std::string & dstPath);
|
||||||
bool copyFileList(const std::string & fileList, const std::string & dstPath);
|
bool copyFileList(const std::string & fileList, const std::string & dstPath);
|
||||||
|
@@ -1575,7 +1575,7 @@ void CControlAPI::StartPluginCGI(CyhookHandler *hh)
|
|||||||
if (hh->ParamList["name"] != "")
|
if (hh->ParamList["name"] != "")
|
||||||
{
|
{
|
||||||
pluginname = hh->ParamList["name"];
|
pluginname = hh->ParamList["name"];
|
||||||
pluginname=decodeString(pluginname);
|
//pluginname=decodeString(pluginname);
|
||||||
NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::EVT_START_PLUGIN,
|
NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::EVT_START_PLUGIN,
|
||||||
CEventServer::INITID_HTTPD,
|
CEventServer::INITID_HTTPD,
|
||||||
(void *) pluginname.c_str(),
|
(void *) pluginname.c_str(),
|
||||||
|
@@ -214,7 +214,7 @@ std::string decodeString(std::string encodedString) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Encode URLEncoded std::string
|
// HTMLEncode std::string
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
std::string encodeString(std::string decodedString) {
|
std::string encodeString(std::string decodedString) {
|
||||||
unsigned int len = sizeof(char) * decodedString.length() * 5 + 1;
|
unsigned int len = sizeof(char) * decodedString.length() * 5 + 1;
|
||||||
|
@@ -160,6 +160,7 @@ bool CWebserverRequest::ParseParams(std::string param_string) {
|
|||||||
if (!ySplitStringExact(param_string, "&", param, param_string))
|
if (!ySplitStringExact(param_string, "&", param, param_string))
|
||||||
ende = true;
|
ende = true;
|
||||||
if (ySplitStringExact(param, "=", name, value)) {
|
if (ySplitStringExact(param, "=", name, value)) {
|
||||||
|
name = decodeString(name);
|
||||||
value = trim(decodeString(value));
|
value = trim(decodeString(value));
|
||||||
if (ParameterList[name].empty())
|
if (ParameterList[name].empty())
|
||||||
ParameterList[name] = value;
|
ParameterList[name] = value;
|
||||||
@@ -168,11 +169,10 @@ bool CWebserverRequest::ParseParams(std::string param_string) {
|
|||||||
ParameterList[name] += value;
|
ParameterList[name] += value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
name = trim(decodeString(name));
|
||||||
number = string_printf("%d", ParameterList.size() + 1);
|
number = string_printf("%d", ParameterList.size() + 1);
|
||||||
log_level_printf(7, "ParseParams: name: %s value: %s\n", name.c_str(), value.c_str());
|
log_level_printf(7, "ParseParams: name: %s value: %s\n", name.c_str(), value.c_str());
|
||||||
if(value.empty()){
|
|
||||||
name = trim(decodeString(name));
|
|
||||||
}
|
|
||||||
ParameterList[number] = name;
|
ParameterList[number] = name;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -212,19 +212,24 @@ bool CWebserverRequest::ParseHeader(std::string header) {
|
|||||||
// query data is splitted and stored in ParameterList
|
// query data is splitted and stored in ParameterList
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void CWebserverRequest::analyzeURL(std::string url) {
|
void CWebserverRequest::analyzeURL(std::string url) {
|
||||||
|
std::string fullurl = "";
|
||||||
if(!ParameterList.empty())
|
if(!ParameterList.empty())
|
||||||
ParameterList.clear();
|
ParameterList.clear();
|
||||||
|
|
||||||
// URI decode
|
// URI decode
|
||||||
url = trim(url, "\r\n"); // non-HTTP-Standard: allow \r or \n in URL. Delete it.
|
fullurl = decodeString(url);
|
||||||
UrlData["fullurl"] = url;
|
fullurl = trim(fullurl, "\r\n"); // non-HTTP-Standard: allow \r or \n in URL. Delete it.
|
||||||
|
UrlData["fullurl"] = fullurl;
|
||||||
|
|
||||||
// split Params
|
// split Params
|
||||||
if (ySplitString(url, "?", UrlData["url"], UrlData["paramstring"])){ // split pure URL and all Params
|
if (ySplitString(url, "?", UrlData["url"], UrlData["paramstring"])){ // split pure URL and all Params
|
||||||
|
UrlData["url"] = decodeString(UrlData["url"]);
|
||||||
ParseParams( UrlData["paramstring"]); // split params to ParameterList
|
ParseParams( UrlData["paramstring"]); // split params to ParameterList
|
||||||
}else{
|
}else{
|
||||||
// No Params
|
// No Params
|
||||||
url = decodeString(url);
|
UrlData["url"] = fullurl;
|
||||||
UrlData["url"] = url;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ySplitStringLast(UrlData["url"], "/", UrlData["path"],
|
if (!ySplitStringLast(UrlData["url"], "/", UrlData["path"],
|
||||||
UrlData["filename"])) {
|
UrlData["filename"])) {
|
||||||
UrlData["path"] = "/"; // Set "/" if not contained
|
UrlData["path"] = "/"; // Set "/" if not contained
|
||||||
|
@@ -193,7 +193,7 @@ int check_dir(const char * dir)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool get_fs_usage(const char * dir, long &btotal, long &bused)
|
bool get_fs_usage(const char * dir, long &btotal, long &bused, long *bsize/*=NULL*/)
|
||||||
{
|
{
|
||||||
btotal = bused = 0;
|
btotal = bused = 0;
|
||||||
struct statfs s;
|
struct statfs s;
|
||||||
@@ -201,6 +201,8 @@ bool get_fs_usage(const char * dir, long &btotal, long &bused)
|
|||||||
if (::statfs(dir, &s) == 0 && s.f_blocks) {
|
if (::statfs(dir, &s) == 0 && s.f_blocks) {
|
||||||
btotal = s.f_blocks;
|
btotal = s.f_blocks;
|
||||||
bused = s.f_blocks - s.f_bfree;
|
bused = s.f_blocks - s.f_bfree;
|
||||||
|
if (bsize != NULL)
|
||||||
|
*bsize = s.f_bsize;
|
||||||
//printf("fs (%s): total %ld used %ld\n", dir, btotal, bused);
|
//printf("fs (%s): total %ld used %ld\n", dir, btotal, bused);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -31,7 +31,7 @@ int safe_mkdir(char * path);
|
|||||||
bool file_exists(const char *filename);
|
bool file_exists(const char *filename);
|
||||||
void wakeup_hdd(const char *hdd_dir);
|
void wakeup_hdd(const char *hdd_dir);
|
||||||
int check_dir(const char * dir);
|
int check_dir(const char * dir);
|
||||||
bool get_fs_usage(const char * dir, long &total, long &used);
|
bool get_fs_usage(const char * dir, long &total, long &used, long *bsize=NULL);
|
||||||
bool get_mem_usage(unsigned long &total, unsigned long &free);
|
bool get_mem_usage(unsigned long &total, unsigned long &free);
|
||||||
|
|
||||||
std::string trim(std::string &str, const std::string &trimChars = " \n\r\t");
|
std::string trim(std::string &str, const std::string &trimChars = " \n\r\t");
|
||||||
|
@@ -514,9 +514,11 @@ typedef enum
|
|||||||
LOCALE_FLASHUPDATE_TITLEREADFLASH,
|
LOCALE_FLASHUPDATE_TITLEREADFLASH,
|
||||||
LOCALE_FLASHUPDATE_TITLEWRITEFLASH,
|
LOCALE_FLASHUPDATE_TITLEWRITEFLASH,
|
||||||
LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_DEL_SKIPPED,
|
LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_DEL_SKIPPED,
|
||||||
|
LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_ERROR,
|
||||||
LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_PROCESSED,
|
LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_PROCESSED,
|
||||||
LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_SKIPPED,
|
LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_SKIPPED,
|
||||||
LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_SUCCESSFULLY,
|
LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_SUCCESSFULLY,
|
||||||
|
LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_WARNING,
|
||||||
LOCALE_FLASHUPDATE_UPDATEMODE,
|
LOCALE_FLASHUPDATE_UPDATEMODE,
|
||||||
LOCALE_FLASHUPDATE_UPDATEMODE_INTERNET,
|
LOCALE_FLASHUPDATE_UPDATEMODE_INTERNET,
|
||||||
LOCALE_FLASHUPDATE_UPDATEMODE_MANUAL,
|
LOCALE_FLASHUPDATE_UPDATEMODE_MANUAL,
|
||||||
|
@@ -514,9 +514,11 @@ const char * locale_real_names[] =
|
|||||||
"flashupdate.titlereadflash",
|
"flashupdate.titlereadflash",
|
||||||
"flashupdate.titlewriteflash",
|
"flashupdate.titlewriteflash",
|
||||||
"flashupdate.update_with_settings_del_skipped",
|
"flashupdate.update_with_settings_del_skipped",
|
||||||
|
"flashupdate.update_with_settings_error",
|
||||||
"flashupdate.update_with_settings_processed",
|
"flashupdate.update_with_settings_processed",
|
||||||
"flashupdate.update_with_settings_skipped",
|
"flashupdate.update_with_settings_skipped",
|
||||||
"flashupdate.update_with_settings_successfully",
|
"flashupdate.update_with_settings_successfully",
|
||||||
|
"flashupdate.update_with_settings_warning",
|
||||||
"flashupdate.updatemode",
|
"flashupdate.updatemode",
|
||||||
"flashupdate.updatemode_internet",
|
"flashupdate.updatemode_internet",
|
||||||
"flashupdate.updatemode_manual",
|
"flashupdate.updatemode_manual",
|
||||||
|
Reference in New Issue
Block a user