Changeset 2704 in MondoRescue


Ignore:
Timestamp:
Jan 27, 2011, 7:31:24 PM (13 years ago)
Author:
Bruno Cornec
Message:

r4180@localhost: bruno | 2011-01-27 10:26:41 +0100

  • Fix multiple port issues from 2.2.9 that prevented mindi to work
  • Change interface of call_program_and_get_last_line_of_output to allow not logging (call to mindi)
  • Status is working boot, but NFS interface broken due to conf file issues
Location:
branches/2.2.10
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.10/mindi/mindi

    r2696 r2704  
    14131413    if [ "$ARCH" != "ia64" ] ; then
    14141414        if [ _"$MONDO_SHARE" != _"" ]; then
    1415             cp -f $MINDI_TMP/iso/{isolinux.cfg,initrd.img,vmlinuz,isolinux.bin,message.txt} $MONDO_ROOT 2>> $LOGFILE || Die "Cannot copy core files to ramdisk for boot disk (under $MONDO_ROOT). Did you run out of disk space?"
     1415            cp -f $MINDI_TMP/iso/{isolinux.cfg,initrd.img,vmlinuz,isolinux.bin,message.txt} $MONDO_CACHE 2>> $LOGFILE || Die "Cannot copy core files to ramdisk for boot disk (under $MONDO_CACHE). Did you run out of disk space?"
    14161416            if [ $KERNEL_IS_XEN = "yes" ]; then
    1417                 cp -f $MINDI_TMP/iso/{mboot.c32,xen.gz} $MONDO_ROOT 2>> $LOGFILE || Die "Cannot copy Xen core files to ramdisk for boot disk (under $MONDO_ROOT). Did you run out of disk space?"
     1417                cp -f $MINDI_TMP/iso/{mboot.c32,xen.gz} $MONDO_CACHE 2>> $LOGFILE || Die "Cannot copy Xen core files to ramdisk for boot disk (under $MONDO_CACHE). Did you run out of disk space?"
    14181418            fi
    14191419            cp -f $MONDO_SHARE/autorun $MINDI_TMP/iso 2>> $LOGFILE
     
    23112311    done
    23122312
    2313     rm -f $MINDI_TMP/ungzip.lis
    23142313    for i in `echo $needed_modules  | tr ' ' '\n' | sort -u`; do
    23152314        grep -qE '^$i$' $MINDI_TMP/cp.lis
     
    23182317            LogFile "Adding $i ($s KB) to the rootfs"
    23192318            echo $i >> $MINDI_TMP/cp.lis
    2320 
    2321             # Uncompress modules if not using udev and native modprobe
    2322             if [ ! -f $mountpoint/tmp/USE-UDEV ]; then
    2323                 if [ "`echo "$i" | grep -F ".gz"`" ]; then
    2324                     echo "$i" >> $MINDI_TMP/ungzip.lis
    2325                 fi
    2326             fi
    23272319        fi
    23282320    done
     
    23402332    # Copy FW in case some drivers needs it
    23412333    if [ -d "/lib/firmware" ]; then
    2342         cp -rp /lib/firmware $mountpoint/lib
     2334        echo "lib/firmware" >> $MINDI_TMP/mkdir.lis
     2335        echo "/lib/firmware" >> $MINDI_TMP/cp.lis
    23432336    fi
    23442337
     
    23802373    # Then copy files needed
    23812374    LANGUAGE=C tar cf - `cat $MINDI_TMP/cp.lis` 2> /dev/null | (cd $mountpoint ; tar xf - ) 2>&1 | grep -Ev "tar: Removing.*/\'" >> $LOGFILE
    2382 
    2383     # Uncompress modules if not using udev and native modprobe
    2384     for f in `cat $MINDI_TMP/ungzip.lis`; do
    2385         echo "Uncompressing $f" >> $LOGFILE
    2386         gunzip -f $mountpoint/$f
    2387     done
    2388     rm -f $MINDI_TMP/ungzip.lis
    23892375
    23902376    # Then handle links
     
    24902476LogFile "Start date : `date`"
    24912477LogFile "-----------------------------"
    2492 
    2493 # TODO: Remove that
    2494 [ -e "/sbin/mkdosfs" ] && [ ! -e "/sbin/mkfs.vfat" ] && ln -sf /sbin/mkdosfs /sbin/mkfs.vfat
    24952478
    24962479# Log some capital variables
     
    26302613LogFile "-------------"
    26312614LogFile "Liste of extra modules is:"
     2615LogFile "-------------"
    26322616LogFile "$EXTRA_MODS"
    26332617LogFile "-------------"
     
    27182702            Die "MONDO_TMP is /, aborting"
    27192703        fi
    2720         mv $MINDI_TMP/* $MINDI_TMP/.??* $MONDO_TMP 2>> $LOGFILE
    27212704        rmdir $MINDI_TMP
    27222705        export MINDI_TMP=$MONDO_TMP
  • branches/2.2.10/mondo/src/common/libmondo-archive.c

    r2644 r2704  
    612612
    613613#ifdef __FreeBSD__
    614         bootdev = call_program_and_get_last_line_of_output("mount | grep ' /boot ' | head -1 | cut -d' ' -f1 | sed 's/\\([0-9]\\).*/\\1/'");
     614        bootdev = call_program_and_get_last_line_of_output("mount | grep ' /boot ' | head -1 | cut -d' ' -f1 | sed 's/\\([0-9]\\).*/\\1/'",TRUE);
    615615        if (!bootdev[0]) {
    616616            mr_free(bootdev);
    617             bootdev = call_program_and_get_last_line_of_output("mount | grep ' / ' | head -1 | cut -d' ' -f1 | sed 's/\\([0-9]\\).*/\\1/'");
     617            bootdev = call_program_and_get_last_line_of_output("mount | grep ' / ' | head -1 | cut -d' ' -f1 | sed 's/\\([0-9]\\).*/\\1/'",TRUE);
    618618        }
    619619#else
    620620        /* Linux */
    621621#ifdef __IA64__
    622         bootdev = call_program_and_get_last_line_of_output("mount | grep ' /boot/efi ' | head -1 | cut -d' ' -f1 | sed 's/[0-9].*//'");
     622        bootdev = call_program_and_get_last_line_of_output("mount | grep ' /boot/efi ' | head -1 | cut -d' ' -f1 | sed 's/[0-9].*//'",TRUE);
    623623#else
    624         bootdev = call_program_and_get_last_line_of_output("mount | grep ' /boot ' | head -1 | cut -d' ' -f1 | sed 's/[0-9].*//'");
     624        bootdev = call_program_and_get_last_line_of_output("mount | grep ' /boot ' | head -1 | cut -d' ' -f1 | sed 's/[0-9].*//'",TRUE);
    625625#endif
    626626        if (strstr(bootdev, "/dev/cciss/")) {
    627627            mr_free(bootdev);
    628628#ifdef __IA64__
    629             bootdev = call_program_and_get_last_line_of_output("mount | grep ' /boot/efi ' | head -1 | cut -d' ' -f1 | cut -dp -f1");
     629            bootdev = call_program_and_get_last_line_of_output("mount | grep ' /boot/efi ' | head -1 | cut -d' ' -f1 | cut -dp -f1",TRUE);
    630630#else
    631             bootdev = call_program_and_get_last_line_of_output("mount | grep ' /boot ' | head -1 | cut -d' ' -f1 | cut -dp -f1");
     631            bootdev = call_program_and_get_last_line_of_output("mount | grep ' /boot ' | head -1 | cut -d' ' -f1 | cut -dp -f1",TRUE);
    632632#endif
    633633        }
    634634        if (!bootdev[0]) {
    635635            mr_free(bootdev);
    636             bootdev = call_program_and_get_last_line_of_output("mount | grep ' / ' | head -1 | cut -d' ' -f1 | sed 's/[0-9].*//'");
     636            bootdev = call_program_and_get_last_line_of_output("mount | grep ' / ' | head -1 | cut -d' ' -f1 | sed 's/[0-9].*//'",TRUE);
    637637            if (strstr(bootdev, "/dev/cciss/")) {
    638638                mr_free(bootdev);
    639                 bootdev = call_program_and_get_last_line_of_output("mount | grep ' / ' | head -1 | cut -d' ' -f1 | cut -dp -f1");
     639                bootdev = call_program_and_get_last_line_of_output("mount | grep ' / ' | head -1 | cut -d' ' -f1 | cut -dp -f1",TRUE);
    640640            }
    641641        }
     
    840840    if (!res) {
    841841        log_to_screen("Boot+data disks were created OK");
    842         mr_asprintf(command, "cp -f /%s/images/mindi.iso %s/mondorescue.iso", MINDI_CACHE_REL, MINDI_CACHE);
     842        mr_asprintf(command, "cp -f /%s/mindi.iso %s/mondorescue.iso", MINDI_CACHE_REL, MINDI_CACHE);
    843843        log_msg(2, command);
    844844        run_program_and_log_output(command, FALSE);
     
    866866        log_to_screen("Mindi failed to create your boot+data disks.");
    867867        mr_asprintf(command, "grep 'Fatal error' /var/log/mindi.log");
    868         tmp = call_program_and_get_last_line_of_output(command);
     868        tmp = call_program_and_get_last_line_of_output(command,TRUE);
    869869        mr_free(command);
    870870
     
    11251125    mr_asprintf(data_disks_file, "/%s/all.tar.gz", MINDI_CACHE_REL);
    11261126
    1127     g_serial_string = call_program_and_get_last_line_of_output("dd  if=/dev/urandom bs=16 count=1 2> /dev/null |  hexdump | tr -s ' ' '0' | head -n1");
     1127    g_serial_string = call_program_and_get_last_line_of_output("dd  if=/dev/urandom bs=16 count=1 2> /dev/null |  hexdump | tr -s ' ' '0' | head -n1",TRUE);
    11281128    mr_strip_spaces(g_serial_string);
    11291129    mr_strcat(g_serial_string, "...word.");
     
    18111811    mr_asprintf(command, "dd if=%s bs=512 count=1 2> /dev/null | strings | head -n1", bigfile_fname);
    18121812    log_msg(1, "command = '%s'", command);
    1813     tmp = call_program_and_get_last_line_of_output(command);
     1813    tmp = call_program_and_get_last_line_of_output(command,TRUE);
    18141814    mr_free(command);
    18151815
     
    25442544            mr_asprintf(tmp, "cat %s 2> /dev/null", szserfname);
    25452545            mr_free(our_serial_str);
    2546             our_serial_str = call_program_and_get_last_line_of_output(tmp);
     2546            our_serial_str = call_program_and_get_last_line_of_output(tmp,TRUE);
    25472547            mr_free(tmp);
    25482548            // FIXME - should be able to use last_line_of_file(), surely?
     
    27332733        mr_asprintf(command, "ntfsresize --force --info %s|grep '^You might resize at '|cut -d' ' -f5", biggie_filename);
    27342734        log_it("command = %s", command);
    2735         tmp = call_program_and_get_last_line_of_output(command);
     2735        tmp = call_program_and_get_last_line_of_output(command,TRUE);
    27362736        mr_free(command);
    27372737        log_it("res of it = %s", tmp);
  • branches/2.2.10/mondo/src/common/libmondo-cli.c

    r2696 r2704  
    490490        mr_asprintf(tmp1, "mount | grep -E \"^[%s@]*%s[/]* .*\" | cut -d' ' -f3", bkpinfo->netfs_user, bkpinfo->netfs_mount);
    491491        mr_free(bkpinfo->isodir);
    492         bkpinfo->isodir = call_program_and_get_last_line_of_output(tmp1);
     492        bkpinfo->isodir = call_program_and_get_last_line_of_output(tmp1,TRUE);
    493493        mr_free(tmp1);
    494494
     
    511511                mr_asprintf(tmp1, "mount | grep -E \"^[%s@]*%s[/]* .*\" | cut -d' ' -f3", bkpinfo->netfs_user, bkpinfo->netfs_mount);
    512512                mr_free(bkpinfo->isodir);
    513                 bkpinfo->isodir = call_program_and_get_last_line_of_output(tmp1);
     513                bkpinfo->isodir = call_program_and_get_last_line_of_output(tmp1,TRUE);
    514514                mr_free(tmp1);
    515515
  • branches/2.2.10/mondo/src/common/libmondo-devices.c

    r2696 r2704  
    532532    if (tmp1) {
    533533        mr_asprintf(command, "%s -scanbus 2> /dev/null | tr -s '\t' ' ' | grep \"[0-9]*,[0-9]*,[0-9]*\" | grep -v \"[0-9]*) \\*\" | grep CD | cut -d' ' -f2 | head -n1", cdr_exe);
    534         tmp = call_program_and_get_last_line_of_output(command);
     534        tmp = call_program_and_get_last_line_of_output(command,TRUE);
    535535        mr_free(command);
    536536    }
     
    812812
    813813    log_msg(1, "command=%s", command);
    814     tmp = call_program_and_get_last_line_of_output(command);
     814    tmp = call_program_and_get_last_line_of_output(command,TRUE);
    815815    mr_free(command);
    816816
     
    840840    }
    841841
    842     tmp = call_program_and_get_last_line_of_output("dvdrecord -scanbus 2> /dev/null | grep \") '\" | grep -n \"\" | grep DVD | cut -d':' -f1");
     842    tmp = call_program_and_get_last_line_of_output("dvdrecord -scanbus 2> /dev/null | grep \") '\" | grep -n \"\" | grep DVD | cut -d':' -f1",TRUE);
    843843    log_msg(5, "tmp = '%s'", tmp);
    844844    if (!tmp[0])
    845845        mr_free(tmp);
    846         tmp = call_program_and_get_last_line_of_output("cdrecord -scanbus 2> /dev/null | grep \") '\" | grep -n \"\" | grep DVD | cut -d':' -f1");
     846        tmp = call_program_and_get_last_line_of_output("cdrecord -scanbus 2> /dev/null | grep \") '\" | grep -n \"\" | grep DVD | cut -d':' -f1",TRUE);
    847847    if (tmp[0]) {
    848848        devno = atoi(tmp) - 1;
     
    11071107    int i = 2;
    11081108
    1109     tmp = call_program_and_get_last_line_of_output("/sbin/sysctl -n kern.osreldate");
     1109    tmp = call_program_and_get_last_line_of_output("/sbin/sysctl -n kern.osreldate",TRUE);
    11101110    i = atoi(tmp);
    11111111    mr_free(tmp);
     
    11221122    } else {
    11231123        sprintf(command, "mdconfig -a -t vnode -f %s", fname);
    1124         mddevice = call_program_and_get_last_line_of_output(command);
     1124        mddevice = call_program_and_get_last_line_of_output(command,TRUE);
    11251125        if (!strstr(mddevice, "md")) {
    11261126            return NULL;
     
    11521152    }
    11531153
    1154     tmp = call_program_and_get_last_line_of_output("/sbin/sysctl -n kern.osreldate"));
     1154    tmp = call_program_and_get_last_line_of_output("/sbin/sysctl -n kern.osreldate",TRUE);
    11551155    i = atoi(tmp);
    11561156    mr_free(tmp);
     
    15831583    mr_asprintf(command, "mount 2>/dev/null | awk '{if($1 ~ \"^/dev/\"){print $0}}'|wc -l");
    15841584    log_msg(5, "Running: %s", command);
    1585     mounted_file_system = call_program_and_get_last_line_of_output(command);
     1585    mounted_file_system = call_program_and_get_last_line_of_output(command,TRUE);
    15861586    mr_free(command);
    15871587
     
    15931593        mr_asprintf(command, "mount 2>/dev/null | awk '{if($1 ~ \"^/dev/\"){print $1,$3}}'|head -n %d", i);
    15941594        log_msg(5, "Running: %s", command);
    1595         mounted_file_system = call_program_and_get_last_line_of_output(command);
     1595        mounted_file_system = call_program_and_get_last_line_of_output(command,TRUE);
    15961596        mr_free(command);
    15971597
     
    16731673    mr_asprintf(command, "ls -al %s 2>/dev/null | wc -l", dsf);
    16741674    log_msg(5, "  Executing: %s", command);
    1675     tmp = call_program_and_get_last_line_of_output(command);
     1675    tmp = call_program_and_get_last_line_of_output(command,TRUE);
    16761676    mr_free(command);
    16771677
     
    16991699    mr_asprintf(command, "parted2fdisk -l %s 2>/dev/null|grep -E \"^/dev/\"|awk '{printf(\"%%s \", $1)}END{print \"\"}'", dsf);
    17001700    log_msg(5, "Executing: %s", command);
    1701     partition_list = call_program_and_get_last_line_of_output(command);
     1701    partition_list = call_program_and_get_last_line_of_output(command,TRUE);
    17021702    mr_free(command);
    17031703
     
    17671767        mr_asprintf(command, "parted2fdisk -l %s 2>/dev/null | awk '{if(($1==\"%s\")&&(toupper($0) ~ \"SWAP\")){print $1;exit}}'", ndsf, partitions[i]);
    17681768        log_msg(5, "  Running: %s", command);
    1769         tmp = call_program_and_get_last_line_of_output(command);
     1769        tmp = call_program_and_get_last_line_of_output(command,TRUE);
    17701770        mr_free(command);
    17711771
     
    17811781        /* It's not swap. See if we can find the mount point from the mount command. */
    17821782        mr_asprintf(command, "mount 2>/dev/null | awk '{if((NF>0)&&($1==\"%s\")){print $3}}'", partitions[i]);
    1783         tmp = call_program_and_get_last_line_of_output(command);
     1783        tmp = call_program_and_get_last_line_of_output(command,TRUE);
    17841784        mr_free(command);
    17851785
     
    18031803        mr_asprintf(command, "pvdisplay -c %s | grep '%s:' 2> /dev/null", partitions[i], partitions[i]);
    18041804        log_msg(5, "  Running: %s", command);
    1805         tmp = call_program_and_get_last_line_of_output(command);
     1805        tmp = call_program_and_get_last_line_of_output(command,TRUE);
    18061806        mr_free(command);
    18071807
     
    18111811            mr_asprintf(command, "pvdisplay -v %s 2>/dev/null|grep \"VG Name\"|awk '{print $NF}'", partitions[i]);
    18121812            log_msg(5, "  Running: %s", command);
    1813             strcpy(VG, call_program_and_get_last_line_of_output(command));
     1813            strcpy(VG, call_program_and_get_last_line_of_output(command,TRUE));
    18141814            mr_free(command);
    18151815
     
    18201820                mr_asprintf(command, "mount 2>/dev/null|grep -E \"/dev/mapper/%s-|/dev/%s/\"|awk '{printf(\"%%s \",$3)}END{print \"\"}'", VG, VG);
    18211821                log_msg(5, "  Running: %s", command);
    1822                 mr_asprintf(mount_list, "%s", call_program_and_get_last_line_of_output(command));
     1822                mr_asprintf(mount_list, "%s", call_program_and_get_last_line_of_output(command,TRUE));
    18231823                mr_free(command);
    18241824
     
    18441844                mr_asprintf(command, "%s", "cat /proc/mdstat|grep -iv Personal|awk '{if($0~\"^.*[ ]+:\"){printf(\"/dev/%s \", $1)}}END{print \"\"}'");
    18451845                log_msg (5, "Running: %s", command);
    1846                 mr_asprintf(mount_list, "%s", call_program_and_get_last_line_of_output(command));
     1846                mr_asprintf(mount_list, "%s", call_program_and_get_last_line_of_output(command,TRUE));
    18471847                mr_free(command);
    18481848
     
    18531853                    log_msg (5, "Running: %s", command);
    18541854                    mr_free(tmp);
    1855                     mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output(command));
     1855                    mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output(command,TRUE));
    18561856                    mr_free(command);
    18571857
     
    18891889        mr_asprintf(command, "mdadm --examine %s 2>/dev/null | awk '{if($1 == \"UUID\"){print $3}}'", partitions[i]);
    18901890        log_msg(4, "  Running: %s", command);
    1891         tmp = call_program_and_get_last_line_of_output(command);
     1891        tmp = call_program_and_get_last_line_of_output(command,TRUE);
    18921892        mr_free(command);
    18931893
     
    19021902        mr_asprintf(command, "%s", "cat /proc/mdstat|grep -iv Personal|awk '{if($0~\"^.*[ ]+:\"){printf(\"/dev/%s \", $1)}}END{print \"\"}'");
    19031903        log_msg (5, "  Running: %s", command);
    1904         mount_list = call_program_and_get_last_line_of_output(command);
     1904        mount_list = call_program_and_get_last_line_of_output(command,TRUE);
    19051905        mr_free(command);
    19061906
     
    19131913            mr_free(tmp);
    19141914
    1915             tmp = call_program_and_get_last_line_of_output(command);
     1915            tmp = call_program_and_get_last_line_of_output(command,TRUE);
    19161916            mr_free(command);
    19171917
     
    20762076
    20772077    mr_asprintf(exclude_these_directories,"%s",list_of_NETFS_mounts_only());
    2078     exclude_these_devices = call_program_and_get_last_line_of_output("tr -s '\t' ' ' < /etc/fstab | grep -E '( (coda|ncpfs|sshfs|nfs|nfs4|smbfs|cifs|afs|gfs|ocfs|ocfs2|mvfs|nsspool|nsvol) )' | cut -d' ' -f1 | tr -s '\n' ' ' | awk '{print $0;}'");
     2078    exclude_these_devices = call_program_and_get_last_line_of_output("tr -s '\t' ' ' < /etc/fstab | grep -E '( (coda|ncpfs|sshfs|nfs|nfs4|smbfs|cifs|afs|gfs|ocfs|ocfs2|mvfs|nsspool|nsvol) )' | cut -d' ' -f1 | tr -s '\n' ' ' | awk '{print $0;}'",TRUE);
    20792079    snprintf(result_sz, 1023, "%s %s", exclude_these_directories, exclude_these_devices);
    20802080    mr_free(exclude_these_devices);
     
    20972097    static char result_sz[512];
    20982098
    2099     exclude_these_directories = call_program_and_get_last_line_of_output("mount -t coda,ncpfs,fuse.sshfs,nfs,nfs4,smbfs,cifs,afs,gfs,ocfs,ocfs2,mvfs,nsspool,nssvol | tr -s '\t' ' ' | cut -d' ' -f3 | tr -s '\n' ' ' | awk '{print $0;}'");
     2099    exclude_these_directories = call_program_and_get_last_line_of_output("mount -t coda,ncpfs,fuse.sshfs,nfs,nfs4,smbfs,cifs,afs,gfs,ocfs,ocfs2,mvfs,nsspool,nssvol | tr -s '\t' ' ' | cut -d' ' -f3 | tr -s '\n' ' ' | awk '{print $0;}'",TRUE);
    21002100    snprintf(result_sz, 511, "%s", exclude_these_directories);
    21012101    mr_free(exclude_these_directories);
     
    21492149
    21502150#ifdef __FreeBSD__
    2151     tmp = call_program_and_get_last_line_of_output("LANGUAGE=C df -m -P -t nonfs,msdosfs,ntfs,ntfs-3g,smbfs,smb,cifs,afs,gfs,ocfs,ocfs2,mvfs,nsspool,nssvol | grep -vE \"none|Filesystem\" | awk '{printf \"%s %s\\n\", $4, $6;}' | sort -n | tail -n1 | awk '{print $NF;} | while read x ; do test -w $x && echo $x && break ; done'");
     2151    tmp = call_program_and_get_last_line_of_output("LANGUAGE=C df -m -P -t nonfs,msdosfs,ntfs,ntfs-3g,smbfs,smb,cifs,afs,gfs,ocfs,ocfs2,mvfs,nsspool,nssvol | grep -vE \"none|Filesystem\" | awk '{printf \"%s %s\\n\", $4, $6;}' | sort -n | tail -n1 | awk '{print $NF;} | while read x ; do test -w $x && echo $x && break ; done'",TRUE);
    21522152#else
    2153     tmp = call_program_and_get_last_line_of_output("LANGUAGE=C df -m -P -x nfs -x nfs4 -x fuse.sshfs -x fuse -x vfat -x ntfs -x ntfs-3g -x smbfs -x smb -x cifs -x afs -x gfs -x ocfs -x ocfs2 -x mvfs -x nsspool -x nssvol -x iso9660 | grep -vE \"none|Filesystem|/dev/shm\" | awk '{printf \"%s %s\\n\", $4, $6;}' | sort -n | tail -n1 | awk '{print $NF;}' | while read x ; do test -w $x && echo $x && break ; done");
     2153    tmp = call_program_and_get_last_line_of_output("LANGUAGE=C df -m -P -x nfs -x nfs4 -x fuse.sshfs -x fuse -x vfat -x ntfs -x ntfs-3g -x smbfs -x smb -x cifs -x afs -x gfs -x ocfs -x ocfs2 -x mvfs -x nsspool -x nssvol -x iso9660 | grep -vE \"none|Filesystem|/dev/shm\" | awk '{printf \"%s %s\\n\", $4, $6;}' | sort -n | tail -n1 | awk '{print $NF;}' | while read x ; do test -w $x && echo $x && break ; done",TRUE);
    21542154#endif
    21552155
     
    22452245    if (g_ISO_restore_mode) {
    22462246        mr_asprintf(tmp, "mount | grep iso9660 | awk '{print $3;}'");
    2247         mountdev = call_program_and_get_last_line_of_output(tmp);
     2247        mountdev = call_program_and_get_last_line_of_output(tmp,TRUE);
    22482248        mr_strcat(mountdev, "/archives/THIS-CD-NUMBER");
    22492249        mr_free(tmp);
     
    22992299
    23002300#ifdef __FreeBSD__
    2301     output = call_program_and_get_last_line_of_output("mount | grep ' on / ' | cut -d' ' -f1");
     2301    output = call_program_and_get_last_line_of_output("mount | grep ' on / ' | cut -d' ' -f1",TRUE);
    23022302#else
    2303     output = call_program_and_get_last_line_of_output("mount | grep ' on / ' | cut -d' ' -f1 | sed 's/[0-9]//' | sed 's/[0-9]//'");
     2303    output = call_program_and_get_last_line_of_output("mount | grep ' on / ' | cut -d' ' -f1 | sed 's/[0-9]//' | sed 's/[0-9]//'",TRUE);
    23042304    if (strstr(output, "/dev/cciss/")) {
    23052305        mr_free(output);
    2306         output = call_program_and_get_last_line_of_output("mount | grep ' on / ' | cut -d' ' -f1 | cut -dp -f1");
     2306        output = call_program_and_get_last_line_of_output("mount | grep ' on / ' | cut -d' ' -f1 | cut -dp -f1",TRUE);
    23072307    }
    23082308    if (strstr(output, "/dev/md")) {
    23092309        mr_free(output);
    2310         output = call_program_and_get_last_line_of_output("mount | grep ' on / ' | cut -d' ' -f1");
     2310        output = call_program_and_get_last_line_of_output("mount | grep ' on / ' | cut -d' ' -f1",TRUE);
    23112311    }
    23122312#endif
     
    25462546            log_msg(1, "curr_fname = %s", curr_fname);
    25472547            mr_asprintf(command, "file %s", curr_fname);
    2548             tmp = call_program_and_get_last_line_of_output(command);
     2548            tmp = call_program_and_get_last_line_of_output(command,TRUE);
    25492549            mr_free(command);
    25502550            for (p = tmp + strlen(tmp); p != tmp && *p != '`' && *p != ' '; p--);
     
    25962596    mr_free(fdisk);
    25972597
    2598     tmp = call_program_and_get_last_line_of_output(command);
     2598    tmp = call_program_and_get_last_line_of_output(command,TRUE);
    25992599    mr_free(command);
    26002600
     
    28742874        /* Initiate bkpinfo netfs_mount path from running environment if not already done */
    28752875        if (bkpinfo->netfs_mount == NULL) {
    2876             bkpinfo->netfs_mount = call_program_and_get_last_line_of_output("mount | grep \":\" | cut -d' ' -f1 | head -n1");
     2876            bkpinfo->netfs_mount = call_program_and_get_last_line_of_output("mount | grep \":\" | cut -d' ' -f1 | head -n1",TRUE);
    28772877        }
    28782878#ifdef __FreeBSD__
     
    29032903            mr_asprintf(command, "mount | grep \"%s \" | cut -d' ' -f3", bkpinfo->netfs_mount);
    29042904            mr_free(bkpinfo->isodir);
    2905             bkpinfo->isodir = call_program_and_get_last_line_of_output(command);
     2905            bkpinfo->isodir = call_program_and_get_last_line_of_output(command,TRUE);
    29062906            mr_free(command);
    29072907
     
    29532953        mr_free(bkpinfo->isodir);
    29542954        if (is_this_device_mounted(bkpinfo->netfs_mount)) {
    2955             bkpinfo->isodir = call_program_and_get_last_line_of_output("mount | grep \":\" | cut -d' ' -f3 | head -n1");
     2955            bkpinfo->isodir = call_program_and_get_last_line_of_output("mount | grep \":\" | cut -d' ' -f3 | head -n1",TRUE);
    29562956
    29572957        } else {
     
    30603060#ifdef __FreeBSD__
    30613061#define EXAMPLEBD   "/dev/ad0"
    3062         bkpinfo->boot_device = call_program_and_get_last_line_of_output("mount | grep ' / ' | head -1 | cut -d' ' -f1 | sed 's/\\([0-9]\\).*/\\1/'");
     3062        bkpinfo->boot_device = call_program_and_get_last_line_of_output("mount | grep ' / ' | head -1 | cut -d' ' -f1 | sed 's/\\([0-9]\\).*/\\1/'",TRUE);
    30633063#else
    30643064#define EXAMPLEBD   "/dev/hda"
    3065         bkpinfo->boot_device = call_program_and_get_last_line_of_output("mount | grep ' / ' | head -1 | cut -d' ' -f1 | sed 's/[0-9].*//'");
     3065        bkpinfo->boot_device = call_program_and_get_last_line_of_output("mount | grep ' / ' | head -1 | cut -d' ' -f1 | sed 's/[0-9].*//'",TRUE);
    30663066#endif
    30673067        i = which_boot_loader(bkpinfo->boot_device);
     
    31203120        mr_free(tmp);
    31213121// NTFS
    3122         tmp = call_program_and_get_last_line_of_output("parted2fdisk -l | grep -i ntfs | awk '{ print $1};' | tr -s '\\n' ' ' | awk '{ print $0};'");
     3122        tmp = call_program_and_get_last_line_of_output("parted2fdisk -l | grep -i ntfs | awk '{ print $1};' | tr -s '\\n' ' ' | awk '{ print $0};'",TRUE);
    31233123        if (strlen(tmp) > 2) {
    31243124            p = popup_and_get_string("NTFS partitions", "Please enter/confirm the NTFS partitions you wish to backup as well.", tmp);
  • branches/2.2.10/mondo/src/common/libmondo-fifo.c

    r2508 r2704  
    165165    mr_asprintf(command, "ps %s | grep -F \"%s\" | grep -Fv grep | awk '{print $2;}' | grep -v PID | head -1", ps_options, g_sz_call_to_buffer);
    166166    log_msg(2, "kill_buffer() --- command = %s", command);
    167     tmp = call_program_and_get_last_line_of_output(command);
     167    tmp = call_program_and_get_last_line_of_output(command,TRUE);
    168168    mr_free(command);
    169169
  • branches/2.2.10/mondo/src/common/libmondo-filelist.c

    r2696 r2704  
    874874    log_msg(6, "tmp = %s", tmp);
    875875
    876     tmp1 = call_program_and_get_last_line_of_output(tmp);
     876    tmp1 = call_program_and_get_last_line_of_output(tmp,TRUE);
    877877    mr_free(tmp);
    878878
     
    13771377
    13781378        mr_asprintf(tmp, "wc -l %s | awk '{print $1;}'", g_skeleton_filelist);
    1379         tmp1 = call_program_and_get_last_line_of_output(tmp);
     1379        tmp1 = call_program_and_get_last_line_of_output(tmp,TRUE);
    13801380        mr_free(tmp);
    13811381
     
    15451545        }
    15461546        make_hole_for_file(sz_datefile);
    1547         tmp1 = call_program_and_get_last_line_of_output("date +%s");
     1547        tmp1 = call_program_and_get_last_line_of_output("date +%s",TRUE);
    15481548        write_one_liner_data_file(sz_datefile, tmp1);
    15491549        mr_free(tmp1);
     
    15721572        }
    15731573        log_msg(1, "Calculating filelist");
    1574         tmp2 = call_program_and_get_last_line_of_output("mount | grep -Ew 'ntfs|ntfs-3g|fat|vfat|dos' | awk '{print $3}'");
     1574        tmp2 = call_program_and_get_last_line_of_output("mount | grep -Ew 'ntfs|ntfs-3g|fat|vfat|dos' | awk '{print $3}'",TRUE);
    15751575        if (strlen(tmp2) < 1) {
    15761576            mr_asprintf(tmp1," ");
     
    15791579            mr_asprintf(tmp1, "find %s -name '/win386.swp' -o -name '/hiberfil.sys' -o -name '/pagefile.sys' 2> /dev/null\n",tmp2);
    15801580            mr_free(tmp2);
    1581             tmp2 = call_program_and_get_last_line_of_output(tmp1);
     1581            tmp2 = call_program_and_get_last_line_of_output(tmp1,TRUE);
    15821582            log_msg(2, "Found windows files: %s",tmp2);
    15831583        }
  • branches/2.2.10/mondo/src/common/libmondo-files.c

    r2623 r2704  
    274274    char *kernel = NULL;;
    275275
    276     kernel = call_program_and_get_last_line_of_output("mindi --findkernel 2> /dev/null");
     276    kernel = call_program_and_get_last_line_of_output("mindi --findkernel 2> /dev/null",TRUE);
    277277   
    278278    // If we didn't get anything back, check whether mindi raised a fatal error
    279279    if (!kernel[0]) {
    280280        mr_asprintf(command, "%s", "grep 'Fatal error' /var/log/mindi.log");
    281         tmp = call_program_and_get_last_line_of_output(command);
     281        tmp = call_program_and_get_last_line_of_output(command,TRUE);
    282282        if (strlen(tmp) > 1) {
    283283            popup_and_OK(tmp);
     
    331331    assert_string_is_neither_NULL_nor_zerolength(fname);
    332332    mr_asprintf(command, "which %s 2> /dev/null", fname);
    333     output = call_program_and_get_last_line_of_output(command);
     333    output = call_program_and_get_last_line_of_output(command,TRUE);
    334334    mr_free(command);
    335335    if (output[0] == '\0') {
     
    340340        mr_asprintf(command, "file %s 2> /dev/null | cut -d':' -f1 2> /dev/null", output);
    341341        mr_free(output);
    342         output = call_program_and_get_last_line_of_output(command);
     342        output = call_program_and_get_last_line_of_output(command,TRUE);
    343343        mr_free(command);
    344344    }
     
    346346        mr_asprintf(command, "dirname %s 2> /dev/null", output);
    347347        mr_free(output);
    348         output = call_program_and_get_last_line_of_output(command);
     348        output = call_program_and_get_last_line_of_output(command,TRUE);
    349349        mr_free(command);
    350350    }
     
    429429    if (i < 0) {
    430430        mr_asprintf(command, "tail -n3 %s | grep -Fi %% | tail -n1 | awk '{print $0;}'", filename);
    431         lastline = call_program_and_get_last_line_of_output(command);
     431        lastline = call_program_and_get_last_line_of_output(command,FALSE);
    432432        mr_free(command);
    433433        if (!lastline[0]) {
     
    722722
    723723    log_it(command);
    724     sz_res = call_program_and_get_last_line_of_output(command);
     724    sz_res = call_program_and_get_last_line_of_output(command,TRUE);
    725725    file_len_K = atol(sz_res);
    726726    log_msg(4, "%s --> %s --> %ld", command, sz_res, file_len_K);
     
    779779                    mr_asprintf(command, "ntfsresize --force --info %s|grep '^You might resize at '|cut -d' ' -f5", fname);
    780780                    log_it("command = %s", command);
    781                     tmp = call_program_and_get_last_line_of_output(command);
     781                    tmp = call_program_and_get_last_line_of_output(command,TRUE);
    782782                    mr_free(command);
    783783
     
    10221022    }
    10231023
    1024     tmp = call_program_and_get_last_line_of_output("which mondorestore");
     1024    tmp = call_program_and_get_last_line_of_output("which mondorestore",TRUE);
    10251025    if (!tmp[0]) {
    10261026        mr_free(tmp);
     
    10931093    /* BERLIOS : there is a bug #67 here as it only considers the first NIC */
    10941094    mr_asprintf(command, "ifconfig | tr '\n' '#' | sed s/##// | tr '#' ' ' | tr '' '\n' | head -n1 | cut -d' ' -f1");
    1095     netfs_dev = call_program_and_get_last_line_of_output(command);
     1095    netfs_dev = call_program_and_get_last_line_of_output(command,TRUE);
    10961096    mr_free(command);
    10971097
    10981098    mr_asprintf(command, "%s", "ifconfig | tr '\n' '#' | sed s/##// | tr '#' ' ' | tr '' '\\n' | head -n1 | tr -s '\t' ' ' | cut -d' ' -f7 | cut -d':' -f2");
    1099     netfs_client_ipaddr = call_program_and_get_last_line_of_output(command);
     1099    netfs_client_ipaddr = call_program_and_get_last_line_of_output(command,TRUE);
    11001100    mr_free(command);
    11011101
    11021102    mr_asprintf(command, "%s", "ifconfig | tr '\n' '#' | sed s/##// | tr '#' ' ' | tr '' '\\n' | head -n1 | tr -s '\t' ' ' | cut -d' ' -f9 | cut -d':' -f2");
    1103     netfs_client_netmask = call_program_and_get_last_line_of_output(command);
     1103    netfs_client_netmask = call_program_and_get_last_line_of_output(command,TRUE);
    11041104    mr_free(command);
    11051105
    11061106    mr_asprintf(command, "%s", "ifconfig | tr '\n' '#' | sed s/##// | tr '#' ' ' | tr '' '\\n' | head -n1 | tr -s '\t' ' ' | cut -d' ' -f8 | cut -d':' -f2");
    1107     netfs_client_broadcast = call_program_and_get_last_line_of_output(command);
     1107    netfs_client_broadcast = call_program_and_get_last_line_of_output(command,TRUE);
    11081108    mr_free(command);
    11091109
    11101110    mr_asprintf(command, "%s", "route -n | grep '^0.0.0.0' | awk '{print $2}'");
    1111     netfs_client_defgw = call_program_and_get_last_line_of_output(command);
     1111    netfs_client_defgw = call_program_and_get_last_line_of_output(command,TRUE);
    11121112    mr_free(command);
    11131113
     
    11281128        log_to_screen("Found bonding device %s; looking for corresponding ethN slave device\n", netfs_dev);
    11291129        mr_asprintf(command, "%s", "ifconfig %s | awk '{print $5}' | head -n1", netfs_dev);
    1130         mac_addr = call_program_and_get_last_line_of_output(command);
     1130        mac_addr = call_program_and_get_last_line_of_output(command,TRUE);
    11311131        mr_free(command);
    11321132
     
    11351135        mr_free(netfs_dev);
    11361136
    1137         netfs_dev = call_program_and_get_last_line_of_output(command);
     1137        netfs_dev = call_program_and_get_last_line_of_output(command,TRUE);
    11381138        mr_free(command);
    11391139
  • branches/2.2.10/mondo/src/common/libmondo-fork-EXT.h

    r2339 r2704  
    11/* libmondo-fork-EXT.h */
    22
    3 extern char *call_program_and_get_last_line_of_output(char *call);
     3extern char *call_program_and_get_last_line_of_output(char *call, bool logit);
    44extern int run_program_and_log_to_screen(char *basic_call,
    55                                         char *what_i_am_doing);
  • branches/2.2.10/mondo/src/common/libmondo-fork.c

    r2696 r2704  
    3535 * @note The returned value points to an allocated string that the caller needs to free
    3636 */
    37 char *call_program_and_get_last_line_of_output(char *call)
     37char *call_program_and_get_last_line_of_output(char *call, bool logit)
    3838{
    3939    /*@ buffers ***************************************************** */
     
    5252    mr_asprintf(tmpf, "%s/cpgll.out", bkpinfo->tmpdir);
    5353    mr_asprintf(newcall, "%s > %s", call, tmpf);
    54     log_msg(4, "Calling command: %s", newcall);
     54    if (logit) {
     55        log_msg(4, "Calling command: %s", newcall);
     56    }
    5557    /* By default return an empty string in any case */
    5658    mr_asprintf(result, "");
     
    7375            mr_free(tmp);
    7476        }
    75         log_msg(9, "Pre-Result: %s", result);
     77        if (logit) {
     78            log_msg(9, "Pre-Result: %s", result);
     79        }
    7680        mr_strip_spaces(result);
    7781        paranoid_pclose(fin);
     
    8084    }
    8185    mr_free(tmpf);
    82     log_msg(4, "Result: %s", result);
     86    if (logit) {
     87        log_msg(4, "Result: %s", result);
     88    }
    8389    return(result);
    8490}
  • branches/2.2.10/mondo/src/common/libmondo-fork.h

    r2339 r2704  
    55
    66
    7 char *call_program_and_get_last_line_of_output(char *call);
     7char *call_program_and_get_last_line_of_output(char *call, bool logit);
    88int run_program_and_log_to_screen(char *basic_call, char *what_i_am_doing);
    99int run_program_and_log_output(char *program, int);
  • branches/2.2.10/mondo/src/common/libmondo-stream.c

    r2462 r2704  
    265265
    266266    mr_asprintf(command, "%s -scanbus 2> /dev/null | grep -i tape | wc -l", cdr_exe);
    267     tmp = call_program_and_get_last_line_of_output(command);
     267    tmp = call_program_and_get_last_line_of_output(command,TRUE);
    268268    mr_free(command);
    269269
     
    277277
    278278    mr_asprintf(command, "%s -scanbus 2> /dev/null | tr -s '\t' ' ' | grep \"[0-9]*,[0-9]*,[0-9]*\" | grep -v \"[0-9]*) \\*\" | grep -i TAPE | cut -d' ' -f2 | head -n1", cdr_exe);
    279     tmp = call_program_and_get_last_line_of_output(command);
     279    tmp = call_program_and_get_last_line_of_output(command,TRUE);
    280280    mr_free(command);
    281281
     
    289289    mr_asprintf(command, "%s -scanbus 2> /dev/null | tr -s '\t' ' ' | grep \"[0-9]*,[0-9]*,[0-9]*\" | grep -v \"[0-9]*) \\*\" | grep -i TAPE | cut -d' ' -f3 | cut -d')' -f1 | head -n1", cdr_exe);
    290290    mr_free(cdr_exe);
    291     tmp = call_program_and_get_last_line_of_output(command);
     291    tmp = call_program_and_get_last_line_of_output(command,TRUE);
    292292    mr_free(command);
    293293
     
    324324    }
    325325
    326     tmp = call_program_and_get_last_line_of_output(" cdrecord -scanbus 2> /dev/null | tr -s '\t' ' ' |  grep \"[0-9]*,[0-9]*,[0-9]*\" | grep -v \"[0-9]*) \\*\" | grep -i TAPE |  awk '{for(i=1; i<NF; i++) { if (index($i, \"GB\")>0) { print $i;};};};'");
     326    tmp = call_program_and_get_last_line_of_output(" cdrecord -scanbus 2> /dev/null | tr -s '\t' ' ' |  grep \"[0-9]*,[0-9]*,[0-9]*\" | grep -v \"[0-9]*) \\*\" | grep -i TAPE |  awk '{for(i=1; i<NF; i++) { if (index($i, \"GB\")>0) { print $i;};};};'",TRUE);
    327327
    328328    if (mt_says_tape_exists(dev)) {
  • branches/2.2.10/mondo/src/common/libmondo-tools.c

    r2696 r2704  
    225225    d = 5.2;                    // :-)
    226226#else
    227     tmp = call_program_and_get_last_line_of_output("uname -r");
     227    tmp = call_program_and_get_last_line_of_output("uname -r",TRUE);
    228228    p = strchr(tmp, '.');
    229229    if (p) {
     
    476476        if (getenv ("SUDO_COMMAND")) {
    477477            mr_asprintf(command, "strings `which growisofs` | grep -c SUDO_COMMAND");
    478             tmp = call_program_and_get_last_line_of_output(command);
     478            tmp = call_program_and_get_last_line_of_output(command,TRUE);
    479479            if (!strcmp(tmp, "1")) {
    480480                mr_free(command);
     
    575575        mr_asprintf(command, "df -P %s | tail -n1 | cut -d' ' -f1", bkpinfo->isodir);
    576576        log_it("command = %s", command);
    577         iso_dev = call_program_and_get_last_line_of_output(command);
     577        iso_dev = call_program_and_get_last_line_of_output(command,TRUE);
    578578        log_it("res of it = %s", iso_dev);
    579579        mr_free(command);
     
    583583
    584584        log_it("command = %s", command);
    585         iso_mnt = call_program_and_get_last_line_of_output(command);
     585        iso_mnt = call_program_and_get_last_line_of_output(command,TRUE);
    586586        log_it("res of it = %s", iso_mnt);
    587587        mr_free(command);
     
    858858
    859859    mr_asprintf(command, "df -m -P %s | tail -n1 | tr -s ' ' '\t' | cut -f4", partition);
    860     out_sz = call_program_and_get_last_line_of_output(command);
     860    out_sz = call_program_and_get_last_line_of_output(command,TRUE);
    861861    mr_free(command);
    862862
     
    900900        run_program_and_log_output("ln -sf `which mkfs.msdos` /sbin/mkfs.vfat", FALSE);
    901901    }
    902     tmp = call_program_and_get_last_line_of_output("free | grep Mem | head -n1 | tr -s ' ' '\t' | cut -f2");
     902    tmp = call_program_and_get_last_line_of_output("free | grep Mem | head -n1 | tr -s ' ' '\t' | cut -f2",TRUE);
    903903    if (atol(tmp) < 35000) {
    904904        retval++;
     
    961961
    962962    run_program_and_log_output("umount `mount | grep cdr | cut -d' ' -f3 | tr '\n' ' '`", 5);
    963     tmp = call_program_and_get_last_line_of_output("mount | grep -E \"cdr(om|w)\"");
     963    tmp = call_program_and_get_last_line_of_output("mount | grep -E \"cdr(om|w)\"",TRUE);
    964964    if (strcmp("", tmp)) {
    965965        if (strstr(tmp, "autofs")) {
     
    10461046    } else {
    10471047        mr_asprintf(command, "grep '%s .*' %s| cut -d' ' -f2,3,4,5", label, config_file);
    1048         value = call_program_and_get_last_line_of_output(command);
     1048        value = call_program_and_get_last_line_of_output(command,TRUE);
    10491049        mr_free(command);
    10501050
     
    11751175    mr_asprintf(command, "%s", "grep -v \":\" /etc/fstab | grep -vE '^#.*$' | grep -E \"[   ]/boot[     ]\" | tr -s ' ' '\t' | cut -f1 | head -n1");
    11761176    log_msg(4, "Cool. Command = '%s'", command);
    1177     tmp = call_program_and_get_last_line_of_output(command);
     1177    tmp = call_program_and_get_last_line_of_output(command,TRUE);
    11781178    mr_free(command);
    11791179
     
    11821182    mr_asprintf(command, "mount | grep -Ew '/boot'");
    11831183    mr_free(tmp);
    1184     tmp = call_program_and_get_last_line_of_output(command);
     1184    tmp = call_program_and_get_last_line_of_output(command,TRUE);
    11851185    mr_free(command);
    11861186
     
    13811381    char *tmp = NULL;
    13821382
    1383     tmp = call_program_and_get_last_line_of_output("ps ax | grep -w magicdev | grep -v grep | tr -s '\t' ' '| cut -d' ' -f6-99");
     1383    tmp = call_program_and_get_last_line_of_output("ps ax | grep -w magicdev | grep -v grep | tr -s '\t' ' '| cut -d' ' -f6-99",TRUE);
    13841384
    13851385    strcpy(g_magicdev_command, tmp);
  • branches/2.2.10/mondo/src/mondorestore/mondo-prep.c

    r2623 r2704  
    213213#endif
    214214
    215     tmp = call_program_and_get_last_line_of_output("cat "CMDLINE);
     215    tmp = call_program_and_get_last_line_of_output("cat "CMDLINE,TRUE);
    216216    if (strstr(tmp, "nolvm")) {
    217217        mr_free(tmp);
     
    336336            if (lvmversion == 2) {
    337337                mr_asprintf(tmp1, "tail -n5 %s | grep Insufficient | tail -n1", MONDO_LOGFILE);
    338                 tmp = call_program_and_get_last_line_of_output(tmp1);
     338                tmp = call_program_and_get_last_line_of_output(tmp1,TRUE);
    339339                mr_free(tmp1);
    340340            } else {
    341341                mr_asprintf(tmp1, "tail -n5 %s | grep lvcreate | tail -n1", MONDO_LOGFILE);
    342                 tmp = call_program_and_get_last_line_of_output(tmp1);
     342                tmp = call_program_and_get_last_line_of_output(tmp1,TRUE);
    343343                mr_free(tmp1);
    344344            }
     
    15791579    if (pout_to_fdisk) {
    15801580        // mark relevant partition as bootable
    1581         tmp1 = call_program_and_get_last_line_of_output ("make-me-bootable "MINDI_CACHE"/mountlist.txt dummy");
     1581        tmp1 = call_program_and_get_last_line_of_output ("make-me-bootable "MINDI_CACHE"/mountlist.txt dummy",TRUE);
    15821582        mr_asprintf(tmp, "a\n%s\n", tmp1);
    15831583        mr_free(tmp1);
  • branches/2.2.10/mondo/src/mondorestore/mondo-rstr-compare.c

    r2623 r2704  
    631631  /** needs malloc **/
    632632    char *dir;
    633     char *command = NULL;
    634633
    635634    assert(bkpinfo != NULL);
     
    683682    int res;
    684683    char *dir;
    685     char *command = NULL;
    686684
    687685    assert(bkpinfo != NULL);
  • branches/2.2.10/mondo/src/mondorestore/mondo-rstr-tools.c

    r2696 r2704  
    719719        mr_free(value);
    720720   
    721         tmp = call_program_and_get_last_line_of_output("cat " CMDLINE);
     721        tmp = call_program_and_get_last_line_of_output("cat " CMDLINE,TRUE);
    722722        if (strstr(tmp, "pxe")) {
    723723            /* We need to override prefix value in PXE mode as it's
     
    904904
    905905tmp = read_cfg_var(MINDI_CACHE"/mondorestore.cfg", "please-dont-eject");
    906 tmp1 = call_program_and_get_last_line_of_output("cat " CMDLINE);
     906tmp1 = call_program_and_get_last_line_of_output("cat " CMDLINE,TRUE);
    907907if (tmp || strstr(tmp1, "donteject")) {
    908908    bkpinfo->please_dont_eject = TRUE;
     
    938938        }
    939939    }
    940     tmp1 = call_program_and_get_last_line_of_output("cat " CMDLINE);
     940    tmp1 = call_program_and_get_last_line_of_output("cat " CMDLINE,TRUE);
    941941    if (strstr(tmp1, "pxe")) {
    942942        mr_free(tmp1);
     
    997997            mr_asprintf(command, "mount | grep -E '^%s' | tail -n1 | cut -d' ' -f3", g_isodir_device);
    998998            log_it("command = %s", command);
    999             iso_mnt = call_program_and_get_last_line_of_output(command);
     999            iso_mnt = call_program_and_get_last_line_of_output(command,TRUE);
    10001000            log_it("res of it = %s", iso_mnt);
    10011001            mr_free(command);
  • branches/2.2.10/mondo/src/mondorestore/mondorestore.c

    r2696 r2704  
    448448    log_it("Done loading config file; resizing ML");
    449449
    450     tmp1 = call_program_and_get_last_line_of_output("cat " CMDLINE);
     450    tmp1 = call_program_and_get_last_line_of_output("cat " CMDLINE,TRUE);
    451451    if (strstr(tmp1, "noresize")) {
    452452        log_msg(1, "Not resizing mountlist.");
     
    742742    load_mountlist(mountlist, MINDI_CACHE"/mountlist.txt"); // in case read_cfg_file_into_bkpinfo updated the mountlist
    743743
    744     tmp = call_program_and_get_last_line_of_output("cat " CMDLINE);
     744    tmp = call_program_and_get_last_line_of_output("cat " CMDLINE,TRUE);
    745745    if (strstr(tmp, "noresize")) {
    746746        log_msg(2, "Not resizing mountlist.");
     
    777777            twenty_seconds_til_yikes();
    778778            g_fprep = fopen("/tmp/prep.sh", "w");
    779             tmp = call_program_and_get_last_line_of_output("cat " CMDLINE);
     779            tmp = call_program_and_get_last_line_of_output("cat " CMDLINE,TRUE);
    780780            if (strstr(tmp, "nopart")) {
    781781                log_msg(2, "Not partitioning drives due to 'nopart' option.");
     
    850850
    851851  after_the_nuke:
    852     tmp1 = call_program_and_get_last_line_of_output("cat " CMDLINE);
     852    tmp1 = call_program_and_get_last_line_of_output("cat " CMDLINE,TRUE);
    853853    if (retval) {
    854854        log_to_screen("Errors occurred during the nuke phase.");
     
    25892589    /* Configure global variables */
    25902590    malloc_libmondo_global_strings();
    2591     tmp1 = call_program_and_get_last_line_of_output("cat " CMDLINE);
     2591    tmp1 = call_program_and_get_last_line_of_output("cat " CMDLINE,TRUE);
    25922592    if (strstr(tmp1, "textonly")) {
    25932593        g_text_mode = TRUE;
     
    26012601    setup_newt_stuff();         /* call newtInit and setup screen log */
    26022602
    2603     tmp1 = call_program_and_get_last_line_of_output("which mondorestore");
     2603    tmp1 = call_program_and_get_last_line_of_output("which mondorestore",TRUE);
    26042604    strcpy(g_mondo_home, tmp1);
    26052605    mr_free(tmp1);
  • branches/2.2.10/mondo/src/mondorestore/mr-externs.h

    r2623 r2704  
    1818extern int closein_tape();
    1919extern void close_evalcall_form(void);
    20 extern char *call_program_and_get_last_line_of_output(char *);
     20extern char *call_program_and_get_last_line_of_output(char *,bool);
    2121extern void close_progress_form(void);
    2222extern long count_lines_in_file(char *);
Note: See TracChangeset for help on using the changeset viewer.