Changeset 1158


Ignore:
Timestamp:
Feb 14, 2007, 2:32:50 AM (12 years ago)
Author:
bruno
Message:

WARNING: Interface change for mondo-restore.cfg: the delimiter between the variable name and its value is now a = (was a ' ')
This change will allow the introduction of the new mr_conf functions

Location:
branches/stable
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mindi/mindi

    r1143 r1158  
    517517        echo -en "Adding the following keyboard mapping tables: "
    518518        mkdir -p $bigdir/tmp
    519         echo "keymap-lives-here /etc/console/boottime.kmap.gz" > $MINDI_TMP/mondo-restore.cfg
     519        echo "keymap-lives-here=/etc/console/boottime.kmap.gz" >> $MINDI_TMP/mondo-restore.cfg
    520520        KBDEPTH=0
    521521        mkdir -p $bigdir/etc/console
     
    568568    echo -en "Adding the following keyboard mapping tables: "
    569569    mkdir -p $bigdir/tmp
    570     echo "keymap-lives-here $mappath" > $MINDI_TMP/mondo-restore.cfg
     570    echo "keymap-lives-here=$mappath" >> $MINDI_TMP/mondo-restore.cfg
    571571    KBDEPTH=0
    572572    AddKeyboardMappingFile $mappath
     
    22442244    # master boot record, too
    22452245    if [ _"$MONDORESTORECFG" != _"" ]; then
    2246         i=`grep bootloader.device $MONDORESTORECFG | cut -d' ' -f2 2> /dev/null`
     2246        i=`grep bootloader.device $MONDORESTORECFG | cut -d'=' -f2 2> /dev/null`
    22472247        if [ "$i" ] ; then
    22482248            LogIt "Backing up $i's MBR"
     
    31283128        echo "-----------------------------------" >> $LOGFILE
    31293129
    3130         CDRECOVERY=`grep use-cdrecovery $MONDORESTORECFG | cut -d' ' -f2`
    3131         NOT_BOOT=`grep non-bootable $MONDORESTORECFG | cut -d' ' -f2`
    3132         USE_LILO=`grep use-lilo $MONDORESTORECFG | cut -d' ' -f2`
    3133         EXCLUDE_DEVS=`grep excluded-devs $MONDORESTORECFG | cut -d' ' -f2`
    3134         NFS_DEV=`grep nfs-dev $MONDORESTORECFG | cut -d' ' -f2`
    3135         VALUE=`grep image-devs $MONDORESTORECFG | cut -d' ' -f2`
     3130        CDRECOVERY=`grep use-cdrecovery $MONDORESTORECFG | cut -d'=' -f2`
     3131        NOT_BOOT=`grep non-bootable $MONDORESTORECFG | cut -d'=' -f2`
     3132        USE_LILO=`grep use-lilo $MONDORESTORECFG | cut -d'=' -f2`
     3133        EXCLUDE_DEVS=`grep excluded-devs $MONDORESTORECFG | cut -d'=' -f2`
     3134        NFS_DEV=`grep nfs-dev $MONDORESTORECFG | cut -d'=' -f2`
     3135        VALUE=`grep image-devs $MONDORESTORECFG | cut -d'=' -f2`
    31363136        if [ "$VALUE" = "(null)" ] || [ "$VALUE" = "" ] ; then
    31373137            IMAGE_DEVS=""
  • branches/stable/mindi/rootfs/sbin/find-and-mount-cdrom

    r1087 r1158  
    77    for device in /dev/hd? /dev/scd? /dev/rcd? /dev/sr? /dev/cd? /dev/ide/*/*/*/*/cd /dev/scsi/*/*/*/*/cd; do
    88        [ ! "$SECOND_TRY" ] && LogIt "Trying $device"
    9         if [ "`grep "using-cdstream yes" /tmp/mondo-restore.cfg`" ]; then
     9        if [ "`grep "using-cdstream=yes" /tmp/mondo-restore.cfg`" ]; then
    1010            pwd=`pwd`
    1111            cd $GROOVY
     
    7777#mount /dev/fd0u1722 -t ext2 /mnt/floppy
    7878[ "$1" = "--second-try" ] && exit 1; # don't try to mount floppy drive
    79 if [ "`grep "using-cdstream yes" /tmp/mondo-restore.cfg`" ] ; then
     79if [ "`grep "using-cdstream=yes" /tmp/mondo-restore.cfg`" ] ; then
    8080    LogIt "Because you are using cdstream, I won't try to mount CD."
    8181    exit 0
  • branches/stable/mindi/rootfs/sbin/hack-cfg-if-necessary

    r275 r1158  
    1616LogIt "OK, we've found /mnt/cdrom/archives/*; great."
    1717
    18 if ! grep "backup-media-type iso" /tmp/mondo-restore.cfg ; then
     18if ! grep "backup-media-type=iso" /tmp/mondo-restore.cfg ; then
    1919    LogIt "Config file is fine, BTW."
    2020    exit 0
     
    2323LogIt "Re-jigging mondo-restore.cfg because you backed up to ISOs and then burned them to CDs" 1
    2424mv -f /tmp/mondo-restore.cfg /tmp/mrco
    25 sed 's/backup-media-type iso/backup-media-type cdr/' /tmp/mrco > /tmp/mondo-restore.cfg
     25sed 's/backup-media-type=iso/backup-media-type=cdr/' /tmp/mrco > /tmp/mondo-restore.cfg
    2626LogIt "Done re-jigging. Yay."
    2727exit 0
  • branches/stable/mindi/rootfs/sbin/init

    r1087 r1158  
    8383LoadKeymap() {
    8484    local fname
    85     fname=`grep keymap-lives-here /tmp/mondo-restore.cfg | cut -d' ' -f2 2> /dev/null`
     85    fname=`grep keymap-lives-here /tmp/mondo-restore.cfg | cut -d'=' -f2 2> /dev/null`
    8686    [ "$fname" = "" ] && return
    8787    if which loadkeys > /dev/null 2> /dev/null ; then
     
    101101    cd $GROOVY
    102102    [ "$1" != "" ] && tapedev=$1
    103     [ ! "$tapedev" ] && tapedev=`grep media-dev /tmp/mondo-restore.cfg | tr -s ' ' ' ' | cut -d' ' -f2`
     103    [ ! "$tapedev" ] && tapedev=`grep media-dev /tmp/mondo-restore.cfg | tr -s ' ' ' ' | cut -d'=' -f2`
    104104#    tar -zxf $tapedev
    105105    dd if=$tapedev bs=32k count=1024 | tar -zx
     
    107107    if [ "$res" -eq "0" ] ; then
    108108    grep -v media-dev /tmp/mondo-restore.cfg > /tmp/mr.cfg
    109     echo "media-dev $tapedev" >> /tmp/mr.cfg
     109    echo "media-dev=$tapedev" >> /tmp/mr.cfg
    110110        cp -f /tmp/mr.cfg /tmp/mondo-restore.cfg
    111111    fi
  • branches/stable/mindi/rootfs/sbin/start-nfs

    r802 r1158  
    1111
    1212# Get info from config file
    13 ipdev=`grep nfs-dev /tmp/mondo-restore.cfg | cut -d' ' -f2-`
    14 ipaddress=`grep nfs-client-ipaddr /tmp/mondo-restore.cfg | cut -d' ' -f2-`
    15 ipnetmask=`grep nfs-client-netmask /tmp/mondo-restore.cfg | cut -d' ' -f2-`
    16 ipbroadcast=`grep nfs-client-broadcast /tmp/mondo-restore.cfg | cut -d' ' -f2-`
    17 ipgateway=`grep nfs-client-defgw /tmp/mondo-restore.cfg | cut -d' ' -f2-`
     13ipdev=`grep nfs-dev /tmp/mondo-restore.cfg | cut -d'=' -f2-`
     14ipaddress=`grep nfs-client-ipaddr /tmp/mondo-restore.cfg | cut -d'=' -f2-`
     15ipnetmask=`grep nfs-client-netmask /tmp/mondo-restore.cfg | cut -d'=' -f2-`
     16ipbroadcast=`grep nfs-client-broadcast /tmp/mondo-restore.cfg | cut -d'=' -f2-`
     17ipgateway=`grep nfs-client-defgw /tmp/mondo-restore.cfg | cut -d'=' -f2-`
    1818ipconf=""
    19 export nfsmount=`grep nfs-server-mount /tmp/mondo-restore.cfg | cut -d' ' -f2-`
    20 export imgname=`grep iso-prefix /tmp/mondo-restore.cfg | cut -d' ' -f2-`
     19export nfsmount=`grep nfs-server-mount /tmp/mondo-restore.cfg | cut -d'=' -f2-`
     20export imgname=`grep iso-prefix /tmp/mondo-restore.cfg | cut -d'=' -f2-`
    2121if [ "$imgname" = "" ]; then
    2222    export imgname="mondorescue"
    2323fi
    24 export dirimg=`grep nfs-server-path /tmp/mondo-restore.cfg | cut -d' ' -f2-`
     24export dirimg=`grep nfs-server-path /tmp/mondo-restore.cfg | cut -d'=' -f2-`
    2525if [ "$dirimg" = "" ]; then
    2626    export dirimg="/"
  • branches/stable/mondo/src/common/libmondo-archive.c

    r1155 r1158  
    794794    mr_fprintf(fd, "mindi_use_own_kernel=yes\n");
    795795
    796     mr_fprintf(fd1, "files-in-filelist %ld\n", lines_in_filelist);
    797     mr_fprintf(fd1, "internal-tape-block-size %ld\n", bkpinfo->internal_tape_block_size);
    798     mr_fprintf(fd1, "total-slices %ld\n", estimated_total_noof_slices);
    799     mr_fprintf(fd1, "excluded-devs %s\n", devs_to_exclude);
    800     mr_fprintf(fd1, "image-devs %s\n", bkpinfo->image_devs);
    801     mr_fprintf(fd1, "last-filelist-number %s\n", last_filelist_number);
    802     mr_fprintf(fd1, "bootloader.name %s\n", bootldr_str);
    803     mr_fprintf(fd1, "bootloader.device %s\n", bkpinfo->boot_device);
     796    mr_fprintf(fd1, "files-in-filelist=%ld\n", lines_in_filelist);
     797    mr_fprintf(fd1, "internal-tape-block-size=%ld\n", bkpinfo->internal_tape_block_size);
     798    mr_fprintf(fd1, "total-slices=%ld\n", estimated_total_noof_slices);
     799    mr_fprintf(fd1, "excluded-devs=%s\n", devs_to_exclude);
     800    mr_fprintf(fd1, "image-devs=%s\n", bkpinfo->image_devs);
     801    mr_fprintf(fd1, "last-filelist-number=%s\n", last_filelist_number);
     802    mr_fprintf(fd1, "bootloader.name=%s\n", bootldr_str);
     803    mr_fprintf(fd1, "bootloader.device=%s\n", bkpinfo->boot_device);
    804804
    805805    switch (bkpinfo->backup_media_type) {
    806806    case cdr:
    807         mr_fprintf(fd1, "backup-media-type cdr\n");
     807        mr_fprintf(fd1, "backup-media-type=cdr\n");
    808808        break;
    809809    case cdrw:
    810         mr_fprintf(fd1, "backup-media-type cdrw\n");
     810        mr_fprintf(fd1, "backup-media-type=cdrw\n");
    811811        break;
    812812    case cdstream:
    813         mr_fprintf(fd1, "backup-media-type cdstream\n");
     813        mr_fprintf(fd1, "backup-media-type=cdstream\n");
    814814        break;
    815815    case tape:
    816         mr_fprintf(fd1, "backup-media-type tape\n");
     816        mr_fprintf(fd1, "backup-media-type=tape\n");
    817817        break;
    818818    case udev:
    819         mr_fprintf(fd1, "backup-media-type udev\n");
     819        mr_fprintf(fd1, "backup-media-type=udev\n");
    820820        break;
    821821    case iso:
    822         mr_fprintf(fd1, "backup-media-type iso\n");
     822        mr_fprintf(fd1, "backup-media-type=iso\n");
    823823        break;
    824824    case nfs:
    825         mr_fprintf(fd1, "backup-media-type nfs\n");
     825        mr_fprintf(fd1, "backup-media-type=nfs\n");
    826826        break;
    827827    case dvd:
    828         mr_fprintf(fd1, "backup-media-type dvd\n");
     828        mr_fprintf(fd1, "backup-media-type=dvd\n");
    829829        break;
    830830    case usb:
    831         mr_fprintf(fd1, "backup-media-type usb\n");
     831        mr_fprintf(fd1, "backup-media-type=usb\n");
    832832        break;
    833833    default:
     
    842842        mr_fprintf(fd, "mindi_write_tape=yes\n");
    843843        mr_fprintf(fd, "mindi_tape_device=%s\n", bkpinfo->media_device);
    844         mr_fprintf(fd1, "media-dev %s\n", bkpinfo->media_device);
    845         mr_fprintf(fd1, "media-size %ld\n", bkpinfo->media_size[1]);
     844        mr_fprintf(fd1, "media-dev=%s\n", bkpinfo->media_device);
     845        mr_fprintf(fd1, "media-size=%ld\n", bkpinfo->media_size[1]);
    846846    }
    847847    if (bkpinfo->compression_level > 0) {
    848         mr_fprintf(fd1, "use-comp yes\n");
    849     } else {
    850         mr_fprintf(fd1, "use-comp no\n");
     848        mr_fprintf(fd1, "use-comp=yes\n");
     849    } else {
     850        mr_fprintf(fd1, "use-comp=no\n");
    851851    }
    852852    if (bkpinfo->use_gzip) {
    853         mr_fprintf(fd1, "use-gzip yes\n");
    854     } else {
    855         mr_fprintf(fd1, "use-gzip no\n");
     853        mr_fprintf(fd1, "use-gzip=yes\n");
     854    } else {
     855        mr_fprintf(fd1, "use-gzip=no\n");
    856856    }
    857857    if (bkpinfo->use_lzo) {
    858         mr_fprintf(fd1, "use-lzo yes\n");
    859     } else {
    860         mr_fprintf(fd1, "use-lzo no\n");
     858        mr_fprintf(fd1, "use-lzo=yes\n");
     859    } else {
     860        mr_fprintf(fd1, "use-lzo=no\n");
    861861    }
    862862    if (bkpinfo->use_star) {
    863         mr_fprintf(fd1, "use-star yes\n");
    864     } else {
    865         mr_fprintf(fd1, "use-star no\n");
     863        mr_fprintf(fd1, "use-star=yes\n");
     864    } else {
     865        mr_fprintf(fd1, "use-star=no\n");
    866866    }
    867867    if (g_getfattr) {
    868         mr_fprintf(fd1, "xattr yes\n");
    869     } else {
    870         mr_fprintf(fd1, "xattr no\n");
     868        mr_fprintf(fd1, "xattr=yes\n");
     869    } else {
     870        mr_fprintf(fd1, "xattr=no\n");
    871871    }
    872872    if (g_getfacl) {
    873         mr_fprintf(fd1, "acl yes\n");
    874     } else {
    875         mr_fprintf(fd1, "acl no\n");
     873        mr_fprintf(fd1, "acl=yes\n");
     874    } else {
     875        mr_fprintf(fd1, "acl=no\n");
    876876    }
    877877
    878878    if (g_cd_recovery) {
    879         mr_fprintf(fd1, "use-cdrecovery yes\n");
    880     } else {
    881         mr_fprintf(fd1, "use-cdrecovery no\n");
     879        mr_fprintf(fd1, "use-cdrecovery=yes\n");
     880    } else {
     881        mr_fprintf(fd1, "use-cdrecovery=no\n");
    882882    }
    883883
    884884    if (bkpinfo->make_cd_use_lilo) {
    885         mr_fprintf(fd1, "use-lilo yes\n");
    886     } else {
    887         mr_fprintf(fd1, "use-lilo no\n");
     885        mr_fprintf(fd1, "use-lilo=yes\n");
     886    } else {
     887        mr_fprintf(fd1, "use-lilo=no\n");
    888888    }
    889889    if (bkpinfo->nonbootable_backup) {
    890         mr_fprintf(fd1, "non-bootable yes\n");
    891     } else {
    892         mr_fprintf(fd1, "non-bootable no\n");
     890        mr_fprintf(fd1, "non-bootable=yes\n");
     891    } else {
     892        mr_fprintf(fd1, "non-bootable=no\n");
    893893    }
    894894    if (bkpinfo->differential) {
    895         mr_fprintf(fd1, "differential 1\n");
    896     } else {
    897         mr_fprintf(fd1, "differential 0\n");
     895        mr_fprintf(fd1, "differential=1\n");
     896    } else {
     897        mr_fprintf(fd1, "differential=0\n");
    898898    }
    899899
    900900    mr_fclose(fd);
    901     mr_fprintf(fd1, "datestamp %s\n", mr_date());
     901    mr_fprintf(fd1, "datestamp=%s\n", mr_date());
    902902    mr_fclose(fd1);
    903903
     
    39173917
    39183918    if ((p = getenv("PATH")) == NULL) {
    3919         mr_asprintf(&p,path_min);
    3920     }
    3921     mr_asprintf(&tmp, "%s:%s",p, path_min);
    3922     mr_free(p);
     3919        mr_asprintf(&tmp, path_min);
     3920    } else {
     3921        mr_asprintf(&tmp, "%s:%s",p, path_min);
     3922    }
    39233923    mr_setenv("PATH",tmp);
    39243924    mr_free(tmp);
  • branches/stable/mondo/src/common/libmondo-files.c

    r1153 r1158  
    11641164
    11651165    fd1 = mr_fopen(MONDORESTORECFG, "a");
    1166     mr_fprintf(fd1, "nfs-dev %s\n", nfs_dev);
    1167     mr_fprintf(fd1, "nfs-client-ipaddr %s\n", nfs_client_ipaddr);
    1168     mr_fprintf(fd1, "nfs-client-netmask %s\n", nfs_client_netmask);
    1169     mr_fprintf(fd1, "nfs-client-broadcast %s\n", nfs_client_broadcast);
    1170     mr_fprintf(fd1, "nfs-client-defgw %s\n", nfs_client_defgw);
    1171     mr_fprintf(fd1, "nfs-server-ipaddr %s\n", nfs_server_ipaddr);
    1172     mr_fprintf(fd1, "nfs-server-mount %s\n", bkpinfo->nfs_mount);
    1173     mr_fprintf(fd1, "nfs-server-path %s\n", bkpinfo->nfs_remote_dir);
    1174     mr_fprintf(fd1, "iso-prefix %s\n", bkpinfo->prefix);
     1166    mr_fprintf(fd1, "nfs-dev=%s\n", nfs_dev);
     1167    mr_fprintf(fd1, "nfs-client-ipaddr=%s\n", nfs_client_ipaddr);
     1168    mr_fprintf(fd1, "nfs-client-netmask=%s\n", nfs_client_netmask);
     1169    mr_fprintf(fd1, "nfs-client-broadcast=%s\n", nfs_client_broadcast);
     1170    mr_fprintf(fd1, "nfs-client-defgw=%s\n", nfs_client_defgw);
     1171    mr_fprintf(fd1, "nfs-server-ipaddr=%s\n", nfs_server_ipaddr);
     1172    mr_fprintf(fd1, "nfs-server-mount=%s\n", bkpinfo->nfs_mount);
     1173    mr_fprintf(fd1, "nfs-server-path=%s\n", bkpinfo->nfs_remote_dir);
     1174    mr_fprintf(fd1, "iso-prefix=%s\n", bkpinfo->prefix);
    11751175    mr_fclose(fd1);
    11761176
  • branches/stable/mondo/src/common/libmondo-tools.c

    r1155 r1158  
    605605
    606606        fd1 = mr_fopen(MONDORESTORECFG, "a");
    607         mr_fprintf(fd1, "iso-dev %s\n", iso_dev);
     607        mr_fprintf(fd1, "iso-dev=%s\n", iso_dev);
    608608
    609609        sprintf(command, "mount | grep -w %s | tail -n1 | cut -d' ' -f3",
     
    614614
    615615        log_it("res of it = %s", iso_mnt);
    616         mr_fprintf(fd1, "iso-mnt %s\n", iso_mnt);
     616        mr_fprintf(fd1, "iso-mnt=%s\n", iso_mnt);
    617617        log_it("isomnt: %s, %d", iso_mnt, strlen(iso_mnt));
    618618
     
    624624        }
    625625        log_it("isodir: %s", iso_path);
    626         mr_fprintf(fd1, "isodir %s\n", iso_path);
     626        mr_fprintf(fd1, "isodir=%s\n", iso_path);
    627627
    628628        log_it("iso-prefix: %s",  bkpinfo->prefix);
    629         mr_fprintf(fd1, "iso-prefix %s\n", bkpinfo->prefix);
     629        mr_fprintf(fd1, "iso-prefix=%s\n", bkpinfo->prefix);
    630630
    631631        mr_fclose(fd1);
  • branches/stable/mondo/src/include/my-stuff.h

    r1144 r1158  
    1717#define MONDO_CACHE "/var/cache/mondo"
    1818#define MONDORESTORECFG MONDO_CACHE"/mondo-restore.cfg"
     19/**
     20 * The mondo-restore.cfg stub (appended to the directory where all.tar.gz was unpacked).
     21 */
     22#define MONDO_CFG_FILE_STUB "tmp/mondo-restore.cfg"
     23
    1924
    2025
     
    9196 */
    9297#define MOUNTLIST_FNAME_STUB "tmp/mountlist.txt"
    93 
    94 /**
    95  * The mondo-restore.cfg stub (appended to the directory where all.tar.gz was unpacked).
    96  */
    97 #define MONDO_CFG_FILE_STUB "tmp/mondo-restore.cfg"
    9898
    9999/**
Note: See TracChangeset for help on using the changeset viewer.