Changeset 2296 in MondoRescue for branches/2.2.10/mondo/src/common/libmondo-devices.c
- Timestamp:
- Jul 23, 2009, 2:53:30 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.10/mondo/src/common/libmondo-devices.c
r2291 r2296 257 257 mr_asprintf(&command, "cdcontrol -f %s close", dev); 258 258 } else { 259 mr_asprintf(&command, "camcontrol load `echo %s | sed 's|/dev/||'`", 260 dev); 259 mr_asprintf(&command, "camcontrol load `echo %s | sed 's|/dev/||'`", dev); 261 260 } 262 261 #else … … 343 342 #ifdef __FreeBSD__ 344 343 // We assume here that this is running from mondorestore. (It is.) 345 mr_asprintf(&program, "ls %s %s >/dev/null 2>&1", drive, 346 build_partition_name(tmp, drive, partno)); 344 mr_asprintf(&program, "ls %s %s >/dev/null 2>&1", drive, build_partition_name(tmp, drive, partno)); 347 345 res = system(program); 348 346 mr_free(program); … … 399 397 assert_string_is_neither_NULL_nor_zerolength(str); 400 398 401 mr_asprintf(&command, 402 "dd if=%s bs=446 count=1 2> /dev/null | strings | grep \"%s\" > /dev/null 2> /dev/null", 403 dev, str); 399 mr_asprintf(&command, "dd if=%s bs=446 count=1 2> /dev/null | strings | grep \"%s\" > /dev/null 2> /dev/null", dev, str); 404 400 i = system(command); 405 401 mr_free(command); … … 425 421 int i; 426 422 427 mr_asprintf(&command, 428 "dd if=%s bs=512 count=%i 2> /dev/null | strings | grep \"%s\" > /dev/null 2> /dev/null", 429 dev, n, str); 423 mr_asprintf(&command, "dd if=%s bs=512 count=%i 2> /dev/null | strings | grep \"%s\" > /dev/null 2> /dev/null", dev, n, str); 430 424 i = system(command); 431 425 mr_free(command); … … 530 524 } 531 525 if (find_home_of_exe(cdr_exe)) { 532 mr_asprintf(&command, 533 "%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", 534 cdr_exe); 526 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); 535 527 mr_asprintf(&tmp, "%s", call_program_and_get_last_line_of_output(command)); 536 528 mr_free(command); … … 848 840 } 849 841 850 mr_asprintf(&command, 851 "%s -scanbus | grep \"[0-9],[0-9],[0-9]\" | grep \"[D|C][V|D]\" | grep -n \"\" | grep \"%s\" | cut -d':' -f2", 852 cdr_exe, g_cdrw_drive_is_here); 842 mr_asprintf(&command, "%s -scanbus | grep \"[0-9],[0-9],[0-9]\" | grep \"[D|C][V|D]\" | grep -n \"\" | grep \"%s\" | cut -d':' -f2", cdr_exe, g_cdrw_drive_is_here); 853 843 log_msg(1, "command=%s", command); 854 844 mr_asprintf(&tmp1, "%s", call_program_and_get_last_line_of_output(command)); … … 1042 1032 1043 1033 #ifdef __FreeBSD__ 1044 mr_asprintf(&command, 1045 "lsvfs | tr -s '\t' ' ' | grep -v Filesys | grep -v -- -- | cut -d' ' -f1 | tr -s '\n' ' '"); 1034 mr_asprintf(&command, "lsvfs | tr -s '\t' ' ' | grep -v Filesys | grep -v -- -- | cut -d' ' -f1 | tr -s '\n' ' '"); 1046 1035 #else 1047 mr_asprintf(&command, 1048 "grep -v nodev /proc/filesystems | tr -s '\t' ' ' | cut -d' ' -f2 | tr -s '\n' ' '"); 1036 mr_asprintf(&command, "grep -v nodev /proc/filesystems | tr -s '\t' ' ' | cut -d' ' -f2 | tr -s '\n' ' '"); 1049 1037 #endif 1050 1038 … … 1243 1231 1244 1232 #ifdef __FreeBSD__ 1245 mr_asprintf(&command, "mount_vfat %s %s 2>> %s", 1246 device, mountpoint, MONDO_LOGFILE); 1233 mr_asprintf(&command, "mount_vfat %s %s 2>> %s", device, mountpoint, MONDO_LOGFILE); 1247 1234 1248 1235 #else 1249 mr_asprintf(&command, "mount %s -t vfat %s 2>> %s", 1250 device, mountpoint, MONDO_LOGFILE); 1236 mr_asprintf(&command, "mount %s -t vfat %s 2>> %s", device, mountpoint, MONDO_LOGFILE); 1251 1237 #endif 1252 1238 … … 1382 1368 mr_free(tmp); 1383 1369 1384 mr_asprintf(&tmp, "%s/%s/%s-%d.iso", bkpinfo->isodir, 1385 bkpinfo->nfs_remote_dir, bkpinfo->prefix, 1386 cd_number_i_want); 1370 mr_asprintf(&tmp, "%s/%s/%s-%d.iso", bkpinfo->isodir, bkpinfo->nfs_remote_dir, bkpinfo->prefix, cd_number_i_want); 1387 1371 if (!does_file_exist(tmp)) { 1388 1372 mr_free(tmp); 1389 mr_asprintf(&tmp, "%s/isodir/%s/%s-%d.iso", bkpinfo->tmpdir, 1390 bkpinfo->nfs_remote_dir, bkpinfo->prefix, 1391 cd_number_i_want); 1373 mr_asprintf(&tmp, "%s/isodir/%s/%s-%d.iso", bkpinfo->tmpdir, bkpinfo->nfs_remote_dir, bkpinfo->prefix, cd_number_i_want); 1392 1374 if (does_file_exist(tmp)) { 1393 1375 log_msg(1, … … 1550 1532 mr_free(tmp); 1551 1533 1552 mr_asprintf(&comment, 1553 "How much data (in Megabytes) will each %s store?", mds); 1534 mr_asprintf(&comment, "How much data (in Megabytes) will each %s store?", mds); 1554 1535 mr_free(mds); 1555 1536 if (!popup_and_get_string("Size", comment, sz_size, 5)) { … … 1588 1569 log_msg(1, "bkpinfo->media_device = %s", 1589 1570 bkpinfo->media_device); 1590 mr_asprintf(&comment, 1591 "Please specify your %s drive's /dev entry", mds); 1571 mr_asprintf(&comment, "Please specify your %s drive's /dev entry", mds); 1592 1572 if (!popup_and_get_string 1593 1573 ("Device?", comment, bkpinfo->media_device, … … 1761 1741 1762 1742 if (!bkpinfo->restore_data) { 1763 mr_asprintf(&comment, 1764 "How much data (in Megabytes) will each media store?"); 1743 mr_asprintf(&comment, "How much data (in Megabytes) will each media store?"); 1765 1744 if (!popup_and_get_string("Size", comment, sz_size, 5)) { 1766 1745 mr_free(comment);
Note:
See TracChangeset
for help on using the changeset viewer.