Changeset 3278 in MondoRescue


Ignore:
Timestamp:
Apr 30, 2014, 12:30:11 PM (10 years ago)
Author:
Bruno Cornec
Message:
  • File KEYMAP-LIVES-HERE, USING-* not used anymore
  • Nomalize name usinf iso-dir and ISO-DIR where relevant
  • config entry netfs-server-path not used anymore (iso-dir instead when needed)
  • In network restore mode, also have the extended boot messages
  • Manages grub2 version string as grub 1 was
Location:
branches/3.2
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/MondoRescue/bin/mr-net-get-config

    r3267 r3278  
    172172        print $fd "netfs-server-mount $ARGV[0]\n";
    173173        print $fd "netfs-server-user $account\n";
    174         print $fd "netfs-server-path $path\n";
    175174        print $fd "netfs-server-ipaddr $hostip\n";
    176175        open(ROUTE, "/proc/net/route") || die "Unable to read /proc/net/route: $!";
  • branches/3.2/mindi/mindi

    r3277 r3278  
    3535MINDI_LIB=LLL
    3636MINDI_CACHE=/var/cache/mindi
     37
     38MRCFG=mondorestore.cfg
    3739
    3840# Temporary directory for mindi
     
    400402        LogFile "INFO: Debian-style config detected."
    401403        mkdir -p $bigdir/tmp
    402         echo "/etc/console/boottime.kmap.gz" > $bigdir/tmp/KEYMAP-LIVES-HERE
     404        echo "keymap-lives-here /etc/console/boottime.kmap.gz" >> $bigdir/tmp/$MRCFG
    403405        KBDEPTH=0
    404406        mkdir -p $bigdir/etc/console
     
    415417            kbdfile="/etc/console-setup/cached.kmap.gz"
    416418        fi
    417         echo $kbdfile > $bigdir/tmp/KEYMAP-LIVES-HERE
     419        echo "keymap-lives-here $kbdfile" >> $bigdir/tmp/$MRCFG
    418420        KBDEPTH=0
    419421        mkdir -p $bigdir/etc/console-setup
     
    479481    LogAll "INFO: Adding the following keyboard mapping tables: "
    480482    mkdir -p $bigdir/tmp
    481     echo "$mappath" > $bigdir/tmp/KEYMAP-LIVES-HERE
     483    echo "keymap-lives-here $mappath" >> $bigdir/tmp/$MRCFG
    482484    KBDEPTH=0
    483485    AddKeyboardMappingFile $mappath
     
    652654        if [ -e "$MINDI_TMP/NETFS-SERVER-MOUNT" ] ; then
    653655            LogAll "\nINFO: Incorporating Network-related settings"
    654             for r in NETFS-* ISO-PREFIX ; do
     656            for r in NETFS-* ; do
    655657                cp -f $MINDI_TMP/$r $bigdir/tmp 2>> $LOGFILE || Die "Cannot copy $r - did you run out of disk space?"
    656658                LogFile "INFO: Copying $r to ramdisk"
     
    974976}
    975977
    976 # Called by TurnTgzIntoRdz, to make /tmp/mondorestore.cfg
     978# Called by TurnTgzIntoRdz, to make /tmp/$MRCFG
    977979MakeMondoConfigFile() {
    978980    local outfile use_lzo use_comp use_star
     
    10001002    AddFileToCfgIfExists $MINDI_TMP/ISO-MNT           iso-mnt           $outfile
    10011003    AddFileToCfgIfExists $MINDI_TMP/ISO-PREFIX        iso-prefix        $outfile
    1002     AddFileToCfgIfExists $MINDI_TMP/ISODIR            isodir            $outfile
     1004    AddFileToCfgIfExists $MINDI_TMP/ISO-DIR           iso-dir           $outfile
    10031005    AddFileToCfgIfExists $MINDI_TMP/BOOTLOADER.DEVICE bootloader.device $outfile
    10041006    AddFileToCfgIfExists $MINDI_TMP/BOOTLOADER.NAME   bootloader.name   $outfile
    1005     AddFileToCfgIfExists $MINDI_TMP/BOOTLOADER.VER    bootloader.ver   $outfile
    1006     AddFileToCfgIfExists $MINDI_TMP/KEYMAP-LIVES-HERE keymap-lives-here $outfile
     1007    AddFileToCfgIfExists $MINDI_TMP/BOOTLOADER.VER    bootloader.ver    $outfile
    10071008    AddFileToCfgIfExists $MINDI_TMP/TAPEDEV-HAS-DATA-DISKS tapedev-has-data-disks $outfile
    10081009    AddFileToCfgIfExists $MINDI_TMP/BACKUP-MEDIA-TYPE backup-media-type $outfile
    10091010    AddFileToCfgIfExists $MINDI_TMP/DIFFERENTIAL      differential      $outfile
    1010     AddFileToCfgIfExists $MINDI_TMP/ACL      acl      $outfile
    1011     AddFileToCfgIfExists $MINDI_TMP/XATTR      xattr      $outfile
    1012     AddFileToCfgIfExists $MINDI_TMP/OBDR      obdr      $outfile
     1011    AddFileToCfgIfExists $MINDI_TMP/ACL               acl               $outfile
     1012    AddFileToCfgIfExists $MINDI_TMP/XATTR             xattr             $outfile
     1013    AddFileToCfgIfExists $MINDI_TMP/OBDR              obdr              $outfile
     1014
    10131015    # Deal with network configuration in a portable way
    10141016    if [ -f $MINDI_TMP/NETFS-SERVER-MOUNT ]; then
    10151017        mr-net-get-config `cat $MINDI_TMP/NETFS-SERVER-MOUNT` >> $outfile
    1016         grep netfs-server-path $outfile | awk '{print $2}' > $MINDI_TMP/NETFS-SERVER-PATH
    10171018    fi
    10181019}
     
    17281729        if [ "$CDRECOVERY" != "yes" ] ; then
    17291730            if [ -e "$MINDI_TMP/NETFS-SERVER-MOUNT" ] ; then
    1730                 echo -en "Press <enter> to continue.\n"
     1731                echo -en "Press <enter> for network restore\n"
     1732                echo -en "$BOOT_MEDIA_MESSAGE"
    17311733            elif [ ! "$MINDI_TMP" ] ; then
    17321734                echo -en "FYI, this is _not_ a Mondo Rescue CD.\n"
     
    18931895
    18941896    mkdir -p $mountpoint/tmp
    1895     if [ -f "$MINDI_TMP/mondorestore.cfg" ]; then
    1896         cp -f $MINDI_TMP/mondorestore.cfg $mountpoint/tmp
     1897    if [ -f "$MINDI_TMP/$MRCFG" ]; then
     1898        cp -f $MINDI_TMP/$MRCFG $mountpoint/tmp
    18971899    fi
    18981900
     
    19881990
    19891991    mkdir -p $mountpoint/tmp
    1990     if [ -f "$MINDI_TMP/mondorestore.cfg" ]; then
    1991         cp -f $MINDI_TMP/mondorestore.cfg $mountpoint/tmp
     1992    if [ -f "$MINDI_TMP/$MRCFG" ]; then
     1993        cp -f $MINDI_TMP/$MRCFG $mountpoint/tmp
    19921994    fi
    19931995
     
    20952097    if [ _"$MONDO_SHARE" != _"" ]; then
    20962098        # BCO: no reason to have the cfg file stored twice
    2097         MakeMondoConfigFile $MINDI_TMP/mondorestore.cfg
    2098         cp -f $MINDI_TMP/mondorestore.cfg $bigdir/tmp &> /dev/null
     2099        MakeMondoConfigFile $MINDI_TMP/$MRCFG
     2100        cp -f $MINDI_TMP/$MRCFG $bigdir/tmp &> /dev/null
    20992101    fi
    21002102    [ -d "/mnt/.boot.d" ] && echo "GENTOO" > $bigdir/tmp/DUMBASS-GENTOO
     
    27722774    [ "$TAPEDEV" ] && echo -en "$TAPEDEV" > $mountpoint/tmp/TAPEDEV-LIVES-HERE
    27732775    if [ _"$MONDO_SHARE" != _"" ]; then
    2774         MakeMondoConfigFile $mountpoint/tmp/mondorestore.cfg
    2775         cp -f $mountpoint/tmp/mondorestore.cfg $MINDI_TMP 2>> $LOGFILE || Die "Cannot copy mondorestore.cfg to ramdisk"
     2776        MakeMondoConfigFile $mountpoint/tmp/$MRCFG
     2777        cp -f $mountpoint/tmp/$MRCFG $MINDI_TMP 2>> $LOGFILE || Die "Cannot copy $MRCFG to ramdisk"
    27762778        cp -f $MINDI_TMP/mountlist.txt $mountpoint/tmp/ 2>> $LOGFILE || Die "Cannot copy mountlist to ramdisk"
    27772779        echo -en "$FILES_IN_FILELIST" > $mountpoint/tmp/FILES-IN-FILELIST
    27782780        echo -en "$LAST_FILELIST_NUMBER" > $mountpoint/tmp/LAST-FILELIST-NUMBER
    2779         [ "$USE_LZO" = "yes" ] && echo -en "Pras 4 Pres 2004" >> $mountpoint/tmp/USING-LZO
    2780         [ "$USE_GZIP" = "yes" ] && echo -en "YES" >> $mountpoint/tmp/USING-GZIP
    2781         [ "$USE_COMP" = "yes" ] && echo -en "Compression, yep" >> $mountpoint/tmp/USING-COMP
    2782         [ "$USE_STAR" = "yes" ] && echo -en "Using star. Hooray." >> $mountpoint/tmp/USING-STAR
    27832781    fi
    27842782    mkdir -p $mountpoint/proc
     
    32923290LogFile "NOT_BOOT = '$NOT_BOOT'"
    32933291if [ "$NOT_BOOT" != "" ] && [ "$NOT_BOOT" != "0" ] && [ "$NOT_BOOT" != "no" ] ; then
    3294     LogIt "INFO: Just creating mondorestore.cfg and a small all.tar.gz for Mondo. Nothing else."
    3295     MakeMondoConfigFile $MINDI_TMP/mondorestore.cfg
     3292    LogIt "INFO: Just creating $MRCFG and a small all.tar.gz for Mondo. Nothing else."
     3293    MakeMondoConfigFile $MINDI_TMP/$MRCFG
    32963294    MakeMountlist $MINDI_TMP/mountlist.txt
    32973295    CheckMountlist $MINDI_TMP/mountlist.txt
    32983296    mkdir -p $MINDI_TMP/small-all/tmp
    32993297    cd "$MINDI_TMP/small-all"
    3300     cp -f $MINDI_TMP/{mountlist.txt,mondorestore.cfg,filelist.full.gz,biggielist.txt} tmp 2>> $LOGFILE || Die "Cannot copy small all.tar.gz"
     3298    cp -f $MINDI_TMP/{mountlist.txt,$MRCFG,filelist.full.gz,biggielist.txt} tmp 2>> $LOGFILE || Die "Cannot copy small all.tar.gz"
    33013299    tar -cv ./tmp | gzip -9 > $MINDI_TMP/all.tar.gz 2>> $MINDI_TMP/$$.log || Die "Cannot make small all.tar.gz" $MINDI_TMP/$$.log
    33023300    sleep 2
  • branches/3.2/mindi/rootfs/etc/init.d/rcS

    r3277 r3278  
    102102        opt="-c"
    103103    fi
     104    echo "Launching terminals on other ttys - Use ALT+F[2-6] to use them"
    104105    openvt $opt 2 /bin/sh
    105106    openvt $opt 3 /bin/sh
     
    780781ModprobeAllModules() {
    781782
     783    echo "Searching for modules to install..."
    782784    lismod=`find /lib/modules -name '*\.ko*' -o -name '*\.o*'`
    783785    # loading forced modules first
     
    879881exec 2> >(tee -a ${LOGFILE} >&2)
    880882
    881 echo "Welcome to init (from mindi ${MINDI_VER}-r${MINDI_REV})" | tee -a $LOGFILE
     883echo "Welcome to init (from mindi ${MINDI_VER}-r${MINDI_REV})"
    882884
    883885mkdir /sys 2> /dev/null
  • branches/3.2/mindi/rootfs/usr/sbin/start-netfs

    r3271 r3278  
    2727    export imgname="mondorescue"
    2828fi
    29 export dirimg=`grep netfs-server-path /tmp/mondorestore.cfg 2> /dev/null | cut -d' ' -f2-`
     29export dirimg=`grep iso-dir /tmp/mondorestore.cfg 2> /dev/null | cut -d' ' -f2-`
    3030if [ "$dirimg" = "" ]; then
    3131    export dirimg="/"
  • branches/3.2/mondo/src/common/libmondo-archive.c

    r3208 r3278  
    684684        }
    685685        mr_asprintf(bootldr_ver, "%s", call_program_and_get_last_line_of_output("grub --version"));
     686        if (strcmp(bootldr_ver,"") ==0) {
     687            mf_free(bootldr_ver);
     688            mr_asprintf(bootldr_ver, "%s", call_program_and_get_last_line_of_output("grub2-install --version"));
     689        }
    686690    } else if (bkpinfo->boot_loader == 'E') {
    687691        mr_asprintf(bootldr_str, "ELILO");
  • branches/3.2/mondo/src/common/libmondo-devices.c

    r3271 r3278  
    25012501            strcpy(bkpinfo->isodir, call_program_and_get_last_line_of_output("mount | grep \":\" | cut -d' ' -f3 | head -n1"));
    25022502        } else {
     2503            // Why netfsdir ?
    25032504            sprintf(bkpinfo->isodir, "%s/netfsdir", bkpinfo->tmpdir);
    25042505            mr_asprintf(command, "mkdir -p %s", bkpinfo->isodir);
  • branches/3.2/mondo/src/common/libmondo-files.c

    r3272 r3278  
    10861086 * @param bkpinfo The backup information structure. Fields used:
    10871087 * - @c netfs_mount
    1088  * - @c netfs_remote_dir
    10891088 * - @c tmpdir
    10901089 */
     
    10951094    char *netfs_dev = NULL;
    10961095    char *netfs_client_hwaddr = NULL;
    1097     char *netfs_mount = NULL;
    1098     char *netfs_client_ipaddr = NULL;
    1099     char *netfs_client_netmask = NULL;
    1100     char *netfs_client_broadcast = NULL;
    1101     char *netfs_client_defgw = NULL;
    1102     char *netfs_server_ipaddr = NULL;
    1103     char *tmp = NULL;
    11041096    char *command = NULL;
    1105 
    1106     /*@ pointers ***** */
    1107     char *p;
    1108 
    1109     if (bkpinfo->netfs_mount == NULL) {
    1110         fatal_error("No netfs_mount found !");
    1111     }
    1112 
    1113     log_it("Storing Network configuration");
    11141097
    11151098    /********
  • branches/3.2/mondo/src/common/libmondo-tools.c

    r3268 r3278  
    351351    char *mondo_mkisofs_sz = NULL;
    352352    char *command = NULL;
    353     char *hostname = NULL;
    354353    char *isofs_cmd = NULL;
    355     char *ip_address = NULL;
    356354    int retval = 0;
    357     char *colon;
    358355    char *cdr_exe = NULL;
    359356    char *tmp = NULL;
     
    362359    char *iso_mnt = NULL;
    363360    char *iso_tmp = NULL;
    364     char *iso_path = NULL;
    365     char *cfg_fname = NULL;
     361    char *iso_dir = NULL;
    366362
    367363    assert(bkpinfo != NULL);
     
    532528    if (bkpinfo->backup_media_type == iso) {
    533529
    534 /* Patch by Conor Daly <conor.daly@met.ie>
    535  * 23-june-2004
    536  * Break up isodir into iso_mnt and iso_path
     530/* Break up isodir into iso_mnt and iso_dir
    537531 * These will be used along with iso-dev at restore time
    538532 * to locate the ISOs where ever they're mounted
     
    560554        mr_free(command);
    561555
    562         log_it("isomnt: %s, %d", iso_mnt, strlen(iso_mnt));
     556        log_it("iso_mnt: %s, %d", iso_mnt, strlen(iso_mnt));
    563557        mr_asprintf(iso_tmp, "%s", bkpinfo->isodir);
    564558        if (strlen(iso_tmp) < strlen(iso_mnt)) {
    565             mr_asprintf(iso_path, "%s", "");
     559            mr_asprintf(iso_dir, "%s", "");
    566560        } else {
    567             // If iso_mnt is only / then iso_path is the full dir
     561            // If iso_mnt is only / then iso_dir is the full dir
    568562            // (the formula bellow doesn't work in this case)
    569563            if (strcmp(iso_mnt, "/") == 0) {
    570                 mr_asprintf(iso_path, "%s", iso_tmp);
     564                mr_asprintf(iso_dir, "%s", iso_tmp);
    571565            // else it's a part of iso_tmp
    572566            } else {
    573                 mr_asprintf(iso_path, "%s", iso_tmp + strlen(iso_mnt));
     567                mr_asprintf(iso_dir, "%s", iso_tmp + strlen(iso_mnt));
    574568            }
    575569        }
     
    577571        mr_free(iso_tmp);
    578572
    579         mr_asprintf(tmp, "%s/ISODIR", bkpinfo->tmpdir);
    580         write_one_liner_data_file(tmp, iso_path);
    581         mr_free(tmp);
    582 
    583         log_it("isodir: %s", iso_path);
    584         mr_free(iso_path);
     573        mr_asprintf(tmp, "%s/ISO-DIR", bkpinfo->tmpdir);
     574        write_one_liner_data_file(tmp, iso_dir);
     575        mr_free(tmp);
     576
     577        log_it("iso-dir: %s", iso_dir);
     578        mr_free(iso_dir);
    585579
    586580        mr_asprintf(tmp, "%s/ISO-PREFIX", bkpinfo->tmpdir);
     
    596590        mr_asprintf(tmp, "%s/ISO-PREFIX", bkpinfo->tmpdir);
    597591        write_one_liner_data_file(tmp, bkpinfo->prefix);
     592        mr_free(tmp);
     593
     594        mr_asprintf(tmp, "%s/ISO-MNT", bkpinfo->tmpdir);
     595        write_one_liner_data_file(tmp, bkpinfo->isodir);
     596        mr_free(tmp);
     597
     598        mr_asprintf(tmp, "%s/ISO-DIR", bkpinfo->tmpdir);
     599        write_one_liner_data_file(tmp, bkpinfo->netfs_remote_dir);
    598600        mr_free(tmp);
    599601
  • branches/3.2/mondo/src/common/mondostructures.h

    r3273 r3278  
    455455   * The directory we're backing up to.
    456456   * If backup_media_type is @b iso, then this is that directory.
     457   * If backup_media_type is @b netfs, then this is the directory where the share is mounted.
    457458   * If backup_media_type is anything else, this is ignored.
    458459   */
  • branches/3.2/mondo/src/mondorestore/mondo-rstr-tools.c

    r3271 r3278  
    267267        strcpy(bkpinfo->isodir, "/");
    268268    }
    269     if (does_file_exist("/tmp/NETFS-SERVER-PATH")) {
     269    // TODO: Are we shure it does what it's expected to do here ?
     270    if (does_file_exist("/tmp/NETFS-SERVER-MOUNT")) {
    270271        strcpy(isodir_device, last_line_of_file("/tmp/NETFS-SERVER-MOUNT"));
    271272        strcpy(isodir_format, "netfs");
    272         strcpy(bkpinfo->isodir, last_line_of_file("/tmp/NETFS-SERVER-PATH"));
     273        strcpy(bkpinfo->isodir, last_line_of_file("/tmp/ISO-DIR"));
    273274    }
    274275    if (nuke_me_please) {
     
    276277    }
    277278
    278     if (popup_and_get_string
    279         ("ISO Mode - device", "On what device do the ISO files live?",
    280          isodir_device, MAX_STR_LEN / 4)) {
    281         if (popup_and_get_string
    282             ("ISO Mode - format",
    283              "What is the disk format of the device? (Hit ENTER if you don't know.)",
    284              isodir_format, 16)) {
     279    if (popup_and_get_string("ISO Mode - device", "On what device do the ISO files live?", isodir_device, MAX_STR_LEN / 4)) {
     280        if (popup_and_get_string ("ISO Mode - format", "What is the disk format of the device? (Hit ENTER if you don't know.)", isodir_format, 16)) {
    285281            if (popup_with_buttons("Are you restoring from an external hard drive ?", "Yes", "No")) {
    286282                HDD = TRUE;
    287283            }
    288             if (popup_and_get_string
    289                 ("ISO Mode - path",
    290                 "At what path on this device can the ISO files be found ?",
    291                 bkpinfo->isodir, MAX_STR_LEN / 4)) {
     284            if (popup_and_get_string ("ISO Mode - path", "At what path on this device can the ISO files be found ?", bkpinfo->isodir, MAX_STR_LEN / 4)) {
    292285                strip_spaces(isodir_device);
    293286                strip_spaces(isodir_format);
     
    327320read_cfg_var(g_mondo_cfg_file, "iso-dev", g_isodir_device);
    328321if (bkpinfo->disaster_recovery) {
    329     /* Patch Conor Daly 26-june-2004
    330     * Don't let this clobber an existing bkpinfo->isodir */
     322    /* Don't let this clobber an existing bkpinfo->isodir */
    331323    if (!bkpinfo->isodir[0]) {
    332324        strcpy(bkpinfo->isodir, "/tmp/isodir");
    333325    }
    334     /* End patch */
    335326    mr_asprintf(command, "mkdir -p %s", bkpinfo->isodir);
    336327    run_program_and_log_output(command, 5);
     
    865856        mr_free(bkpinfo->netfs_mount);
    866857        mr_asprintf(bkpinfo->netfs_mount, "%s", value);
    867 
    868         read_cfg_var(cfg_file, "netfs-server-path", value);
     858        if (bkpinfo->netfs_mount != NULL) {
     859            log_msg(2, "netfs_mount is %s", bkpinfo->netfs_mount);
     860        }
     861
     862        read_cfg_var(cfg_file, "iso-dir", value);
    869863        mr_free(bkpinfo->netfs_remote_dir);
    870864        mr_asprintf(bkpinfo->netfs_remote_dir, "%s", value);
    871 
    872         if (bkpinfo->netfs_mount != NULL) {
    873             log_msg(2, "netfs_mount is %s", bkpinfo->netfs_mount);
    874         }
    875865        if (bkpinfo->netfs_remote_dir != NULL) {
    876866            log_msg(2, "netfs_remote_dir is %s", bkpinfo->netfs_remote_dir);
    877867        }
     868
    878869        if (bkpinfo->netfs_proto != NULL) {
    879870            log_msg(2, "netfs_proto is %s", bkpinfo->netfs_proto);
     
    907898    mr_asprintf(old_isodir, "%s", bkpinfo->isodir);
    908899    read_cfg_var(cfg_file, "iso-mnt", iso_mnt);
    909     read_cfg_var(cfg_file, "isodir", iso_path);
     900    read_cfg_var(cfg_file, "iso-dir", iso_path);
    910901    sprintf(bkpinfo->isodir, "%s%s", iso_mnt, iso_path);
    911902    if (!bkpinfo->isodir[0]) {
  • branches/3.2/mondo/src/mondorestore/mondorestore.c

    r3273 r3278  
    702702//    {
    703703    if (system("umount -d /tmp/isodir 2> /dev/null")) {
    704         log_to_screen
    705             ("WARNING - unable to unmount device where the ISO files are stored.");
     704        log_to_screen("WARNING - unable to unmount device where the ISO files are stored.");
    706705    }
    707706//    }
Note: See TracChangeset for help on using the changeset viewer.