Ignore:
Timestamp:
May 13, 2006, 8:47:23 PM (18 years ago)
Author:
bcornec
Message:

Stable is reverted to r436 (2.0.7) to put it in line with 2.0.8 and start from there over

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/mondo/common/libmondo-archive.c

    r538 r541  
    179179#include "libmondo-devices-EXT.h"
    180180#include "libmondo-tools-EXT.h"
    181 #include "newt-specific-EXT.h"
     181#include "libmondo-gui-EXT.h"
    182182#include "libmondo-fork-EXT.h"
    183183#include "libmondo-files-EXT.h"
     
    186186#include "libmondo-verify-EXT.h"
    187187#include "libmondo-archive.h"
     188#include "lib-common-externs.h"
    188189#include <sys/sem.h>
    189190#include <sys/types.h>
     
    580581 * @ingroup archiveGroup
    581582 */
    582 int backup_data(struct s_bkpinfo *bkpinfo, struct s_mrconf *mrconf)
     583int backup_data(struct s_bkpinfo *bkpinfo)
    583584{
    584585    int retval = 0, res = 0;
     
    643644    sprintf(tmp, "rm -f %s/images/*.iso", bkpinfo->scratchdir);
    644645    run_program_and_log_output(tmp, 1);
    645     retval += make_those_afios_phase(bkpinfo,mrconf);   // backup regular files
     646    retval += make_those_afios_phase(bkpinfo);  // backup regular files
    646647    retval += make_those_slices_phase(bkpinfo); // backup BIG files
    647648    retval += do_that_final_phase(bkpinfo); // clean up
     
    10141015    if (!res) {
    10151016        log_to_screen("Boot+data disks were created OK");
    1016         sprintf(command, "mkdir -p /var/cache/mindi/");
     1017        sprintf(command, "mkdir -p /root/images/mindi/");
    10171018        log_msg(2, command);
    10181019        run_program_and_log_output(command, FALSE);
    10191020        sprintf(command,
    1020                 "cp -f %s/images/mindi.iso /var/cache/mindi/mondorescue.iso",
     1021                "cp -f %s/images/mindi.iso /root/images/mindi/mondorescue.iso",
    10211022                bkpinfo->scratchdir);
    10221023        log_msg(2, command);
     
    12521253 * @ingroup MLarchiveGroup
    12531254 */
    1254 int do_that_final_phase(struct s_bkpinfo *bkpinfo, struct s_mrconf *mrconf)
     1255int do_that_final_phase(struct s_bkpinfo *bkpinfo)
    12551256{
    12561257
     
    12731274        /* write final ISO */
    12741275    {
    1275         res = write_final_iso_if_necessary(bkpinfo, mrconf);
     1276        res = write_final_iso_if_necessary(bkpinfo);
    12761277        retval += res;
    12771278        if (res) {
     
    15631564 * @return The number of errors encountered (0 for success)
    15641565 */
    1565 int make_afioballs_and_images(struct s_bkpinfo *bkpinfo, struct s_mrconf *mrconf)
     1566int make_afioballs_and_images(struct s_bkpinfo *bkpinfo)
    15661567{
    15671568
     
    16191620    log_to_screen("Archiving regular files");
    16201621    log_msg(5, "Go, Shorty. It's your birthday.");
    1621     open_progress_form(_("Backing up filesystem"),
    1622                        _("I am backing up your live filesystem now."),
    1623                        _("Please wait. This may take a couple of hours."),
    1624                        _("Working..."),
     1622    open_progress_form("Backing up filesystem",
     1623                       "I am backing up your live filesystem now.",
     1624                       "Please wait. This may take a couple of hours.",
     1625                       "Working...",
    16251626                       get_last_filelist_number(bkpinfo) + 1);
    16261627
     
    17071708            } else {
    17081709                res =
    1709                     move_files_to_cd(bkpinfo, mrconf, storing_filelist_fname,
     1710                    move_files_to_cd(bkpinfo, storing_filelist_fname,
    17101711                                     curr_xattr_list_fname,
    17111712                                     curr_acl_list_fname,
     
    17851786 * @return The number of errors encountered (0 for success)
    17861787 */
    1787 int make_iso_fs(struct s_bkpinfo *bkpinfo, struct s_mrconf *mrconf, char *destfile)
     1788int make_iso_fs(struct s_bkpinfo *bkpinfo, char *destfile)
    17881789{
    17891790    /*@ int ********************************************** */
     
    18481849    tmp3 = NULL;
    18491850    if (bkpinfo->backup_media_type == iso && bkpinfo->manual_cd_tray) {
    1850         popup_and_OK(_("Please insert new media and press Enter."));
     1851        popup_and_OK("Please insert new media and press Enter.");
    18511852    }
    18521853
     
    20052006#ifdef __IA64__
    20062007                log_msg(1, "IA64 --> elilo");
    2007                 asprintf(&tmp2,"mkisofs -no-emul-boot -b images/mindi-bootroot.%s.img -c boot.cat -o _ISO_ -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ .", mrconf->ia64_boot_size);
    20082008                res = eval_call_to_make_ISO(bkpinfo,
    20092009                                            //-b images/mindi-boot.2880.img
    2010                                             tmp2,
     2010                                            "mkisofs -no-emul-boot -b images/mindi-bootroot."
     2011                                            IA64_BOOT_SIZE
     2012                                            ".img -c boot.cat -o _ISO_ -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ .",
    20112013                                            destfile,
    20122014                                            g_current_media_number,
     
    20162018// FIXME --- change mkisofs string to MONDO_MKISOFS_REGULAR_SYSLINUX/LILO depending on bkpinfo->make_cd_usE_lilo
    20172019// and add ' .' at end
    2018                 paranoid_free(tmp2);
    20192020                log_msg(1, "Non-ia64 --> lilo");
    20202021                res =
     
    21502151 */
    21512152int
    2152 make_slices_and_images(struct s_bkpinfo *bkpinfo, struct s_mrconf *mrconf, char *biggielist_fname)
     2153make_slices_and_images(struct s_bkpinfo *bkpinfo, char *biggielist_fname)
    21532154{
    21542155
     
    22232224        } else {
    22242225// Call ntfsclone (formerly partimagehack) if it's a /dev entry (i.e. a partition to be imaged)
    2225             log_msg(2, "bigfile_fname = '%s'", bigfile_fname);
     2226            log_msg(2, "bigfile_fname = %s", bigfile_fname);
    22262227            use_ntfsprog = FALSE;
    22272228            if (!strncmp(bigfile_fname, "/dev/", 5)
     
    22692270            }
    22702271            res =
    2271                 slice_up_file_etc(bkpinfo, mrconf, bigfile_fname,
     2272                slice_up_file_etc(bkpinfo, bigfile_fname,
    22722273                                  ntfsprog_fifo, biggie_file_number,
    22732274                                  noof_biggie_files, use_ntfsprog);
     
    23212322 * @see make_afioballs_and_images
    23222323 */
    2323 int make_afioballs_and_images_OLD(struct s_bkpinfo *bkpinfo, struct s_mrconf *mrconf)
     2324int make_afioballs_and_images_OLD(struct s_bkpinfo *bkpinfo)
    23242325{
    23252326
     
    23492350    log_to_screen("Archiving regular files");
    23502351
    2351     open_progress_form(_("Backing up filesystem"),
    2352                        _("I am backing up your live filesystem now."),
    2353                        _("Please wait. This may take a couple of hours."),
    2354                        _("Working..."),
     2352    open_progress_form("Backing up filesystem",
     2353                       "I am backing up your live filesystem now.",
     2354                       "Please wait. This may take a couple of hours.",
     2355                       "Working...",
    23552356                       get_last_filelist_number(bkpinfo) + 1);
    23562357
     
    24032404        } else {
    24042405            res =
    2405                 move_files_to_cd(bkpinfo, mrconf, curr_filelist_fname,
     2406                move_files_to_cd(bkpinfo, curr_filelist_fname,
    24062407                                 curr_xattr_list_fname,
    24072408                                 curr_acl_list_fname, curr_afioball_fname,
     
    24482449 * @ingroup MLarchiveGroup
    24492450 */
    2450 int make_those_afios_phase(struct s_bkpinfo *bkpinfo, struct s_mrconf *mrconf)
     2451int make_those_afios_phase(struct s_bkpinfo *bkpinfo)
    24512452{
    24522453    /*@ int ******************************************* */
     
    24652466        log_msg(1,
    24662467                "Using single-threaded make_afioballs_and_images() to suit b0rken FreeBSD 5.0");
    2467         res = make_afioballs_and_images_OLD(bkpinfo, mrconf);
     2468        res = make_afioballs_and_images_OLD(bkpinfo);
    24682469#else
    2469         res = make_afioballs_and_images_OLD(bkpinfo, mrconf);
     2470        res = make_afioballs_and_images_OLD(bkpinfo);
    24702471#endif
    24712472        write_header_block_to_stream(0, "stop-afioballs",
    24722473                                     BLK_STOP_AFIOBALLS);
    24732474    } else {
    2474         res = make_afioballs_and_images(bkpinfo, mrconf);
     2475        res = make_afioballs_and_images(bkpinfo);
    24752476    }
    24762477
     
    25752576 * transfer files over the network) or leave it as is.
    25762577 */
    2577 int (*move_files_to_cd) (struct s_bkpinfo *, struct s_mrconf *mrconf, char *, ...) =
     2578int (*move_files_to_cd) (struct s_bkpinfo *, char *, ...) =
    25782579    _move_files_to_cd;
    25792580
     
    25962597 * @return The number of errors encountered (0 for success)
    25972598 */
    2598 int _move_files_to_cd(struct s_bkpinfo *bkpinfo, struct s_mrconf *mrconf, char *files_to_add, ...)
     2599int _move_files_to_cd(struct s_bkpinfo *bkpinfo, char *files_to_add, ...)
    25992600{
    26002601
     
    26352636    }
    26362637    if (would_occupy / 1024 > bkpinfo->media_size[g_current_media_number]) {
    2637         res = write_iso_and_go_on(bkpinfo, struct s_mrconf *mrconf, FALSE); /* FALSE because this is not the last CD we'll write */
     2638        res = write_iso_and_go_on(bkpinfo, FALSE);  /* FALSE because this is not the last CD we'll write */
    26382639        retval += res;
    26392640        if (res) {
     
    26852686 * @c backup_media_type field is used in this function.
    26862687 * @param imagesdir The directory containing the floppy images (usually
    2687  * /var/cache/mindi).
     2688 * /root/images/mindi).
    26882689 *
    26892690 * @return The number of errors encountered (0 for success)
     
    28642865    if (!bkpinfo->nonbootable_backup) {
    28652866#ifdef __FreeBSD__
    2866         if (!does_file_exist("/var/cache/mindi/mindi-kern.1722.img"))
     2867        if (!does_file_exist("/root/images/mindi/mindi-kern.1722.img"))
    28672868#else
    2868         if (!does_file_exist("/var/cache/mindi/mindi-bootroot.1722.img")
    2869             && !does_file_exist("/var/cache/mindi/mindi-boot.1440.img")
    2870             && !does_file_exist("/var/cache/mindi/mindi-boot.2880.img")
    2871             && !does_file_exist("/var/cache/mindi/mindi-boot.5760.img"))
     2869        if (!does_file_exist("/root/images/mindi/mindi-bootroot.1722.img")
     2870            && !does_file_exist("/root/images/mindi/mindi-boot.1440.img"))
    28722871#endif
    28732872        {
    28742873            mvaddstr_and_log_it(g_currentY++, 74, "No Imgs");
    2875             if (does_file_exist("/var/cache/mindi/mondorescue.iso")) {
     2874            if (does_file_exist("/root/images/mindi/mondorescue.iso")) {
    28762875                popup_and_OK
    2877                     ("Boot+data floppy creation failed. However, FYI, you may burn /var/cache/mindi/mondorescue.iso to a CD and boot from that instead if you wish.");
     2876                    ("Boot+data floppy creation failed. However, FYI, you may burn /root/images/mindi/mondorescue.iso to a CD and boot from that instead if you wish.");
    28782877                res++;
    28792878            }
    28802879        } else {
    2881             offer_to_write_floppies(bkpinfo, "/var/cache/mindi");
     2880            offer_to_write_floppies(bkpinfo, "/root/images/mindi");
    28822881            mvaddstr_and_log_it(g_currentY++, 74, "Done.");
    28832882        }
     
    32793278 */
    32803279int
    3281 slice_up_file_etc(struct s_bkpinfo *bkpinfo, struct s_mrconf *mrconf, char *biggie_filename,
     3280slice_up_file_etc(struct s_bkpinfo *bkpinfo, char *biggie_filename,
    32823281                  char *ntfsprog_fifo, long biggie_file_number,
    32833282                  long noof_biggie_files, bool use_ntfsprog)
     
    34093408    } else {
    34103409        res =
    3411             move_files_to_cd(bkpinfo, mrconf,
     3410            move_files_to_cd(bkpinfo,
    34123411                             slice_fname(biggie_file_number, 0,
    34133412                                         bkpinfo->tmpdir, ""), NULL);
     
    35113510            res = move_files_to_stream(bkpinfo, file_to_archive, NULL);
    35123511        } else {
    3513             res = move_files_to_cd(bkpinfo, mrconf, file_to_archive, NULL);
     3512            res = move_files_to_cd(bkpinfo, file_to_archive, NULL);
    35143513        }
    35153514        retval += res;
     
    36033602 * however, this occurs rarely.
    36043603 */
    3605 int write_final_iso_if_necessary(struct s_bkpinfo *bkpinfo, struct s_mrconf *mrconf)
     3604int write_final_iso_if_necessary(struct s_bkpinfo *bkpinfo)
    36063605{
    36073606    /*@ int ***************************************************** */
     
    36243623    }
    36253624#endif
    3626     res = write_iso_and_go_on(bkpinfo, struct s_mrconf *mrconf, TRUE);
     3625    res = write_iso_and_go_on(bkpinfo, TRUE);
    36273626#ifndef _XWIN
    36283627    if (!g_text_mode) {
     
    36533652 * @see make_iso_fs
    36543653 */
    3655 int write_iso_and_go_on(struct s_bkpinfo *bkpinfo, struct s_mrconf *mrconf, bool last_cd)
     3654int write_iso_and_go_on(struct s_bkpinfo *bkpinfo, bool last_cd)
    36563655{
    36573656    /*@ pointers **************************************************** */
     
    37293728            g_current_media_number);
    37303729    for (that_one_was_ok = FALSE; !that_one_was_ok;) {
    3731         res = make_iso_fs(bkpinfo, mrconf, isofile);
     3730        res = make_iso_fs(bkpinfo, isofile);
    37323731        if (g_current_media_number == 1 && !res
    37333732            && (bkpinfo->backup_media_type == cdr
     
    40314030setenv("MONDO_SHARE", MONDO_SHARE, 1);
    40324031}
    4033 
    4034 void mrarchive_init_conf(struct s_mrconf *mrconf) {
    4035     char *command = NULL;
    4036     FILE *conffd = NULL;
    4037     FILE *fin = NULL;
    4038     int n = 0;
    4039     char *param = NULL;
    4040 
    4041     mrconf = (struct s_mrconf *)malloc(sizeof(struct s_mrconf));
    4042     if (mrconf == NULL) {
    4043             fatal_error("Unable to malloc mrconf");
    4044     }
    4045     /* Default for everything int : 0 char * : NULL */
    4046 
    4047     /* mindi conf parameters also needed in mondo */
    4048     mrconf->ia64_boot_size = 0;
    4049 
    4050     asprintf(&command, "mindi -printvar IA64_BOOT_SIZE");
    4051     fin = popen(command, "r");
    4052     getline(&param, &n, fin);
    4053     pclose(fin);
    4054     paranoid_free(command);
    4055     mrconf->ia64_boot_size = atoi(param);
    4056     paranoid_free(param);
    4057 
    4058     mrconf->iso_creation_cmd = NULL;
    4059 
    4060     /* Finds mondo conf file */
    4061     mrconf_open(MONDO_CONF_DIR"/mondo.conf");
    4062 
    4063     /* mondo conf parameters needed */
    4064     mrconf->iso_creation_cmd = mrconf_sread(iso_creation_cmd);
    4065 
    4066     mrconf_close();
Note: See TracChangeset for help on using the changeset viewer.