summaryrefslogtreecommitdiffstats
path: root/etc/ecl.php
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2013-02-25 10:38:46 -0300
committerRenato Botelho <garga@FreeBSD.org>2013-02-25 10:38:46 -0300
commit774aedf09016d9b496e0157202a4f8c9a0b6dbda (patch)
treeca3ce2206a89f53926c6b9a2158f22efcc86ee69 /etc/ecl.php
parent5203443215689fcec7fae36fcd41698504c5e427 (diff)
downloadpfsense-774aedf09016d9b496e0157202a4f8c9a0b6dbda.zip
pfsense-774aedf09016d9b496e0157202a4f8c9a0b6dbda.tar.gz
Ignore swap partitions when looking for external config file
Diffstat (limited to 'etc/ecl.php')
-rwxr-xr-xetc/ecl.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/etc/ecl.php b/etc/ecl.php
index 28e8f3d..c8eae9c 100755
--- a/etc/ecl.php
+++ b/etc/ecl.php
@@ -42,6 +42,11 @@ function get_boot_disk() {
return $disk;
}
+function get_swap_disks() {
+ exec("/usr/sbin/swapinfo | /usr/bin/sed '/^\/dev/!d; s,^/dev/,,; s, .*\$,,'", $disks);
+ return $disks;
+}
+
function get_disk_slices($disk) {
global $g, $debug;
$slices_array = array();
@@ -108,6 +113,7 @@ function find_config_xml() {
if(!is_array($disks))
return;
$boot_disk = get_boot_disk();
+ $swap_disks = get_swap_disks();
exec("/bin/mkdir -p /tmp/mnt/cf");
foreach($disks as $disk) {
$slices = get_disk_slices($disk);
@@ -120,6 +126,11 @@ function find_config_xml() {
echo "\nSkipping boot device slice $slice";
continue;
}
+ if(in_array($slice, $swap_disks)) {
+ if($debug)
+ echo "\nSkipping swap device slice $slice";
+ continue;
+ }
echo " $slice";
// First try msdos fs
if($debug)
OpenPOWER on IntegriCloud