Changeset 16857


Ignore:
Timestamp:
06/26/12 23:08:15 (12 years ago)
Author:
nit
Message:

[titan] fix system update (log) if no space for log, add funktion to detekt if swap is in flash

Location:
titan/titan
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • titan/titan/global.h

    r16851 r16857  
    11#ifndef GLOBAL_H
    22#define GLOBAL_H
     3
     4//check if swap is in flash(1) or not(0)
     5int checkswaplink()
     6{
     7        int ret = 1;
     8        char* tmpstr = NULL;
     9
     10        tmpstr = realpath("/var/swap", NULL);
     11        if(tmpstr != NULL && ostrcmp(tmpstr, "/mnt/swapextensions") != 0)
     12                ret = 0;
     13
     14        free(tmpstr); tmpstr = NULL;
     15        return ret;
     16}
    317
    418char* delmountpart(char* filename, int free1)
  • titan/titan/mediadbsettings.h

    r16837 r16857  
    1616
    1717        addchoicebox(mediadbpath, "/media/hdd/.mediadb", "/media/hdd/.mediadb");
    18         tmpstr = realpath("/var/swap", NULL);
    19         if(tmpstr != NULL && ostrcmp(tmpstr, "/mnt/swapextensions") != 0)
     18        if(checkswaplink() == 0)
    2019                addchoicebox(mediadbpath, "/var/swap/.mediadb", "/var/swap/.mediadb");
    21         free(tmpstr); tmpstr = NULL;
    2220        setchoiceboxselection(mediadbpath, getconfig("mediadbpath", NULL));
    2321
     
    7775                                mkdir(getconfig("mediadbpath", NULL), 0777);
    7876                       
    79                         free(tmpstr), tmpstr = NULL;
     77                        free(tmpstr); tmpstr = NULL;
    8078                        tmpstr = ostrcat(getconfig("mediadbpath", NULL), "/mediadb", 0, 0);
    8179                        addconfig("mediadbfile", tmpstr);
  • titan/titan/system_update.h

    r16832 r16857  
    187187                                writeallconfig(1);
    188188
    189                                 if(file_exist("/tmp/.swapextensionsdev") && file_exist("/etc/.beta"))
    190                                 {
    191                                         printf("Update: update with log\n");
     189                                if(file_exist("/tmp/.swapextensionsdev") && checkswaplink() == 0 && file_exist("/etc/.beta"))
     190                                {
     191                                        debug(40, "Update: update with log");
    192192                                        if(ostrstr(filelist->select->text, "_KERNEL_") != NULL && file_exist("/etc/.beta"))
    193193                                        {
     
    253253                                else
    254254                                {
    255                                         printf("Update: update without log\n");
     255                                        debug(40, "Update: update without log");
    256256
    257257                                        if(ostrstr(filelist->select->text, "_KERNEL_") != NULL && file_exist("/etc/.beta"))
     
    324324                                        debug(40, "update started cmd: %s", cmd);
    325325                                        system(cmd);
     326                                        //should only reached if system fails
     327                                        textbox(_("Message"), _("Can't start system update\nPlease remove Stick/HDD and try again"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 0, 0);
     328                                        debug(40, "update error cmd: %s", cmd);
     329                                        drawscreen(systemupdate, 0, 0);
     330                                        getfilelist(systemupdate, filelistpath, filelist, filepath, filemask, 1, NULL);
     331                                        addscreenrc(systemupdate, filelist);
     332                                        continue;
    326333                                }
    327334                                else
Note: See TracChangeset for help on using the changeset viewer.