Changeset 1535 in MondoRescue


Ignore:
Timestamp:
Jul 18, 2007, 6:18:02 PM (17 years ago)
Author:
Bruno Cornec
Message:

Use the configuration files in mondo (begining). That revision doesn't even compile.

Location:
branches/stable
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mindi/distributions/conf/mindi.conf.dist

    r1520 r1535  
    170170"
    171171
     172#
     173# Options common between mindi and mondo are stored below
     174#
     175
     176#
     177# ISO image CLI command to use
     178# For mindi options are fixed and based on mkisofs options
     179# Potentially overwritten by monoarchive values
     180#
     181mr_iso_creation_cmd="/usr/bin/mkisofs"
     182#mindi_iso_creation_cmd="/usr/bin/growisofs"
     183
     184#
     185# ISO image common creation options (for mkisofs/growisofs/wodim)
     186# do not specify the -o, -c or the -b options, nor the directory to backup
     187# as they will be generated by mondoarchive
     188#
     189mr_iso_creation_opt="-J -r -p MondoRescue -publisher http://www.mondorescue.org -A MondoRescue"
     190#mr_iso_creation_options="-use-the-force-luke -v  -J -r -p MondoRescue -publisher www.mondorescue.org -A MondoRescue -V _CD#_"
  • branches/stable/mindi/mindi

    r1530 r1535  
    109109NET_MODS="$mindi_net_mods"
    110110EXTRA_MODS="$CDROM_MODS $mindi_extra_mods $mindi_additional_mods"
    111 DENY_MODS="mindi_deny_mods"
    112 FORCE_MODS="mindi_force_mods"
     111DENY_MODS="$mindi_deny_mods"
     112FORCE_MODS="$mindi_force_mods"
     113ISO_CMD="$mr_iso_creation_cmd"
     114ISO_OPT="$mr_iso_creation_opt"
    113115
    114116BOOT_MEDIA_MESSAGE="$mindi_boot_msg"
     
    16171619            cp -f $MONDO_SHARE/autorun . 2>> $LOGFILE
    16181620        fi
    1619         mkisofs -U -J -r -o $MINDI_CACHE/mindi.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table . > /dev/null 2> $MINDI_TMP/mkisofs.log
    1620     else
    1621         mkisofs -J -r -o $MINDI_CACHE/mindi.iso -b images/mindi-bootroot.$BOOT_SIZE.img -c isolinux/boot.cat -no-emul-boot . > /dev/null 2> $MINDI_TMP/mkisofs.log
     1621        $ISO_CMD -U $ISO_OPT -V Mindi_Image -o $MINDI_CACHE/mindi.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table . > /dev/null 2> $MINDI_TMP/mkisofs.log
     1622    else
     1623        $ISO_CMD $ISO_OPT -V Mindi_Image -o $MINDI_CACHE/mindi.iso -b images/mindi-bootroot.$BOOT_SIZE.img -c isolinux/boot.cat -no-emul-boot . > /dev/null 2> $MINDI_TMP/mkisofs.log
    16221624    fi
    16231625    if [ "$?" -ne "0" ] ; then
    1624         echo "----------- mkisofs's errors --------------" >> $LOGFILE
     1626        echo "----------- $ISO_CMD's errors --------------" >> $LOGFILE
    16251627        cat $MINDI_TMP/mkisofs.log >> $LOGFILE
    1626         echo "mkisofs returned the following errors:-"
     1628        echo "$ISO_CMD returned the following errors:-"
    16271629        cat $MINDI_TMP/mkisofs.log
    16281630        LogIt "Failed to create ISO image."
     
    29072909    shift
    29082910    if [ _"$1" != _"" ] ; then
    2909         set | egrep "^$1" | cut -d= -f2
     2911        set | grep -Ew "^$1" | cut -d= -f2
    29102912    fi
    29112913    MindiExit 0
  • branches/stable/mondo/distributions/conf/mondo.conf.dist

    r1529 r1535  
    44#
    55# We tried to give sensible defaults in this file.
    6 # It will alwys be loaded by mondoarchive before your own configuration files.
     6# It will always be loaded by mondoarchive before your own configuration files.
    77# DO NOT CHANGE THAT FILE IN ANYWAY AS ITS MD5 SUM IS USED AS A CHECK !!
    88# Anyway changing some values in your own configuration file may render
    99# mondoarchive instable or cause failures. Use with care.
    10 
    11 #
    12 # ISO image CLI command to use
    13 # do not specify the -o, -c or the -b options, nor the directory to backup
    14 # as they will be generated by mondoarchive
    15 #
    16 mondo_iso_creation_cmd="/usr/bin/mkisofs"
    17 #mondo_iso_creation_cmd="/usr/bin/growisofs"
    18 
    19 #
    20 # ISO image common creation options (for mkisofs and growisofs)
    21 # do not specify the -o, -c or the -b options, nor the directory to backup
    22 #
    23 mondo_iso_creation_options="-J -r -p MondoRescue -publisher http://www.mondorescue.org -A MondoRescue -V _CD#_"
    24 #mondo_iso_creation_options="-use-the-force-luke -v  -J -r -p MondoRescue -publisher www.mondorescue.org -A MondoRescue -V _CD#_"
    2510
    2611#
     
    3015
    3116#
    32 #  ISO Burning CLI command options
     17# ISO Burning CLI command options
    3318mondo_iso_burning_options="-eject dev=_DEVICE_ speed=_SPEED_ fs=24m driveropts=burnfree"
    3419
     
    4126# Default size of media
    4227#
    43 # Use 4380 for DVDs, 650 or 700 for CDs
     28# Use 4480 for DVDs, 650 or 700 for CDs
    4429#
    4530mondo_media_size=4480
  • branches/stable/mondo/src/common/libmondo-archive.c

    r1438 r1535  
    4040
    4141#define DVDRWFORMAT 1
     42
     43extern struct mr_ar_conf mr_conf;
    4244
    4345
     
    18691871        mr_free(message_to_screen);
    18701872    } else {
    1871         mr_asprintf(&message_to_screen, "Running mkisofs to make %s #%d",
     1873        mr_asprintf(&message_to_screen, "Running %s to make %s #%d",
     1874                mr_conf->iso_creation_cmd,
    18721875                 bkpinfo->backup_media_string,
    18731876                 g_current_media_number);
    18741877        mr_msg(1, message_to_screen);
    1875         mr_asprintf(&result_sz, "Call to mkisofs to make ISO (%s #%d) ",
     1878        mr_asprintf(&result_sz, "Call to %s to make ISO (%s #%d) ",
     1879                mr_conf->iso_creation_cmd,
    18761880                 bkpinfo->backup_media_string,
    18771881                 g_current_media_number);
  • branches/stable/mondo/src/include/mr_conf.h

    r1422 r1535  
    44 *
    55 * based on parse_conf.h (c)2002-2004 Anton Kulchitsky  mailto:anton@kulchitsky.org
    6  * Review for mondorescue (c) 2006 Bruno Cornec <bruno@mondorescue.org>
     6 * Reviewed for mondorescue (c) 2006-2007 Bruno Cornec <bruno@mondorescue.org>
    77 *   
    88 *     Header file of mr_conf: a very small and simple
     
    2121 */
    2222struct mr_ar_conf {
    23     /* ISO image CLI command to use */
     23    /* MINDI: ISO image CLI command to use */
    2424    char *iso_creation_cmd;
    25     /* ISO image common creation options */
    26     char *iso_creation_options;
     25    /* MINDI: ISO image common creation options */
     26    char *iso_creation_opt;
    2727    /* ISO Burning CLI command to use */
    2828    char *iso_burning_cmd;
  • branches/stable/mondo/src/lib/mr_conf.c

    r1434 r1535  
    212212
    213213/*
    214   reads string outstr after string str in the current file (between
    215   "..."), not more than maxlength symbols: cannot check if outstr has
    216   enough length! It must be at least maxlength+1 ! Returns number of
    217   read chars
    218214*/
    219215char *mr_conf_sread(const char *field_name) {
  • branches/stable/mondo/src/mondoarchive/mondoarchive.c

    r1458 r1535  
    133133}
    134134
     135/* fill the mr_ar_conf structure from mindi's conf file */
     136static void mr_ar_store_conf_mindi(struct mr_ar_conf *mr_cnf) {
     137   
     138    char *p = NULL;
     139
     140    p = mr_conf_sread("mr_iso_creation_cmd");
     141    if (p != NULL) {
     142        mr_cnf->iso_creation_cmd = p;
     143    }
     144    p = mr_conf_sread("mr_iso_creation_opt");
     145    if (p != NULL) {
     146        mr_cnf->iso_creation_opt = p;
     147    }
     148}
     149
    135150/* create the mr_ar_conf structure from mondo's conf file */
    136151static void mr_ar_store_conf(struct mr_ar_conf *mr_cnf) {
    137152   
    138153    char *p = NULL;
    139 
    140     mr_asprintf(&p, mr_conf_sread("mondo_iso_creation_cmd"));
    141     mr_cnf->iso_creation_cmd = p;
    142     p = NULL;
    143 
    144     mr_asprintf(&p, mr_conf_sread("mondo_iso_creation_options"));
    145     mr_cnf->iso_creation_options = p;
    146     p = NULL;
    147154
    148155    mr_asprintf(&p, mr_conf_sread("mondo_iso_burning_cmd"));
     
    234241    }
    235242    mr_free(mr_cnf->iso_creation_cmd);
    236     mr_free(mr_cnf->iso_creation_options);
     243    mr_free(mr_cnf->iso_creation_opt);
    237244    mr_free(mr_cnf->iso_burning_cmd);
    238245    mr_free(mr_cnf->iso_burning_options);
     
    331338    mr_conf_close();
    332339
     340    /* Check md5 sum before */
     341    /* Get content of mindi conf file now to finish structure initialization */
     342/* Tempo Hack */
     343#define MINDI_CONF_DIR /etc/mindi
     344    if (mr_conf_open(MINDI_CONF_DIR"/mindi.conf.dist") != 0) {
     345            mr_log_exit(-1, "Unable to open "MINDI_CONF_DIR"/mindi.conf.dist");
     346    }
     347    mr_ar_store_conf_mindi(&mr_conf);
     348    mr_conf_close();
     349
     350    if (mr_conf_open(MINDI_CONF_DIR"/mindi.conf") == 0) {
     351        mr_ar_store_conf_mindi(&mr_conf);
     352        mr_conf_close();
     353    }
     354    mr_msg(5, "Command for ISO images is %s", mr_cnf->iso_creation_cmd);
     355
    333356    /* Add MONDO_SHARE + other environment variables for mindi */
    334357    setenv_mondo_var();
  • branches/stable/tools/backupqemu

    r1334 r1535  
    3333
    3434d=/users/svg
    35 mkdir -p \$d
    36 mount ${iph}:$demodir \$d
    37 mkdir -p \$d/tmp-$h \$d/scratch-$h \$d/images
    38 /usr/sbin/mondoarchive -n ${iph}:$demodir -G -F -N -O -E "/usr/share/doc /usr/src /home /users /var/log" -d images -s 4300m -T \$d/tmp-$h -S \$d/scratch-$h -p $h-$m
    39 umount \$d
     35mkdir -p \$d/images
     36mount ${iph}:$demodir \$d/images
     37mkdir -p \$d/tmp-$h \$d/scratch-$h
     38/usr/sbin/mondoarchive -n ${iph}:$demodir -G -F -N -O -E "/usr/share/doc /usr/src /home /users /var/log" -d images -s 650m -T \$d/tmp-$h -S \$d/scratch-$h -p $h-$m
     39umount \$d/images
    4040EOF
    4141chmod 755 $TMPDIR/test-mondo
  • branches/stable/tools/restoreqemu

    r1334 r1535  
    1919. $TOOLHOME/qemu-env
    2020
     21if [ _"$1" = _"" ]; then
     22    echo "Syntax: restoreqemu vm"
     23    exit -1
     24else
     25    m=$1
     26fi
     27
    2128demodir=/home/bruno/demo-mondo
    2229
    2330
    2431QEMUOPT=" $QEMUOPT -kernel $demodir/k -initrd $demodir/i"
    25 QEMUAPP="load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=65536 rw root=/dev/ram iso_mode nuke pxe prefix=test-mondo-$m ipconf=eth0:dhcp nfsmount=10.0.2.2:$demodir"
     32QEMUAPP="load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=65536 rw root=/dev/ram iso_mode pxe prefix=test-mondo-$m ipconf=eth0:dhcp nfsmount=10.0.2.2:$demodir"
    2633
    2734cp $demodir/pxe.qemu $demodir/test.qemu
Note: See TracChangeset for help on using the changeset viewer.