Project

General

Profile

« Previous | Next » 

Revision 774aedf0

Added by Renato Botelho over 12 years ago

Ignore swap partitions when looking for external config file

View differences:

etc/ecl.php
42 42
	return $disk;
43 43
}
44 44

  
45
function get_swap_disks() {
46
	exec("/usr/sbin/swapinfo | /usr/bin/sed '/^\/dev/!d; s,^/dev/,,; s, .*\$,,'", $disks);
47
	return $disks;
48
}
49

  
45 50
function get_disk_slices($disk) {
46 51
	global $g, $debug;
47 52
	$slices_array = array();
......
108 113
	if(!is_array($disks)) 
109 114
		return;
110 115
	$boot_disk = get_boot_disk();
116
	$swap_disks = get_swap_disks();
111 117
	exec("/bin/mkdir -p /tmp/mnt/cf");
112 118
	foreach($disks as $disk) {
113 119
		$slices = get_disk_slices($disk);
......
120 126
						echo "\nSkipping boot device slice $slice";
121 127
					continue;
122 128
				}
129
				if(in_array($slice, $swap_disks)) {
130
					if($debug)
131
						echo "\nSkipping swap device slice $slice";
132
					continue;
133
				}
123 134
				echo " $slice";
124 135
				// First try msdos fs
125 136
				if($debug) 

Also available in: Unified diff