Revision ffab5cb4
Added by Renato Botelho over 8 years ago
src/etc/inc/config.lib.inc | ||
---|---|---|
304 | 304 |
******/ |
305 | 305 |
/* mount flash card read/write */ |
306 | 306 |
function conf_mount_rw() { |
307 |
global $g, $config; |
|
308 |
|
|
309 |
/* do not mount on cdrom platform */ |
|
310 |
if ($g['platform'] == "cdrom" or $g['platform'] == $g['product_name']) { |
|
311 |
return; |
|
312 |
} |
|
313 |
|
|
314 |
if ((refcount_reference(1000) > 1) && is_writable("/")) { |
|
315 |
return; |
|
316 |
} |
|
317 |
|
|
318 |
$status = mwexec("/sbin/mount -u -w -o sync,noatime {$g['cf_path']}"); |
|
319 |
if ($status <> 0) { |
|
320 |
if (platform_booting()) { |
|
321 |
echo gettext("/cf Filesystem is dirty.") . "\n"; |
|
322 |
} |
|
323 |
$status = mwexec("/sbin/mount -u -w -o sync,noatime {$g['cf_path']}"); |
|
324 |
} |
|
325 |
|
|
326 |
/* if the platform is soekris or wrap or $product, lets mount the |
|
327 |
* compact flash cards root. |
|
328 |
*/ |
|
329 |
$status = mwexec("/sbin/mount -u -w -o sync,noatime /"); |
|
330 |
/* we could not mount this correctly. */ |
|
331 |
if ($status <> 0) { |
|
332 |
log_error(gettext("/ File system is dirty.")); |
|
333 |
$status = mwexec("/sbin/mount -u -w -o sync,noatime /"); |
|
334 |
} |
|
335 |
|
|
336 |
mark_subsystem_dirty('mount'); |
|
307 |
/* Obsoleted. Keep it here untill all calls are removed */ |
|
308 |
return; |
|
337 | 309 |
} |
338 | 310 |
|
339 | 311 |
/****f* config/conf_mount_ro |
... | ... | |
343 | 315 |
* null |
344 | 316 |
******/ |
345 | 317 |
function conf_mount_ro() { |
346 |
global $g, $config; |
|
347 |
|
|
348 |
// do nothing here. redmine #6184 |
|
318 |
/* Obsoleted. Keep it here untill all calls are removed */ |
|
349 | 319 |
return; |
350 |
|
|
351 |
/* Do not trust $g['platform'] since this can be clobbered during factory reset. */ |
|
352 |
$platform = trim(file_get_contents("/etc/platform")); |
|
353 |
/* do not umount on cdrom or pfSense platforms */ |
|
354 |
if ($platform == "cdrom" or $platform == $g['product_name']) { |
|
355 |
return; |
|
356 |
} |
|
357 |
|
|
358 |
if (refcount_unreference(1000) > 0) { |
|
359 |
return; |
|
360 |
} |
|
361 |
|
|
362 |
if (isset($config['system']['nanobsd_force_rw'])) { |
|
363 |
return; |
|
364 |
} |
|
365 |
|
|
366 |
if (platform_booting()) { |
|
367 |
return; |
|
368 |
} |
|
369 |
|
|
370 |
clear_subsystem_dirty('mount'); |
|
371 |
/* sync data, then force a remount of /cf */ |
|
372 |
pfSense_fsync($g['cf_path']); |
|
373 |
mwexec("/sbin/mount -u -r -f -o sync,noatime {$g['cf_path']}"); |
|
374 |
mwexec("/sbin/mount -u -r -f -o sync,noatime /"); |
|
375 | 320 |
} |
376 | 321 |
|
377 | 322 |
/****f* config/convert_config |
Also available in: Unified diff
Obsolete conf_mount_ro() and conf_mount_rw()
Now that nanobsd is gone these functions are not necessary anymore.
Keep them around until all calls are cleaned up