Changeset 196 in MondoRescue for branches/2.05/mondo/mondo


Ignore:
Timestamp:
Dec 14, 2005, 12:04:21 AM (18 years ago)
Author:
bcornec
Message:

Usage of parted2fdisk instead of fdisk everywhere.
on ia64 this is mandatory, and simplifies the infrastructure
on other archs, it doesn't change anything as parted2fdisk here is a link to fdisk

Location:
branches/2.05/mondo/mondo
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/2.05/mondo/mondo/common/libmondo-devices.c

    r161 r196  
    27482748
    27492749    sprintf(list_drives_cmd,
    2750             // "parted2fdisk
    2751             "fdisk -l 2>/dev/null | grep \"/dev/.*:\" | tr -s ':' ' ' | tr -s ' ' '\n' | grep /dev/; echo %s",
     2750            "parted2fdisk -l 2>/dev/null | grep \"/dev/.*:\" | tr -s ':' ' ' | tr -s ' ' '\n' | grep /dev/; echo %s",
    27522751            where_is_root_mounted());
    27532752    log_it("list_drives_cmd = %s", list_drives_cmd);
     
    29042903    malloc_string(fdisk);
    29052904    log_msg(0, "Looking for partition table format type");
    2906 // BERLIOS: Do that temporarily: we need to put back parted2fdisk everywhere
    2907 #ifdef __IA64__
    2908     sprintf(fdisk, "/usr/local/bin/fdisk");
    2909     if (stat(fdisk, &buf) != 0) {
    2910 #endif
    2911         sprintf(fdisk, "/sbin/fdisk");
    2912 #ifdef __IA64__
    2913     }
    2914 #endif
     2905    sprintf(fdisk, "/sbin/parted2fdisk");
    29152906    log_msg(1, "Using %s", fdisk);
    29162907    sprintf(command, "%s -l %s | grep 'EFI GPT'", fdisk, drive);
  • branches/2.05/mondo/mondo/common/libmondo-files.c

    r192 r196  
    11891189    char nfs_client_ipaddr[MAX_STR_LEN];
    11901190    char nfs_client_netmask[MAX_STR_LEN];
     1191    char nfs_client_broadcast[MAX_STR_LEN];
    11911192    char nfs_client_defgw[MAX_STR_LEN];
    11921193    char nfs_server_ipaddr[MAX_STR_LEN];
     
    12221223           call_program_and_get_last_line_of_output(command));
    12231224    sprintf(command,
     1225            "ifconfig | tr '\n' '#' | sed s/##// | tr '#' ' ' | tr '' '\\n' | head -n1 | tr -s '\t' ' ' | cut -d' ' -f8 | cut -d':' -f2");
     1226    strcpy(nfs_client_broadcast,
     1227           call_program_and_get_last_line_of_output(command));
     1228    sprintf(command,
    12241229            "route -n | grep '^0.0.0.0' | awk '{printf $2}'");
    12251230    strcpy(nfs_client_defgw,
     
    12391244    }
    12401245    fprintf(fout, "ifconfig lo 127.0.0.1  # config loopback\n");
    1241     fprintf(fout, "ifconfig %s %s netmask %s    # config client\n", nfs_dev,
    1242             nfs_client_ipaddr, nfs_client_netmask);
     1246    fprintf(fout, "ifconfig %s %s netmask %s broadcast %s   # config client\n", nfs_dev,
     1247            nfs_client_ipaddr, nfs_client_netmask, nfs_client_broadcast);
    12431248    fprintf(fout, "route add default gw %s  # default route\n", nfs_client_defgw);
    12441249    fprintf(fout, "ping -c 1 %s # ping server\n", nfs_server_ipaddr);
     
    12621267    sprintf(tmp, "%s/NFS-CLIENT-NETMASK", bkpinfo->tmpdir);
    12631268    write_one_liner_data_file(tmp, nfs_client_netmask);
     1269    sprintf(tmp, "%s/NFS-CLIENT-BROADCAST", bkpinfo->tmpdir);
     1270    write_one_liner_data_file(tmp, nfs_client_broadcast);
    12641271    sprintf(tmp, "%s/NFS-CLIENT-DEFGW", bkpinfo->tmpdir);
    12651272    write_one_liner_data_file(tmp, nfs_client_defgw);
  • branches/2.05/mondo/mondo/common/libmondo-tools.c

    r182 r196  
    12201220    }
    12211221
    1222     if (!run_program_and_log_output("fdisk -l | grep -i raid", 1)
     1222    if (!run_program_and_log_output("parted2fdisk -l | grep -i raid", 1)
    12231223        && !does_file_exist("/etc/raidtab")) {
    12241224        log_to_screen
  • branches/2.05/mondo/mondo/mondorestore/mondo-prep.c

    r128 r196  
    15251525#else
    15261526    make_hole_for_file(FDISK_LOG);
    1527 #ifdef __IA64__
    1528     sprintf(tmp, "parted2fdisk %s >> %s 2>> %s", drivename, FDISK_LOG,
    1529             FDISK_LOG);
    1530 #else
    1531     sprintf(tmp, "fdisk %s >> %s 2>> %s", drivename, FDISK_LOG, FDISK_LOG);
    1532 #endif
     1527    sprintf(tmp, "parted2fdisk %s >> %s 2>> %s", drivename, FDISK_LOG, FDISK_LOG);
    15331528    pout_to_fdisk = popen(tmp, "w");
    15341529    if (!pout_to_fdisk) {
    1535         log_to_screen("Cannot call fdisk to configure %s", drivename);
     1530        log_to_screen("Cannot call parted2fdisk to configure %s", drivename);
    15361531        paranoid_free(device_str);
    15371532        paranoid_free(format);
  • branches/2.05/mondo/mondo/restore-scripts/mondo/grub-MR

    r139 r196  
    166166    line=`cat /proc/mdstat | grep $base | head -n1`
    167167    echo "mbrpart was $mbrpart"
    168     mbrpart=`fdisk -l | grep /dev/ | head -n1 | tr ':' ' ' \
     168    mbrpart=`parted2fdisk -l | grep /dev/ | head -n1 | tr ':' ' ' \
    169169| cut -d' ' -f2`
    170170    echo "mbrpart is $mbrpart"
  • branches/2.05/mondo/mondo/restore-scripts/mondo/make-me-bootable

    r30 r196  
    3131            boot_drv=$drive
    3232            boot_part=$partno
    33 #       if [ "$mountpt" = "/" ] || [ "$mountpt" = "/boot" ] || [ "$format" = "vfat" ] ; then
    34 #           LogIt "Making $i bootable (drive=$drive, partno=$partno)"
    35 #           echo -e -n "a\n$partno\nw\n" | fdisk $drive >> $LOGFILE 2>> $LOGFILE
    36 #            HAVE_ACTIVE="true"
    3733        fi
    3834    fi
Note: See TracChangeset for help on using the changeset viewer.