Changeset 541 in MondoRescue for branches/stable/mondo/mondo/common/libmondo-devices.c
- Timestamp:
- May 13, 2006, 8:47:23 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mondo/mondo/common/libmondo-devices.c
r501 r541 232 232 #include "libmondo-files-EXT.h" 233 233 #include "libmondo-devices.h" 234 #include "lib-common-externs.h" 234 235 #include "libmondo-string-EXT.h" 235 236 #include "libmondo-tools-EXT.h" 236 #include " newt-specific-EXT.h"237 #include "libmondo-gui-EXT.h" 237 238 #include "libmondo-fork-EXT.h" 238 239 #include "libmondo-stream-EXT.h" … … 351 352 && !does_file_exist("/tmp/mountlist.txt.sample")) { 352 353 log_to_screen 353 ( _("Using /dev/root is stupid of you but I'll forgive you."));354 ("Using /dev/root is stupid of you but I'll forgive you."); 354 355 is_this_a_ramdisk = FALSE; 355 356 } … … 379 380 switch (bt) { 380 381 case none: 381 strcpy(output, _("none"));382 strcpy(output, "none"); 382 383 break; 383 384 case iso: 384 strcpy(output, _("iso"));385 strcpy(output, "iso"); 385 386 break; 386 387 case cdr: 387 strcpy(output, _("cdr"));388 strcpy(output, "cdr"); 388 389 break; 389 390 case cdrw: 390 strcpy(output, _("cdrw"));391 strcpy(output, "cdrw"); 391 392 break; 392 393 case cdstream: 393 strcpy(output, _("cdstream"));394 strcpy(output, "cdstream"); 394 395 break; 395 396 case nfs: 396 strcpy(output, _("nfs"));397 strcpy(output, "nfs"); 397 398 break; 398 399 case tape: 399 strcpy(output, _("tape"));400 strcpy(output, "tape"); 400 401 break; 401 402 case udev: 402 strcpy(output, _("udev"));403 strcpy(output, "udev"); 403 404 break; 404 405 default: 405 strcpy(output, _("default"));406 strcpy(output, "default"); 406 407 } 407 408 return (output); … … 694 695 if (!dev[0] || (res = mount_CDROM_here(dev, mountpoint))) { 695 696 if (!popup_and_get_string 696 ( _("CD-ROM device"), _("Please enter your CD-ROM's /dev device"),697 ("CD-ROM device", "Please enter your CD-ROM's /dev device", 697 698 dev, MAX_STR_LEN / 4)) { 698 699 res = 1; … … 702 703 } 703 704 if (res) { 704 log_msg(1, _("mount failed"));705 log_msg(1, "mount failed"); 705 706 } else { 706 log_msg(1, _("mount succeeded with %s"), dev);707 log_msg(1, "mount succeeded with %s", dev); 707 708 } 708 709 paranoid_free(dev); … … 1771 1772 } 1772 1773 if (res) { 1773 log_to_screen( _("WARNING - failed to unmount CD-ROM drive"));1774 log_to_screen("WARNING - failed to unmount CD-ROM drive"); 1774 1775 } 1775 1776 if (!bkpinfo->please_dont_eject) { … … 1779 1780 } 1780 1781 if (res) { 1781 log_to_screen( _("WARNING - failed to eject CD-ROM disk"));1782 log_to_screen("WARNING - failed to eject CD-ROM disk"); 1782 1783 } 1783 1784 popup_and_OK(request); … … 1840 1841 which_backup_media_type(bkpinfo->restore_data); 1841 1842 if (bkpinfo->backup_media_type == none) { 1842 log_to_screen( _("User has chosen not to backup the PC"));1843 log_to_screen("User has chosen not to backup the PC"); 1843 1844 finish(1); 1844 1845 } 1845 1846 if (bkpinfo->backup_media_type == tape && bkpinfo->restore_data) { 1846 popup_and_OK( _("Please remove CD/floppy from drive(s)"));1847 popup_and_OK("Please remove CD/floppy from drive(s)"); 1847 1848 } 1848 1849 log_msg(3, "media type = %s", … … 1879 1880 if (archiving_to_media) { 1880 1881 if (ask_me_yes_or_no 1881 ( _("Is your computer a laptop, or does the CD writer incorporate BurnProof technology?")))1882 ("Is your computer a laptop, or does the CD writer incorporate BurnProof technology?")) 1882 1883 { 1883 1884 bkpinfo->manual_cd_tray = TRUE; … … 1885 1886 if ((bkpinfo->compression_level = 1886 1887 which_compression_level()) == -1) { 1887 log_to_screen( _("User has chosen not to backup the PC"));1888 log_to_screen("User has chosen not to backup the PC"); 1888 1889 finish(1); 1889 1890 } 1890 sprintf(comment, _("What speed is your %s (re)writer?"),1891 sprintf(comment, "What speed is your %s (re)writer?", 1891 1892 media_descriptor_string(bkpinfo->backup_media_type)); 1892 1893 if (bkpinfo->backup_media_type == dvd) { … … 1902 1903 } 1903 1904 if (bkpinfo->backup_media_type != dvd) { 1904 if (!popup_and_get_string( _("Speed"), comment, tmp, 4)) {1905 log_to_screen( _("User has chosen not to backup the PC"));1905 if (!popup_and_get_string("Speed", comment, tmp, 4)) { 1906 log_to_screen("User has chosen not to backup the PC"); 1906 1907 finish(1); 1907 1908 } … … 1909 1910 bkpinfo->cdrw_speed = atoi(tmp); // if DVD then this shouldn't ever be used anyway :) 1910 1911 sprintf(comment, 1911 _("How much data (in Megabytes) will each %s store?"),1912 "How much data (in Megabytes) will each %s store?", 1912 1913 media_descriptor_string(bkpinfo->backup_media_type)); 1913 1914 if (!popup_and_get_string("Size", comment, sz_size, 5)) { 1914 log_to_screen( _("User has chosen not to backup the PC"));1915 log_to_screen("User has chosen not to backup the PC"); 1915 1916 finish(1); 1916 1917 } … … 1919 1920 } 1920 1921 if (bkpinfo->media_size[0] <= 0) { 1921 log_to_screen( _("User has chosen not to backup the PC"));1922 log_to_screen("User has chosen not to backup the PC"); 1922 1923 finish(1); 1923 1924 } … … 1940 1941 bkpinfo->media_device); 1941 1942 sprintf(comment, 1942 _("Please specify your %s drive's /dev entry"),1943 "Please specify your %s drive's /dev entry", 1943 1944 media_descriptor_string(bkpinfo-> 1944 1945 backup_media_type)); 1945 1946 if (!popup_and_get_string 1946 ( _("Device?"), comment, bkpinfo->media_device,1947 ("Device?", comment, bkpinfo->media_device, 1947 1948 MAX_STR_LEN / 4)) { 1948 log_to_screen( _("User has chosen not to backup the PC"));1949 log_to_screen("User has chosen not to backup the PC"); 1949 1950 finish(1); 1950 1951 } … … 1959 1960 if (bkpinfo->media_device[0]) { 1960 1961 sprintf(tmp, 1961 _("I think I've found your %s burner at SCSI node %s; am I right on the money?"),1962 "I think I've found your %s burner at SCSI node %s; am I right on the money?", 1962 1963 media_descriptor_string(bkpinfo-> 1963 1964 backup_media_type), … … 1969 1970 if (!bkpinfo->media_device[0]) { 1970 1971 if (g_kernel_version < 2.6) { 1971 i = popup_and_get_string( _("Device node?"),1972 _("What is the SCSI node of your CD (re)writer, please?"),1972 i = popup_and_get_string("Device node?", 1973 "What is the SCSI node of your CD (re)writer, please?", 1973 1974 bkpinfo->media_device, 1974 1975 MAX_STR_LEN / 4); 1975 1976 } else { 1976 i = popup_and_get_string( _("/dev entry?"),1977 _("What is the /dev entry of your CD (re)writer, please?"),1977 i = popup_and_get_string("/dev entry?", 1978 "What is the /dev entry of your CD (re)writer, please?", 1978 1979 bkpinfo->media_device, 1979 1980 MAX_STR_LEN / 4); 1980 1981 } 1981 1982 if (!i) { 1982 log_to_screen( _("User has chosen not to backup the PC"));1983 log_to_screen("User has chosen not to backup the PC"); 1983 1984 finish(1); 1984 1985 } … … 1993 1994 case udev: 1994 1995 if (!ask_me_yes_or_no 1995 ( _("This option is for advanced users only. Are you sure?"))) {1996 log_to_screen( _("User has chosen not to backup the PC"));1996 ("This option is for advanced users only. Are you sure?")) { 1997 log_to_screen("User has chosen not to backup the PC"); 1997 1998 finish(1); 1998 1999 } … … 2000 2001 2001 2002 if (find_tape_device_and_size(bkpinfo->media_device, sz_size)) { 2002 log_msg(3, _("Ok, using vanilla scsi tape."));2003 log_msg(3, "Ok, using vanilla scsi tape."); 2003 2004 strcpy(bkpinfo->media_device, VANILLA_SCSI_TAPE); 2004 2005 if ((fin = fopen(bkpinfo->media_device, "r"))) { … … 2018 2019 } 2019 2020 sprintf(tmp, 2020 _("I think I've found your tape streamer at %s; am I right on the money?"),2021 "I think I've found your tape streamer at %s; am I right on the money?", 2021 2022 bkpinfo->media_device); 2022 2023 } 2023 2024 if (bkpinfo->media_device[0]) { 2024 2025 sprintf(tmp, 2025 _("I think I've found your tape streamer at %s; am I right on the money?"),2026 "I think I've found your tape streamer at %s; am I right on the money?", 2026 2027 bkpinfo->media_device); 2027 2028 if (!ask_me_yes_or_no(tmp)) { … … 2031 2032 if (!bkpinfo->media_device[0]) { 2032 2033 if (!popup_and_get_string 2033 ( _("Device name?"),2034 _("What is the /dev entry of your tape streamer?"),2034 ("Device name?", 2035 "What is the /dev entry of your tape streamer?", 2035 2036 bkpinfo->media_device, MAX_STR_LEN / 4)) { 2036 log_to_screen( _("User has chosen not to backup the PC"));2037 log_to_screen("User has chosen not to backup the PC"); 2037 2038 finish(1); 2038 2039 } … … 2040 2041 sprintf(tmp, "ls -l %s", bkpinfo->media_device); 2041 2042 if (run_program_and_log_output(tmp, FALSE)) { 2042 log_to_screen( _("User has not specified a valid /dev entry"));2043 log_to_screen("User has not specified a valid /dev entry"); 2043 2044 finish(1); 2044 2045 } … … 2068 2069 if ((bkpinfo->compression_level = 2069 2070 which_compression_level()) == -1) { 2070 log_to_screen( _("User has chosen not to backup the PC"));2071 log_to_screen("User has chosen not to backup the PC"); 2071 2072 finish(1); 2072 2073 } … … 2089 2090 { 2090 2091 if (!popup_and_get_string 2091 ( _("NFS dir."),2092 _("Please enter path and directory where archives are stored remotely. (Mondo has taken a guess at the correct value. If it is incorrect, delete it and type the correct one.)"),2092 ("NFS dir.", 2093 "Please enter path and directory where archives are stored remotely. (Mondo has taken a guess at the correct value. If it is incorrect, delete it and type the correct one.)", 2093 2094 bkpinfo->nfs_mount, MAX_STR_LEN / 4)) { 2094 log_to_screen( _("User has chosen not to backup the PC"));2095 log_to_screen("User has chosen not to backup the PC"); 2095 2096 finish(1); 2096 2097 } … … 2098 2099 if ((bkpinfo->compression_level = 2099 2100 which_compression_level()) == -1) { 2100 log_to_screen( _("User has chosen not to backup the PC"));2101 log_to_screen("User has chosen not to backup the PC"); 2101 2102 finish(1); 2102 2103 } … … 2113 2114 2114 2115 sprintf(comment, 2115 _("How much data (in Megabytes) will each media store?"));2116 if (!popup_and_get_string( _("Size"), comment, sz_size, 5)) {2117 log_to_screen( _("User has chosen not to backup the PC"));2116 "How much data (in Megabytes) will each media store?"); 2117 if (!popup_and_get_string("Size", comment, sz_size, 5)) { 2118 log_to_screen("User has chosen not to backup the PC"); 2118 2119 finish(1); 2119 2120 } … … 2122 2123 } 2123 2124 if (bkpinfo->media_size[0] <= 0) { 2124 log_to_screen( _("User has chosen not to backup the PC"));2125 log_to_screen("User has chosen not to backup the PC"); 2125 2126 finish(1); 2126 2127 } … … 2129 2130 system("umount /tmp/isodir 2> /dev/null"); 2130 2131 if (!popup_and_get_string 2131 ( _("NFS share"), _("Which remote NFS share should I mount?"),2132 ("NFS share", "Which remote NFS share should I mount?", 2132 2133 bkpinfo->nfs_mount, MAX_STR_LEN)) { 2133 log_to_screen( _("User has chosen not to backup the PC"));2134 log_to_screen("User has chosen not to backup the PC"); 2134 2135 finish(1); 2135 2136 } … … 2148 2149 if (!is_this_device_mounted(bkpinfo->nfs_mount)) { 2149 2150 popup_and_OK 2150 ( _("Please mount that partition before you try to backup to or restore from it."));2151 ("Please mount that partition before you try to backup to or restore from it."); 2151 2152 finish(1); 2152 2153 } 2153 2154 strcpy(tmp, bkpinfo->nfs_remote_dir); 2154 2155 if (!popup_and_get_string 2155 ( _("Directory"), _("Which directory within that mountpoint?"), tmp,2156 ("Directory", "Which directory within that mountpoint?", tmp, 2156 2157 MAX_STR_LEN)) { 2157 log_to_screen( _("User has chosen not to backup the PC"));2158 log_to_screen("User has chosen not to backup the PC"); 2158 2159 finish(1); 2159 2160 } … … 2166 2167 strcpy(tmp, bkpinfo->nfs_remote_dir); 2167 2168 sprintf(prompt, 2168 _("Directory '%s' under mountpoint '%s' does not exist or is not writable. You can fix this or change the directory and retry or cancel the backup."),2169 "Directory '%s' under mountpoint '%s' does not exist or is not writable. You can fix this or change the directory and retry or cancel the backup.", 2169 2170 bkpinfo->nfs_remote_dir, bkpinfo->isodir); 2170 2171 if (!popup_and_get_string 2171 ( _("Directory"), prompt, tmp, MAX_STR_LEN)) {2172 log_to_screen( _("User has chosen not to backup the PC"));2172 ("Directory", prompt, tmp, MAX_STR_LEN)) { 2173 log_to_screen("User has chosen not to backup the PC"); 2173 2174 finish(1); 2174 2175 } … … 2180 2181 } 2181 2182 if (!popup_and_get_string 2182 ( _("Prefix."),2183 _("Please enter the prefix that will be prepended to your ISO filename. Example: machine1 to obtain machine1-[1-9]*.iso files"),2183 ("Prefix.", 2184 "Please enter the prefix that will be prepended to your ISO filename. Example: machine1 to obtain machine1-[1-9]*.iso files", 2184 2185 bkpinfo->prefix, MAX_STR_LEN / 4)) { 2185 log_to_screen( _("User has chosen not to backup the PC"));2186 log_to_screen("User has chosen not to backup the PC"); 2186 2187 finish(1); 2187 2188 } … … 2199 2200 if (!bkpinfo->disaster_recovery) { 2200 2201 if (!popup_and_get_string 2201 ( _("Storage dir."),2202 _("Please enter the full path that contains your ISO images. Example: /mnt/raid0_0"),2202 ("Storage dir.", 2203 "Please enter the full path that contains your ISO images. Example: /mnt/raid0_0", 2203 2204 bkpinfo->isodir, MAX_STR_LEN / 4)) { 2204 log_to_screen( _("User has chosen not to backup the PC"));2205 log_to_screen("User has chosen not to backup the PC"); 2205 2206 finish(1); 2206 2207 } … … 2208 2209 if ((bkpinfo->compression_level = 2209 2210 which_compression_level()) == -1) { 2210 log_to_screen( _("User has chosen not to backup the PC"));2211 log_to_screen("User has chosen not to backup the PC"); 2211 2212 finish(1); 2212 2213 } 2213 2214 if (!popup_and_get_string 2214 ( _("ISO size."),2215 _("Please enter how big you want each ISO image to be (in megabytes). This should be less than or equal to the size of the CD-R[W]'s or DVD's you plan to backup to."),2215 ("ISO size.", 2216 "Please enter how big you want each ISO image to be (in megabytes). This should be less than or equal to the size of the CD-R[W]'s or DVD's you plan to backup to.", 2216 2217 sz_size, 16)) { 2217 log_to_screen( _("User has chosen not to backup the PC"));2218 log_to_screen("User has chosen not to backup the PC"); 2218 2219 finish(1); 2219 2220 } … … 2222 2223 } 2223 2224 if (!popup_and_get_string 2224 ( _("Prefix."),2225 _("Please enter the prefix that will be prepended to your ISO filename. Example: machine1 to obtain machine1-[1-9]*.iso files"),2225 ("Prefix.", 2226 "Please enter the prefix that will be prepended to your ISO filename. Example: machine1 to obtain machine1-[1-9]*.iso files", 2226 2227 bkpinfo->prefix, MAX_STR_LEN / 4)) { 2227 2228 log_to_screen("User has chosen not to backup the PC"); … … 2258 2259 #ifdef __FreeBSD__ 2259 2260 if (!popup_and_get_string 2260 ( _("Boot device"),2261 _("What is your boot device? (e.g. /dev/ad0)"),2261 ("Boot device", 2262 "What is your boot device? (e.g. /dev/ad0)", 2262 2263 bkpinfo->boot_device, MAX_STR_LEN / 4)) { 2263 log_to_screen( _("User has chosen not to backup the PC"));2264 log_to_screen("User has chosen not to backup the PC"); 2264 2265 finish(1); 2265 2266 } … … 2267 2268 #else 2268 2269 if (!popup_and_get_string 2269 ( _("Boot device"),2270 _("What is your boot device? (e.g. /dev/hda)"),2270 ("Boot device", 2271 "What is your boot device? (e.g. /dev/hda)", 2271 2272 bkpinfo->boot_device, MAX_STR_LEN / 4)) { 2272 log_to_screen( _("User has chosen not to backup the PC"));2273 log_to_screen("User has chosen not to backup the PC"); 2273 2274 finish(1); 2274 2275 } … … 2290 2291 if (i == 'U') { 2291 2292 if (ask_me_yes_or_no 2292 ( _("Unidentified boot loader. Shall I restore it byte-for-byte at restore time and hope for the best?")))2293 ("Unidentified boot loader. Shall I restore it byte-for-byte at restore time and hope for the best?")) 2293 2294 { 2294 2295 i = 'R'; // raw 2295 2296 } else { 2296 2297 log_to_screen 2297 ( _("I cannot find your boot loader. Please run mondoarchive with parameters."));2298 ("I cannot find your boot loader. Please run mondoarchive with parameters."); 2298 2299 finish(1); 2299 2300 } … … 2303 2304 strcpy(bkpinfo->include_paths, "/"); 2304 2305 if (!popup_and_get_string 2305 ( _("Backup paths"),2306 _("Please enter paths which you want me to backup. The default is '/' (i.e. everything)."),2306 ("Backup paths", 2307 "Please enter paths which you want me to backup. The default is '/' (i.e. everything).", 2307 2308 bkpinfo->include_paths, MAX_STR_LEN)) { 2308 log_to_screen( _("User has chosen not to backup the PC"));2309 log_to_screen("User has chosen not to backup the PC"); 2309 2310 finish(1); 2310 2311 } … … 2322 2323 if (strlen(tmp) > 2) { 2323 2324 if (!popup_and_get_string 2324 ( _("NTFS partitions"),2325 _("Please enter/confirm the NTFS partitions you wish to backup as well."),2325 ("NTFS partitions", 2326 "Please enter/confirm the NTFS partitions you wish to backup as well.", 2326 2327 tmp, MAX_STR_LEN / 4)) { 2327 log_to_screen( _("User has chosen not to backup the PC"));2328 log_to_screen("User has chosen not to backup the PC"); 2328 2329 finish(1); 2329 2330 } … … 2333 2334 2334 2335 if (!popup_and_get_string 2335 ( _("Exclude paths"),2336 _("Please enter paths which you do NOT want to backup. Separate them with spaces. NB: /tmp and /proc are always excluded. :-) Just hit 'Enter' if you want to do a full system backup."),2336 ("Exclude paths", 2337 "Please enter paths which you do NOT want to backup. Separate them with spaces. NB: /tmp and /proc are always excluded. :-) Just hit 'Enter' if you want to do a full system backup.", 2337 2338 bkpinfo->exclude_paths, MAX_STR_LEN)) { 2338 log_to_screen( _("User has chosen not to backup the PC"));2339 log_to_screen("User has chosen not to backup the PC"); 2339 2340 finish(1); 2340 2341 } … … 2343 2344 bkpinfo->verify_data = 2344 2345 ask_me_yes_or_no 2345 ( _("Will you want to verify your backups after Mondo has created them?"));2346 ("Will you want to verify your backups after Mondo has created them?"); 2346 2347 2347 2348 #ifndef __FreeBSD__ 2348 2349 if (!ask_me_yes_or_no 2349 ( _("Are you confident that your kernel is a sane, sensible, standard Linux kernel? Say 'no' if you are using a Gentoo <1.4 or Debian <3.0, please.")))2350 ("Are you confident that your kernel is a sane, sensible, standard Linux kernel? Say 'no' if you are using a Gentoo <1.4 or Debian <3.0, please.")) 2350 2351 #endif 2351 2352 { … … 2354 2355 2355 2356 if (!ask_me_yes_or_no 2356 ( _("Are you sure you want to proceed? Hit 'no' to abort."))) {2357 log_to_screen( _("User has chosen not to backup the PC"));2357 ("Are you sure you want to proceed? Hit 'no' to abort.")) { 2358 log_to_screen("User has chosen not to backup the PC"); 2358 2359 finish(1); 2359 2360 }
Note:
See TracChangeset
for help on using the changeset viewer.